/* ==================================================================
   Yali Language — Feuille de style principale
   Thème : élégant, professionnel, retenu (noir / blanc / doré).
   ================================================================== */

/* --------------------------------------------------------------------------
   DIRECTION ARTISTIQUE — « Institutional Trust »
   --------------------------------------------------------------------------
   Palette : bleu nuit institutionnel (autorité, sérieux, droit, gouvernement),
   accent or sobre (excellence, haut de gamme), gris neutres froids (lisibilité,
   sobriété). Aucun dégradé décoratif, aucune couleur criarde : le contraste et
   l'espacement portent la hiérarchie.
   Typographie : pile système sans-serif pour le texte (aucune police à
   télécharger → performance et rendu natif sur mobile) + serif sobre réservé
   aux grands titres d'affichage.
   Échelle d'espacement : multiples de 4 px (`--space-*`), rayons et ombres
   uniques (`--radius*`, `--shadow*`) : plus aucune valeur improvisée dans les
   pages, tout composant réutilise ces jetons.
   -------------------------------------------------------------------------- */
:root {
    /* --- Couleurs de marque ------------------------------------------- */
    --color-navy: #12263f;          /* marque, en-têtes, boutons principaux */
    --color-navy-dark: #0b1a2c;
    --color-gold: #b08d3e;          /* accent (bordures, filets, badges) */
    --color-gold-dark: #8a6c26;     /* or lisible sur fond clair (texte) */
    --color-gold-soft: #f4eddc;

    /* --- Surfaces & texte --------------------------------------------- */
    --color-bg: #f5f7fa;
    --color-surface: #ffffff;
    --color-surface-alt: #f0f3f7;
    --color-ink: #1b2430;
    --color-muted: #5b6675;         /* ≥ 4,5:1 sur blanc (AA) */
    --color-border: #dce1e8;
    --color-border-strong: #c3ccd7;

    /* --- États (texte + fond, jamais la couleur seule) ---------------- */
    --color-success: #1f6b45;
    --color-success-bg: #e8f3ed;
    --color-warning: #8a5a12;
    --color-warning-bg: #fdf3e3;
    --color-danger: #a32a1e;
    --color-danger-bg: #fceceb;
    --color-info: #1f4e79;
    --color-info-bg: #eaf1f8;

    /* --- Accessibilité ------------------------------------------------- */
    --focus-ring: 0 0 0 3px rgba(176, 141, 62, 0.45);
    --focus-color: #12263f;

    /* --- Typographie --------------------------------------------------- */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
                  "Times New Roman", serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --fs-xs: 0.78rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-md: 1.0625rem;
    --fs-lg: 1.25rem;
    --fs-xl: 1.5rem;
    --fs-2xl: 1.9rem;
    --fs-3xl: 2.35rem;

    --lh-tight: 1.2;
    --lh-snug: 1.35;
    --lh-base: 1.6;

    /* --- Espacement (échelle 4 px) ------------------------------------ */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;

    /* --- Rayons, ombres, largeurs -------------------------------------- */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(16, 26, 40, 0.06);
    --shadow: 0 1px 3px rgba(16, 26, 40, 0.08),
              0 10px 24px -16px rgba(16, 26, 40, 0.28);
    --shadow-lg: 0 24px 48px -24px rgba(16, 26, 40, 0.35);

    --container: 1140px;
    --container-narrow: 780px;
    --header-h: 68px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    color: var(--color-ink);
    background: var(--color-bg);
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { color: var(--color-navy); line-height: var(--lh-tight); }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-md); }

/* Les grands titres d'affichage (héros, en-têtes de page) gardent une serif
   sobre : c'est la seule signature « éditoriale » de l'interface. */
.hero-title, .page-head h1, .display-title { font-family: var(--font-serif); }

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

/* Anneau de focus unique : visible au clavier, invisible à la souris. */
:focus-visible {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

::selection { background: var(--color-gold-soft); color: var(--color-navy); }

/* Texte réservé aux technologies d'assistance (jamais affiché). */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Lien d'évitement : premier élément focalisable de chaque page. */
.skip-link {
    position: absolute;
    left: var(--space-4);
    top: -3rem;
    z-index: 2000;
    padding: var(--space-2) var(--space-4);
    background: var(--color-navy);
    color: #fff;
    border-radius: 0 0 var(--radius) var(--radius);
    transition: top 0.15s ease-out;
}
.skip-link:focus { top: 0; text-decoration: none; }

/* ---------------------------------------------------------------- NAVBAR */
.navbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.9rem 2rem;
    background: var(--color-ink);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-wrap: wrap;
}
.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.03em;
}
.navbar-logo { height: 2.1rem; width: auto; }
.navbar-links {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}
.navbar-links a { color: #ddd; }
.navbar-links a.active { color: #fff; border-bottom: 2px solid var(--color-gold); }
.nav-disabled { color: var(--color-muted); cursor: not-allowed; text-decoration: none; }
.navbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.user-menu { display: flex; align-items: center; gap: 0.75rem; }

/* --------------------------------------------------------------- BOUTONS */
.btn {
    display: inline-block;
    padding: 0.55rem 1.3rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
    background: transparent;
}
.btn-primary { background: var(--color-gold); color: #fff; }
.btn-primary:hover { background: var(--color-gold-dark); }
.btn-outline { border: 1px solid var(--color-gold); color: var(--color-gold); }
.btn-ghost { border: 1px solid rgba(255, 255, 255, 0.4); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 0.8rem 1.8rem; font-size: 1.05rem; }
.account-link { border-color: var(--color-gold); }

/* --------------------------------------------------------------- CONTENU */
.container {
    max-width: 1080px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* ------------------------------------------------------------------ HERO */
.hero { text-align: center; padding: 4rem 1rem; }
.hero-badge { margin-bottom: 1.5rem; }
.hero-title { font-size: 2.4rem; line-height: 1.2; margin: 0.5rem 0 0.5rem; }
.hero-subtitle { font-size: 1.15rem; color: var(--color-muted); max-width: 620px; margin: 0 auto; }
.hero-actions { margin-top: 2rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------ CARDS */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.6rem;
}
.card h3 { margin-top: 0; }
.tag {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.15rem 0.6rem;
    background: #efece4;
    color: var(--color-muted);
    border-radius: 999px;
}
/* ------------------------------------------------------------ AUTH & FORMS */
.auth-card {
    max-width: 430px;
    margin: 2rem auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}
.auth-title { margin-top: 0; text-align: center; }
.auth-subtitle { text-align: center; color: var(--color-muted); }
.auth-switch { text-align: center; margin-top: 1rem; font-size: 0.92rem; }

.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; margin-bottom: 0.35rem; font-weight: 600; }
.form-control {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
}
.form-control:focus { border-color: var(--color-gold); outline: none; }
.form-error { display: block; color: var(--color-danger); font-size: 0.82rem; margin-top: 0.3rem; }
.form-check { margin-bottom: 1.1rem; }
.form-check-input { margin-right: 0.4rem; transform: scale(1.2); }
.form-check-label { font-size: 0.92rem; }

/* -------------------------------------------------------------- FLASH */
.alert {
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 0.85rem 1.1rem;
    margin-bottom: 0.75rem;
}
.alert-success { background: #e9f4ec; color: var(--color-success); border-color: #bfe0c8; }
.alert-danger  { background: #fbecec; color: var(--color-danger); border-color: #ecc7c7; }
.alert-info    { background: #eef2f7; color: #2f5b8f; border-color: #c9d8e8; }
.flash-container { max-width: 1080px; margin: 1rem auto; padding: 0 1.5rem; }

/* -------------------------------------------------------------- ACCOUNT */
.profile { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; }
.profile-header { display: flex; gap: 1.5rem; align-items: center; }
.profile-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--color-ink);
    color: var(--color-gold);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; font-weight: 700;
    text-transform: uppercase;
}
.profile-name { margin: 0; font-size: 1.7rem; }
.profile-meta { margin: 0.3rem 0 0; }
.profile-email { color: var(--color-muted); }
.role-badge {
    display: inline-block;
    font-size: 0.72rem;
    padding: 0.15rem 0.6rem;
    background: var(--color-gold);
    color: #fff;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.profile-details { margin: 1.5rem 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.75rem 1.5rem; }
.profile-details dt { color: var(--color-muted); }
.profile-details dd { margin: 0; }
.profile-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* -------------------------------------------------------------- FOOTER */
.footer {
    margin-top: 3rem;
    padding: 1.4rem;
    background: var(--color-ink);
    color: #cfcfcf;
    text-align: center;
    font-size: 0.85rem;
}
.footer a { color: var(--color-gold); }

/* ==================================================================
   BACK-OFFICE (ADMIN)
   ================================================================== */
.admin-entry { border-color: var(--color-gold); color: #fff; }

.admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    align-items: start;
}
.admin-sidebar {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.2rem;
    position: sticky;
    top: calc(var(--header-h) + var(--space-4));
    /* La navigation compte 25 entrées : sans hauteur bornée, les dernières
       deviennent inaccessibles lorsque la fenêtre est basse. La sidebar défile
       donc pour elle-même (`overscroll-behavior: contain` évite d'entraîner la
       page) et garde sa position pendant le défilement du contenu. */
    max-height: calc(100vh - var(--header-h) - var(--space-6));
    max-height: calc(100dvh - var(--header-h) - var(--space-6));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.admin-brand a { font-weight: 700; color: var(--color-ink); font-size: 1.05rem; }
.admin-nav { display: flex; flex-direction: column; margin-top: 1rem; }
.admin-nav-item {
    color: var(--color-ink);
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius);
    font-size: 0.92rem;
}
.admin-nav-item:hover { background: #f2efe7; }
.admin-nav-item.active {
    background: var(--color-ink);
    color: #fff;
    border-left: 3px solid var(--color-gold);
}
.admin-sidebar-footer { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.admin-back { font-size: 0.85rem; color: var(--color-muted); }

.admin-main { min-width: 0; }
.admin-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}
.admin-title { margin: 0; font-size: 1.7rem; }
.admin-subtitle { margin: 0.3rem 0 0; color: var(--color-muted); }
.admin-page-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.admin-muted { color: var(--color-muted); font-size: 0.92rem; }
.text-muted { color: var(--color-muted); }

.admin-letter {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-gold);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
}
.admin-greeting { margin: 0 0 0.3rem; font-size: 1.05rem; }

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.admin-card {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.1rem;
    color: var(--color-ink);
}
.admin-card:hover { border-color: var(--color-gold); }
.admin-card-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.admin-card-label { font-weight: 600; font-size: 0.95rem; }
.admin-card-counts { display: flex; align-items: baseline; gap: 0.4rem; margin-top: 0.6rem; }
.admin-card-total { font-size: 1.9rem; font-weight: 700; color: var(--color-gold); }
.admin-card-meta { color: var(--color-muted); font-size: 0.82rem; }
.admin-card-deleted { display: block; margin-top: 0.4rem; font-size: 0.8rem; color: var(--color-danger); }
.admin-card-deleted.muted { color: var(--color-border); }

.badge {
    display: inline-block;
    font-size: 0.72rem;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    background: #efece4;
    color: var(--color-muted);
    white-space: nowrap;
}
.badge-on { background: #e9f4ec; color: var(--color-success); }
.badge-off { background: #f3efef; color: var(--color-muted); }
.badge-soft { background: #eef2f7; color: #2f5b8f; }

.admin-search { display: flex; gap: 0.6rem; margin-bottom: 1rem; }
.admin-search-input { max-width: 340px; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.admin-table th, .admin-table td {
    text-align: left;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
    vertical-align: middle;
}
.admin-table thead th { background: #f4f2ec; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.admin-table tbody tr:hover { background: #fbfaf6; }
.admin-actions-col { width: 220px; }
.admin-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.admin-actions form { display: inline; margin: 0; }
.admin-action {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    color: var(--color-gold);
}
.admin-action-danger { color: var(--color-danger); }
.admin-action-restore { color: var(--color-success); }
.admin-action:hover { text-decoration: underline; opacity: 0.9; }
.admin-empty { text-align: center; color: var(--color-muted); padding: 1.5rem; }

.admin-pagination { display: flex; align-items: center; gap: 1rem; margin-top: 1.2rem; }
.admin-page-info { color: var(--color-muted); font-size: 0.9rem; }

.admin-form {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}
.admin-fieldset { border: none; padding: 0; margin: 0 0 1.2rem; }
.admin-fieldset legend {
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-muted);
    margin-bottom: 0.8rem;
}
.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0 1.2rem;
}
.admin-col-full { grid-column: 1 / -1; }
.admin-form-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.admin-dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.2rem; margin: 0; }
.admin-dl dt { color: var(--color-muted); }
.admin-dl dd { margin: 0; }
.admin-link-row { display: flex; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }

.admin-danger-zone {
    margin-top: 1.5rem;
    border: 1px solid #ecc7c7;
    border-radius: var(--radius);
    background: #fdf6f5;
    padding: 1.2rem;
}
.admin-danger-title { margin: 0 0 0.3rem; font-size: 1.05rem; color: var(--color-danger); }

.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: #93331f; }

/* ==========================================================================
   TEMPS RÉEL — toasts, cloche de notifications, badges
   (réutilise les variables de thème : --radius, --shadow, --color-*)
   ========================================================================== */

/* --- Secours sans JavaScript : les messages flash restent visibles -------- */
html.no-js .toast-seed { display: block; }
.toast-seed { display: none; }

/* --- Pile de toasts ------------------------------------------------------ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: min(360px, calc(100vw - 2rem));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 0.9rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-muted);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: toast-in 0.22s ease-out;
}

.toast.is-leaving { opacity: 0; transform: translateX(12px); transition: all 0.2s ease-in; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .toast { animation: none; }
}

.toast-icon {
    flex: 0 0 1.4rem;
    width: 1.4rem;
    height: 1.4rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    background: var(--color-muted);
}

.toast-body { flex: 1; margin: 0; font-size: 0.9rem; line-height: 1.35; }
.toast-body a { color: inherit; text-decoration: underline; }

.toast-close {
    border: 0;
    background: transparent;
    color: var(--color-muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.15rem;
}

.toast-success { border-left-color: var(--color-success); }
.toast-success .toast-icon { background: var(--color-success); }
.toast-danger  { border-left-color: var(--color-danger); }
.toast-danger .toast-icon { background: var(--color-danger); }
.toast-warning { border-left-color: #8a6d1f; }
.toast-warning .toast-icon { background: #8a6d1f; }
.toast-info .toast-icon { background: #2f5b8f; }

@media (max-width: 600px) {
    .toast-container { top: auto; bottom: 1rem; right: 0.75rem; left: 0.75rem; width: auto; }
}

/* Alerte inline (message d'information persistant dans le flux de page). */
.alert-warning { background: #fdf6e6; color: #8a6d1f; border-color: #ecd9a8; }

/* --- Cloche de notifications -------------------------------------------- */
.notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-ink);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
}

.notif-bell:hover { border-color: var(--color-gold); }

.notif-count {
    min-width: 1.35rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--color-danger);
    color: #fff;
    font-size: 0.72rem;
    line-height: 1.35rem;
    text-align: center;
    font-weight: 700;
}

.notif-count.is-empty { display: none; }

.notif-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: min(360px, calc(100vw - 2rem));
    max-height: 60vh;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.4rem;
    z-index: 1300;
}

.notif-panel[hidden] { display: none; }
.notif-list { list-style: none; margin: 0; padding: 0; }

.notif-item {
    padding: 0.6rem 0.65rem;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
}

.notif-item:last-child { border-bottom: 0; }
.notif-item.is-unread { background: #fdf8ec; }
.notif-item.is-new { animation: toast-in 0.22s ease-out; }
.notif-item strong { display: block; font-size: 0.88rem; }
.notif-item p { margin: 0.15rem 0 0; font-size: 0.82rem; }
.notif-link { display: inline-block; margin-top: 0.25rem; font-size: 0.8rem; }
.notif-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.35rem 0.45rem; }
.notif-head button { border: 0; background: transparent; color: var(--color-gold-dark); cursor: pointer; font-size: 0.8rem; }
.notif-empty { padding: 0.75rem; color: var(--color-muted); font-size: 0.85rem; }

/* --- Badges de compteurs (barre latérale admin, navigation) ------------- */
.nav-badge {
    display: inline-block;
    min-width: 1.4rem;
    margin-left: 0.4rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--color-gold);
    color: #fff;
    font-size: 0.72rem;
    line-height: 1.4rem;
    text-align: center;
    font-weight: 700;
}

.nav-badge.is-empty { display: none; }



/* -------------------------------------------------- ADMIN : filtres avancés */
.admin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    align-items: flex-end;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
}
.admin-filter { display: flex; flex-direction: column; gap: 0.2rem; min-width: 150px; }
.admin-filter-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted); }
.admin-filter .form-control { padding: 0.4rem 0.55rem; font-size: 0.9rem; }
.admin-reset { font-size: 0.85rem; color: var(--color-muted); align-self: center; }
.admin-reset:hover { color: var(--color-danger); }

