/* ═══════════════════════════════════════════════════════════════════════════
   SÉQUENCES CYCLE 4 — CSS Global
   Design éditorial · Académique · Chaleureux
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
    /* Couleurs */
    --c-bg:          #f7f4ee;
    --c-surface:     #ffffff;
    --c-primary:     #1e3a5f;
    --c-primary-dk:  #152b48;
    --c-accent:      #b85c38;
    --c-accent-lt:   #f0e6df;
    --c-text:        #1a1a1a;
    --c-text-muted:  #6b6560;
    --c-border:      #ddd7cc;
    --c-success:     #2e7d56;
    --c-warning:     #b07a1a;
    --c-error:       #b83232;
    --c-pending:     #5a6275;

    /* Typographie */
    --font-serif:    'Playfair Display', Georgia, serif;
    --font-sans:     'DM Sans', system-ui, sans-serif;

    /* Espacements */
    --sp-xs:  0.25rem;
    --sp-sm:  0.5rem;
    --sp-md:  1rem;
    --sp-lg:  1.5rem;
    --sp-xl:  2.5rem;
    --sp-2xl: 4rem;

    /* Rayon */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    /* Ombres */
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,.1);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.12);

    /* Layout */
    --max-w:     1100px;
    --header-h:  64px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--c-text);
    background-color: var(--c-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* ── Utilitaires ─────────────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--sp-xl);
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: var(--c-primary);
    border-bottom: 3px solid var(--c-accent);
    box-shadow: var(--shadow-md);
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--sp-xl);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-lg);
}

.site-logo {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    color: #ffffff;
    transition: opacity .2s;
}
.site-logo:hover { opacity: .85; }

.logo-mark {
    width: 36px;
    height: 36px;
    background: var(--c-accent);
    color: #fff;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    align-items: baseline;
    line-height: 1;
}
.logo-text strong {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: .01em;
    color: #fff;
}
.logo-text strong em {
    font-style: normal;
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--c-accent) !important;
    background: rgba(255,255,255,.12);
    padding: 0 .18em;
    border-radius: 3px;
    letter-spacing: .02em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: var(--sp-lg);
}

.site-nav a {
    color: rgba(255,255,255,.8);
    font-size: .9rem;
    font-weight: 400;
    letter-spacing: .02em;
    transition: color .2s;
}
.site-nav a:hover { color: #fff; }
.site-nav .nav-logout { color: rgba(255,255,255,.5); }

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-sm);
    padding: .65rem 1.4rem;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 500;
    letter-spacing: .02em;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--c-accent);
    color: #fff;
    border-color: var(--c-accent);
}
.btn-primary:hover {
    background: #a34e2e;
    border-color: #a34e2e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(184,92,56,.3);
}

.btn-secondary {
    background: var(--c-surface);
    color: var(--c-primary);
    border-color: var(--c-border);
}
.btn-secondary:hover {
    border-color: var(--c-primary);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--c-primary);
    border-color: var(--c-primary);
}
.btn-ghost:hover {
    background: var(--c-primary);
    color: #fff;
}

.btn-sm {
    padding: .4rem .9rem;
    font-size: .82rem;
}

.btn-danger {
    background: var(--c-error);
    color: #fff;
    border-color: var(--c-error);
}
.btn-danger:hover { background: #9a2222; }

/* ── Main ────────────────────────────────────────────────────────────────── */
.site-main {
    flex: 1;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
    position: relative;
    overflow: hidden;
    background: var(--c-primary);
    padding: var(--sp-2xl) 0;
    min-height: 420px;
    display: flex;
    align-items: center;
}

/* Texture grain subtile */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(ellipse at 30% 50%, rgba(180,100,60,.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(255,255,255,.04) 0%, transparent 50%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 2;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--sp-xl);
}

.hero-eyebrow {
    font-size: .78rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--c-accent);
    font-weight: 500;
    margin-bottom: var(--sp-md);
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.15;
    margin-bottom: var(--sp-lg);
}

.hero-title em {
    font-weight: 500;
    color: rgba(255,255,255,.65);
    font-size: .78em;
    display: block;
    margin-top: .15em;
}

.hero-sub {
    font-size: 1.05rem;
    color: rgba(255,255,255,.7);
    line-height: 1.7;
    max-width: 560px;
    margin-bottom: var(--sp-xl);
    font-weight: 300;
}

.hero-actions {
    display: flex;
    gap: var(--sp-md);
    flex-wrap: wrap;
}

.hero-actions .btn-ghost {
    color: rgba(255,255,255,.8);
    border-color: rgba(255,255,255,.3);
}
.hero-actions .btn-ghost:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
    border-color: rgba(255,255,255,.6);
}

/* Mots décoratifs flottants */
.hero-deco {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
    pointer-events: none;
}

.deco-word {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: rgba(255,255,255,.07);
    white-space: nowrap;
    display: block;
}

.deco-word:nth-child(2) { margin-left: 1.5rem; }
.deco-word:nth-child(4) { margin-left: 2.5rem; }

/* ── Section features ────────────────────────────────────────────────────── */
.section-features {
    padding: var(--sp-2xl) 0;
    background: var(--c-bg);
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: var(--sp-xl);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--c-accent);
    margin-top: var(--sp-sm);
}

.section-title.small { font-size: 1.1rem; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--sp-lg);
}

.feature-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--sp-xl);
    transition: box-shadow .25s, transform .25s;
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.feature-icon {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--c-accent);
    margin-bottom: var(--sp-md);
    opacity: .8;
}

.feature-card h3 {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: var(--sp-sm);
}

.feature-card p {
    font-size: .9rem;
    color: var(--c-text-muted);
    line-height: 1.6;
}

/* ── Section status (dev) ────────────────────────────────────────────────── */
.section-status {
    padding: var(--sp-xl) 0 var(--sp-2xl);
    background: var(--c-bg);
    border-top: 1px solid var(--c-border);
}

.status-table {
    width: 100%;
    max-width: 600px;
    border-collapse: collapse;
    font-size: .875rem;
}

.status-table td {
    padding: .6rem .8rem;
    border-bottom: 1px solid var(--c-border);
    vertical-align: middle;
}

.status-table td:first-child {
    color: var(--c-text-muted);
    font-weight: 500;
    width: 160px;
}

