/*
 * Wavia Academy — Design System « Atelier »
 * Chaud & humain + confiance institutionnelle. Encre Wavia #002030, accent corail.
 * Tokens et composants consolidés à partir des maquettes Claude Design.
 */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,600;12..96,700;12..96,800&family=Hanken+Grotesk:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Spline+Sans+Mono:wght@400;500;600&display=swap');

:root {
    /* Encre (marque Wavia) */
    --ink-950: #001821;
    --ink-900: #002030;
    --ink-800: #0C3340;
    --ink-700: #1B4651;
    --ink-600: #2D5A65;

    /* Corail (accent / actions) */
    --coral-700: #A8381C;
    --coral-600: #C94724;
    --coral-500: #EC6045;
    --coral-400: #F08566;
    --coral-300: #F8A88F;
    --coral-100: #FCEAE3;
    --coral-50: #FEF5F1;

    /* Miel (certifications, IA) */
    --honey-700: #8A5413;
    --honey-600: #A96A1E;
    --honey-500: #F4A259;
    --honey-100: #FDF0DD;
    --honey-50: #FFF8EE;

    /* Lagon (informationnel, données) */
    --lagoon-700: #0F6B72;
    --lagoon-500: #1FA0A8;
    --lagoon-100: #E2F2F2;

    /* Neutres chauds */
    --cream: #FFFBF5;
    --paper: #FFFFFF;
    --sand-100: #F7F1E8;
    --sand-200: #F0E7DA;
    --sand-300: #E5D9C7;
    --sand-400: #D9D4CC;
    --warm-700: #5A5048;
    --warm-500: #877C6E;
    --warm-400: #A99E8E;
    --warm-300: #C9BFB0;

    /* Sémantiques */
    --success-600: #207E54;
    --success-100: #E1F2E9;
    --warning-600: #B5750F;
    --warning-100: #FCEFD7;
    --danger-600: #B5352F;
    --danger-500: #D64545;
    --danger-100: #FBE6E6;

    /* Alias sémantiques */
    --surface-app: var(--cream);
    --surface-card: var(--paper);
    --surface-sunken: var(--sand-100);
    --surface-inverse: var(--ink-950);
    --border-subtle: var(--sand-200);
    --border-default: var(--sand-300);
    --border-strong: var(--sand-400);
    --text-strong: var(--ink-900);
    --text-body: var(--warm-700);
    --text-muted: var(--warm-500);
    --text-disabled: var(--warm-400);
    --accent: var(--coral-500);
    --accent-hover: var(--coral-400);
    --accent-active: var(--coral-600);
    --ring: rgba(236, 96, 69, .45);

    /* Typo */
    --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
    --font-sans: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
    --font-mono: 'Spline Sans Mono', ui-monospace, 'SF Mono', monospace;

    /* Rayons */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    /* Ombres */
    --shadow-sm: 0 1px 2px rgba(0, 32, 48, .06), 0 2px 6px -2px rgba(0, 32, 48, .08);
    --shadow-md: 0 2px 4px rgba(0, 32, 48, .05), 0 8px 20px -8px rgba(0, 32, 48, .14);
    --shadow-lg: 0 4px 8px rgba(0, 32, 48, .06), 0 18px 40px -16px rgba(0, 32, 48, .22);
    --shadow-coral: 0 8px 18px -8px rgba(236, 96, 69, .6);

    --sidebar-width: 232px;
    --ease-out: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-body);
    background: var(--surface-app);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--text-strong);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin: 0;
}

p { margin: 0; }
a { color: var(--coral-600); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd, samp { font-family: var(--font-mono); }
::selection { background: var(--coral-300); color: var(--ink-900); }

:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* ===== Shell applicatif ===== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--ink-950);
    padding: 22px 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 18px;
}

.sidebar__logo {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: rgba(244, 162, 89, .18);
    color: var(--honey-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 15px;
}

.sidebar__brand-name { color: var(--cream); font-family: var(--font-display); font-weight: 700; font-size: 13.5px; line-height: 1.1; }
.sidebar__brand-role { color: var(--warm-500); font-size: 9px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--warm-400);
    font-size: 13.5px;
    font-weight: 500;
    transition: background .15s var(--ease-out), color .15s var(--ease-out);
}
.nav-item:hover { color: var(--cream); background: rgba(255, 255, 255, .06); text-decoration: none; }
.nav-item.is-active { background: rgba(244, 162, 89, .20); color: var(--cream); font-weight: 600; }
.nav-item i { width: 17px; height: 17px; }
.sidebar__spacer { flex: 1; }

.sidebar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px 4px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    margin-top: 8px;
}
.sidebar__logout { margin-left: auto; color: var(--warm-400); display: flex; }
.sidebar__logout:hover { color: var(--cream); }

.main { flex: 1; background: var(--surface-app); padding: 30px 36px; min-width: 0; }

/* ===== En-tête de page ===== */
.page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 13px;
    border-radius: var(--radius-pill);
    background: var(--honey-100);
    color: var(--honey-700);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
}
.page-eyebrow .dot { width: 7px; height: 7px; border-radius: var(--radius-pill); background: var(--honey-500); }
.page-title { font-size: 28px; margin-bottom: 6px; }
.page-subtitle { font-size: 14px; color: var(--text-body); max-width: 72ch; }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.breadcrumb i { width: 13px; height: 13px; }
.breadcrumb .current { color: var(--warm-700); }

/* ===== Cartes ===== */
.card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card--pad { padding: 20px 22px; }

.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.section-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.section-icon--ink { background: var(--ink-900); color: var(--honey-500); }
.section-icon i { width: 16px; height: 16px; }
.section-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text-strong); }