/* -------------------------------------------------- ADMIN : panneaux fiche */
.admin-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.3rem 1.4rem;
    margin-bottom: 1.3rem;
}
.admin-panel-title { margin: 0 0 0.7rem; font-size: 1.15rem; }
.admin-panel-subtitle { margin: 1rem 0 0.3rem; font-size: 0.95rem; }
.admin-inline-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.admin-inline-form .form-control { max-width: 320px; }
.admin-action-strong { font-weight: 700; }
.admin-action-buy { color: var(--color-gold); font-weight: 700; }

/* --------------------------------------------------- COMPTE UTILISATEUR */
.btn-inline { margin-left: 0.6rem; padding: 0.3rem 0.8rem; font-size: 0.85rem; }
.order-card { margin-bottom: 1rem; }
.order-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

/* ------------------------------------------------- ADMIN : médias & e-mails */
.admin-file-input { margin-top: 0.4rem; padding: 0.35rem; background: #fbfaf6; }
.media-upload-label { display: block; margin-top: 0.5rem; font-size: 0.85rem; color: var(--color-muted); }
.form-hint { display: block; margin-top: 0.4rem; font-size: 0.78rem; color: var(--color-muted); }
.media-preview { margin-top: 0.6rem; display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.media-thumb { max-height: 90px; max-width: 160px; border: 1px solid var(--color-border); border-radius: 6px; }
.media-thumb-video { max-height: 120px; max-width: 220px; border: 1px solid var(--color-border); border-radius: 6px; }
.media-thumb-sm { max-height: 42px; max-width: 70px; border: 1px solid var(--color-border); border-radius: 4px; vertical-align: middle; }
.media-current { font-size: 0.78rem; color: var(--color-muted); word-break: break-all; }

/* --------------------------------------- ADMIN : signature dessinée (canvas) */
.signature-panel { margin-top: 1.2rem; }
.signature-current { display: flex; align-items: center; gap: 0.6rem; margin: 0.4rem 0 0.8rem; }
.signature-thumb { max-height: 70px; border: 1px solid var(--color-border); border-radius: 6px; background: #fff; }
.signature-toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.6rem 0 0.5rem; }
.signature-toolbar .btn.is-active { background: var(--color-gold); color: #fff; }
.signature-canvas {
    display: block;
    width: 100%;
    max-width: 640px;
    height: auto;
    background: #fff;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    touch-action: none;            /* le tracé au doigt ne fait pas défiler la page */
    cursor: crosshair;
}
.signature-hint { font-size: 0.82rem; margin: 0.45rem 0 0; }
.signature-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.8rem; }

.admin-hint-box {
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-gold);
    background: #fbfaf6;
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    margin: 0.5rem 0 1.2rem;
}
.admin-vars { margin: 0.4rem 0 0.6rem; padding-left: 1.1rem; font-size: 0.86rem; color: var(--color-muted); }
.admin-vars code { background: #efece4; padding: 0.05rem 0.35rem; border-radius: 4px; color: var(--color-ink); }

/* ==================================================================
   SITE PUBLIC
   ================================================================== */
.page-head { text-align: center; padding: 2.5rem 1rem 1rem; }
.page-head h1 { margin: 0 0 0.5rem; font-size: 2.1rem; }
.page-subtitle { color: var(--color-muted); max-width: 720px; margin: 0 auto; }
.breadcrumb { margin: 0 0 0.6rem; font-size: 0.9rem; }
.muted { color: var(--color-muted); }

.section { margin: 2.2rem 0; }
.section-title { font-size: 1.35rem; margin: 0 0 1rem; }
.two-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.6rem; align-items: start; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.cta-block { text-align: center; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.legal-note { font-size: 0.82rem; }

/* Langues */
.lang-strip { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.8rem 0; }
.lang-pill { background: #efece4; color: #4a4a4a; border-radius: 999px; padding: 0.18rem 0.7rem; font-size: 0.82rem; }

/* Produits */
.product-card { display: flex; flex-direction: column; gap: 0.4rem; }
.card-image { width: 100%; height: 160px; object-fit: cover; border-radius: 8px; }
.product-price { font-size: 1.15rem; font-weight: 700; color: var(--color-gold); margin: 0.2rem 0; }
.product-price-lg { font-size: 1.6rem; }
.price-old { text-decoration: line-through; color: var(--color-muted); font-size: 0.9rem; font-weight: 400; }
.card-actions { display: flex; gap: 0.5rem; margin-top: auto; flex-wrap: wrap; }
.card-actions form { display: inline; margin: 0; }
.badge-off { background: #fbecec; color: var(--color-danger); }

/* Détail produit */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 1.8rem; align-items: start; }
.detail-image { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.detail-facts { list-style: none; padding: 0; margin: 0.6rem 0; }
.detail-facts li { padding: 0.25rem 0; border-bottom: 1px dashed var(--color-border); font-size: 0.92rem; }
.detail-description { margin: 0.8rem 0; }
.detail-actions { display: flex; align-items: flex-end; gap: 0.8rem; flex-wrap: wrap; margin-top: 1rem; }
.qty-label { font-size: 0.8rem; color: var(--color-muted); display: flex; flex-direction: column; gap: 0.2rem; }
.qty-input { max-width: 90px; }

/* Instructeur */
.instructor-block { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.instructor-card { display: flex; gap: 1.4rem; align-items: flex-start; }
.instructor-photo { width: 130px; height: 130px; object-fit: cover; border-radius: 10px; }
.instructor-block + .section-title { margin-top: 0; }

/* À propos — hommage au fondateur : texte de présentation à gauche,
   portrait (nom + dates) à droite. Sur écran étroit, la grille repasse sur
   une seule colonne : le portrait s'affiche alors sous le texte, centré. */
.about-homage { display: grid; grid-template-columns: 1.55fr 1fr; gap: 2rem; align-items: start; }
.about-homage-text > .section-title { margin-top: 0; }
.about-homage-text > p { margin: 0 0 1rem; }
.about-portrait {
    position: sticky;
    top: 5rem;
    margin: 0;
    padding: 1rem;
    text-align: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.about-portrait img {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
}
.about-portrait figcaption { margin-top: 0.9rem; }
.about-portrait-name { display: block; font-weight: 700; font-size: 1.2rem; line-height: 1.25; }
.about-portrait-dates { display: block; margin-top: 0.15rem; color: var(--color-muted); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
    .about-homage { grid-template-columns: 1fr; gap: 1.4rem; }
    .about-portrait { position: static; max-width: 420px; margin: 0 auto; }
}

/* Newsletter */
.newsletter-block { text-align: center; background: var(--color-ink); color: #eee; border-radius: var(--radius); padding: 2rem; }
.newsletter-block .section-title { color: #fff; }
.newsletter-form { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.newsletter-form .form-control { max-width: 220px; }

/* Formations */
.chapter-list { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.9rem; }
.chapter-list li { padding: 0.15rem 0; }
.session-form { margin: 0; max-width: none; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 0.6rem; }
.faq-item { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 0.9rem 1.1rem; }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item p { margin: 0.6rem 0 0; color: #444; }

/* Formulaire interprète */
.join-form { max-width: 960px; margin: 0 auto; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.2rem 1rem; }

/* Demande de services d'interprétation (formulaire institutionnel) */
.form-section {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem 1.1rem;
    margin: 0 0 1rem;
    background: var(--color-surface);
}
.form-section legend {
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0 0.4rem;
    color: var(--color-ink);
}
.form-section .muted { margin: 0.2rem 0 0.5rem; font-size: 0.85rem; }
.plain-list { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.plain-list li { padding: 0.15rem 0; }
.process-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 1.2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.7rem;
    counter-reset: step;
}
.process-steps li {
    counter-increment: step;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.8rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.process-steps li::before {
    content: counter(step);
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: var(--color-gold);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.process-steps li span { font-size: 0.85rem; color: var(--color-muted); }
.btn-inline { margin-left: 0.5rem; }
.enquiry-details { margin-top: 0.4rem; }
.enquiry-details summary {
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--color-gold);
    font-weight: 600;
}
.enquiry-details .detail-facts { margin-top: 0.4rem; }
.tag { display: inline-block; background: #efece4; color: #4a4a4a; border-radius: 999px; padding: 0.1rem 0.6rem; font-size: 0.75rem; margin-right: 0.3rem; }

/* Page pleine « Demande de services d'interprétation » / compte institutionnel */
.request-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(240px, 1fr);
    gap: 1.6rem;
    align-items: start;
}
.request-form { min-width: 0; }
.request-aside { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 0.9rem; }
.aside-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    box-shadow: var(--shadow);
}
.aside-title { font-size: 0.98rem; margin: 0 0 0.4rem; }
.aside-card .plain-list { font-size: 0.88rem; }
.request-hint { font-size: 0.82rem; text-align: center; }
.institutional-badge {
    display: inline-block;
    background: #eef3ee;
    color: #2f5d3a;
    border: 1px solid #cdddcd;
    border-radius: 999px;
    padding: 0.12rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
}
@media (max-width: 900px) {
    .request-layout { grid-template-columns: 1fr; }
    .request-aside { position: static; }
}

/* --------- Visuels de cartes : cadre commun + repli (produits et services) */
.media-frame { width: 100%; }
.media-frame .card-image,
.media-frame .h-card-image,
.media-frame .detail-image { display: block; }
.media-fallback {
    width: 100%;
    height: 160px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.5rem;
    background: linear-gradient(135deg, #f4f1e9, #e6e1d4);
    border: 1px dashed var(--color-border);
    color: var(--color-muted);
    text-align: center;
}
.h-scroll > .h-card .media-fallback { height: 140px; }
.media-fallback-icon { font-size: 1.5rem; line-height: 1; }
.media-fallback-name {
    font-size: 0.78rem;
    max-width: 92%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .media-fallback { height: 130px; }
    .h-scroll > .h-card .media-fallback { height: 120px; }
}

/* ------------------------------- Mes formations -------------------------- */
.training-card { display: flex; flex-direction: column; gap: 0.4rem; }
.training-card-head { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.training-locked { margin: 0.4rem 0; font-size: 0.88rem; }
.course-card { display: flex; flex-direction: column; gap: 0.4rem; }

.progress-bar {
    height: 8px;
    background: #eae6dc;
    border-radius: 999px;
    overflow: hidden;
    margin: 0.5rem 0 0.2rem;
}
.progress-bar > span { display: block; height: 100%; background: var(--color-gold); }
.progress-text { font-size: 0.82rem; margin: 0; }
.prog-facts { display: flex; gap: 0.3rem; flex-wrap: wrap; margin: 0.3rem 0; }

/* --------------------------- Lecteur de cours --------------------------- */
.reader-layout {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: 1.6rem;
    align-items: start;
}
.reader-toc {
    position: sticky;
    top: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}
.toc-chapters { list-style: none; padding: 0; margin: 0; }
.toc-chapters > li { margin-bottom: 0.7rem; }
.toc-chapter-title { font-weight: 700; font-size: 0.9rem; display: block; }
.toc-lessons { list-style: none; padding-left: 0.6rem; margin: 0.25rem 0 0; }
.toc-lesson { font-size: 0.85rem; padding: 0.12rem 0; border-left: 2px solid transparent; padding-left: 0.5rem; }
.toc-lesson.is-read { border-left-color: #2f5d3a; }
.toc-check { color: #2f5d3a; font-weight: 700; }
.reader-content { min-width: 0; }
.reader-chapter { margin-bottom: 2rem; }
.reader-chapter-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.4rem;
}
.reader-lesson {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    margin: 0.9rem 0;
    box-shadow: var(--shadow);
}
.reader-lesson.is-read { border-left: 3px solid #2f5d3a; }
.reader-lesson-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.reader-lesson-head h3 { margin: 0; font-size: 1.02rem; }
.reader-text { margin: 0.6rem 0; white-space: pre-line; line-height: 1.6; }
.reader-attachments { list-style: none; padding: 0; margin: 0.6rem 0; }
.reader-attachment { display: flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0; font-size: 0.9rem; }
.reader-mark { margin-top: 0.7rem; }
.reader-foot { display: flex; align-items: center; gap: 0.7rem; margin: 1.4rem 0; }

/* Vidéo intégrée */
.video-block { margin: 0.7rem 0; }
.video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }
.video-player { width: 100%; max-height: 70vh; border-radius: 8px; background: #000; }
.video-actions { font-size: 0.82rem; margin: 0.3rem 0 0; }

@media (max-width: 900px) {
    .reader-layout { grid-template-columns: 1fr; }
    .reader-toc { position: static; max-height: none; }
}

/* --------------------- Carrousels horizontaux (accueil) ------------------- */
.h-scroll-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.h-scroll-hint { font-size: 0.78rem; color: var(--color-muted); }
.h-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.4rem 0.2rem 1rem;
    margin: 0 -0.2rem;
    -webkit-overflow-scrolling: touch;
}
.h-scroll > .h-card {
    flex: 0 0 auto;
    width: 300px;
    scroll-snap-align: start;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.h-scroll > .h-card h3 { margin: 0; font-size: 1.05rem; }
.h-scroll > .h-card.h-card-wide { width: min(420px, 86vw); }
.h-scroll > .h-card .detail-facts { font-size: 0.86rem; }
.h-scroll > .h-card .detail-facts li { padding: 0.18rem 0; }
.h-scroll > .h-card .h-card-image { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; }
.h-scroll > .h-card .h-card-actions { margin-top: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.h-scroll > .h-card .h-card-actions form { display: inline; margin: 0; }
.h-scroll::-webkit-scrollbar { height: 8px; }
.h-scroll::-webkit-scrollbar-thumb { background: #d8d4c8; border-radius: 999px; }

/* ------------------------------- Modales --------------------------------- */
body.modal-open { overflow: hidden; }
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(16, 16, 16, 0.55);
    align-items: flex-start;
    justify-content: center;
    padding: 4rem 1rem 2rem;
    overflow-y: auto;
}
.modal.is-open { display: flex; }
.modal-dialog {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 560px;
    padding: 1.6rem;
    position: relative;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.modal-title { margin: 0 0 0.2rem; font-size: 1.3rem; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-muted);
    padding: 0 0.2rem;
}
.modal-close:hover { color: var(--color-danger); }

/* ==================================================================
   PROGRAMME DE FORMATION — back-office (cascade cours › chapitres › leçons)
   ================================================================== */
.prog-stats { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.6rem 0; }
.prog-stat {
    background: #f2efe7;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.25rem 0.6rem;
    font-size: 0.88rem;
}
.prog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.prog-form { display: flex; flex-direction: column; gap: 0.25rem; }
.prog-form .form-control { margin-bottom: 0.35rem; }
.prog-form-boxed {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.9rem;
    background: var(--color-surface);
}
.prog-form-row { border-left: 3px solid var(--color-border); padding-left: 0.8rem; margin: 0.5rem 0 0.9rem; }
.prog-course {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    box-shadow: var(--shadow);
    padding: 0.9rem 1rem 1.2rem;
    margin-bottom: 1.2rem;
}
.prog-course-head { cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.prog-course-title { font-weight: 700; font-size: 1.08rem; }
.prog-course-meta { color: var(--color-muted); font-size: 0.86rem; }
.prog-index, .prog-index-soft {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.4rem; height: 1.4rem; border-radius: 50%;
    background: var(--color-ink); color: #fff; font-size: 0.78rem; margin-right: 0.5rem;
}
.prog-index-soft { background: #e8e4d8; color: var(--color-ink); min-width: 1.25rem; height: 1.25rem; }
.prog-toolbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 0.6rem 0; }
.prog-toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.prog-toolbar form { display: inline; margin: 0; }
.prog-move { display: inline-flex; gap: 0.15rem; }
.prog-icon-btn {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 6px;
    cursor: pointer;
    padding: 0.05rem 0.4rem;
    line-height: 1.2;
}
.prog-icon-btn:disabled { opacity: 0.35; cursor: default; }
.prog-chapter { border-top: 1px solid var(--color-border); margin-top: 1rem; padding-top: 0.8rem; }
.prog-chapter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.prog-chapter-title { font-weight: 700; }
.prog-chapter-meta, .prog-lesson-meta { color: var(--color-muted); font-size: 0.84rem; }
.prog-lesson {
    background: #fbfaf6;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.7rem 0.8rem;
    margin-top: 0.7rem;
}
.prog-lesson-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.prog-lesson-title { font-weight: 600; }
.prog-attachments { margin-top: 0.6rem; border-top: 1px dashed var(--color-border); padding-top: 0.6rem; }
.prog-subtitle { margin: 0 0 0.3rem; font-size: 0.95rem; }
.prog-attachment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.prog-attachment-list li {
    display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius); padding: 0.3rem 0.5rem;
}
.prog-attachment-title { display: inline-flex; align-items: center; gap: 0.4rem; }
.prog-inline-check {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.88rem; color: var(--color-muted); margin: 0.2rem 0;
}
.prog-current { font-size: 0.85rem; color: var(--color-muted); margin: 0.2rem 0 0.4rem; }
.prog-thumb img { max-width: 220px; border-radius: var(--radius); border: 1px solid var(--color-border); }
.prog-summary { margin: 0.6rem 0; }
.prog-summary-course { margin: 0.5rem 0 0.8rem; }
.prog-summary-list { margin: 0.2rem 0 0 1.1rem; padding: 0; font-size: 0.9rem; }

/* Programme affiché sur le site public */
.prog-facts { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0; }
.prog-public { max-width: 980px; }
.prog-public-course {
    border: 1px solid var(--color-border); border-radius: var(--radius);
    background: var(--color-surface); box-shadow: var(--shadow);
    padding: 0.9rem 1.1rem; margin-bottom: 1rem;
}
.prog-public-course-head { cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.prog-public-chapter { margin-top: 0.9rem; }
.prog-public-chapter-title { margin: 0 0 0.2rem; font-size: 1.02rem; }
.prog-public-lessons { list-style: none; margin: 0.3rem 0 0; padding: 0; }
.prog-public-lessons li {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    padding: 0.3rem 0; border-bottom: 1px dashed var(--color-border);
}
.prog-public-lesson-title { display: inline-flex; align-items: baseline; gap: 0.5rem; }

/* Modales du programme (formulaires plus larges, séparateurs internes) */
.prog-modal { max-width: 760px; }
.prog-modal .admin-panel-subtitle { margin: 0.9rem 0 0.4rem; }
.prog-modal .form-control { margin-bottom: 0.4rem; }
.prog-sep { border: none; border-top: 1px solid var(--color-border); margin: 1.2rem 0; }
.prog-add-option { margin-top: 0.9rem; }

/* ==================================================================
   PHOTOS DE PROFIL (tous les rôles) + pages d'authentification
   ================================================================== */
.profile-avatar-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-gold);
    background: var(--color-surface);
}
.avatar-mini {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0.35rem;
    vertical-align: middle;
    border: 1px solid rgba(255, 255, 255, 0.65);
}
.profile-photo-link { margin: 0.4rem 0 0; }
.photo-link-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    color: var(--color-gold);
    text-decoration: underline;
}
.photo-link-button:hover { opacity: 0.85; }
.profile-photo-preview { margin: 0 0 0.8rem; text-align: center; }
.photo-remove-form { margin-top: 0.6rem; }
.auth-resend { margin-top: 0.6rem; }
.auth-resend .btn-inline { padding: 0.15rem 0.65rem; }

/* ==================================================================
   SÉLECTEUR DE LANGUE (i18n : français / anglais / espagnol)
   ------------------------------------------------------------------
   Le libellé reste visible (et adapte sa largeur à la traduction) : aucune
   largeur fixe n'est imposée, car « Interface language » est plus long que
   « Langue de l'interface ». Le drapeau est décoratif (aria-hidden).
   ================================================================== */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.lang-switch-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
}
.lang-switch-flag { font-size: 1rem; line-height: 1; }
.lang-select {
    font: inherit;
    font-size: 0.85rem;
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    max-width: 12rem;
}
.lang-select option { color: var(--color-ink); background: #fff; }
.lang-select:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}
/* Sélecteur du back-office : posé sur un fond clair. */
.admin-shell .lang-switch-label,
.admin-topbar .lang-switch-label { color: var(--color-muted); }
.admin-shell .lang-select,
.admin-topbar .lang-select {
    background: var(--color-surface);
    color: var(--color-ink);
    border-color: var(--color-border);
}
@media (max-width: 640px) {
    /* Sur petit écran le libellé textuel est masqué : le nom natif de la
       langue reste lisible dans la liste, et `aria-label` porte l'intitulé. */
    .lang-switch-text { display: none; }
}

/* ==========================================================================
   DESIGN SYSTEM v2 — couche de cohérence globale
   --------------------------------------------------------------------------
   Toutes les interfaces (site public, espace client, back-office) partagent
   ces composants : un bouton de la page A est identique à un bouton de la
   page C, un badge de statut porte toujours un texte + un ton, une liste vide
   propose toujours une action.
   ========================================================================== */

/* --------------------------------------------------------------- STRUCTURE */
body { display: flex; flex-direction: column; min-height: 100vh; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: var(--space-6) auto;
    padding: 0 var(--space-5);
    flex: 1 0 auto;
}
.container-narrow { max-width: var(--container-narrow); }

.section { margin: var(--space-7) 0; }
.section-title {
    font-size: var(--fs-lg);
    font-weight: 700;
    margin: 0 0 var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border);
}
.section-lead { color: var(--color-muted); max-width: 62ch; margin: -0.4rem 0 var(--space-4); }

/* ------------------------------------------------------------------ EN-TÊTE */
/* Bandeau institutionnel clair : lisibilité et codes du secteur
   juridique/gouvernemental (le fond sombre est réservé au pied de page). */
.navbar {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    min-height: var(--header-h);
    padding: var(--space-2) var(--space-5);
    background: var(--color-surface);
    color: var(--color-ink);
    border-bottom: 1px solid var(--color-border);
    border-top: 3px solid var(--color-navy);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1100;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--color-navy);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.navbar-brand:hover { text-decoration: none; }
.navbar-logo { height: 40px; width: auto; }

.navbar-links {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    margin-left: auto;
    flex-wrap: wrap;
}
.navbar-links a {
    display: inline-block;
    padding: var(--space-2) var(--space-3);
    color: var(--color-ink);
    font-size: var(--fs-sm);
    font-weight: 500;
    border-radius: var(--radius-sm);
    border-bottom: 2px solid transparent;
}
.navbar-links a:hover { background: var(--color-surface-alt); text-decoration: none; }
.navbar-links a.active {
    color: var(--color-navy);
    border-bottom-color: var(--color-gold);
    font-weight: 700;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    justify-content: flex-end;
}
.user-menu { display: flex; align-items: center; gap: var(--space-2); }
.account-link { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }

/* Bandeau de confiance : domaines d'expertise, sous l'en-tête. */
.trustbar {
    background: var(--color-navy);
    color: #eaf0f7;
    font-size: var(--fs-xs);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.trustbar-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-2) var(--space-5);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-5);
    justify-content: center;
    text-align: center;
}
.trustbar strong { color: #fff; font-weight: 600; }

/* Menu mobile : bouton discret + panneau pleine largeur. */
.nav-toggle {
    display: none;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-surface);
    color: var(--color-navy);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
}
.nav-toggle:hover { background: var(--color-surface-alt); }
.nav-toggle-icon { font-size: 1.1rem; line-height: 1; }

/* ----------------------------------- TIROIR DE NAVIGATION (menu mobile) */
/* `position: fixed` : le tiroir est ancré au **viewport**, pas au document.
   Conséquence directe : il s'affiche immédiatement, même si l'utilisateur est
   tout en bas de la page (aucun besoin de remonter). Il glisse depuis la
   droite, reste dans la largeur de l'écran (`min(86vw, 21rem)`) et défile seul
   si son contenu est long (`overscroll-behavior: contain` évite de faire
   défiler la page d'arrière-plan). */
.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: min(86vw, 21rem);
    max-width: 100%;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    padding: var(--space-4) var(--space-4)
             calc(var(--space-6) + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    z-index: var(--z-drawer);
    transform: translateX(101%);
    visibility: hidden;
    transition: transform 0.26s ease-out, visibility 0.26s;
}
.mobile-nav.is-open { transform: translateX(0); visibility: visible; }
.mobile-nav[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
    .mobile-nav { transition: none; }
}

/* Voile de fermeture : présent dans le DOM uniquement lorsque le tiroir est
   ouvert (attribut `hidden` piloté par le script) → il ne peut jamais
   intercepter un appui destiné à la page. */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 22, 36, 0.5);
    z-index: var(--z-overlay);
    border: 0;
}
.nav-overlay[hidden] { display: none; }

.mobile-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}
.mobile-nav-head strong { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); }
.mobile-nav-close { width: 2.5rem; min-width: 2.5rem; padding: 0; }
.mobile-nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.mobile-nav-list a {
    display: block;
    padding: var(--space-3) var(--space-2);
    color: var(--color-ink);
    font-weight: 500;
    border-bottom: 1px solid var(--color-border);
}
.mobile-nav-list a.active { color: var(--color-navy); font-weight: 700; }
.mobile-nav-actions { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.mobile-nav-actions .btn { width: 100%; }
.mobile-lang { margin-top: var(--space-4); }
.mobile-lang .lang-switch { width: 100%; justify-content: space-between; }
.mobile-lang .lang-select { flex: 1 1 auto; max-width: none; }

/* Sélecteur de langue sur fond clair (en-tête redessiné). */
.lang-switch-label { color: var(--color-muted); }
.lang-select {
    background: var(--color-surface);
    color: var(--color-ink);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.5rem;
    min-height: 2.25rem;
}
.lang-select option { color: var(--color-ink); background: #fff; }


/* ------------------------------------------------------------------ PIED */
.footer {
    margin-top: var(--space-8);
    padding: var(--space-7) var(--space-5) var(--space-5);
    background: var(--color-navy);
    color: #d7e0ea;
    font-size: var(--fs-sm);
    flex-shrink: 0;
}
.footer-inner { max-width: var(--container); margin: 0 auto; }
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
    gap: var(--space-6) var(--space-5);
}
.footer-brand { display: flex; align-items: center; gap: var(--space-3); }
.footer-brand img {
    height: 40px;
    width: auto;
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 3px;
}
.footer-brand strong { color: #fff; font-size: 1rem; letter-spacing: 0.02em; }
.footer-tagline { color: #b9c6d4; margin: var(--space-3) 0 0; max-width: 34ch; }
.footer h2, .footer h3 {
    color: #fff;
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 var(--space-3);
    border: 0;
    padding: 0;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.footer a { color: #d7e0ea; }
.footer a:hover { color: #fff; }
.footer-bottom {
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    justify-content: space-between;
    color: #aebdcc;
    font-size: var(--fs-xs);
}

/* ---------------------------------------------------------------- BOUTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 2.6rem;
    padding: 0.6rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    background: var(--color-surface);
    color: var(--color-ink);
    transition: background-color 0.15s ease, border-color 0.15s ease,
                color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
    background: var(--color-navy);
    color: #fff;
    border-color: var(--color-navy);
}
.btn-primary:hover { background: var(--color-navy-dark); border-color: var(--color-navy-dark); }

/* Appel à l'action d'excellence (héros, bandeaux) : or sur encre. */
.btn-accent {
    background: var(--color-gold);
    color: var(--color-navy);
    border-color: var(--color-gold);
}
.btn-accent:hover { background: var(--color-gold-dark); border-color: var(--color-gold-dark); color: #fff; }

/* Bouton apaisé, lisible sur fond clair — « Déconnexion », « Annuler »…
   (auparavant blanc sur blanc : bouton invisible). */
.btn-ghost {
    background: transparent;
    color: var(--color-ink);
    border-color: var(--color-border-strong);
}
.btn-ghost:hover { background: var(--color-surface-alt); border-color: var(--color-muted); }

.btn-outline {
    background: var(--color-surface);
    color: var(--color-navy);
    border-color: var(--color-navy);
}
.btn-outline:hover { background: var(--color-surface-alt); color: var(--color-navy-dark); }

/* Bouton posé sur bandeau sombre (pied de page, bandeau de confiance). */
.btn-on-dark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.55); }
.btn-on-dark:hover { background: rgba(255, 255, 255, 0.12); }

.btn-danger { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn-danger:hover { background: #8b2118; border-color: #8b2118; }

.btn-link {
    background: none;
    border: 0;
    padding: 0;
    min-height: 0;
    color: var(--color-gold-dark);
    text-decoration: underline;
    font-weight: 600;
}
.btn-block { width: 100%; }
.btn-lg { min-height: 3.1rem; padding: 0.8rem 1.6rem; font-size: var(--fs-base); }
.btn-sm { min-height: 2.1rem; padding: 0.3rem 0.7rem; font-size: var(--fs-xs); }
.btn-inline { margin-left: var(--space-2); }

/* État de chargement : le bouton ne peut plus être soumis deux fois. */
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 1.05rem;
    height: 1.05rem;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.btn-ghost.is-loading::after,
.btn-outline.is-loading::after,
.btn-accent.is-loading::after {
    border-color: rgba(18, 38, 63, 0.35);
    border-top-color: var(--color-navy);
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .btn.is-loading::after { animation-duration: 1.6s; }
}

/* Groupe d'actions de page (pied de formulaire, pied de fiche). */
.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
    margin-top: var(--space-5);
}
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}
.form-actions .btn { min-width: 10rem; }

/* ------------------------------------------------------- BADGES DE STATUT */
/* Un badge porte TOUJOURS un texte : la couleur seule ne porte jamais
   l'information (accessibilité, daltonisme, impression noir et blanc). */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    background: var(--color-surface-alt);
    color: var(--color-ink);
}
.badge::before { content: "•"; font-size: 0.9em; line-height: 1; }
.badge-plain::before { content: none; }
.badge-neutral { background: var(--color-surface-alt); color: #445063; border-color: var(--color-border); }
.badge-info    { background: var(--color-info-bg);    color: var(--color-info);    border-color: #c6dbee; }
.badge-success { background: var(--color-success-bg); color: var(--color-success); border-color: #bfe0cd; }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); border-color: #ecd9a8; }
.badge-danger  { background: var(--color-danger-bg);  color: var(--color-danger);  border-color: #eec7c4; }
/* Alias historiques (compatibilité des gabarits existants). */
.badge-on   { background: var(--color-success-bg); color: var(--color-success); border-color: #bfe0cd; }
.badge-soft { background: var(--color-surface-alt); color: #445063; border-color: var(--color-border); }
.badge-off  { background: var(--color-danger-bg); color: var(--color-danger); border-color: #eec7c4; }
.badge-gold { background: var(--color-gold-soft); color: var(--color-gold-dark); border-color: #e6d8b4; }
.tag {
    display: inline-block;
    font-size: var(--fs-xs);
    padding: 0.15rem 0.6rem;
    background: var(--color-surface-alt);
    color: #445063;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
}

/* ----------------------------------------------------------------- ALERTES */
.alert {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 0.6rem;
    border: 1px solid var(--color-border);
    border-left-width: 4px;
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-3);
    font-size: var(--fs-sm);
    background: var(--color-surface);
}
.alert strong { font-weight: 700; }
.alert-success { background: var(--color-success-bg); color: var(--color-success); border-color: #bfe0cd; }
.alert-danger  { background: var(--color-danger-bg);  color: var(--color-danger);  border-color: #eec7c4; }
.alert-info    { background: var(--color-info-bg);    color: var(--color-info);    border-color: #c6dbee; }
.alert-warning { background: var(--color-warning-bg); color: var(--color-warning); border-color: #ecd9a8; }
.alert .btn { align-self: center; }
.alert a { color: inherit; text-decoration: underline; }
.flash-container { max-width: var(--container); margin: var(--space-4) auto; padding: 0 var(--space-5); }

/* -------------------------------------------------------------- FIL D'ARIANE */
.breadcrumbs { font-size: var(--fs-sm); margin: 0 0 var(--space-3); color: var(--color-muted); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 0.4rem; }
.breadcrumbs li + li::before { content: "/"; color: var(--color-border-strong); }
.breadcrumbs [aria-current="page"] { color: var(--color-ink); font-weight: 600; }
.breadcrumb { margin: 0 0 var(--space-2); font-size: var(--fs-sm); }

/* -------------------------------------------------------- EN-TÊTE DE PAGE */
.page-head { text-align: center; padding: var(--space-6) var(--space-4) var(--space-4); }
.page-head h1 { margin: 0 0 var(--space-2); }
.page-subtitle { color: var(--color-muted); max-width: 72ch; margin: 0 auto var(--space-2); }
.page-actions-center { justify-content: center; }

/* -------------------------------------------------------------- ÉTATS VIDES */
.empty-state {
    display: grid;
    justify-items: center;
    gap: var(--space-2);
    text-align: center;
    padding: var(--space-7) var(--space-5);
    background: var(--color-surface);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
}
.empty-state-icon { font-size: 2rem; line-height: 1; color: var(--color-gold-dark); }
.empty-state-title { margin: 0; font-size: var(--fs-md); }
.empty-state-body { margin: 0; color: var(--color-muted); max-width: 52ch; }
.empty-state-actions { margin-top: var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: center; }
.empty-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-2) var(--space-3);
    padding: var(--space-5) var(--space-4);
    color: var(--color-muted);
    text-align: center;
}

/* -------------------------------------------------- CARTES & MESURES CLÉS */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
}
.card > h2, .card > h3 { margin-top: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: var(--space-5); }

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
    gap: var(--space-4);
}
.metric {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-gold);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    box-shadow: var(--shadow-sm);
}
.metric-label {
    display: block;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-muted);
    margin-bottom: var(--space-1);
}
.metric-value { font-size: var(--fs-2xl); font-weight: 700; color: var(--color-navy); line-height: 1.1; }
.metric-hint { font-size: var(--fs-xs); color: var(--color-muted); }

/* --------------------------------------------------- BARRE DE MISE EN AVANT */
.hero {
    text-align: center;
    padding: var(--space-8) var(--space-4) var(--space-6);
    background: linear-gradient(180deg, #ffffff 0%, var(--color-bg) 100%);
    border-bottom: 1px solid var(--color-border);
}
.hero-badge { margin-bottom: var(--space-4); }
.hero-eyebrow {
    display: inline-block;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-gold-dark);
    font-weight: 700;
    margin-bottom: var(--space-3);
}
.hero-title { font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0 0 var(--space-3); }
.hero-subtitle { font-size: var(--fs-md); color: var(--color-muted); max-width: 64ch; margin: 0 auto; }
.hero-actions { margin-top: var(--space-5); display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }
.hero-note { margin: var(--space-4) auto 0; font-size: var(--fs-xs); color: var(--color-muted); max-width: 60ch; }

/* Bandeau d'appel à l'action final (pages publiques). */
.cta-band {
    background: var(--color-navy);
    color: #eaf0f7;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
}
.cta-band h2 { color: #fff; margin: 0 0 var(--space-2); border: 0; }
.cta-band p { color: #c9d5e2; margin: 0 auto var(--space-4); max-width: 62ch; }
.cta-band .page-actions { justify-content: center; margin-top: 0; }

/* ------------------------------------------------------- PARCOURS / ÉTAPES */
.process-steps { list-style: none; counter-reset: step; margin: 0 0 var(--space-5); padding: 0; display: grid; gap: var(--space-3); }
.process-steps li {
    position: relative;
    padding: var(--space-3) var(--space-4) var(--space-3) 3.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    counter-increment: step;
}
.process-steps li::before {
    content: counter(step);
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    width: 1.9rem;
    height: 1.9rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--color-navy);
    color: #fff;
    font-size: var(--fs-sm);
    font-weight: 700;
}
.process-steps li strong { display: block; }
.process-steps li span { font-size: var(--fs-sm); color: var(--color-muted); }

/* ------------------------------------------------ NAVIGATION ESPACE CLIENT */
.account-nav {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-2);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-sm);
}
.account-nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1); }
.account-nav-list a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius);
    color: var(--color-ink);
    font-size: var(--fs-sm);
    font-weight: 500;
}
.account-nav-list a:hover { background: var(--color-surface-alt); text-decoration: none; }
.account-nav-list a[aria-current="page"] { background: var(--color-navy); color: #fff; font-weight: 600; }
.account-nav-count {
    min-width: 1.4rem;
    padding: 0 0.35rem;
    border-radius: var(--radius-pill);
    background: var(--color-gold-soft);
    color: var(--color-gold-dark);
    font-size: var(--fs-xs);
    font-weight: 700;
    text-align: center;
}
.account-nav-list a[aria-current="page"] .account-nav-count { background: rgba(255, 255, 255, 0.25); color: #fff; }

/* Étapes d'un parcours long (formulaires multi-sections). */
.stepper { list-style: none; margin: 0 0 var(--space-5); padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.stepper li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    font-size: var(--fs-xs);
    color: var(--color-muted);
}
.stepper li.is-current { border-color: var(--color-navy); color: var(--color-navy); font-weight: 700; }

/* --------------------------------------------------------------- FORMULAIRES */
/* Mobile-first : champs pleine largeur, hauteur de cible ≥ 44 px, libellés
   toujours visibles (jamais remplacés par un simple placeholder). */
.form-group { margin-bottom: var(--space-4); }
.form-label {
    display: block;
    margin-bottom: var(--space-1);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--color-navy);
}
.form-label .required { color: var(--color-danger); margin-left: 0.15rem; }
.form-label .optional {
    color: var(--color-muted);
    font-weight: 400;
    font-size: var(--fs-xs);
    margin-left: 0.3rem;
}

.form-control {
    width: 100%;
    min-height: 2.9rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-ink);
    font-family: inherit;
    font-size: var(--fs-base);
}
textarea.form-control { min-height: 7rem; resize: vertical; line-height: var(--lh-snug); }
select.form-control { appearance: none; padding-right: 2rem;
    background-image: linear-gradient(45deg, transparent 50%, var(--color-muted) 50%),
                      linear-gradient(135deg, var(--color-muted) 50%, transparent 50%);
    background-position: calc(100% - 1.15rem) 1.15rem, calc(100% - 0.8rem) 1.15rem;
    background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
    background-repeat: no-repeat;
}
.form-control:focus { border-color: var(--color-navy); box-shadow: var(--focus-ring); outline: none; }
.form-control[aria-invalid="true"] { border-color: var(--color-danger); background: #fffafa; }
.form-control:disabled, .form-control[readonly] { background: var(--color-surface-alt); color: var(--color-muted); }
.form-control::placeholder { color: #8b95a3; }

.form-hint { display: block; margin-top: var(--space-1); font-size: var(--fs-xs); color: var(--color-muted); }
.form-error {
    display: block;
    margin-top: var(--space-1);
    color: var(--color-danger);
    font-size: var(--fs-xs);
    font-weight: 600;
}
.form-error::before { content: "⚠ "; }

/* Résumé des erreurs en tête de formulaire : l'utilisateur sait où aller. */
.form-errors-summary {
    background: var(--color-danger-bg);
    border: 1px solid #eec7c4;
    border-left: 4px solid var(--color-danger);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-5);
    color: var(--color-danger);
}
.form-errors-summary h2, .form-errors-summary h3 { color: var(--color-danger); margin: 0 0 var(--space-2); }
.form-errors-summary ul { margin: 0; padding-left: 1.2rem; }
.form-errors-summary a { color: inherit; }

/* Cases à cocher : cible confortable, libellé aligné. */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}
.form-check-input {
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
    margin: 0.15rem 0 0;
    accent-color: var(--color-navy);
}
.form-check-label { font-size: var(--fs-sm); font-weight: 500; }
.form-check-label a { color: var(--color-gold-dark); text-decoration: underline; }
.form-check .form-error { flex-basis: 100%; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: var(--space-2); }

/* Champs de fichier (CV, certificats, W-9, photo de profil). */
.form-control[type="file"], .admin-file-input { padding: var(--space-2); background: var(--color-surface-alt); font-size: var(--fs-sm); }
.form-control[type="file"]::file-selector-button {
    margin-right: var(--space-3);
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-navy);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* Sections de formulaire long : titres numérotés, lecture par étapes. */
.form-section, .admin-fieldset {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    padding: var(--space-5);
    margin: 0 0 var(--space-5);
}
.form-section legend, .admin-fieldset legend {
    display: block;
    padding: 0 var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-navy);
    border: 0;
}
.form-section .form-section-help, .form-section > p.muted:first-of-type { margin-top: 0; }
.admin-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 0 var(--space-5); }
.admin-col-full { grid-column: 1 / -1; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }

/* Barre d'action collante sur les formulaires longs : le bouton d'envoi reste
   accessible sans faire défiler tout le formulaire. */
.form-sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-4);
    padding: var(--space-3) 0;
    background: linear-gradient(180deg, rgba(245, 247, 250, 0), var(--color-bg) 45%);
}

/* ------------------------------------------------------------------ TABLEAUX */
/* Enveloppe : défilement horizontal maîtrisé avec repère visuel (jamais un
   débordement silencieux de la page). */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}
.table-wrap > table { border: 0; border-radius: 0; box-shadow: none; min-width: 44rem; }
.table-hint { font-size: var(--fs-xs); color: var(--color-muted); margin: var(--space-2) 0 0; }

/* Tableau « cartes » : sur petit écran, chaque ligne devient une carte
   étiquetée (`data-label`), plus aucune colonne coupée ni texte illisible. */
@media (max-width: 700px) {
    .stack-table { border: 0; background: none; box-shadow: none; min-width: 0; }
    .stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
    .stack-table tr {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
        padding: var(--space-3) var(--space-4);
        margin-bottom: var(--space-3);
    }
    .stack-table td {
        display: flex;
        align-items: baseline;
        gap: var(--space-2);
        border: 0;
        border-bottom: 1px dashed var(--color-border);
        padding: var(--space-2) 0;
        font-size: var(--fs-sm);
    }
    .stack-table td:last-child { border-bottom: 0; }
    .stack-table td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        font-size: var(--fs-xs);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--color-muted);
        font-weight: 700;
    }
    .stack-table td[data-label=""]::before, .stack-table td:not([data-label])::before { content: none; }
    .stack-table td.admin-actions, .stack-table td.table-actions { justify-content: flex-start; }
    .admin-table.stack-table { min-width: 0; }
}

/* ------------------------------------------------------------------- MODALES
   Sur mobile : feuille plein écran, lisible et refermable (bouton 44 px). */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: rgba(12, 22, 36, 0.55);
    overflow-y: auto;
}
.modal.is-open { display: flex; }
.modal-dialog {
    width: min(560px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-5);
}
.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}
.modal-title { margin: 0; font-size: var(--fs-lg); }
.modal-close {
    flex: 0 0 auto;
    width: 2.4rem;
    height: 2.4rem;
    display: grid;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-ink);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}