.status-hint {
    font-size: .8rem;
    color: var(--c-text-muted);
    margin-top: .3rem;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .6rem;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: .03em;
}

.badge-ok      { background: #e6f4ed; color: var(--c-success); }
.badge-err     { background: #fce8e8; color: var(--c-error); }
.badge-warn    { background: #fef6e0; color: var(--c-warning); }
.badge-pending { background: #eef0f5; color: var(--c-pending); }

/* ── Formulaires ─────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: var(--sp-lg);
}

.form-label {
    display: block;
    font-size: .85rem;
    font-weight: 500;
    color: var(--c-text-muted);
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: var(--sp-xs);
}

.form-control {
    width: 100%;
    padding: .6rem .85rem;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    color: var(--c-text);
    transition: border-color .2s, box-shadow .2s;
    font-size: .95rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(30,58,95,.1);
}

.form-control[readonly],
.form-control[disabled] {
    background: #f0ede8;
    cursor: not-allowed;
    color: var(--c-text-muted);
}

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

.form-hint {
    font-size: .8rem;
    color: var(--c-text-muted);
    margin-top: .25rem;
}

.form-error {
    font-size: .8rem;
    color: var(--c-error);
    margin-top: .25rem;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--sp-xl);
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: var(--sp-md);
}

/* ── Onglets ─────────────────────────────────────────────────────────────── */
.tabs-bar {
    display: flex;
    border-bottom: 2px solid var(--c-border);
    gap: 0;
    overflow-x: auto;
    background: var(--c-surface);
}

.tab-btn {
    padding: .75rem 1.2rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--c-text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: color .2s, border-color .2s;
}

.tab-btn:hover { color: var(--c-primary); }

.tab-btn.active {
    color: var(--c-primary);
    border-bottom-color: var(--c-accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Alertes inline ──────────────────────────────────────────────────────── */
.alert {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--sp-sm) var(--sp-md);
    padding: var(--sp-md) var(--sp-lg);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    margin-bottom: var(--sp-md);
    border-left: 4px solid;
    line-height: 1.6;
}

.alert-error   { background: #fce8e8; border-color: var(--c-error);   color: #6b1010; }
.alert-warning { background: #fef6e0; border-color: var(--c-warning); color: #6b4a00; }
.alert-success { background: #e6f4ed; border-color: var(--c-success); color: #1a4d30; }
.alert-info    { background: #e8eff8; border-color: var(--c-primary); color: #142a45; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--c-primary);
    color: rgba(255,255,255,.4);
    text-align: center;
    padding: var(--sp-lg);
    font-size: .78rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-top: auto;
}

/* ── Page intérieure générique ────────────────────────────────────────────── */
.page-header {
    background: var(--c-primary);
    padding: var(--sp-xl) 0;
    color: #fff;
}

.page-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-lg);
}

.page-header h1 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
}

.page-body {
    padding: var(--sp-2xl) 0;
}

/* ── Progress bar ────────────────────────────────────────────────────────── */
.progress-bar-wrap {
    background: var(--c-border);
    border-radius: 99px;
    height: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--c-accent);
    border-radius: 99px;
    transition: width .4s ease;
}

/* ── Indicateur de sauvegarde ────────────────────────────────────────────── */
.save-indicator {
    font-size: .78rem;
    color: var(--c-text-muted);
    display: flex;
    align-items: center;
    gap: .35rem;
    transition: color .3s;
}

.save-indicator.saving { color: var(--c-warning); }
.save-indicator.saved  { color: var(--c-success); }
.save-indicator.error  { color: var(--c-error);   }

/* ── Pages Auth ──────────────────────────────────────────────────────────── */
.auth-page {
    min-height: calc(100vh - var(--header-h) - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-xl);
    background: var(--c-bg);
}

.auth-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: var(--sp-2xl);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--sp-xl);
}

.auth-logo-mark {
    width: 52px;
    height: 52px;
    background: var(--c-primary);
    color: #fff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.4rem;
    margin: 0 auto var(--sp-md);
}

.auth-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: var(--sp-sm);
}

.auth-subtitle {
    font-size: .92rem;
    color: var(--c-text-muted);
    line-height: 1.6;
}

.auth-subtitle strong {
    color: var(--c-text);
}

.auth-form {
    margin-bottom: var(--sp-lg);
}

.form-control-lg {
    padding: .75rem 1rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-arrow {
    margin-left: auto;
    transition: transform .2s;
}
.btn:hover .btn-arrow { transform: translateX(3px); }

.auth-legal {
    text-align: center;
    font-size: .78rem;
    color: var(--c-text-muted);
    line-height: 1.6;
    margin-top: var(--sp-lg);
    padding-top: var(--sp-lg);
    border-top: 1px solid var(--c-border);
}

.auth-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-sm);
    margin-top: var(--sp-lg);
    font-size: .85rem;
}

.auth-link {
    color: var(--c-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity .2s;
}
.auth-link:hover { opacity: .7; }
.auth-link-muted { color: var(--c-text-muted); }
.auth-sep { color: var(--c-border); }

/* ── Inputs code 6 chiffres ──────────────────────────────────────────────── */
.code-inputs {
    display: flex;
    gap: .6rem;
    justify-content: center;
    margin-top: var(--sp-md);
}

.code-digit {
    width: 46px;
    height: 56px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font-serif);
    color: var(--c-primary);
    border: 2px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: var(--c-bg);
    transition: border-color .2s, box-shadow .2s;
    caret-color: var(--c-accent);
}

.code-digit:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(184,92,56,.15);
    background: #fff;
}

.code-digit:not(:placeholder-shown) {
    border-color: var(--c-primary);
    background: #fff;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    :root { --sp-xl: 1.5rem; --sp-2xl: 2.5rem; }

    .hero-deco { display: none; }

    .header-inner { padding: 0 var(--sp-lg); }

    .logo-text em { display: none; }

    .features-grid { grid-template-columns: 1fr; }

    .page-header .container { flex-direction: column; align-items: flex-start; }
}

/* ── Classes ─────────────────────────────────────────────────────────────── */
.page-header-sub {
    font-size: .85rem;
    color: rgba(255,255,255,.6);
    margin-top: .2rem;
}

/* Badges niveau */
.level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
    margin-right: .4rem;
}