/* ===== Boutons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: filter .15s var(--ease-out), transform .1s var(--ease-out), background .15s var(--ease-out);
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn i { width: 15px; height: 15px; }

.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-coral); }
.btn--primary:hover { filter: brightness(1.05); }
.btn--ghost { background: var(--paper); color: var(--warm-700); border-color: var(--border-default); }
.btn--ghost:hover { background: var(--surface-sunken); }
.btn--dark { background: var(--ink-900); color: #fff; }
.btn--dark:hover { filter: brightness(1.15); }
.btn--danger-soft { background: var(--danger-100); color: var(--danger-600); }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 13px; font-size: 12px; }

/* ===== Formulaires ===== */
.field { margin-bottom: 14px; }
.field__label { display: block; font-size: 11px; font-weight: 600; color: var(--warm-700); margin-bottom: 5px; }
.field__label .req { color: var(--accent); }
.field__control,
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field select {
    width: 100%;
    height: 38px;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background: #fff;
    padding: 0 12px;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-strong);
}
.field input::placeholder { color: var(--warm-400); }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.field__error { color: var(--danger-600); font-size: 11px; margin-top: 5px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

/* ===== Barre de filtres ===== */
.filter-bar { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; padding: 16px 18px; }
.filter-bar__field { display: flex; flex-direction: column; gap: 6px; }
.filter-bar__field--grow { flex: 1 1 240px; min-width: 220px; }
.filter-bar__label { font-size: 10.5px; font-weight: 700; color: var(--warm-500); text-transform: uppercase; letter-spacing: 0.05em; }
.filter-bar__control {
    height: 40px;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background: #fff;
    padding: 0 12px;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-strong);
    width: 100%;
}
.filter-bar__control::placeholder { color: var(--warm-400); }
.filter-bar__control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
select.filter-bar__control {
    appearance: none; -webkit-appearance: none;
    padding-right: 34px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A8967E' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 11px center;
}
.filter-bar__actions { display: flex; gap: 8px; }
.filter-bar__actions .btn { height: 40px; }

/* ===== Tableau de données ===== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    padding: 0 12px 12px;
}
.data-table td { padding: 13px 12px; border-top: 1px solid var(--border-subtle); font-size: 13px; color: var(--text-strong); }
.data-table tr:hover td { background: var(--surface-sunken); }
.cell-muted { color: var(--text-muted); }
.row-link { cursor: pointer; }
.parcours-card:hover { box-shadow: 0 6px 20px rgba(12, 51, 64, 0.10); border-color: var(--warm-400, #C9B79E); }

/* ===== Avatars, badges, chips ===== */
.avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.avatar--root { background: var(--ink-900); color: var(--honey-500); }
.avatar--sm { width: 26px; height: 26px; font-size: 9px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
}
.badge--success { background: var(--success-100); color: var(--success-600); }
.badge--muted { background: var(--sand-200); color: var(--text-muted); }
.badge--honey { background: var(--honey-100); color: var(--honey-700); font-size: 9px; font-weight: 700; padding: 1px 7px; }

.pill-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    background: var(--lagoon-100);
    color: var(--lagoon-700);
    font-size: 11px;
    font-weight: 600;
}

/* ===== Liste d'accès (super-admins) ===== */
.access-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}
.access-row__name { font-size: 13px; font-weight: 600; color: var(--text-strong); display: flex; align-items: center; gap: 7px; }
.access-row__mail { font-size: 11px; color: var(--text-muted); }
.access-row__status { font-family: var(--font-mono); font-size: 10px; color: var(--success-600); }

.icon-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--warm-400);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.icon-btn:hover { background: var(--surface-sunken); color: var(--warm-700); }
.icon-btn i { width: 16px; height: 16px; }

/* ===== Alertes (flash) ===== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 16px;
}
.alert i { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.alert--success { background: var(--success-100); color: var(--success-600); }
.alert--error { background: var(--danger-100); color: var(--danger-600); }

/* ===== Helpers ===== */
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.mt-4 { margin-top: 16px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }

/* ===== Écrans d'authentification (variante A : panneau divisé) ===== */
.auth-split { display: flex; min-height: 100vh; }

.auth-aside {
    position: relative;
    overflow: hidden;
    width: 42%;
    max-width: 520px;
    background: var(--ink-950);
    color: var(--cream);
    padding: 40px 38px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.auth-aside__wave { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
.auth-brand { position: relative; display: flex; align-items: center; gap: 11px; }
.auth-brand__logo {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: rgba(244, 162, 89, .18);
    color: var(--honey-500);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 800; font-size: 17px;
}
.auth-brand__name { color: var(--cream); font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.auth-aside__body { position: relative; }
.auth-aside__icon {
    width: 46px; height: 46px;
    border-radius: 13px;
    background: var(--honey-500);
    color: var(--ink-900);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.auth-aside__title { color: var(--cream); font-size: 23px; line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 10px; text-wrap: balance; }
.auth-aside__text { color: var(--warm-300); font-size: 13px; line-height: 1.55; }

.auth-main { flex: 1; background: var(--cream); display: flex; align-items: center; justify-content: center; padding: 34px 32px; }
.auth-form { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 24px; margin-bottom: 4px; }
.auth-form__sub { font-size: 13.5px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.55; }
.auth-meta { margin-top: 22px; font-size: 12px; color: var(--text-muted); text-align: center; line-height: 1.5; }
.auth-link { font-size: 12.5px; font-weight: 600; color: var(--coral-600); }
.auth-back { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--warm-700); margin-top: 20px; }
.auth-back i { width: 15px; height: 15px; }

/* Champ avec icône en préfixe (44px, design auth) */
.input-icon { position: relative; }
.input-icon > i.lead { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--warm-400); pointer-events: none; }
.input-icon input { height: 44px; border-radius: 12px; padding-left: 40px; }
.input-icon input.has-toggle { padding-right: 42px; }
.pw-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; border: none; background: transparent;
    color: var(--warm-400); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.pw-toggle:hover { color: var(--warm-700); }
.pw-toggle i { width: 17px; height: 17px; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-body); cursor: pointer; }
.checkbox-inline input { width: auto; height: auto; }

/* Zone d'upload (logo) */
.dropzone {
    border: 1.5px dashed var(--warm-300);
    border-radius: 11px;
    background: var(--surface-app);
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}
.dropzone > i { width: 20px; height: 20px; color: var(--warm-400); }
.dropzone input[type="file"] { font-size: 12px; color: var(--text-muted); max-width: 100%; }
.dropzone__hint { font-size: 10px; color: var(--warm-400); }

/* Sélecteur de couleur */
.color-input { width: 46px; height: 38px; padding: 3px; border: 1px solid var(--border-default); border-radius: 10px; background: #fff; cursor: pointer; }

/* Bandeau d'impersonation (« se connecter en tant que ») */
.impersonation-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--honey-500);
    color: var(--ink-900);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
}
.impersonation-bar i { width: 16px; height: 16px; vertical-align: -3px; }
.impersonation-bar a { color: var(--ink-900); text-decoration: underline; }