.modal-close:hover { background: var(--color-surface-alt); }
body.modal-open { overflow: hidden; }

@media (max-width: 640px) {
    .modal { padding: 0; align-items: flex-end; }
    .modal-dialog {
        width: 100%;
        max-height: 94vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        padding: var(--space-4) var(--space-4) var(--space-6);
    }
}

/* --------------------------------------------- TOASTS & CLOCHE DE NOTIFICATIONS */
.toast { border-left-width: 4px; box-shadow: var(--shadow-lg); }
.toast-body { font-size: var(--fs-sm); }
.toast-close {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: var(--radius-sm);
    line-height: 1;
    font-size: 1rem;
}
.toast-close:hover { background: var(--color-surface-alt); }

.notif-bell {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.4rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-ink);
}
.notif-bell:hover { background: var(--color-surface-alt); border-color: var(--color-navy); }
.notif-panel {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-3);
    max-height: min(70vh, 32rem);
}
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding-bottom: var(--space-2); border-bottom: 1px solid var(--color-border); }
.notif-list { max-height: 24rem; overflow-y: auto; }
.notif-item {
    padding: var(--space-3);
    border-bottom: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.notif-item.is-unread { background: var(--color-gold-soft); }
.notif-empty { padding: var(--space-4); text-align: center; color: var(--color-muted); font-size: var(--fs-sm); }

/* ------------------------------------------------- CHARGEMENT & SQUELETTES */
/* Un écran ne reste jamais figé : squelette pendant un rechargement de
   fragment, indicateur intégré au bouton pendant une soumission. */
.skeleton {
    border-radius: var(--radius);
    background: linear-gradient(90deg, #eef1f5 25%, #e3e8ee 37%, #eef1f5 63%);
    background-size: 400% 100%;
    animation: skeleton-slide 1.4s ease-in-out infinite;
    min-height: 1rem;
}
@keyframes skeleton-slide {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}
.is-busy { position: relative; }
.is-busy::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(245, 247, 250, 0.55);
    border-radius: inherit;
}
@media (prefers-reduced-motion: reduce) {
    .skeleton { animation: none; }
}

/* -------------------------------------------------------------- MÉDIAS */
.media-frame { width: 100%; }
.media-frame > img { display: block; width: 100%; height: auto; }
.card-image, .h-card-image { width: 100%; height: 170px; object-fit: cover; border-radius: var(--radius); }
.detail-image { width: 100%; height: auto; border-radius: var(--radius-lg); }
.media-fallback {
    display: grid;
    place-items: center;
    gap: var(--space-2);
    min-height: 140px;
    background: var(--color-surface-alt);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius);
    color: var(--color-muted);
    text-align: center;
    padding: var(--space-4);
}
.media-fallback-icon { font-size: 1.6rem; color: var(--color-gold-dark); }