.level-5e { background: #e8f0fb; color: #1a4fa0; }
.level-4e { background: #e8f6ee; color: #1a6640; }
.level-3e { background: #fef0e0; color: #8a4800; }

/* Dot coloré dans les cartes */
.classe-level-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: .5rem;
    flex-shrink: 0;
}
.level-dot-5e { background: #3b7dd8; }
.level-dot-4e { background: #2e8c5a; }
.level-dot-3e { background: #d4820a; }

/* Groupe par niveau */
.classes-group {
    margin-bottom: var(--sp-xl);
}

.classes-group-title {
    display: flex;
    align-items: center;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: var(--sp-md);
    padding-bottom: var(--sp-sm);
    border-bottom: 1px solid var(--c-border);
}

.classes-count {
    margin-left: auto;
    font-family: var(--font-sans);
    font-size: .78rem;
    font-weight: 400;
    color: var(--c-text-muted);
    background: var(--c-bg);
    padding: .15rem .6rem;
    border-radius: 99px;
    border: 1px solid var(--c-border);
}

/* Grille cartes */
.classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--sp-md);
}

.classe-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}

.classe-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.classe-card-body {
    padding: var(--sp-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.classe-name {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: .3rem;
    display: flex;
    align-items: center;
}

.classe-meta {
    font-size: .8rem;
    color: var(--c-text-muted);
    margin-top: auto;
    padding-top: var(--sp-sm);
}

.classe-card-actions {
    display: flex;
    gap: var(--sp-sm);
    padding: var(--sp-sm) var(--sp-lg) var(--sp-md);
    border-top: 1px solid var(--c-border);
    background: #fafaf8;
    flex-wrap: wrap;
}

/* État vide */
.empty-state {
    text-align: center;
    padding: var(--sp-2xl) var(--sp-xl);
    background: var(--c-surface);
    border: 2px dashed var(--c-border);
    border-radius: var(--radius-lg);
    max-width: 480px;
    margin: 0 auto;
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: var(--sp-md);
}

.empty-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--c-primary);
    margin-bottom: var(--sp-sm);
}

.empty-sub {
    font-size: .9rem;
    color: var(--c-text-muted);
    margin-bottom: var(--sp-lg);
    line-height: 1.6;
}

/* Formulaire classe */
.form-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--sp-2xl);
    max-width: 560px;
    box-shadow: var(--shadow-sm);
}

.form-control-error {
    border-color: var(--c-error);
}
.form-control-error:focus {
    box-shadow: 0 0 0 3px rgba(184,50,50,.12);
}

/* Radio niveau */
.level-radio-group {
    display: flex;
    gap: var(--sp-md);
    flex-wrap: wrap;
    margin-top: var(--sp-sm);
}