.btn--lg { height: 46px; padding: 0 18px; font-size: 14px; }

@media (max-width: 860px) {
    .auth-aside { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* ===== E-learning — composer de parcours ===== */
.composer-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 22px; align-items: start; }
.lib-module, .parcours-module { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: 11px; background: var(--surface-card); }
.parcours-module { background: var(--surface-app); }
.parcours-module.sortable-ghost { opacity: .4; }
.pm-index { width: 24px; height: 24px; flex-shrink: 0; border-radius: 999px; background: var(--ink-900); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
@media (max-width: 900px) { .composer-grid { grid-template-columns: 1fr; } }

/* ===== E-learning — éditeur de module ===== */
.bloc-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--surface-card); }
.bloc-row.sortable-ghost { opacity: .4; }
.bloc-edit-form { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; align-items: flex-start; }
.bloc-edit-form .field__control { width: 100%; }
.palette-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 11px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--surface-card); font-size: 12px; font-weight: 600; cursor: pointer; }
.palette-btn:hover:not([disabled]) { background: var(--surface-sunken); }
.palette-btn[disabled] { opacity: .5; cursor: not-allowed; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 9px; font-weight: 700; letter-spacing: .04em; }
.trix-content { min-height: 90px; border: 1px solid var(--border-subtle); border-radius: 9px; background: #fff; width: 100%; }

/* ===== E-learning — indicateur d'auto-enregistrement des blocs ===== */
.bloc-save-status { font-size: 11px; font-weight: 600; color: var(--text-muted); align-self: flex-start; min-height: 14px; }
.bloc-save-status[data-state="saving"], .bloc-save-status[data-state="dirty"] { color: var(--warm-500); }
.bloc-save-status[data-state="saved"] { color: var(--success-600); }

/* ===== Espace apprenant ===== */
.ea-shell { display:flex; min-height:100vh; background:#E4E0D9; }
.ea-sidebar { width:212px; flex-shrink:0; background:#002030; padding:22px 16px; display:flex; flex-direction:column; gap:5px; }
.ea-sidebar__brand { display:flex; align-items:center; gap:11px; padding:4px 8px 20px; color:#FFFBF5; }
.ea-sidebar__logo { width:32px;height:32px;border-radius:9px;background:rgba(255,255,255,0.1);display:flex;align-items:center;justify-content:center;font-family:'Bricolage Grotesque';font-weight:800; }
.ea-sidebar__name { font-family:'Bricolage Grotesque'; font-weight:700; font-size:15px; }
.ea-nav { display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:12px; color:#A99E8E; font-size:14px; font-weight:500; text-decoration:none; }
.ea-nav.on { background:rgba(236,96,69,0.18); color:#FFFBF5; font-weight:600; }
.ea-nav.is-disabled { opacity:0.55; cursor:default; }
.ea-nav i { width:18px; height:18px; }
.ea-sidebar__user { margin-top:auto; display:flex; align-items:center; gap:10px; padding:10px 8px; border-top:1px solid rgba(255,255,255,0.1); }
.ea-sidebar__avatar { width:34px;height:34px;border-radius:999px;background:#2D5A65;display:flex;align-items:center;justify-content:center;color:#FFFBF5;font-size:12px;font-weight:700; }
.ea-sidebar__user-name { color:#FFFBF5; font-size:13px; font-weight:600; }
.ea-sidebar__user-tenant { color:#877C6E; font-size:11px; }
.ea-sidebar__logout { margin-left:auto; color:#A99E8E; }
.ea-main { flex:1; padding:32px; overflow:auto; }

.ea-h1 { font-family:'Bricolage Grotesque'; font-weight:800; font-size:28px; margin:0 0 20px; }
.ea-btn { display:inline-flex; align-items:center; gap:8px; padding:11px 20px; border-radius:12px; font-size:14px; font-weight:600; text-decoration:none; border:1px solid transparent; cursor:pointer; }
.ea-btn i { width:16px; height:16px; }
.ea-btn--brand { background:#EC6045; color:#fff; }
.ea-btn--ghost { background:#fff; border-color:#E5D9C7; color:#5A5048; }
.ea-btn--sm { padding:7px 13px; font-size:12px; }
.ea-bar { height:6px; border-radius:999px; background:#F0E7DA; overflow:hidden; }
.ea-bar--mini { width:64px; }
.ea-bar__fill { height:100%; background:#EC6045; }

/* Dashboard */
.ea-dash__hello { font-family:'Bricolage Grotesque'; font-weight:800; font-size:27px; margin:0 0 18px; }
.ea-resume { background:#002030; border-radius:18px; padding:22px; margin-bottom:18px; }
.ea-resume__eyebrow { font-size:11px; font-weight:700; letter-spacing:0.12em; text-transform:uppercase; color:#F4A259; margin-bottom:7px; }
.ea-resume__title { font-family:'Bricolage Grotesque'; font-weight:700; font-size:19px; color:#FFFBF5; margin-bottom:14px; }
.ea-kpis { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.ea-kpi { background:#fff; border:1px solid #F0E7DA; border-radius:15px; padding:16px 18px; }
.ea-kpi__label { font-size:11.5px; color:#877C6E; margin-bottom:8px; }
.ea-kpi__value { font-family:'Bricolage Grotesque'; font-weight:800; font-size:24px; }
.ea-kpi__hint { font-size:11px; color:#877C6E; margin-top:8px; }
.ea-kpi__hint.is-good { color:#207E54; }

/* Parcours */
.ea-parcours-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:14px; }
.ea-parcours-card { display:block; background:#fff; border:1px solid #F0E7DA; border-radius:15px; padding:18px; text-decoration:none; color:inherit; }
.ea-parcours-card__title { font-family:'Bricolage Grotesque'; font-weight:700; font-size:16px; margin-bottom:4px; }
.ea-parcours-card__code { font-family:'Spline Sans Mono'; font-size:11px; color:#877C6E; margin-bottom:12px; }
.ea-parcours-card__pct { font-size:11px; color:#877C6E; margin-top:6px; }
.ea-parcours-banner { background:linear-gradient(120deg,#EC6045,#F4A259); border-radius:18px; padding:24px 28px; color:#fff; margin-bottom:18px; }
.ea-parcours-banner__title { font-family:'Bricolage Grotesque'; font-weight:800; font-size:24px; }
.ea-parcours-banner__meta { font-size:13px; opacity:0.92; margin-top:3px; }
.ea-badge { padding:3px 10px; border-radius:999px; background:rgba(255,255,255,0.92); color:#002030; font-size:10px; font-weight:700; }
.ea-badge--ink { background:rgba(0,32,48,0.28); color:#fff; }
.ea-modules { display:flex; flex-direction:column; gap:10px; }
.ea-module { display:flex; align-items:center; gap:14px; background:#fff; border:1px solid #EFE9DF; border-radius:13px; padding:13px 16px; }
.ea-module--current { background:#FEF5F1; border:1.5px solid #EC6045; }
.ea-module--locked { background:#FBF8F2; opacity:0.7; }
.ea-module__icon { width:32px;height:32px;border-radius:999px;display:flex;align-items:center;justify-content:center; }
.ea-module__icon--done { background:#E1F2E9; color:#207E54; }
.ea-module__icon--current { background:#EC6045; color:#fff; }
.ea-module__icon--locked { background:#F0E7DA; color:#A99E8E; }
.ea-module__body { flex:1; }
.ea-module__title { font-size:13.5px; font-weight:600; }
.ea-module__sub { font-size:11.5px; color:#A99E8E; }

/* Reader (3 cols) */
.ea-reader { display:flex; min-height:100vh; background:#FFFBF5; }
.ea-rail { width:248px; flex-shrink:0; background:#FBF8F2; border-right:1px solid #F0E7DA; padding:22px 18px; display:flex; flex-direction:column; }
.ea-rail__back { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:#877C6E; font-weight:600; margin-bottom:14px; text-decoration:none; }
.ea-rail__eyebrow { font-family:'Spline Sans Mono'; font-size:10px; color:#C94724; margin-bottom:3px; }
.ea-rail__title { font-family:'Bricolage Grotesque'; font-weight:700; font-size:16px; line-height:1.25; margin-bottom:18px; }
.ea-rail__list { display:flex; flex-direction:column; gap:4px; }
.ea-res { display:flex; align-items:center; gap:10px; padding:9px 11px; border-radius:10px; font-size:12.5px; color:#877C6E; text-decoration:none; }
.ea-res.is-done { color:#207E54; }
.ea-res.is-quiz { background:#FFF8EE; border:1px solid #FDF0DD; color:#8A5413; font-weight:600; }
.ea-res i { width:16px; height:16px; }
.ea-rail__progress { margin-top:auto; padding-top:16px; border-top:1px solid #F0E7DA; }
.ea-rail__progress-row { display:flex; justify-content:space-between; font-size:11px; margin-bottom:6px; }
.ea-read { flex:1; overflow:auto; }
.ea-read__topbar { position:sticky; top:0; z-index:5; padding:14px 32px; background:rgba(255,251,245,0.9); backdrop-filter:blur(8px); border-bottom:1px solid #F0E7DA; }
.ea-read__crumbs { display:flex; align-items:center; gap:8px; font-family:'Spline Sans Mono'; font-size:11px; color:#877C6E; }
.ea-read__content { max-width:720px; margin:0 auto; padding:38px 32px 64px; }
.ea-read__h1 { font-family:'Bricolage Grotesque'; font-weight:800; font-size:34px; line-height:1.08; margin:0 0 14px; }
.ea-read__h2 { font-family:'Bricolage Grotesque'; font-weight:700; font-size:22px; margin:32px 0 14px; }
.ea-read__p { font-size:15.5px; line-height:1.72; color:#3f3a33; margin:0 0 18px; }
.ea-read__video iframe { width:100%; aspect-ratio:16/9; border:0; border-radius:18px; }
.ea-read__video figcaption, .ea-read__pdf figcaption { font-size:12.5px; color:#877C6E; margin-top:10px; display:flex; align-items:center; gap:6px; }
.ea-read__video-wrap { position: relative; }
.ea-read__video-resume {
    position: absolute; left: 12px; bottom: 12px; z-index: 2;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; border: 0; border-radius: 9px; cursor: pointer;
    background: rgba(17, 17, 17, .82); color: #fff; font: inherit; font-size: 13px;
}
.ea-read__video-resume i { width: 15px; height: 15px; }
.ea-read__pdf { margin:30px 0; }
.ea-read__pdf-head { display:flex; align-items:center; justify-content:space-between; padding:11px 16px; background:#002030; color:#FFFBF5; border-radius:16px 16px 0 0; }
.ea-read__pdf-head a { color:#C9BFB0; text-decoration:none; display:inline-flex; align-items:center; gap:6px; font-size:12px; }
.ea-read__pdf-frame { width:100%; height:520px; border:1px solid #E5D9C7; border-top:0; border-radius:0 0 16px 16px; }
.ea-read__quiz { position:relative; overflow:hidden; background:#002030; border-radius:18px; padding:24px 26px; margin-top:34px; display:flex; align-items:center; gap:22px; }
.ea-read__quiz-icon { width:54px;height:54px;border-radius:15px;background:#F4A259;display:flex;align-items:center;justify-content:center;color:#002030; }
.ea-read__quiz-body { flex:1; color:#FFFBF5; }
.ea-read__quiz-eyebrow { font-size:11px; font-weight:700; letter-spacing:0.12em; text-transform:uppercase; color:#F4A259; margin-bottom:5px; }
.ea-read__quiz-title { font-family:'Bricolage Grotesque'; font-weight:700; font-size:19px; }
.ea-read__quiz-meta { font-size:13px; color:#C9BFB0; }

/* Quiz play / result / review */
.ea-quiz, .ea-result, .ea-review { max-width:640px; margin:0 auto; background:#FFFBF5; border:1px solid #F0E7DA; border-radius:20px; padding:26px 28px; }
.ea-quiz__dots { display:flex; gap:4px; margin-bottom:20px; }
.ea-quiz__dot { width:20px;height:5px;border-radius:999px;background:#F0E7DA; }
.ea-quiz__dot.is-on { background:#EC6045; }
.ea-quiz__count { font-family:'Spline Sans Mono'; font-size:11px; color:#877C6E; margin-bottom:12px; }
.ea-quiz__enonce { font-family:'Bricolage Grotesque'; font-weight:700; font-size:19px; line-height:1.3; margin-bottom:20px; }
.ea-quiz__options { display:flex; flex-direction:column; gap:10px; }
.ea-quiz__option { display:flex; align-items:center; gap:12px; padding:14px 16px; border:1px solid #E5D9C7; border-radius:12px; background:#fff; cursor:pointer; font-size:13.5px; }
.ea-quiz__textarea { width:100%; border:1px solid #E5D9C7; border-radius:12px; padding:12px 14px; font-family:inherit; font-size:14px; }
.ea-quiz__nav { display:flex; justify-content:space-between; gap:10px; margin-top:22px; }
.ea-result { display:flex; flex-direction:column; align-items:center; text-align:center; }
.ea-result__gauge { width:108px;height:108px;border-radius:999px;background:conic-gradient(#2E9E6B calc(var(--score)*1%), #F0E7DA 0); display:flex;align-items:center;justify-content:center;margin-bottom:18px; }
.ea-result__gauge-inner { width:84px;height:84px;border-radius:999px;background:#FFFBF5;display:flex;align-items:center;justify-content:center;font-family:'Bricolage Grotesque';font-weight:800;font-size:24px; }
.ea-result__badge { display:inline-flex; align-items:center; gap:6px; padding:5px 13px; border-radius:999px; font-size:12.5px; font-weight:600; margin-bottom:12px; }
.ea-result__badge.is-good { background:#E1F2E9; color:#207E54; }
.ea-result__badge.is-bad { background:#FCEAE3; color:#A8381C; }
.ea-result__title { font-family:'Bricolage Grotesque'; font-weight:800; font-size:21px; margin-bottom:6px; }
.ea-result__actions { display:flex; gap:10px; margin-top:22px; }
.ea-review__q { padding:14px 0; border-bottom:1px solid #F0E7DA; }
.ea-review__opt { display:flex; align-items:center; gap:8px; padding:6px 0; font-size:13.5px; color:#5A5048; }
.ea-review__opt.is-correct { color:#207E54; font-weight:600; }
.ea-review__opt.is-chosen:not(.is-correct) { color:#A8381C; }
.ea-tag { font-size:11px; padding:2px 8px; border-radius:999px; }
.ea-tag.is-good { background:#E1F2E9; color:#207E54; }
.ea-tag.is-bad { background:#FCEAE3; color:#A8381C; }

/* Complete */
.ea-complete { display:grid; grid-template-columns:1.05fr 1fr; gap:34px; align-items:center; background:#FFFBF5; border:1px solid #F0E7DA; border-radius:20px; padding:36px; }
.ea-complete__badge { display:inline-flex; align-items:center; gap:8px; padding:5px 13px; border-radius:999px; background:#E1F2E9; color:#207E54; font-size:12.5px; font-weight:600; margin-bottom:18px; }
.ea-complete__title { font-family:'Bricolage Grotesque'; font-weight:800; font-size:28px; line-height:1.1; margin-bottom:12px; }
.ea-complete__text { font-size:14.5px; color:#5A5048; line-height:1.6; margin-bottom:24px; }
.ea-complete__card { background:#002030; border-radius:18px; padding:28px; color:#FFFBF5; }
.ea-complete__card-icon { width:50px;height:50px;border-radius:14px;background:#F4A259;display:flex;align-items:center;justify-content:center;color:#002030;margin-bottom:16px; }
.ea-complete__card-title { font-family:'Bricolage Grotesque'; font-weight:700; font-size:19px; margin-bottom:10px; }
.ea-complete__card-text { font-size:13.5px; color:#C9BFB0; line-height:1.6; }

.bloc-save-status[data-state="error"] { color: var(--danger-600); }

/* ===== Éditeur de module — canvas WYSIWYG (maquette 1c) ===== */
.mod-editor { display: grid; grid-template-columns: 262px 1fr 246px; gap: 0; height: calc(100vh - 130px); min-height: 620px; border: 1px solid var(--sand-300); border-radius: 16px; overflow: hidden; background: var(--paper); }
.mod-editor--split { grid-template-columns: 1fr 246px; }
@media (max-width: 1100px) { .mod-editor, .mod-editor--split { grid-template-columns: 1fr; height: auto; } }

.mod-toc { background: var(--sand-100); border-right: 1px solid var(--sand-200); display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.mod-toc__head { padding: 18px 18px 14px; border-bottom: 1px solid var(--sand-200); }
.mod-toc__eyebrow { font-family: var(--font-mono); font-size: 11px; color: var(--coral-600); font-weight: 600; }
.mod-toc__title { font-family: var(--font-display); font-weight: 800; font-size: 16px; margin-top: 4px; }
.mod-toc__meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.mod-toc__list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.mod-toc__item { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 10px; color: var(--text-body); font-size: 13px; font-weight: 500; text-decoration: none; }
.mod-toc__item:hover { background: var(--sand-200); }
.mod-toc__item i { width: 15px; height: 15px; color: var(--warm-500); }

.mod-canvas { display: flex; flex-direction: column; background: var(--sand-200); min-width: 0; min-height: 0; }
.mod-canvas__topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: var(--sand-100); border-bottom: 1px solid var(--sand-300); }
.mod-canvas__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 22px; display: flex; justify-content: center; }
.mod-page { width: 640px; max-width: 100%; align-self: flex-start; background: var(--surface-card, #FFFBF5); border: 1px solid var(--sand-300); border-radius: 16px; box-shadow: 0 18px 40px -28px rgba(0,32,48,0.45); overflow: hidden; }
.mod-page__header { padding: 24px 26px 18px; border-bottom: 1px solid var(--sand-200); }
.mod-page__eyebrow { font-family: var(--font-mono); font-size: 11px; color: var(--coral-600); font-weight: 600; }
.mod-page__title { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; margin-top: 6px; }
.mod-page__title-input { width: 100%; border: 0; background: transparent; outline: none; padding: 2px 0; margin-top: 6px; font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; color: var(--text-strong); border-radius: 6px; }
.mod-page__title-input:focus { box-shadow: inset 0 -2px 0 var(--coral-300); }
.mod-page__blocks { padding: 18px 26px 26px; display: flex; flex-direction: column; gap: 6px; min-height: 120px; }

.mod-block { position: relative; border: 2px solid transparent; border-radius: 14px; padding: 8px; transition: border-color .12s; }
.mod-block:hover, .mod-block.is-selected { border-color: var(--coral-300); }
.mod-block.sortable-ghost { opacity: .4; }
.mod-block__controls { position: absolute; top: -13px; right: 12px; display: none; align-items: center; gap: 4px; }
.mod-block:hover .mod-block__controls, .mod-block.is-selected .mod-block__controls { display: flex; }
.mod-block__pill { position: absolute; top: -13px; left: 14px; display: none; align-items: center; gap: 6px; background: var(--coral-500); color: #fff; border-radius: 8px; padding: 3px 9px; font-size: 10.5px; font-weight: 600; }
.mod-block:hover .mod-block__pill, .mod-block.is-selected .mod-block__pill { display: inline-flex; }
.mod-block__pill i { width: 12px; height: 12px; }
.mod-block__handle, .mod-block__dup, .mod-block__edit, .mod-block__del { width: 24px; height: 24px; border-radius: 7px; background: #fff; border: 1px solid var(--sand-300); display: inline-flex; align-items: center; justify-content: center; color: var(--text-body); cursor: pointer; padding: 0; }
.mod-block__handle { cursor: grab; }
.mod-block__del { color: var(--coral-600); }
.mod-block__dup-form, .mod-block__del-form { display: inline-flex; }
.mod-block__handle i, .mod-block__dup i, .mod-block__edit i, .mod-block__del i { width: 12px; height: 12px; }

.mod-title-input { width: 100%; border: 0; background: transparent; font-family: var(--font-display); color: var(--text-strong); outline: none; padding: 4px 2px; }
.mod-title-input.is-h1 { font-weight: 800; font-size: 26px; letter-spacing: -0.02em; }
.mod-title-input.is-h2 { font-weight: 700; font-size: 20px; }
.mod-callout { background: var(--sand-100); border-left: 3px solid var(--coral-400); border-radius: 10px; padding: 12px 14px; }

.mod-media { border-radius: 11px; overflow: hidden; }
.mod-media iframe { width: 100%; aspect-ratio: 16/9; border: 0; display: block; }
.mod-media__caption { font-size: 11.5px; color: var(--text-muted); padding: 6px 2px 2px; }
.mod-media--empty { display: flex; align-items: center; justify-content: center; gap: 10px; height: 120px; border: 1.5px dashed var(--sand-300); border-radius: 11px; color: var(--text-muted); font-size: 13px; }

.mod-video-progress { margin-top: 8px; }
.mod-video-progress__bar { height: 6px; border-radius: 999px; background: var(--sand-200); overflow: hidden; }
.mod-video-progress__bar > span { display: block; height: 100%; width: 0; background: var(--coral-500); transition: width .2s ease; }
.mod-video-progress__text { margin-top: 6px; font-size: 11px; color: var(--text-muted); }

.mod-doc { display: flex; align-items: center; gap: 12px; border: 1px solid var(--sand-200); border-radius: 12px; padding: 12px 14px; }
.mod-doc__icon { width: 38px; height: 38px; border-radius: 10px; background: var(--lagoon-100); color: var(--lagoon-700); display: flex; align-items: center; justify-content: center; }
.mod-doc__name { font-size: 13.5px; font-weight: 600; }
.mod-doc__meta { font-size: 11.5px; color: var(--text-muted); }
.mod-img img { max-width: 100%; border-radius: 11px; display: block; }
.mod-img__caption { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }

.mod-quiz { display: flex; align-items: center; gap: 12px; background: #FFF8EE; border: 1px solid #F6E3C2; border-radius: 13px; padding: 14px 16px; }
.mod-quiz__icon { width: 38px; height: 38px; border-radius: 10px; background: #FBE3B8; color: #8A5413; display: flex; align-items: center; justify-content: center; }
.mod-quiz__title { font-size: 13.5px; font-weight: 700; }
.mod-quiz__meta { font-size: 11.5px; color: #8A5413; }
.mod-quiz__body { flex: 1; }
.mod-quiz__badge { padding: 3px 9px; border-radius: 999px; background: #FBE3B8; color: #8A5413; font-size: 10px; font-weight: 700; }

.mod-dropzone { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; margin-top: 4px; border: 1.5px dashed var(--coral-300); border-radius: 14px; color: var(--coral-600); font-size: 13px; font-weight: 600; background: var(--coral-50); }
.mod-dropzone i { width: 16px; height: 16px; }

.mod-palette { background: var(--sand-100); border-left: 1px solid var(--sand-200); padding: 20px 16px; display: flex; flex-direction: column; overflow-y: auto; min-height: 0; }
.mod-palette__title { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.mod-palette__hint { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.mod-palette__group { margin: 14px 0 9px; }
.mod-palette__chips { display: flex; flex-direction: column; gap: 8px; }
.mod-chip { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--sand-300); border-radius: 12px; background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-800); cursor: grab; }
.mod-chip.is-disabled { opacity: .45; cursor: not-allowed; }
.mod-chip--btn { width: 100%; cursor: pointer; font-family: inherit; text-align: left; }
.mod-chip--btn:hover { border-color: var(--coral-300); background: var(--coral-50); }
.mod-chip__icon { width: 26px; height: 26px; border-radius: 8px; background: var(--coral-100); color: var(--coral-600); display: flex; align-items: center; justify-content: center; }
.mod-chip__icon i { width: 15px; height: 15px; }
.mod-chip__grip { margin-left: auto; color: var(--warm-300); display: flex; }
.mod-chip__grip i { width: 15px; height: 15px; }
.mod-palette__note { margin-top: auto; background: #FFF8EE; border: 1px solid #F6E3C2; border-radius: 12px; padding: 12px 13px; font-size: 11.5px; color: #8A5413; line-height: 1.5; }

.mod-settings { position: relative; }
.mod-settings__panel { position: absolute; right: 0; top: 40px; z-index: 20; background: #fff; border: 1px solid var(--sand-300); border-radius: 12px; box-shadow: 0 18px 40px -20px rgba(0,32,48,0.4); padding: 14px 16px; width: 260px; }

.mod-modal { border: 1px solid var(--sand-300); border-radius: 16px; padding: 18px 20px; width: 420px; max-width: 92vw; box-shadow: 0 30px 70px -40px rgba(0,32,48,0.5); }
.mod-modal::backdrop { background: rgba(0,32,48,0.35); }
.mod-modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mod-modal__close { background: none; border: 0; cursor: pointer; color: var(--text-muted); }

/* Rendu apprenant : image + encadré */
.ea-read__image { margin: 22px 0; }
.ea-read__image img { max-width: 100%; border-radius: 12px; display: block; }
.ea-read__image figcaption { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #877C6E; margin-top: 8px; }
.ea-read__image figcaption i { width: 14px; height: 14px; }
.ea-read__callout { display: flex; gap: 12px; margin: 22px 0; background: #FFF8EE; border: 1px solid #F6E3C2; border-left: 4px solid #F4A259; border-radius: 12px; padding: 16px 18px; }
.ea-read__callout-icon { color: #B5750F; flex-shrink: 0; }
.ea-read__callout-icon i { width: 18px; height: 18px; }
.ea-read__callout-body { font-size: 14px; line-height: 1.6; color: #5A5048; }

/* ===== Composer de parcours — maquette 3a (pile verticale) ===== */
.pcz-editor { display: grid; grid-template-columns: 1fr 264px; gap: 0; height: calc(100vh - 130px); min-height: 620px; border: 1px solid var(--sand-300); border-radius: 16px; overflow: hidden; background: var(--paper); }
@media (max-width: 1000px) { .pcz-editor { grid-template-columns: 1fr; height: auto; } }

.pcz-canvas { display: flex; flex-direction: column; background: #EDE7DD; min-width: 0; min-height: 0; }
.pcz-canvas__topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: var(--sand-100); border-bottom: 1px solid var(--sand-300); }
.pcz-canvas__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 24px; display: flex; justify-content: center; }
.pcz-page { width: 600px; max-width: 100%; align-self: flex-start; }

.pcz-banner { position: relative; overflow: hidden; background: var(--ink-900); border-radius: 16px; padding: 20px 22px; color: #FFFBF5; margin-bottom: 16px; }
.pcz-banner__wave { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.4; }
.pcz-banner__body { position: relative; }
.pcz-banner__code { font-family: var(--font-mono); font-size: 11px; color: var(--coral-300); font-weight: 600; margin-bottom: 5px; }
.pcz-banner__title { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.01em; }
.pcz-banner__meta { font-size: 12px; color: var(--warm-300); margin-top: 4px; }

.pcz-stack { display: flex; flex-direction: column; gap: 16px; }
.pcz-module { position: relative; display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--sand-200); border-radius: 14px; padding: 13px 15px; }
.pcz-module::before { content: ""; position: absolute; top: -16px; left: 31px; width: 2px; height: 16px; background: var(--warm-300); }
.pcz-module:first-child::before { display: none; }
.pcz-module:hover { border-color: var(--coral-300); }
.pcz-module.is-selected { border: 2px solid var(--coral-500); box-shadow: 0 14px 30px -20px rgba(236,96,69,0.6); }
.pcz-module.sortable-ghost { opacity: .4; }
.pcz-module__num { width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px; background: var(--coral-100); color: var(--coral-600); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 600; font-size: 14px; }
.pcz-module__body { flex: 1; min-width: 0; }
.pcz-module__titlerow { display: flex; align-items: center; gap: 9px; }
.pcz-module__title { font-size: 14.5px; font-weight: 700; color: var(--text-strong); text-decoration: none; }
.pcz-module__title:hover { color: var(--coral-600); }
.pcz-module__meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.pcz-module__edit, .pcz-module__detach { width: 28px; height: 28px; border-radius: 8px; background: #fff; border: 1px solid var(--sand-300); display: inline-flex; align-items: center; justify-content: center; color: var(--text-body); cursor: pointer; text-decoration: none; padding: 0; }
.pcz-module__detach { color: var(--coral-600); }
.pcz-module__edit i, .pcz-module__detach i { width: 14px; height: 14px; }
.pcz-module__detach-form { display: inline-flex; }
.pcz-module__grip { color: var(--warm-400); cursor: grab; display: inline-flex; }
.pcz-module__grip i { width: 16px; height: 16px; }

.pcz-empty { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 22px; border: 1.5px dashed var(--coral-300); border-radius: 14px; color: var(--coral-600); font-size: 13px; font-weight: 600; background: var(--coral-50); }

.pcz-palette { background: var(--sand-100); border-left: 1px solid var(--sand-200); padding: 20px 16px; display: flex; flex-direction: column; overflow-y: auto; min-height: 0; }
.pcz-palette__title { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.pcz-palette__hint { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.pcz-search { height: 34px; border: 1px solid var(--sand-300); border-radius: 10px; background: #fff; display: flex; align-items: center; gap: 8px; padding: 0 11px; margin-bottom: 6px; }
.pcz-search i { width: 14px; height: 14px; color: var(--text-muted); }
.pcz-search input { border: 0; background: transparent; outline: none; flex: 1; font-size: 12px; }
.pcz-palette__chips { display: flex; flex-direction: column; gap: 8px; }
.pcz-chip { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--sand-300); border-radius: 12px; background: #fff; cursor: grab; text-decoration: none; color: inherit; }
.pcz-chip--dashed { border-style: dashed; cursor: pointer; color: var(--text-body); }
.pcz-chip__body { flex: 1; min-width: 0; }
.pcz-chip__title { display: block; font-size: 13px; font-weight: 600; color: var(--ink-800); }
.pcz-chip__meta { font-size: 11px; color: var(--text-muted); }
.pcz-chip__grip { color: var(--warm-300); display: inline-flex; }
.pcz-chip__grip i { width: 15px; height: 15px; }
.pcz-chip__icon { width: 26px; height: 26px; border-radius: 8px; background: var(--sand-200); color: var(--warm-700); display: flex; align-items: center; justify-content: center; }
.pcz-chip__icon i { width: 15px; height: 15px; }

.pcz-settings { position: relative; }
.pcz-settings__panel { position: absolute; right: 0; top: 40px; z-index: 20; background: #fff; border: 1px solid var(--sand-300); border-radius: 12px; box-shadow: 0 18px 40px -20px rgba(0,32,48,0.4); padding: 14px 16px; width: 280px; }

/* =========================================================================
   RESPONSIVE — topbar mobile, sidebars en tiroir, grilles & tableaux
   ========================================================================= */

/* Grilles utilitaires responsives (remplacent les grid inline figées) */
.g-kpi { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.g-2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.g-3 { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
.g-split { display: grid; gap: 18px; align-items: start; grid-template-columns: 1.6fr 1fr; }

/* Barre supérieure mobile (masquée sur desktop) */
.mobile-topbar { display: none; }
.nav-toggle {
    width: 40px; height: 40px; flex-shrink: 0;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--paper); color: var(--text-strong);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.nav-toggle i { width: 20px; height: 20px; }
.mobile-topbar__brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.mobile-topbar__logo {
    width: 30px; height: 30px; flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: rgba(244, 162, 89, .18); color: var(--honey-600);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 800; font-size: 15px;
}
.mobile-topbar__name { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-topbar__spacer { flex: 1; }

/* Voile derrière le tiroir */
.nav-scrim {
    display: none; position: fixed; inset: 0; z-index: 55;
    background: rgba(0, 24, 33, .5); border: 0; padding: 0; margin: 0;
    opacity: 0; transition: opacity .2s var(--ease-out);
}

@media (max-width: 860px) {
    /* --- Shells passent en colonne, sidebars en tiroir --- */
    .app-shell, .ea-shell, .ea-reader { flex-direction: column; }

    .mobile-topbar {
        display: flex; align-items: center; gap: 12px;
        position: sticky; top: 0; z-index: 40;
        padding: 10px 14px;
        background: var(--surface-app);
        border-bottom: 1px solid var(--border-subtle);
    }
    .ea-shell .mobile-topbar, .ea-reader .mobile-topbar { background: #E4E0D9; }

    /* Sidebars (super-admin/OF/entreprise + apprenant) en tiroir gauche */
    .sidebar, .ea-sidebar {
        position: fixed; top: 0; bottom: 0; left: 0;
        width: min(84vw, 300px); z-index: 60;
        transform: translateX(-100%);
        transition: transform .25s var(--ease-out);
        overflow-y: auto;
    }
    body.nav-open .sidebar, body.nav-open .ea-sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }

    /* Rail du lecteur (sommaire) en tiroir également */
    .ea-rail {
        position: fixed; top: 0; bottom: 0; left: 0;
        width: min(84vw, 320px); z-index: 60;
        transform: translateX(-100%);
        transition: transform .25s var(--ease-out);
        overflow-y: auto; border-right: 1px solid #F0E7DA;
    }
    body.rail-open .ea-rail { transform: translateX(0); box-shadow: var(--shadow-lg); }

    body.nav-open .nav-scrim, body.rail-open .nav-scrim { display: block; opacity: 1; }
    body.nav-open, body.rail-open { overflow: hidden; }

    /* Contenu pleine largeur, padding réduit */
    .main { padding: 20px 16px; }
    .ea-main { padding: 20px 16px; }
    .ea-read { min-height: 0; }
    .ea-read__topbar { padding: 12px 16px; }
    .ea-read__content { padding: 24px 16px 48px; }

    /* En-têtes de page plus compacts */
    .page-title { font-size: 22px; }
    .ea-h1, .ea-dash__hello { font-size: 22px; }

    /* Effondrement des grilles multi-colonnes */
    .g-2, .g-3, .g-split,
    .form-grid-2,
    .ea-kpis, .ea-complete { grid-template-columns: 1fr; }
    .ea-complete { padding: 24px; gap: 20px; }

    /* Actions & navigations qui s'empilent */
    .ea-result__actions { flex-direction: column; width: 100%; }
    .ea-result__actions .ea-btn { width: 100%; justify-content: center; }
    .ea-quiz__nav { flex-direction: column-reverse; }
    .ea-quiz__nav .ea-btn { width: 100%; justify-content: center; }

    /* Encadré quiz du lecteur */
    .ea-read__quiz { flex-direction: column; align-items: flex-start; gap: 14px; }

    /* Bannière de parcours */
    .ea-parcours-banner { padding: 20px; }
    .ea-parcours-banner__title { font-size: 20px; }

    /* Tableaux : chaque ligne devient une carte empilée (fini le scroll horizontal) */
    .data-table { min-width: 0; }
    .data-table thead { display: none; }
    .data-table tbody { display: flex; flex-direction: column; gap: 10px; }
    .data-table tr {
        display: flex; flex-direction: column; gap: 2px;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
        padding: 10px 14px;
        background: var(--surface-card);
    }
    .data-table tr:hover td { background: transparent; }
    .data-table td {
        display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
        padding: 6px 0; border: 0; text-align: right;
        border-top: 1px solid var(--border-subtle);
        min-width: 0; overflow-wrap: anywhere;
    }
    .data-table td:first-child { border-top: 0; }
    .data-table td[data-label]::before {
        content: attr(data-label);
        flex-shrink: 0; text-align: left;
        font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
        color: var(--text-muted);
    }
    /* Cellule-titre : nom/entité en tête de carte, pleine largeur */
    .data-table td.cell-title {
        justify-content: flex-start; text-align: left;
        padding: 2px 0 8px; font-size: 15px; font-weight: 700;
    }
    .data-table td.cell-title::before { display: none; }
    /* Cellule d'actions : boutons alignés à droite, sans libellé */
    .data-table td.cell-actions { justify-content: flex-end; text-align: right; }
    .data-table td.cell-actions::before { display: none; }
    /* Ligne « aucun résultat » sur toute la largeur */
    .data-table td[colspan] { justify-content: center; text-align: center; }
    .data-table td[colspan]::before { display: none; }

    /* Tableaux « plats » sans en-tête (timelines) : rangées horizontales compactes */
    .data-table--plain tbody { gap: 0; }
    .data-table--plain tr {
        flex-direction: row; align-items: center; gap: 10px;
        border: 0; border-top: 1px solid var(--border-subtle); border-radius: 0;
        padding: 9px 2px; background: transparent;
    }
    .data-table--plain tr:first-child { border-top: 0; }
    .data-table--plain td {
        border: 0; padding: 0; text-align: left;
        justify-content: flex-start; display: block; width: auto;
    }
    .data-table--plain td[style*="right"] { margin-left: auto; text-align: right; }

    /* Barre de filtres : actions pleine largeur */
    .filter-bar__actions { width: 100%; }
    .filter-bar__actions .btn { flex: 1; }
}

@media (max-width: 520px) {
    .main, .ea-main { padding: 16px 12px; }
    .ea-read__content { padding: 20px 14px 44px; }
    .page-title { font-size: 20px; }
    /* Rangées d'en-tête (titre + actions) qui s'empilent */
    .row.between { flex-wrap: wrap; gap: 12px; }
    .card--pad { padding: 16px; }
}