/* ------------------------------------------ BLOCS DES PAGES PUBLIQUES */
.two-cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--space-5); align-items: start; }
.cta-block {
    text-align: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
}
.legal-note { font-size: var(--fs-xs); color: var(--color-muted); }
.lang-strip { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0; }
.lang-pill {
    background: var(--color-surface);
    color: var(--color-ink);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 0.2rem 0.75rem;
    font-size: var(--fs-xs);
    font-weight: 600;
}
.product-card { display: flex; flex-direction: column; gap: var(--space-2); }
.product-price { font-size: var(--fs-md); font-weight: 700; color: var(--color-navy); margin: var(--space-1) 0; }
.product-price-lg { font-size: var(--fs-2xl); }
.price-old { text-decoration: line-through; color: var(--color-muted); font-size: var(--fs-sm); font-weight: 400; margin-left: 0.35rem; }
.card-actions { display: flex; gap: var(--space-2); margin-top: auto; flex-wrap: wrap; }
.card-actions form { display: inline; margin: 0; }
.card-actions .btn { flex: 1 1 9rem; }
.detail-facts { list-style: none; padding: 0; margin: var(--space-3) 0; display: grid; gap: var(--space-1); }
.detail-facts li { padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); font-size: var(--fs-sm); }
.detail-facts li:last-child { border-bottom: 0; }
.detail-actions { display: flex; align-items: flex-end; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-4); }
.qty-label { display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--fs-xs); color: var(--color-muted); }
.qty-input { max-width: 6rem; }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); align-items: start; }
.instructor-block {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
}
.instructor-card { display: flex; gap: var(--space-5); align-items: flex-start; }
.instructor-photo { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius); }
.newsletter-form { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; margin-top: var(--space-4); }
.newsletter-form .form-control { max-width: 15rem; }
.newsletter-form .btn { min-width: 12rem; }