.level-radio {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1rem;
    border: 2px solid var(--c-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color .2s, background .2s;
}

.level-radio input[type=radio] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.level-radio:hover {
    border-color: var(--c-primary);
}

.level-radio.checked {
    border-color: var(--c-primary);
    background: #eef2f8;
}

.level-radio-badge {
    font-size: .8rem;
    font-weight: 700;
    padding: .15rem .45rem;
    border-radius: 4px;
}

.level-radio-label {
    font-size: .9rem;
    font-weight: 500;
    color: var(--c-text);
}

/* Actions formulaire */
.form-actions {
    display: flex;
    gap: var(--sp-md);
    margin-top: var(--sp-xl);
    padding-top: var(--sp-lg);
    border-top: 1px solid var(--c-border);
}

/* ── Séquences — liste ───────────────────────────────────────────────────── */
.page-breadcrumb {
    font-size: .82rem;
    color: rgba(255,255,255,.55);
    margin-bottom: .4rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}
.page-breadcrumb a {
    color: rgba(255,255,255,.7);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.page-breadcrumb a:hover { color: #fff; }

/* Badges genre */
.genre-badge {
    display: inline-flex;
    align-items: center;
    padding: .18rem .55rem;
    border-radius: 20px;
    font-size: .73rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.genre-recit         { background: #e8f0fb; color: #1a4fa0; }
.genre-poesie        { background: #f3e8fb; color: #6a1a9a; }
.genre-theatre       { background: #fef0e0; color: #8a4800; }
.genre-argumentation { background: #e8f6ee; color: #1a6640; }

/* Liste séquences */
.seq-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
    margin-bottom: var(--sp-lg);
}

.seq-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.seq-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Barre de progression en haut de la carte */
.seq-progress-bar {
    height: 4px;
    background: var(--c-border);
}
.seq-progress-fill {
    height: 100%;
    background: var(--c-accent);
    border-radius: 0;
    transition: width .4s ease;
}

.seq-card-inner {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: var(--sp-lg);
    padding: var(--sp-lg) var(--sp-xl);
}

.seq-card-main { min-width: 0; }

.seq-card-meta {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    margin-bottom: .4rem;
    flex-wrap: wrap;
}

.seq-date {
    font-size: .75rem;
    color: var(--c-text-muted);
}

.seq-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--c-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: .2rem;
}
.seq-title-empty {
    font-style: italic;
    color: var(--c-text-muted);
    font-weight: 400;
}

.seq-entry {
    font-size: .82rem;
    color: var(--c-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cercle de progression */
.seq-card-progress { flex-shrink: 0; }

.progress-circle {
    position: relative;
    width: 52px;
    height: 52px;
}

.progress-svg {
    width: 52px;
    height: 52px;
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: var(--c-border);
    stroke-width: 3;
}

.progress-fg {
    fill: none;
    stroke: var(--c-accent);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray .4s ease;
}

.progress-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    color: var(--c-primary);
}

/* Actions carte */
.seq-card-actions {
    display: flex;
    gap: var(--sp-sm);
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.seq-list-count {
    font-size: .8rem;
    color: var(--c-text-muted);
    text-align: right;
    margin-top: var(--sp-sm);
}

/* Responsive séquences */
@media (max-width: 640px) {
    .seq-card-inner {
        grid-template-columns: 1fr;
        gap: var(--sp-md);
    }
    .seq-card-progress { display: none; }
    .seq-card-actions { justify-content: flex-start; }
}

/* ── Éditeur séquence ────────────────────────────────────────────────────── */
.editor-header {
    background: var(--c-primary);
    border-bottom: 3px solid var(--c-accent);
}

.editor-header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: var(--sp-md) var(--sp-xl);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-lg);
}

.editor-header-left { flex: 1; min-width: 0; }

.editor-title-row {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    flex-wrap: wrap;
    margin-top: .3rem;
}

.editor-seq-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}
.editor-seq-title em { color: rgba(255,255,255,.5); font-style: italic; }

.editor-header-right {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    flex-shrink: 0;
    padding-top: .25rem;
}

.editor-progress {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
}
.editor-progress-label {
    font-size: .75rem;
    color: rgba(255,255,255,.6);
    white-space: nowrap;
}

.editor-flash {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: .5rem var(--sp-xl);
    font-size: .85rem;
    font-weight: 500;
    color: var(--c-success);
    background: rgba(46,125,86,.15);
    border-top: 1px solid rgba(46,125,86,.2);
}

/* Barre d'onglets éditeur */
.editor-tabs-bar {
    display: flex;
    overflow-x: auto;
    background: var(--c-primary);
    border-bottom: 2px solid rgba(255,255,255,.1);
    scrollbar-width: none;
    max-width: 100%;
    position: sticky;
    top: var(--header-h);
    z-index: 90;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.editor-tabs-bar::-webkit-scrollbar { display: none; }

.editor-tabs-bar .tab-btn {
    color: rgba(255,255,255,.55);
    border-bottom-color: transparent;
    font-size: .82rem;
    padding: .65rem 1rem;
    white-space: nowrap;
    text-decoration: none;
    display: block;
}
.editor-tabs-bar .tab-btn:hover { color: rgba(255,255,255,.85); }
.editor-tabs-bar .tab-btn.active {
    color: #fff;
    border-bottom-color: var(--c-accent);
}

/* Corps de l'éditeur */
.editor-body {
    background: var(--c-bg);
    min-height: calc(100vh - var(--header-h) - 110px);
    padding: var(--sp-xl) 0 var(--sp-2xl);
}

.editor-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--sp-xl);
}

/* Sections d'onglets */
.tab-section {
    margin-bottom: var(--sp-xl);
    padding-bottom: var(--sp-lg);
    border-bottom: 1px solid var(--c-border);
}
.tab-section-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: .4rem;
}
.tab-section-desc {
    font-size: .9rem;
    color: var(--c-text-muted);
    line-height: 1.6;
    max-width: 600px;
}

/* Champ readonly */
.readonly-field {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .85rem;
    background: #f0ede8;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    color: var(--c-text-muted);
    flex-wrap: wrap;
}
.readonly-hint { font-size: .78rem; opacity: .7; }
.perspective-field {
    font-style: italic;
    color: var(--c-primary);
    background: #eef2f8;
    border-color: #c5d4e8;
}

/* Compétences */
.comp-domain-group {
    margin-bottom: var(--sp-md);
    padding: var(--sp-md);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
}
.comp-domain-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--c-accent);
    margin-bottom: var(--sp-sm);
}
.comp-checkbox {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    font-size: .875rem;
    color: var(--c-text);
    cursor: pointer;
    padding: .25rem 0;
    line-height: 1.4;
}
.comp-checkbox input[type=checkbox] {
    margin-top: .15rem;
    flex-shrink: 0;
    accent-color: var(--c-accent);
    width: 15px;
    height: 15px;
}

/* Listes dynamiques */
.dynamic-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .75rem; }
.dynamic-item { display: flex; gap: .5rem; align-items: center; }
.dynamic-item .form-control { flex: 1; }
.btn-remove-item {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    color: var(--c-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}
.btn-remove-item:hover { background: #fce8e8; border-color: var(--c-error); color: var(--c-error); }

/* Séances */
.seance-block {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--sp-md);
    overflow: hidden;
}
.seance-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .65rem var(--sp-lg);
    background: #f5f3ef;
    border-bottom: 1px solid var(--c-border);
}
.seance-num {
    font-weight: 700;
    font-size: .875rem;
    color: var(--c-primary);
}
.seance-header-actions { display: flex; align-items: center; gap: .5rem; }
.seance-block-body { padding: var(--sp-lg); }
.seance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 var(--sp-lg);
}
.seance-col-full { grid-column: 1 / -1; }
.seance-tf-check { grid-column: 1 / -1; }