/* ------------------------------- FORMULAIRE DE DEMANDE & ESPACE CLIENT */
.request-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: var(--space-6);
    align-items: start;
}
.request-form { min-width: 0; }
.request-aside { position: sticky; top: calc(var(--header-h) + var(--space-4)); display: grid; gap: var(--space-4); }
.aside-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-gold);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    box-shadow: var(--shadow-sm);
}
.aside-title { margin: 0 0 var(--space-2); font-size: var(--fs-md); }
.request-hint { margin-top: var(--space-3); }
.join-form { max-width: 62rem; margin: 0 auto; }
.profile-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-4); }
.profile-header { display: flex; gap: var(--space-5); align-items: center; flex-wrap: wrap; }
.profile-details {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: var(--space-2) var(--space-5);
    margin: var(--space-5) 0;
}
.profile-details dt { color: var(--color-muted); font-size: var(--fs-sm); }
.profile-details dd { margin: 0; overflow-wrap: anywhere; }
.profile {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-6);
}
.profile-name { margin: 0; font-size: var(--fs-2xl); }
.profile-meta { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin: var(--space-2) 0 0; }
.profile-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--color-navy);
    color: var(--color-gold);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700;
    text-transform: uppercase;
}
.role-badge {
    display: inline-block;
    font-size: var(--fs-xs);
    padding: 0.2rem 0.65rem;
    background: var(--color-navy);
    color: #fff;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.auth-card {
    max-width: 460px;
    margin: var(--space-5) auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--space-6);
}
.auth-card-wide { max-width: 720px; }
.auth-title { margin: 0 0 var(--space-2); text-align: center; font-size: var(--fs-xl); }
.auth-subtitle { text-align: center; color: var(--color-muted); margin: 0 0 var(--space-5); font-size: var(--fs-sm); }
.auth-switch { text-align: center; margin: var(--space-4) 0 0; font-size: var(--fs-sm); }
.auth-resend { margin-top: var(--space-3); }
.session-form { max-width: none; margin: 0; }