/* Validation preview */
.validation-preview {
    display: grid;
    gap: var(--sp-lg);
}
.validation-section {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--sp-lg);
}
.validation-section-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: var(--sp-md);
}
.validation-list { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.val-item {
    font-size: .875rem;
    padding: .35rem .6rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.val-item::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.val-ok      { background: #e6f4ed; color: #1a4d30; }
.val-ok::before { background: var(--c-success); }
.val-missing { background: #fce8e8; color: #6b1010; }
.val-missing::before { background: var(--c-error); }
.val-pending { background: #eef0f5; color: var(--c-pending); }
.val-pending::before { background: var(--c-pending); }

/* Responsive éditeur */
@media (max-width: 640px) {
    .seance-grid { grid-template-columns: 1fr; }
    .seance-col-full { grid-column: auto; }
    .editor-header-right { display: none; }
}

/* ── Compétences enrichies ───────────────────────────────────────────────── */
.form-label-hint {
    font-size: .75rem;
    font-weight: 400;
    color: var(--c-text-muted);
    text-transform: none;
    letter-spacing: 0;
    margin-left: .25rem;
}

.level-radio-expected {
    border-color: var(--c-success) !important;
    background: #e6f4ed !important;
}

.comp-domain-block {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--sp-md);
    overflow: hidden;
    transition: border-color .2s;
}

.comp-domain-expected {
    border-color: rgba(46,125,86,.3);
    border-left: 3px solid var(--c-success);
}

.comp-domain-header {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    padding: .75rem var(--sp-lg);
    background: #fafaf8;
    border-bottom: 1px solid var(--c-border);
    flex-wrap: wrap;
}

.comp-domain-icon { font-size: 1.1rem; flex-shrink: 0; }

.comp-domain-title {
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    display: block;
}

.comp-color-lecture   { color: #1a4fa0; }
.comp-color-ecriture  { color: #6a1a9a; }
.comp-color-oral      { color: #8a4800; }
.comp-color-langue    { color: #1a6640; }

.comp-domain-desc {
    font-size: .75rem;
    color: var(--c-text-muted);
    display: block;
    margin-top: .1rem;
}

.comp-items-grid {
    padding: var(--sp-sm) var(--sp-lg);
}

.comp-item-row {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-sm);
    padding: .45rem 0;
    border-bottom: 1px solid #f5f3ef;
}
.comp-item-row:last-child { border-bottom: none; }

.comp-item-checks {
    display: flex;
    gap: .3rem;
    flex-shrink: 0;
    padding-top: .1rem;
}

.comp-check-label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.comp-check-label input[type=checkbox] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.comp-check-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: 0;
    border: 1.5px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-text-muted);
    transition: all .15s;
    cursor: pointer;
    user-select: none;
}

.comp-check-label input:checked + .comp-maj {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: #fff;
}
.comp-check-label input:checked + .comp-min {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
}

.comp-maj:hover, .comp-min:hover {
    border-color: var(--c-primary);
}

.comp-item-text {
    font-size: .875rem;
    color: var(--c-text);
    line-height: 1.45;
    flex: 1;
}

.comp-legend {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    padding: var(--sp-md) var(--sp-lg);
    background: #f5f3ef;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size: .8rem;
    color: var(--c-text-muted);
    margin-bottom: var(--sp-lg);
}

/* ── Compétences — deux colonnes ─────────────────────────────────────────── */
.comp-two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-lg);
    align-items: start;
}

.comp-col {
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--c-surface);
}

.comp-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem var(--sp-lg);
    border-bottom: 1px solid var(--c-border);
}

.comp-col-maj-header { background: #f0e6df; border-bottom-color: #e0cdc4; }
.comp-col-min-header { background: #e8eff8; border-bottom-color: #ccd9ec; }

.comp-col-title {
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.comp-col-maj-header .comp-col-title { color: #7a3520; }
.comp-col-min-header .comp-col-title { color: #1a3a6b; }

.comp-col-counter {
    font-size: .78rem;
    font-weight: 700;
    padding: .2rem .55rem;
    border-radius: 99px;
    background: rgba(255,255,255,.6);
    color: var(--c-text-muted);
    transition: background .2s, color .2s;
    border: 1px solid rgba(0,0,0,.08);
}

.counter-full {
    background: var(--c-accent) !important;
    color: #fff !important;
}

.comp-col-desc {
    font-size: .78rem;
    color: var(--c-text-muted);
    padding: .5rem var(--sp-lg);
    border-bottom: 1px solid var(--c-border);
    background: #fafaf8;
    font-style: italic;
}

.comp-pick-area {
    max-height: 420px;
    overflow-y: auto;
    padding: var(--sp-sm) 0;
}

.comp-pick-group {
    margin-bottom: var(--sp-xs);
}

.comp-pick-group-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--c-text-muted);
    padding: .45rem var(--sp-lg) .2rem;
    opacity: .7;
}

.comp-pick-item {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .4rem var(--sp-lg);
    cursor: pointer;
    transition: background .15s;
    border-left: 3px solid transparent;
}

.comp-pick-item:hover:not(.disabled) {
    background: #f5f3ef;
}

.comp-pick-item.selected {
    background: #fdf3ef;
    border-left-color: var(--c-accent);
}

.comp-col:last-child .comp-pick-item.selected {
    background: #eef2f8;
    border-left-color: var(--c-primary);
}

.comp-pick-item.disabled {
    opacity: .38;
    cursor: not-allowed;
}

.comp-pick-item input[type=checkbox] {
    margin-top: .2rem;
    flex-shrink: 0;
    accent-color: var(--c-accent);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.comp-pick-item span {
    font-size: .84rem;
    line-height: 1.4;
    color: var(--c-text);
}

/* Responsive compétences */
@media (max-width: 700px) {
    .comp-two-cols { grid-template-columns: 1fr; }
}

/* Item exclu (même compétence déjà dans l'autre colonne) */
.comp-pick-item.excluded {
    opacity: .3;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* ── Autosave indicateur ─────────────────────────────────────────────────── */
.save-indicator-wrap {
    background: var(--c-primary);
    display: flex;
    align-items: center;
    padding: 0 var(--sp-lg);
    border-left: 1px solid rgba(255,255,255,.1);
    margin-left: auto;
}

.save-indicator {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .75rem;
    white-space: nowrap;
    transition: color .3s;
}

.save-dot {
    font-size: .85rem;
    line-height: 1;
    transition: all .3s;
}

.save-text {
    letter-spacing: .02em;
}

/* États */
.save-pending .save-dot  { color: rgba(255,255,255,.4); }
.save-pending .save-text { color: rgba(255,255,255,.4); }

.save-saving .save-dot  { color: var(--c-warning); animation: spin .8s linear infinite; }
.save-saving .save-text { color: rgba(255,255,255,.6); }

.save-saved .save-dot  { color: var(--c-success); }
.save-saved .save-text { color: rgba(255,255,255,.55); }

.save-error .save-dot  { color: var(--c-error); }
.save-error .save-text { color: var(--c-error); }

@keyframes spin {
    from { display: inline-block; transform: rotate(0deg); }
    to   { display: inline-block; transform: rotate(360deg); }
}

/* Responsive : masquer le texte sur petit écran */
@media (max-width: 768px) {
    .save-indicator-wrap { padding: 0 var(--sp-sm); }
    .save-text { display: none; }
}

/* ── Validation — moteur didactique ─────────────────────────────────────── */
.val-score-block {
    display: flex;
    align-items: center;
    gap: var(--sp-xl);
    padding: var(--sp-xl);
    border-radius: var(--radius-md);
    margin-bottom: var(--sp-xl);
    border: 2px solid;
}

.val-score-ok  { background: #e6f4ed; border-color: var(--c-success); }
.val-score-nok { background: #fce8e8; border-color: var(--c-error); }

.val-score-circle {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.val-score-circle .progress-svg  { width: 72px; height: 72px; }
.val-score-circle .progress-label { font-size: .95rem; font-weight: 700; }
.val-score-circle .progress-fg-ok { stroke: var(--c-success); }

.val-score-title {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: .3rem;
}

.val-score-text p {
    font-size: .88rem;
    color: var(--c-text-muted);
    line-height: 1.5;
}

.val-section {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--sp-lg);
    margin-bottom: var(--sp-md);
}

.val-section-title {
    font-family: var(--font-serif);
    font-size: .95rem;
    font-weight: 700;
    margin-bottom: var(--sp-md);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.val-title-error   { color: var(--c-error); }
.val-title-warning { color: var(--c-warning); }
.val-title-advice  { color: var(--c-primary); }

.val-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.val-item {
    font-size: .85rem;
    padding: .5rem .75rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    line-height: 1.5;
}

.val-code {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: .1rem .4rem;
    border-radius: 3px;
    flex-shrink: 0;
    margin-top: .1rem;
}

.val-missing      { background: #fce8e8; color: #6b1010; }
.val-missing .val-code { background: var(--c-error); color: #fff; }

.val-warning-item { background: #fef6e0; color: #6b4a00; }
.val-warning-item .val-code { background: var(--c-warning); color: #fff; }

.val-advice-item  { background: #e8eff8; color: #142a45; }
.val-advice-item .val-code  { background: var(--c-primary); color: #fff; }

/* Récapitulatif */
.val-recap-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .4rem;
}

.val-recap-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    color: var(--c-text);
}

.val-recap-item a {
    color: var(--c-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.val-recap-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-ok      { background: var(--c-success); }
.dot-missing { background: var(--c-error); }

/* Lien récapitulatif validation — toute la ligne cliquable, sans soulignement */
.val-recap-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--c-accent);
    text-decoration: none;
    font-weight: 500;
    padding: .15rem .4rem;
    border-radius: var(--radius-sm);
    transition: background .15s;
}
.val-recap-link:hover {
    background: var(--c-accent-lt);
}

/* Val items cliquables */
.val-item-link { padding: 0; }

.val-item-anchor {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    width: 100%;
    padding: .5rem .75rem;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-sm);
    transition: filter .15s;
    line-height: 1.5;
}
.val-item-anchor:hover { filter: brightness(.93); }

.val-goto {
    margin-left: auto;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: .7;
    flex-shrink: 0;
    padding-top: .1rem;
}

/* ── Boutons export ──────────────────────────────────────────────────────── */
.export-btns {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.export-btns .btn-ghost {
    color: rgba(255,255,255,.7);
    border-color: rgba(255,255,255,.3);
    font-size: .78rem;
    padding: .35rem .7rem;
}
.export-btns .btn-ghost:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
    border-color: rgba(255,255,255,.5);
}
.export-btns .btn-secondary {
    font-size: .78rem;
    padding: .35rem .7rem;
}

/* ── Progression annuelle ────────────────────────────────────────────────── */
.prog-perspective {
    background: #eef2f8;
    border-left: 4px solid var(--c-primary);
    border-radius: var(--radius-sm);
    padding: var(--sp-md) var(--sp-lg);
    margin-bottom: var(--sp-xl);
    display: flex;
    gap: var(--sp-md);
    align-items: baseline;
    flex-wrap: wrap;
}
.prog-perspective-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--c-primary);
    flex-shrink: 0;
}
.prog-perspective-text {
    font-size: .92rem;
    color: var(--c-text);
    font-style: italic;
}

/* Stats globales */
.prog-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-md);
    margin-bottom: var(--sp-xl);
}
.prog-stat-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--sp-lg);
    text-align: center;
}
.prog-stat-value {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--c-primary);
    line-height: 1;
    margin-bottom: .3rem;
}
.prog-stat-label {
    font-size: .78rem;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* Section progression */
.prog-section {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--sp-xl);
    margin-bottom: var(--sp-lg);
}
.prog-section-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: var(--sp-lg);
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
}

/* Bar chart domaines */
.prog-bar-chart { display: flex; flex-direction: column; gap: .6rem; }
.prog-bar-row   { display: flex; align-items: center; gap: var(--sp-md); }
.prog-bar-label {
    width: 80px;
    font-size: .82rem;
    color: var(--c-text-muted);
    text-align: right;
    flex-shrink: 0;
}
.prog-bar-track {
    flex: 1;
    height: 14px;
    background: var(--c-border);
    border-radius: 99px;
    overflow: hidden;
}
.prog-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width .6s ease;
    min-width: 2px;
}
.prog-bar-count {
    font-size: .78rem;
    color: var(--c-text-muted);
    width: 140px;
    flex-shrink: 0;
}

/* Liste séquences progression */
.prog-seq-list { display: flex; flex-direction: column; gap: .75rem; }

.prog-seq-row {
    display: grid;
    grid-template-columns: 36px 1fr auto auto;
    align-items: center;
    gap: var(--sp-lg);
    padding: var(--sp-md) var(--sp-lg);
    background: #fafaf8;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    transition: box-shadow .2s;
}
.prog-seq-row:hover { box-shadow: var(--shadow-sm); }

.prog-seq-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}

.prog-seq-title-row {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    flex-wrap: wrap;
    margin-bottom: .2rem;
}
.prog-seq-name { font-size: .95rem; color: var(--c-primary); }
.prog-seq-entry {
    font-size: .78rem;
    color: var(--c-text-muted);
    margin-bottom: .15rem;
}
.prog-seq-pb {
    font-size: .8rem;
    color: var(--c-text-muted);
    font-style: italic;
    line-height: 1.4;
}

.prog-seq-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    flex-shrink: 0;
}
.prog-bar-fill-sm {
    height: 6px;
    border-radius: 99px;
    min-width: 2px;
    transition: width .4s ease;
}
.prog-seq-seances {
    font-size: .72rem;
    color: var(--c-text-muted);
    white-space: nowrap;
}

.prog-seq-actions {
    display: flex;
    gap: var(--sp-sm);
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .prog-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .prog-seq-row    { grid-template-columns: 28px 1fr; }
    .prog-seq-meta, .prog-seq-actions { display: none; }
}

/* ── Chatbot IA flottant ─────────────────────────────────────────────────── */
#aiChatPanel {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .75rem;
}

/* Bouton toggle */
.ai-toggle {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--c-primary);
    color: #fff;
    border: none;
    padding: .6rem 1rem;
    border-radius: 99px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    transition: all .2s;
    white-space: nowrap;
}
.ai-toggle:hover,
.ai-toggle.open { background: var(--c-accent); }

.ai-toggle-label { font-size: .82rem; }

/* Panneau */
.ai-panel {
    display: flex;
    flex-direction: column;
    width: 380px;
    max-width: calc(100vw - 2rem);
    height: 520px;
    max-height: calc(100vh - 6rem);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(0,0,0,.18);
    overflow: hidden;
}

.ai-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    background: var(--c-primary);
    color: #fff;
    gap: .5rem;
    flex-shrink: 0;
}

.ai-panel-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.ai-panel-icon { font-size: 1.2rem; flex-shrink: 0; }

.ai-panel-title strong {
    display: block;
    font-size: .9rem;
    white-space: nowrap;
}

.ai-panel-sub {
    display: block;
    font-size: .72rem;
    opacity: .65;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.ai-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 .25rem;
    line-height: 1;
    flex-shrink: 0;
}
.ai-close:hover { color: #fff; }

/* Messages */
.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    scroll-behavior: smooth;
}

.ai-msg { display: flex; }

.ai-msg-user     { justify-content: flex-end; }
.ai-msg-assistant{ justify-content: flex-start; }
.ai-msg-error    { justify-content: flex-start; }