/* ==========================================================================
   RESPONSIVE — priorité au mobile : du plus contraint au plus large
   ========================================================================== */

/* --- Tablette : la navigation principale bascule en menu déroulant -------- */
@media (max-width: 1080px) {
    .navbar { flex-wrap: wrap; }
    .navbar-links { display: none; }
    .nav-toggle { display: inline-flex; }
    .mobile-nav { display: block; }
    .account-link { max-width: 10rem; }
    .request-aside { position: static; }
    .request-layout, .two-cols { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .container { margin: var(--space-5) auto; padding: 0 var(--space-4); }
    .hero { padding: var(--space-6) var(--space-4) var(--space-5); }
    .product-detail { grid-template-columns: 1fr; }
    .about-homage { grid-template-columns: 1fr; }
    .about-portrait { position: static; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-nav { display: flex; flex-wrap: wrap; gap: var(--space-1); }
    .admin-nav-item { padding: var(--space-2) var(--space-3); }
}

/* --- Téléphone : lisibilité, cibles tactiles, formulaires ---------------- */
@media (max-width: 640px) {
    :root { --fs-3xl: 1.85rem; --fs-2xl: 1.55rem; --fs-xl: 1.3rem; }
    .container { padding: 0 var(--space-3); }
    .navbar { padding: var(--space-2) var(--space-3); gap: var(--space-3); }
    .navbar-logo { height: 34px; }
    .navbar-brand span { font-size: 0.95rem; }
    .navbar-actions { gap: var(--space-2); }
    .trustbar-inner { gap: var(--space-1) var(--space-3); padding: var(--space-2) var(--space-3); font-size: 0.7rem; }
    .page-head { padding: var(--space-5) var(--space-3) var(--space-3); }
    .section { margin: var(--space-6) 0; }
    .card, .form-section, .admin-fieldset { padding: var(--space-4); }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { width: 100%; }
    .form-row, .check-grid, .admin-form-grid { grid-template-columns: 1fr; }
    .profile-details { grid-template-columns: 1fr; gap: var(--space-1); }
    .profile-details dd { margin-bottom: var(--space-2); }
    .profile { padding: var(--space-4); }
    .auth-card { margin: var(--space-4) auto; padding: var(--space-4); }
    .footer-grid { grid-template-columns: 1fr; gap: var(--space-5); }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    .detail-actions { flex-direction: column; align-items: stretch; }
    .detail-actions .btn, .detail-actions .qty-label, .qty-input { width: 100%; max-width: none; }
    .card-actions .btn { flex: 1 1 100%; }
    .process-steps li { padding-left: 3rem; }
    .cta-band { padding: var(--space-5) var(--space-4); }
    .form-actions { flex-direction: column; align-items: stretch; }
    .form-actions .btn { width: 100%; }
    .notif-panel { width: calc(100vw - 1.5rem); }
    .h-scroll { padding-bottom: var(--space-3); }
    .h-scroll > .h-card { width: 78vw; }
}

/* --- Très petits écrans (320-390 px) : rien ne doit déborder ------------- */
@media (max-width: 400px) {
    /* Les règles de largeur de l'en-tête vivent désormais dans la couche
       responsive finale (`.navbar-name`, `.icon-btn`) : ce bloc ne conserve que
       les ajustements typographiques propres au très petit écran. */
    .btn { padding: 0.6rem 0.9rem; }
    .lang-switch-text { display: none; }
}

/* ------------------------------------------------------------------ IMPRESSION */
@media print {
    .navbar, .mobile-nav, .footer, .toast-container, .trustbar,
    .notif-bell, .skip-link, .h-scroll-hint { display: none !important; }
    body { background: #fff; display: block; }
    .card, .admin-panel, .modal-dialog, .profile { box-shadow: none; border: 1px solid #999; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #444; }
}

/* ======================= AJUSTEMENTS FINAUX DU DESIGN SYSTEM ============== */

/* Icônes SVG de `_ui.html` : jamais déformées, alignées sur la ligne de texte. */
.icon { flex: 0 0 auto; vertical-align: -0.15em; }

/* Sans JavaScript, aucun script ne peut ouvrir le menu mobile : il reste donc
   affiché d'emblée sur petit écran (le bouton, inutile, disparaît). */
html.no-js .mobile-nav { display: block !important; }
html.no-js .nav-toggle { display: none; }

/* Le sélecteur de langue de l'en-tête cède la place à celui du menu mobile. */
@media (max-width: 1080px) {
    .lang-switch-desktop { display: none; }
}

/* Champ en erreur : rappel visuel cohérent (le message reste toujours affiché). */
.form-group.has-error .form-label { color: var(--color-danger); }

/* Menu mobile ouvert : la page ne défile pas derrière le panneau. */
html.nav-open body { overflow: hidden; }

/* Bandeau de page (accueil) : fond légèrement contrasté, jamais criard. */
.section-alt { background: var(--color-surface); border-block: 1px solid var(--color-border); }
.section-alt > .section-inner { max-width: var(--container); margin: 0 auto; padding: var(--space-6) var(--space-5); }

/* Tableaux non convertis en cartes : sur téléphone, le tableau devient sa
   propre zone de défilement horizontal (la page ne déborde jamais). */
@media (max-width: 700px) {
    .container table.admin-table:not(.stack-table) {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

/* Boutons secondaires de l'espace client : hiérarchie visuelle plus discrète
   (ils ne doivent pas concurrencer l'action principale de la page). */
.profile-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.profile-actions .btn { min-height: 2.35rem; padding: 0.4rem 0.9rem; font-size: var(--fs-xs); }
.profile-actions .btn-primary { font-size: var(--fs-sm); }

/* Le sélecteur « Sections numérotées » du formulaire institutionnel : les
   dix sections sont numérotées automatiquement (repères visuels, sans
   dupliquer le texte ni toucher aux ressources i18n). */
.request-form { counter-reset: reqsection; }
.request-form .form-section { counter-increment: reqsection; }
.request-form .form-section legend::before { content: counter(reqsection) ". "; }

/* ==========================================================================
   INTERFACE UTILISATEUR — COUCHE RESPONSIVE FINALE (mobile-first)
   --------------------------------------------------------------------------
   Objectif : **zéro débordement horizontal**, top bar compacte sur une seule
   ligne, et lisibilité conservée du 320 px au grand écran. Cette couche est
   volontairement la dernière du fichier : elle affine les règles précédentes
   sans les réécrire, et ne cible jamais les composants `admin-*`.
   ========================================================================== */

/* ------------------------------------------------ Bouton d'action en icône */
/* Utilisé par la barre d'en-tête (panier, compte, connexion, déconnexion,
   cloche, menu). Carré tactile de 2,5 rem minimum ; le libellé textuel
   (`.text-label`) est masqué sur petit écran, mais `aria-label` + `title`
   portent toujours le sens (aucune action n'est « une icône seule »). */
.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: 0 0.5rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-navy);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    flex: 0 0 auto;
}
.icon-btn:hover { background: var(--color-surface-alt); border-color: var(--color-navy); text-decoration: none; }
.icon-btn:active { transform: translateY(1px); }
.icon-btn .icon { flex: 0 0 auto; }
.icon-btn .avatar-mini { margin: 0; }

/* Compteur (panier, notifications) : pastille chiffrée. */
.icon-btn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.25rem;
    border-radius: var(--radius-pill);
    background: var(--color-danger);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
}
.icon-btn-badge.is-empty { display: none; }

.navbar-cta { min-height: 2.5rem; padding: 0 0.9rem; flex: 0 0 auto; }
.navbar .nav-toggle {
    min-width: 2.5rem;
    min-height: 2.5rem;
    justify-content: center;
    padding: 0 0.5rem;
    border: 1px solid var(--color-border-strong);
    background: var(--color-surface);
}
.navbar .notif-bell {
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: 0 0.5rem;
    gap: 0.4rem;
    border-color: var(--color-border-strong);
}

/* ------------------------------- Bandeau de confiance sur une seule ligne */
/* Informations secondaires : défilement horizontal discret plutôt que trois
   lignes empilées qui repousseraient l'en-tête vers le bas. */
.trustbar-inner {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
}
.trustbar-inner::-webkit-scrollbar { display: none; }
.trustbar-inner > * { flex: 0 0 auto; }

/* -------------------------- LIBELLÉS DE LA BARRE D'ACTION (budget de place) */
/* Budget mesuré : marque ≈ 172 px + liens de navigation ≈ 566 px + sélecteur de
   langue ≈ 150 px + actions avec libellés ≈ 593 px + espacements ≈ 90 px
   ≈ **1 570 px**. Les libellés d'action (panier, compte, déconnexion,
   administration) ne sont donc affichés qu'à partir de 1 600 px : en dessous, la
   barre reste sur **une seule ligne** avec des actions en icônes, chacune
   conservant `aria-label` (nom accessible) et `title` (infobulle traduits). */
.navbar .text-label { display: none; }

@media (min-width: 1081px) and (max-width: 1599px) {
    /* Navigation complète mais resserrée ; le sélecteur de langue perd son
       libellé (le `select` conserve son `aria-label`). */
    .navbar-links a { padding-inline: var(--space-2); font-size: var(--fs-xs); }
    .navbar-name { font-size: 0.95rem; }
    .navbar .lang-switch-text { display: none; }
}

@media (min-width: 1600px) {
    .navbar .text-label { display: inline; }
    .account-label {
        max-width: 12rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ----------------------------------------- En-tête compact (tablette/mobile) */
@media (max-width: 1080px) {
    :root { --header-h: 60px; }
    .navbar {
        flex-wrap: nowrap;
        gap: 0.5rem;
        padding: 0.4rem 0.75rem;
        min-height: var(--header-h);
    }
    .navbar-links { display: none; }
    .nav-toggle { display: inline-flex; }
    .mobile-nav { display: block; }
    .lang-switch-desktop { display: none; }
    .navbar-actions {
        flex-wrap: nowrap;
        gap: 0.35rem;
        margin-left: auto;
        min-width: 0;
        justify-content: flex-end;
    }
    .icon-btn { width: 2.5rem; padding: 0; }
    .icon-btn-badge { position: absolute; top: -0.3rem; right: -0.3rem; margin: 0; }
    .navbar-logo { height: 34px; width: 34px; }
    .navbar-name { font-size: 0.95rem; }
}

@media (max-width: 520px) {
    /* Le logo reste reconnaissable sans son libellé : la marque est portée par
       l'emblème, et la barre reste sur une seule ligne. */
    .navbar-name { display: none; }
}

@media (max-width: 400px) {
    .navbar { padding: 0.35rem 0.5rem; gap: 0.35rem; }
    .navbar-actions { gap: 0.25rem; }
    .icon-btn,
    .navbar .nav-toggle,
    .navbar .notif-bell { width: 2.25rem; min-width: 2.25rem; min-height: 2.25rem; }
    .navbar-cta { padding: 0 0.6rem; font-size: var(--fs-xs); }
    .avatar-mini { width: 20px; height: 20px; }
}

/* ============================ GARDE-FOUS ANTI-DÉBORDEMENT ================= */
/* Aucun composant ne sort du viewport : la page ne défile jamais
   horizontalement. Les tableaux qui doivent rester larges gèrent leur propre
   défilement (`.table-wrap`) ; `overflow: clip` n'introduit pas de conteneur de
   défilement, donc le `sticky` de l'en-tête reste intact. */
html { overflow-x: hidden; }
@supports (overflow: clip) {
    html { overflow-x: clip; }
}

/* Les médias ne dépassent jamais leur conteneur. */
img, svg, video, canvas, iframe { max-width: 100%; }
video, iframe { height: auto; }
table { max-width: 100%; }

/* Un enfant de grille ou de flex ne peut pas élargir son parent. */
.container > *,
.two-cols > *,
.grid-2 > *, .grid-3 > *, .grid-4 > *,
.cards > *, .metric-grid > *, .footer-grid > *, .footer-grid > nav,
.request-layout > *, .reader-layout > *, .form-row > *, .check-grid > *,
.admin-form-grid > *, .profile-header > *, .card, .metric, .h-card,
.admin-panel > *, .notif-head > *, .order-head > *, .mission-head > * { min-width: 0; }

/* Les textes longs (e-mails, références, libellés traduits…) reviennent à la
   ligne au lieu de pousser la mise en page. */
.breadcrumbs, .breadcrumbs a, .breadcrumbs span,
.profile-details dd, .detail-facts li, .admin-dl dd,
.notif-item, .notif-item strong, .toast-body, .empty-state-body,
.media-current, .metric-hint, .card, .footer a, .footer-tagline,
.reader-text, .reader-attachment, .enquiry-details summary { overflow-wrap: anywhere; }

/* Tableaux : le défilement reste TOUJOURS local au tableau. */
.table-wrap { max-width: 100%; overscroll-behavior-x: contain; }
.container table.admin-table:not(.stack-table) { overscroll-behavior-x: contain; }
.stack-table td { flex-wrap: wrap; }
.badge, .tag { max-width: 100%; }

/* Éléments fixes : respect des encoches et de la barre du navigateur mobile. */
.toast-container {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}
.footer { padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom)); }
.modal-dialog { max-height: 90dvh; }
@media (max-width: 640px) { .modal-dialog { max-height: 92dvh; } }

/* Barre d'action collante des formulaires longs : lisible et atteignable. */
.form-sticky-actions {
    background: linear-gradient(180deg, rgba(245, 247, 250, 0), var(--color-bg) 40%);
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
}
@media (max-width: 640px) {
    .form-sticky-actions { flex-direction: column-reverse; align-items: stretch; }
    .form-sticky-actions .btn { width: 100%; }
}

/* ------------------------------------------------------- LISTE DE DONNÉES */
/* Remplace l'usage des classes du back-office dans l'interface utilisateur
   (ex. suivi de candidature) : même présentation, mais rattachée au design
   system utilisateur et adaptée au mobile. */
.data-list {
    display: grid;
    grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
    gap: var(--space-2) var(--space-5);
    margin: 0;
}
.data-list dt { color: var(--color-muted); font-size: var(--fs-sm); }
.data-list dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
    .data-list { grid-template-columns: 1fr; gap: var(--space-1); }
    .data-list dt { margin-top: var(--space-2); }
}

/* ========================= PALIERS RESPONSIVE DE L'INTERFACE UTILISATEUR == */
/* 1080 px : navigation → menu déroulant · 900 px : passage en une colonne ·
   768 px : tablette (deux colonnes) · 640 px : téléphone (une colonne, actions
   empilées) · 400 px : petits téléphones (typo et pastilles réduites).
   Ces paliers remplacent progressivement les anciens seuils épars, sans les
   contredire (les règles du back-office restent inchangées). */

@media (max-width: 900px) {
    .two-cols, .product-detail, .request-layout, .reader-layout { grid-template-columns: 1fr; }
    .request-aside { position: static; top: auto; }
    .profile-header { flex-direction: column; align-items: flex-start; }
    .hero { padding: var(--space-6) var(--space-4) var(--space-5); }
}

@media (max-width: 768px) {
    /* Tablette : deux colonnes au maximum — au-delà, les cartes deviennent
       trop étroites et les libellés longs se cassent mal. */
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .metric-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

@media (max-width: 640px) {
    /* Cartes des carrousels : toujours plus étroites que l'écran (la carte
       « large » du desktop ne déborde plus sur un téléphone de 320 px). */
    .h-scroll > .h-card,
    .h-scroll > .h-card.h-card-wide { width: min(78vw, 20rem); }
    /* Téléphone : une seule colonne, cartes pleine largeur, actions empilées. */
    .cards, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .card, .metric, .empty-state, .cta-band { padding: var(--space-4); }
    .metric-value { font-size: var(--fs-lg); }
    .stepper, .account-nav { overflow-x: auto; scrollbar-width: none; }
    .stepper::-webkit-scrollbar, .account-nav::-webkit-scrollbar { display: none; }
    .stepper { flex-wrap: nowrap; }
    .account-nav-list { flex-wrap: nowrap; }
    .stepper li, .account-nav-list a { flex: 0 0 auto; }
    .page-actions, .profile-actions { flex-direction: column; align-items: stretch; }
    .page-actions .btn, .profile-actions .btn { width: 100%; }
    .order-head, .mission-head { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
    .notif-panel { right: 0; left: auto; }
    .hero-title { font-size: clamp(1.6rem, 8vw, 2.1rem); }
    .section-title { font-size: var(--fs-md); }
    .footer { padding-top: var(--space-6); }
}

@media (max-width: 400px) {
    .badge, .tag { font-size: 0.72rem; }
    .metric-value { font-size: var(--fs-md); }
    .btn { font-size: var(--fs-xs); }
}

/* ==========================================================================
   FINITION MOBILE — PANNEAUX, CLAVIER, CARTES (interface utilisateur)
   --------------------------------------------------------------------------
   Objectif : depuis un smartphone uniquement, tout reste visible, atteignable
   et utilisable. Cette couche s'appuie sur les jetons du design system et sur
   une échelle de `z-index` explicite (plus aucune valeur « magique »).
   ========================================================================== */

/* ------------------------------------------------ Échelle de superposition */
:root {
    --z-header: 1100;
    --z-notif: 1200;
    --z-overlay: 1300;
    --z-drawer: 1310;
    --z-modal: 1400;
    --z-toast: 1500;
}
.navbar { z-index: var(--z-header); }
.toast-container { z-index: var(--z-toast); }
.modal { z-index: var(--z-modal); }

/* ------------------------------------------------ Panneau de notifications */
/* Ancre de référence sur grand écran : le panneau se place sous la cloche. */
.notif-bell-wrap { position: relative; display: inline-flex; }
.notif-head-actions { display: inline-flex; align-items: center; gap: var(--space-2); }
.notif-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-ink);
    cursor: pointer;
}
.notif-close:hover { background: var(--color-surface-alt); }

/* Sur tablette et téléphone, le panneau est ancré au **viewport** (et non à la
   cloche) : il reste donc entièrement dans l'écran — jamais coupé à droite ni à
   gauche — et son contenu défile indépendamment. */
@media (max-width: 1080px) {
    .notif-panel {
        position: fixed;
        top: calc(var(--header-h) + var(--space-2));
        left: var(--space-3);
        right: var(--space-3);
        width: auto;
        max-width: none;
        max-height: calc(100vh - var(--header-h) - var(--space-4));
        max-height: calc(100dvh - var(--header-h) - var(--space-4));
        overflow-y: auto;
        overscroll-behavior: contain;
        z-index: var(--z-notif);
    }
    .notif-list { max-height: none; }
}

/* ------------------------------------------------------- Cartes et textes */
/* Un contenu long (libellé traduit, référence, adresse, motif d'échec) revient
   à la ligne au lieu de sortir du bloc : correction structurelle, aucun
   `overflow: hidden` ne vient masquer le problème. */
.card, .metric, .h-card, .empty-state, .cta-band, .notif-item, .reader-lesson { overflow-wrap: anywhere; }
.card h2, .card h3, .h-card h3, .metric-value, .profile-name, .detail-facts li, .aside-title { overflow-wrap: anywhere; }
.card-actions, .h-card-actions, .page-actions, .profile-actions { min-width: 0; }
.product-price, .order-head strong, .mission-head strong { overflow-wrap: anywhere; }
/* Une pastille de statut peut passer sur deux lignes plutôt que de déborder. */
.badge, .tag { white-space: normal; }

/* ------------------------------------------------ Clavier du smartphone */
/* Quand un champ reçoit le focus, le navigateur l'amène dans la vue : ces
   marges réservent la place du clavier virtuel pour que le champ actif (et le
   bouton qui suit) restent visibles. */
input, select, textarea, button, .btn, .form-check-input, [data-modal-open] {
    scroll-margin-top: calc(var(--header-h) + var(--space-3));
    scroll-margin-bottom: 45vh;
}
/* Police ≥ 16 px : empêche le zoom automatique d'iOS qui cassait la mise en
   page (et donnait l'impression que le clavier ne s'ouvrait pas). */
.form-control, .lang-select { font-size: max(16px, var(--fs-base)); }

/* ---------------------------------------- Sans JavaScript : tiroir statique */
/* Aucun script ne peut ouvrir le tiroir : il redevient un panneau de flux,
   visible, sans transformation (les liens restent accessibles). */
html.no-js .mobile-nav {
    position: static;
    height: auto;
    width: auto;
    max-width: none;
    transform: none !important;
    visibility: visible;
    box-shadow: none;
    border-left: 0;
    border-top: 1px solid var(--color-border);
}
html.no-js .nav-overlay { display: none; }
html.no-js .mobile-nav-close { display: none; }

/* ==========================================================================
   INTERFACE ADMINISTRATION — COUCHE DESKTOP (cadrage, tableaux, formulaires)
   --------------------------------------------------------------------------
   Périmètre strict : composants `.admin-*` et conteneur élargi du back-office
   (`.container-wide`). Aucun sélecteur de l'espace utilisateur n'est touché.
   Objectif : interface dense mais lisible, correctement cadrée de 1024 px à
   1920 px et au-delà, sans aucun débordement ni colonne coupée.
   ========================================================================== */

/* ------------------------------------------------- Cadrage du squelette */
/* Le back-office dispose d'une largeur utile propre : les tableaux à plusieurs
   colonnes restent lisibles, et sur grand écran le contenu ne s'étire pas
   démesurément (plafond 1 720 px, contenu centré par `.container`). */
.container-wide { max-width: min(1720px, 100%); }

.admin-shell {
    grid-template-columns: 236px minmax(0, 1fr);
    gap: var(--space-5);
    align-items: start;
}

/* La barre latérale reste visible pendant le défilement des listes longues,
   sans jamais dépasser la hauteur de l'écran (elle défile seule si besoin). */
.admin-sidebar {
    top: calc(var(--header-h) + var(--space-3));
    max-height: calc(100vh - var(--header-h) - var(--space-5));
    max-height: calc(100dvh - var(--header-h) - var(--space-5));
    overflow-y: auto;
    padding: var(--space-4);
}

/* L'en-tête de page (titre + actions) reste accessible quand on parcourt une
   longue liste : les actions principales ne disparaissent plus hors écran. */
.admin-page-head {
    position: sticky;
    top: var(--header-h);
    z-index: 6;
    padding: var(--space-3) 0;
    margin-bottom: var(--space-4);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

/* ------------------------------------------------------ Tableaux admin */
/* `overflow: hidden` était appliqué au tableau lui-même : les colonnes en trop
   étaient **coupées silencieusement**. Le défilement est désormais porté par
   `.table-wrap` (une seule zone, dans le tableau), donc rien n'est perdu et la
   page ne défile jamais horizontalement. */
.admin-table { overflow: visible; }
.table-wrap > .admin-table { border: 1px solid var(--color-border); }
.admin-table th, .admin-table td { padding: 0.55rem 0.7rem; }
.admin-table tbody tr + tr td { border-top: 1px solid var(--color-border); }

/* La colonne d'actions n'impose plus 220 px fixes : elle s'ajuste au contenu
   et reste insécable (les libellés d'action ne passent pas à la ligne). */
.admin-actions-col { width: 1%; white-space: nowrap; }
.admin-actions { white-space: nowrap; gap: var(--space-3); }
.admin-action { display: inline-flex; align-items: center; min-height: 1.9rem; }

/* Valeur longue : tronquée avec info-bulle (la valeur complète reste sur la
   fiche) — l'information n'est jamais perdue, seulement repliée. */
.cell-clamp {
    display: inline-block;
    max-width: 20ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
@media (min-width: 1500px) { .cell-clamp { max-width: 26ch; } }
@media (min-width: 1800px) { .cell-clamp { max-width: 34ch; } }

/* --------------------------------------------------- Filtres & recherche */
/* Une grille régulière : la barre de filtres ne devient jamais une ligne
   interminable, et chaque champ garde une largeur confortable. */
.admin-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
    gap: var(--space-3);
    align-items: end;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}
.admin-filters .admin-search-input { max-width: none; }
.admin-filters .admin-filter { display: grid; gap: var(--space-1); margin: 0; }
.admin-filters .admin-filter-label { font-size: var(--fs-xs); color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.admin-filters .admin-reset { align-self: center; }

/* ------------------------------------------------------------- Pagination */
.admin-pagination { justify-content: flex-end; gap: var(--space-3); }
.admin-page-info { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ Formulaires */
/* Fiche longue (jusqu'à 30 champs) : la barre d'action reste accessible en bas
   de la zone visible pendant la saisie. */
.admin-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 4;
    padding: var(--space-3) 0;
    background: linear-gradient(180deg, rgba(245, 247, 250, 0), var(--color-bg) 45%);
}
/* Listes de données admin : le libellé ne peut plus imposer sa largeur. */
.admin-dl { grid-template-columns: minmax(0, max-content) minmax(0, 1fr); }
.admin-dl dd { overflow-wrap: anywhere; }

/* ------------------------------------------------- Tableau de bord admin */
/* Regroupement par domaine : chaque section titre ses cartes, ce qui évite une
   grille unique de 25 cartes difficiles à parcourir. */
.admin-section-title {
    margin: var(--space-5) 0 var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border);
    font-size: var(--fs-md);
}
.admin-grid > .admin-card { min-width: 0; }
.admin-card-label { overflow-wrap: anywhere; }


/* ==========================================================================
   FINITION MOBILE — LIGNES FLEXIBLES ET LISTES (dernier durcissement)
   --------------------------------------------------------------------------
   Les lignes « libellé · valeur » et les en-têtes de bloc passent à la ligne
   au lieu de pousser leur parent : c'est la structure qui devient souple, pas
   le débordement qui est masqué.
   ========================================================================== */

/* Listes de données : le libellé ne peut plus imposer sa largeur. */
.profile-details { grid-template-columns: minmax(0, max-content) minmax(0, 1fr); }

@media (max-width: 640px) {
    .profile-details { grid-template-columns: 1fr; gap: var(--space-1); }
    .profile-details dt { margin-top: var(--space-2); }
}

/* Rangées flexibles des pages utilisateur : elles s'enroulent proprement. */
.order-head,
.mission-head,
.h-scroll-head,
.reader-lesson-head,
.reader-foot,
.notif-head,
.training-card-head { flex-wrap: wrap; min-width: 0; gap: var(--space-2); }
.reader-lesson-head h3,
.reader-chapter-title,
.h-scroll-head > *,
.order-head > *,
.mission-head > * { min-width: 0; overflow-wrap: anywhere; }

/* Carrousels : le défilement s'aligne sur la marge du conteneur (la première
   carte ne colle plus au bord de l'écran). */
.h-scroll { scroll-padding-inline: var(--space-3); }

/* Panneau de notifications : ancrage explicite sur grand écran (sous la
   cloche), hauteur bornée pour ne jamais dépasser le viewport. */
.notif-panel {
    left: auto;
    max-height: min(70vh, 32rem);
}

/* ==========================================================================
   INTERFACE ADMINISTRATION — UX DESKTOP (cadrage, densité, défilements)
   --------------------------------------------------------------------------
   Objectif : un poste de travail lisible pendant plusieurs heures. Les règles
   ci-dessous ne touchent que les composants `admin-*` : l'interface utilisateur
   n'est pas concernée. Aucun contenu n'est masqué ni supprimé : l'information
   secondaire est repliée, jamais perdue (valeur complète en info-bulle ou sur
   la fiche « Éditer »).
   ========================================================================== */

/* ------------------------------------------------- Cadrage et respiration */
/* Le contenu s'aligne sur une largeur maîtrisée : pas de formulaire étiré sur
   1 900 px, pas de tableau tronqué inutilement. */
.admin-shell { align-items: start; }
.admin-main { min-width: 0; max-width: 100%; }
.admin-main > .admin-page-head,
.admin-main > .admin-letter,
.admin-main > .admin-section-title,
.admin-main > .admin-panel,
.admin-main > .admin-form,
.admin-main > .admin-grid,
.admin-main > .grid-4 { max-width: 1560px; }
.admin-main > section { margin-bottom: var(--space-5); }
.admin-shell .admin-page-head { align-items: flex-start; column-gap: var(--space-5); }
.admin-shell .admin-page-actions { align-items: center; }
.admin-main .admin-section-title {
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-muted);
    margin: var(--space-6) 0 var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border);
}
.admin-main .admin-panel,
.admin-main .admin-form,
.admin-main .admin-letter { border-radius: var(--radius-lg); }

/* ------------------------------------------- Navigation latérale groupée */
.admin-shell .admin-nav { margin-top: var(--space-3); gap: var(--space-1); }
.admin-shell .admin-nav-group + .admin-nav-group { margin-top: var(--space-4); }
.admin-shell .admin-nav-group-title {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-muted);
    margin: 0 0 var(--space-1);
    padding: 0 var(--space-2);
}
.admin-shell .admin-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-left: 3px solid transparent;
}
.admin-shell .admin-nav-item:hover { background: var(--color-surface-alt); border-left-color: var(--color-border-strong); }
.admin-shell .admin-nav-item.active {
    background: var(--color-navy);
    color: #fff;
    border-left-color: var(--color-gold);
    font-weight: 600;
}
.admin-shell .admin-nav-item:focus-visible,
.admin-main .admin-card:focus-visible,
.admin-main .admin-action:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 2px; }

/* Tableau de bord : bandeau d'indicateurs (niveau 1) + annuaire (niveau 2) */
.admin-main .admin-kpis { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.admin-main .admin-kpi {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-gold);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: var(--color-ink);
}
.admin-main .admin-kpi:hover { border-color: var(--color-gold); text-decoration: none; }
.admin-main .admin-kpi-label { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); font-weight: 600; }
.admin-main .admin-kpi-value { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.1; color: var(--color-navy); }
.admin-main .admin-kpi-meta { font-size: var(--fs-xs); color: var(--color-muted); }
.admin-main .admin-card { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.admin-main .admin-card-total { color: var(--color-navy); }

/* ======================================================== TABLEAUX DE DONNÉES */
/* Portée volontairement limitée à `.admin-main` : les tableaux de l'espace
   utilisateur réutilisent `.admin-table` (`stack-table`) et ne doivent pas
   hériter de ces règles. */
.admin-main .admin-table-scroll {
    max-height: min(72vh, 46rem);
    overflow: auto;
    overscroll-behavior: contain;
}
.admin-main .admin-table-scroll > .admin-table { border: 0; border-radius: 0; box-shadow: none; }
/* Les listes sont longues : l'en-tête de colonnes reste visible pendant le
   défilement (le tableau défile dans son propre cadre, la page non). */
.admin-main .admin-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--color-surface-alt);
    border-bottom: 1px solid var(--color-border-strong);
}
/* Lignes alternées : lecture en diagonale sans effort. */
.admin-main .admin-table tbody tr:nth-child(even) { background: rgba(241, 243, 246, 0.45); }
.admin-main .admin-table tbody tr:hover { background: var(--color-gold-soft); }
/* La première colonne porte l'identité de la ligne. */
.admin-main .admin-table td:first-child { font-weight: 600; color: var(--color-navy); }
.admin-main .admin-table .cell-clamp { display: inline-block; max-width: 34ch; overflow-wrap: anywhere; }
/* Colonne d'actions ajustée au contenu : les colonnes de données récupèrent
   l'espace libéré. */