.ai-msg-content {
    max-width: 85%;
    padding: .55rem .85rem;
    border-radius: 12px;
    font-size: .875rem;
    line-height: 1.55;
}

.ai-msg-user .ai-msg-content {
    background: var(--c-primary);
    color: #fff;
    border-radius: 12px 12px 2px 12px;
}

.ai-msg-assistant .ai-msg-content {
    background: #f0ede8;
    color: var(--c-text);
    border-radius: 12px 12px 12px 2px;
}

.ai-msg-assistant .ai-msg-content code {
    background: rgba(0,0,0,.08);
    padding: .1em .3em;
    border-radius: 3px;
    font-size: .85em;
    font-family: monospace;
}

.ai-msg-error .ai-msg-content {
    background: #fce8e8;
    color: var(--c-error);
    border-radius: 12px 12px 12px 2px;
    font-size: .82rem;
}

/* Points de chargement */
.ai-dots { display: inline-flex; gap: 4px; align-items: center; }
.ai-dots span {
    width: 6px; height: 6px;
    background: var(--c-text-muted);
    border-radius: 50%;
    animation: aiDot 1.2s infinite;
}
.ai-dots span:nth-child(2) { animation-delay: .2s; }
.ai-dots span:nth-child(3) { animation-delay: .4s; }

@keyframes aiDot {
    0%, 80%, 100% { transform: scale(.8); opacity: .4; }
    40%            { transform: scale(1);  opacity: 1;   }
}

/* Zone de saisie */
.ai-input-area {
    display: flex;
    gap: .5rem;
    padding: .75rem;
    border-top: 1px solid var(--c-border);
    background: var(--c-surface);
    flex-shrink: 0;
}

.ai-input {
    flex: 1;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: .5rem .75rem;
    font-size: .875rem;
    resize: none;
    font-family: var(--font-sans);
    line-height: 1.4;
    transition: border-color .2s;
    min-height: 40px;
    max-height: 120px;
}
.ai-input:focus {
    outline: none;
    border-color: var(--c-primary);
}

.ai-send {
    width: 38px;
    height: 38px;
    background: var(--c-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s;
    align-self: flex-end;
}
.ai-send:hover    { background: var(--c-accent); }
.ai-send:disabled { opacity: .5; cursor: not-allowed; }

/* Footer */
.ai-footer {
    display: flex;
    justify-content: space-between;
    padding: .35rem .75rem;
    border-top: 1px solid var(--c-border);
    background: #fafaf8;
    font-size: .72rem;
    color: var(--c-text-muted);
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .ai-toggle-label { display: none; }
    .ai-panel { width: calc(100vw - 2rem); height: 70vh; }
}

/* ── Home SequencIA ──────────────────────────────────────────────────────── */
.hero-title { font-size: 3.5rem; white-space: nowrap; }
.hero-title em { color: var(--c-accent); font-style: normal; }

.hero-credit {
    margin-top: 1.5rem;
    font-size: .82rem;
    color: rgba(255,255,255,.5);
}
.hero-credit a { color: rgba(255,255,255,.6); text-decoration: underline; }

/* Intro bloc */
.section-intro {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    padding: var(--sp-2xl) 0;
}
.intro-block {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: var(--sp-2xl);
    align-items: start;
}
.intro-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: var(--sp-lg);
}
.intro-text p {
    font-size: .95rem;
    line-height: 1.7;
    color: var(--c-text);
    margin-bottom: var(--sp-md);
}
.intro-aside {
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
}
.intro-stat {
    background: #eef2f8;
    border: 1px solid #c5d4e8;
    border-radius: var(--radius-md);
    padding: var(--sp-lg);
    text-align: center;
}
.intro-stat-num {
    display: block;
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--c-primary);
    line-height: 1;
    margin-bottom: .3rem;
}
.intro-stat-label {
    font-size: .75rem;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    line-height: 1.4;
}

@media (max-width: 700px) {
    .intro-block { grid-template-columns: 1fr; }
    .intro-aside { flex-direction: row; flex-wrap: wrap; }
    .intro-stat  { flex: 1; min-width: 100px; }
    .hero-title  { font-size: 2.5rem; }
}

/* ── Chatbox agrandissable ─────────────────────────────────────────────── */
.ai-panel {
    resize: both;
    overflow: hidden;
    min-width: 320px;
    min-height: 400px;
    max-width: 700px;
    max-height: calc(100vh - 4rem);
}