.admin-main .admin-actions-col { width: 1%; white-space: nowrap; }
.admin-main .admin-table .admin-actions { flex-wrap: nowrap; justify-content: flex-end; gap: var(--space-3); }
.admin-main .admin-table th,
.admin-main .admin-table td { padding: 0.55rem 0.7rem; }

/* Menu d'actions secondaires d'une ligne (aucun JavaScript : `<details>`). */
.admin-main .row-menu { position: relative; display: inline-block; }
.admin-main .row-menu > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-ink);
    font-size: 1.05rem;
    line-height: 1;
}
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu[open] > summary { border-color: var(--color-navy); background: var(--color-surface-alt); }
.row-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 0.25rem);
    z-index: var(--z-notif);
    min-width: 11rem;
    padding: var(--space-1);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: grid;
    gap: 2px;
}
.row-menu-list form { margin: 0; }
.row-menu-list .admin-action {
    display: block;
    width: 100%;
    text-align: left;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
}
.row-menu-list .admin-action:hover { background: var(--color-surface-alt); text-decoration: none; }

/* ===================================================== FILTRES ET RECHERCHE */
/* Une seule ligne compacte par défaut ; les filtres secondaires sont repliés
   dans `Filtres avancés` (même formulaire, mêmes paramètres d'URL). */
.admin-main .admin-filters {
    align-items: flex-end;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
}
.admin-main .admin-filters .admin-search-input { min-width: 18rem; }
.admin-main .admin-filters-more > summary {
    cursor: pointer;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--color-gold-dark);
    align-self: center;
}
.admin-main .admin-filters-more[open] {
    flex-basis: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: var(--space-3);
}
.admin-main .admin-filters-more[open] > summary { grid-column: 1 / -1; }
.admin-main .admin-filters-active {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin: 0 0 var(--space-3);
    font-size: var(--fs-xs);
    color: var(--color-muted);
}

/* ======================================================= FORMULAIRES ADMIN */
/* Portée limitée à `.admin-main` : le formulaire public de candidature
   (`site/join.html`) réutilise `.admin-form-grid` et `.admin-fieldset` et ne
   doit pas changer d'apparence. */
/* Grille de 12 colonnes : chaque champ occupe la largeur justifiée par sa
   donnée (un entier n'a pas besoin de 1 400 px, une description si). */
.admin-main .admin-form-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 var(--space-5); }
.admin-main .admin-form-grid > .form-group { grid-column: span 6; }
.admin-main .admin-form-grid > .admin-col-full { grid-column: 1 / -1; }
.admin-main .admin-form-grid > .admin-field-compact { grid-column: span 3; }
.admin-main .admin-form-grid > .admin-field-medium { grid-column: span 4; }
.admin-main .admin-form-grid .form-group { margin-bottom: var(--space-4); }
.admin-main .admin-form-grid .form-control[type="number"],
.admin-main .admin-form-grid .form-control[type="date"],
.admin-main .admin-form-grid .form-control[type="url"],
.admin-main .admin-form-grid .form-control[type="tel"] { max-width: 20rem; }
.admin-main .admin-form-grid .form-check { margin-bottom: var(--space-2); }

/* Enregistrement toujours à portée de main, même en bas d'un long formulaire. */
.admin-main .admin-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding: var(--space-3) 0;
    border-top: 1px solid var(--color-border);
    background: linear-gradient(180deg, rgba(245, 247, 250, 0), var(--color-bg) 40%);
}
.admin-main .admin-form-actions .btn { min-width: 11rem; }
.admin-main .admin-form-actions-readonly { justify-content: space-between; }
.admin-main .admin-form-actions-readonly .btn { min-width: 0; }

/* Sections de formulaire : hiérarchie claire et rythme constant. */
.admin-main .admin-fieldset { margin-bottom: var(--space-6); }
.admin-main .admin-fieldset legend { color: var(--color-navy); font-size: var(--fs-xs); }
.admin-main .admin-dl { max-width: 60rem; }
.admin-main .admin-dl dd { overflow-wrap: anywhere; }
.admin-main .admin-panel-title { font-size: var(--fs-md); }

/* Programme de formation : l'en-tête du cours reste visible pendant le
   défilement de ses chapitres et leçons (les titres ne « disparaissent » plus
   au milieu d'un cours de 40 lignes). */
.admin-main .prog-course > .prog-course-head {
    position: sticky;
    top: var(--header-h);
    z-index: 1;
    padding: var(--space-2) var(--space-2) var(--space-2) 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

/* Fiche longue (interprète, demande) : sommaire d'ancrage compact qui évite de
   chercher une section en faisant défiler toute la page. */
.admin-main .admin-anchor-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: 0 0 var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}
.admin-main .admin-anchor-nav a {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--color-border-strong);
    border-radius: 999px;
    font-size: var(--fs-sm);
    color: var(--color-navy);
    background: var(--color-surface);
}
.admin-main .admin-anchor-nav a:hover { border-color: var(--color-gold); text-decoration: none; }
.admin-main .admin-anchor-nav a:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 2px; }
/* Les sections ciblées ne passent pas sous l'en-tête fixe du site. */
.admin-main .admin-panel[id] { scroll-margin-top: calc(var(--header-h) + var(--space-4)); }

@media (max-width: 1100px) {
    .admin-main .admin-form-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .admin-main .admin-form-grid { grid-template-columns: 1fr; }
    .admin-main .admin-form-grid > .form-group,
    .admin-main .admin-form-grid > .admin-field-compact,
    .admin-main .admin-form-grid > .admin-field-medium { grid-column: 1 / -1; }
    .admin-main .admin-filters .admin-search-input { min-width: 0; }
    .admin-main .admin-table-scroll { max-height: none; overflow-x: auto; overflow-y: visible; }
}








.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: var(--space-5); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: var(--space-5); }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: var(--space-4); }
.reason-card { display: grid; gap: var(--space-2); }
.reason-card h3 { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.reason-card .icon { color: var(--color-gold-dark); }
.reason-card p { margin: 0; color: var(--color-muted); font-size: var(--fs-sm); }