/* Bouton agrandir/réduire */
.ai-panel-header .ai-close,
.ai-panel-header .ai-resize-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,.6);
    font-size: 1rem;
    cursor: pointer;
    padding: .1rem .3rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color .15s;
}
.ai-panel-header .ai-close:hover,
.ai-panel-header .ai-resize-btn:hover { color: #fff; }

/* Groupe boutons header toujours collés à droite */
.ai-header-actions {
    display: flex;
    align-items: center;
    gap: .1rem;
    flex-shrink: 0;
    margin-left: auto;
}

/* ── Section accroche IA ─────────────────────────────────────────────────── */
.section-ia-pitch {
    background: linear-gradient(135deg, #1e3a5f 0%, #2a4f80 100%);
    padding: var(--sp-2xl) 0;
    color: #fff;
}

.ia-pitch-block {
    max-width: 780px;
    margin: 0 auto;
    text-align: center;
}

.ia-pitch-badge {
    display: inline-block;
    background: var(--c-accent);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: .25rem .75rem;
    border-radius: 99px;
    margin-bottom: 1rem;
}

.ia-pitch-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 1.25rem;
}

.ia-pitch-text {
    font-size: .95rem;
    line-height: 1.75;
    color: rgba(255,255,255,.8);
    margin-bottom: 1.75rem;
    max-width: 660px;
    margin-left: auto;
    margin-right: auto;
}

.ia-pitch-points {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .75rem 1.5rem;
}

.ia-point {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    color: rgba(255,255,255,.85);
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    padding: .4rem .9rem;
    border-radius: 99px;
}

.ia-point-icon { font-size: 1rem; }

/* Feature card highlight */
.feature-card-highlight {
    border-color: var(--c-accent);
    background: #fdf6f3;
    position: relative;
}
.feature-card-highlight::before {
    content: 'IA';
    position: absolute;
    top: -10px;
    right: 1rem;
    background: var(--c-accent);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    padding: .15rem .5rem;
    border-radius: 99px;
}

/* ── Page d'aide ─────────────────────────────────────────────────────────── */
.help-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--sp-2xl);
    max-width: var(--max-w);
    margin: 0 auto;
    padding: var(--sp-2xl) var(--sp-xl);
    align-items: start;
}

/* Nav latérale sticky */
.help-nav {
    position: sticky;
    top: 80px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--sp-lg);
    font-size: .85rem;
}
.help-nav-title {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--c-text-muted);
    margin-bottom: var(--sp-md);
}
.help-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.help-nav ul ul {
    margin-left: .75rem;
    margin-top: .2rem;
}
.help-nav li { margin-bottom: .3rem; }
.help-nav a {
    color: var(--c-text-muted);
    text-decoration: none;
    transition: color .15s;
    display: block;
    padding: .1rem 0;
}
.help-nav a:hover { color: var(--c-accent); }

/* Sections */
.help-section {
    margin-bottom: var(--sp-2xl);
    padding-bottom: var(--sp-2xl);
    border-bottom: 1px solid var(--c-border);
}
.help-section:last-child { border-bottom: none; }

.help-section h2 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: var(--sp-lg);
    padding-bottom: var(--sp-sm);
    border-bottom: 2px solid var(--c-accent);
    display: inline-block;
}

.help-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--c-primary);
    margin: var(--sp-lg) 0 var(--sp-sm);
}

.help-section p {
    font-size: .92rem;
    line-height: 1.7;
    color: var(--c-text);
    margin-bottom: var(--sp-md);
}

/* Deux piliers */
.help-pillars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-lg);
    margin: var(--sp-lg) 0;
}
.help-pillar {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--sp-lg);
}
.help-pillar-icon {
    font-size: 1.5rem;
    margin-bottom: var(--sp-sm);
}
.help-pillar h3 {
    margin: 0 0 var(--sp-sm);
    font-size: .95rem;
}
.help-pillar p {
    font-size: .85rem;
    color: var(--c-text-muted);
    margin: 0;
}

/* Étapes */
.help-steps {
    padding-left: 1.5rem;
    margin: var(--sp-lg) 0;
}
.help-steps li {
    font-size: .92rem;
    line-height: 1.65;
    margin-bottom: var(--sp-md);
    color: var(--c-text);
}

/* Liste */
.help-list {
    padding-left: 1.25rem;
    margin: var(--sp-md) 0;
}
.help-list li {
    font-size: .9rem;
    line-height: 1.65;
    margin-bottom: .4rem;
    color: var(--c-text);
}

/* Callouts */
.help-callout {
    padding: var(--sp-md) var(--sp-lg);
    border-radius: var(--radius-sm);
    border-left: 4px solid;
    font-size: .875rem;
    line-height: 1.6;
    margin: var(--sp-md) 0;
}
.help-callout-info {
    background: #e8eff8;
    border-color: var(--c-primary);
    color: #142a45;
}
.help-callout-tip {
    background: #e6f4ed;
    border-color: var(--c-success);
    color: #1a4d30;
}

/* Entrées d'onglets */
.help-tab-entry {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--sp-lg);
    margin-bottom: var(--sp-md);
    scroll-margin-top: 90px;
}
.help-tab-header {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    margin-bottom: var(--sp-md);
}
.help-tab-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}
.help-tab-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--c-primary);
}
.help-tab-entry p { margin-bottom: var(--sp-sm); }
.help-tab-entry code {
    background: #f0ede8;
    padding: .1em .4em;
    border-radius: 3px;
    font-size: .85em;
    font-family: monospace;
}

/* Ancres avec scroll-margin */
.help-section { scroll-margin-top: 80px; }

/* Responsive */
@media (max-width: 768px) {
    .help-layout { grid-template-columns: 1fr; }
    .help-nav { position: static; }
    .help-pillars { grid-template-columns: 1fr; }
}

/* Message limite quotidienne chatbot */
.ai-msg-limit .ai-msg-content {
    background: #fef6e0;
    color: #6b4a00;
    border-radius: 12px 12px 12px 2px;
    font-size: .85rem;
    font-style: italic;
    border-left: 3px solid var(--c-warning, #d4820a);
}
.ai-remaining {
    font-size: .72rem;
    color: var(--c-text-muted);
}

/* ── Chatbox — titre et quota ────────────────────────────────────────────── */
.ai-panel-title {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}
.ai-panel-sub {
    display: block;
    font-size: .72rem;
    opacity: .65;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Quota — toujours visible, ne se tronque pas */
#aiQuota {
    font-size: .72rem;
    opacity: .8;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: .05rem;
}

/* ── Chatbox header — titre + quota ─────────────────────────────────────── */
.ai-title-text {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}
.ai-title-text strong {
    display: block;
    font-size: .88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ai-title-text .ai-panel-sub {
    max-width: 100%;
}
.ai-quota-badge {
    font-size: .68rem;
    font-weight: 600;
    padding: .15rem .45rem;
    border-radius: 99px;
    background: rgba(255,255,255,.15);
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: .02em;
    transition: background .2s;
}
