:root {
    font-family:
        Inter, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;

    --navy: #102f38;
    --navy-2: #173f4a;
    --petrol: #176a78;
    --cyan: #2d92a3;
    --bg: #f3f7f8;
    --surface: #ffffff;
    --surface-2: #f7fafb;
    --border: #d9e5e8;
    --text: #172a33;
    --muted: #6c7f86;
    --success: #24764f;
    --warning: #a66a16;
    --danger: #a33b32;

    color: var(--text);
    background: var(--bg);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 100% 0%, #e4f0f2 0, transparent 38rem),
        var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(440px, 100%);
    padding: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 22px 60px rgba(15, 47, 56, .10);
}

.brand {
    margin: 0 0 8px;
    font-size: 2.35rem;
    line-height: 1;
    color: var(--navy);
}

.subtitle {
    margin: 0 0 28px;
    color: var(--muted);
}

.field {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid #bdcdd2;
    border-radius: 10px;
    background: #fff;
}

input:focus {
    outline: 3px solid rgba(45, 146, 163, .17);
    border-color: var(--cyan);
}

.button-primary,
.button-secondary {
    min-height: 44px;
    padding: 10px 16px;
    border: 0;
    border-radius: 10px;
    font-weight: 750;
}

.button-primary {
    width: 100%;
    background: var(--navy-2);
    color: #fff;
}

.button-secondary {
    background: #e7eef0;
    color: var(--navy);
}

.alert {
    padding: 12px 14px;
    margin: 0 0 20px;
    border: 1px solid #f0cac4;
    border-radius: 10px;
    color: #8a3027;
    background: #fff1ef;
}

.small {
    color: var(--muted);
    font-size: .87rem;
}

/* APP */

.app-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--navy);
    color: #dcebee;
    border-right: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand {
    padding: 26px 24px 22px;
    font-size: 1.6rem;
    font-weight: 850;
    color: #fff;
}

.sidebar-subtitle {
    display: block;
    margin-top: 5px;
    color: #8fb4bc;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.nav-section {
    padding: 12px;
}

.nav-title {
    padding: 10px 12px 6px;
    color: #7ea3ab;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    margin: 3px 0;
    border-radius: 10px;
    color: #dcebee;
    font-weight: 650;
}

.nav-link:hover {
    background: rgba(255,255,255,.07);
}

.nav-link.active {
    background: #fff;
    color: var(--navy);
}

.nav-icon {
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px 20px;
    border-top: 1px solid rgba(255,255,255,.08);
    color: #8fb4bc;
    font-size: .76rem;
}

.content-shell {
    min-width: 0;
}

.topbar {
    min-height: 76px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 14px 28px;
    background: rgba(255,255,255,.90);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.page-context {
    min-width: 0;
}

.page-title {
    margin: 0;
    color: var(--navy);
    font-size: 1.32rem;
}

.page-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .87rem;
}

.user-zone {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-badge {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 750;
    color: var(--navy);
}

.user-role {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: .76rem;
}

.logout-form {
    margin: 0;
}

.main {
    width: min(1400px, calc(100% - 48px));
    margin: 30px auto 50px;
}

.welcome {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: flex-start;
    padding: 26px 28px;
    margin-bottom: 22px;
    background:
        linear-gradient(130deg, var(--navy), #1a5663);
    color: #fff;
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(16,47,56,.14);
}

.welcome h1 {
    margin: 0 0 8px;
    font-size: 1.8rem;
}

.welcome p {
    margin: 0;
    color: #c7dce1;
}

.status-pill {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.13);
    color: #eaf6f8;
    font-size: .8rem;
    font-weight: 750;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 12px 34px rgba(16,47,56,.055);
}

.stat-card {
    padding: 20px;
    border-radius: 15px;
}

.stat-label {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 650;
}

.stat-value {
    display: block;
    margin-top: 8px;
    color: var(--navy);
    font-size: 1.75rem;
    font-weight: 850;
}

.stat-note {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: .76rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, .9fr);
    gap: 20px;
}

.panel {
    padding: 22px;
    border-radius: 17px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 18px;
}

.panel-title {
    margin: 0;
    color: var(--navy);
    font-size: 1.05rem;
}

.panel-description {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: .82rem;
}

.activity-list,
.status-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.activity-item {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid #edf2f3;
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan);
}

.activity-action {
    font-weight: 700;
    color: var(--navy);
}

.activity-meta,
.activity-date {
    color: var(--muted);
    font-size: .76rem;
}

.status-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 0;
    border-bottom: 1px solid #edf2f3;
}

.status-row:last-child {
    border-bottom: 0;
}

.status-name {
    color: var(--muted);
}

.status-ok {
    color: var(--success);
    font-weight: 800;
}

.status-wait {
    color: var(--warning);
    font-weight: 800;
}

.page-card {
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.empty-state {
    padding: 42px 24px;
    text-align: center;
    color: var(--muted);
}

.empty-state strong {
    display: block;
    margin-bottom: 7px;
    color: var(--navy);
    font-size: 1.1rem;
}

.denied {
    border-left: 4px solid var(--danger);
}

.app-footer {
    margin-top: 30px;
    color: var(--muted);
    font-size: .78rem;
}

@media (max-width: 1050px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 760px) {
    .app-layout {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .sidebar-brand {
        padding: 18px 20px 12px;
    }

    .nav-section {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding: 8px 12px 14px;
    }

    .nav-title,
    .sidebar-footer {
        display: none;
    }

    .nav-link {
        flex: 0 0 auto;
        margin: 0;
        white-space: nowrap;
    }

    .topbar {
        padding: 14px 18px;
    }

    .page-subtitle,
    .user-role {
        display: none;
    }

    .main {
        width: min(100% - 28px, 1400px);
        margin-top: 20px;
    }

    .welcome {
        flex-direction: column;
    }

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

    .user-name {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* =========================================================
   MOBILE NAVIGATION DRAWER
   ========================================================= */

.mobile-menu-button {
    display: none;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 10px;
    background: #e7eef0;
    color: var(--navy);
    font-size: 1.4rem;
    line-height: 1;
    font-weight: 800;
}

.sidebar-overlay {
    display: none;
}

@media (max-width: 760px) {

    body.menu-open {
        overflow: hidden;
    }

    .app-layout {
        display: block;
        min-height: 100vh;
    }

    .mobile-menu-button {
        display: inline-grid;
        place-items: center;
    }

    .sidebar {
        position: fixed;
        z-index: 1001;
        top: 0;
        left: 0;
        bottom: 0;

        width: min(320px, 86vw);
        height: 100vh;

        display: flex;
        flex-direction: column;

        transform: translateX(-105%);
        transition: transform .22s ease;

        overflow-y: auto;
        overflow-x: hidden;

        box-shadow: 18px 0 50px rgba(0, 0, 0, .22);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        z-index: 1000;
        inset: 0;
        display: block;

        background: rgba(5, 20, 26, .52);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transition:
            opacity .2s ease,
            visibility .2s ease;
    }

    .sidebar-overlay.is-visible {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .sidebar-brand {
        padding: 24px 22px 18px;
    }

    .nav-section {
        display: block;
        overflow: visible;
        padding: 8px 12px 18px;
    }

    .nav-title {
        display: block;
        padding-top: 16px;
    }

    .nav-link {
        display: flex;
        width: 100%;
        margin: 3px 0;
        white-space: normal;
    }

    .sidebar-footer {
        display: block;
    }

    .content-shell {
        width: 100%;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 900;

        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 12px;

        padding: 12px 14px;
    }

    .page-context {
        min-width: 0;
    }

    .page-title {
        font-size: 1.08rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .page-subtitle {
        display: none;
    }

    .user-zone {
        gap: 8px;
    }

    .user-badge {
        display: none;
    }

    .button-secondary {
        min-height: 40px;
        padding: 8px 12px;
        font-size: .86rem;
    }

    .main {
        width: min(100% - 24px, 1400px);
        margin: 18px auto 36px;
    }

    .welcome {
        padding: 20px;
    }

    .welcome h1 {
        font-size: 1.45rem;
    }

    .status-pill {
        align-self: flex-start;
    }
}

/* =========================================================
   ADMIN CORE
   ========================================================= */

select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #bdcdd2;
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

select:focus {
    outline: 3px solid rgba(45, 146, 163, .17);
    border-color: var(--cyan);
}

.admin-form-card {
    margin-bottom: 20px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.section-heading h2 {
    margin: 0;
    color: var(--navy);
    font-size: 1.1rem;
}

.section-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: .84rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

.button-auto {
    width: auto;
}

.flash {
    padding: 13px 15px;
    margin: 0 0 18px;
    border-radius: 10px;
    font-weight: 650;
}

.flash-success {
    background: #edf8f2;
    border: 1px solid #bddfca;
    color: #236a49;
}

.flash-error {
    background: #fff1ef;
    border: 1px solid #efc4bd;
    color: #91352c;
}

.admin-list {
    display: grid;
    gap: 12px;
}

.admin-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 17px 18px;
    border: 1px solid #e1eaec;
    border-radius: 12px;
    background: #fbfdfd;
}

.admin-list-main {
    min-width: 0;
}

.admin-list-main strong {
    display: block;
    color: var(--navy);
}

.admin-list-main > span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: .85rem;
}

.admin-list-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-form select {
    min-width: 135px;
    min-height: 40px;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eaf1f3;
    color: #466069;
    font-size: .72rem;
    font-weight: 700;
}

.tag-warning {
    background: #fff3db;
    color: #8a5b12;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: .73rem;
    font-weight: 800;
}

.status-active {
    background: #eaf7ef;
    color: #227047;
}

.status-draft {
    background: #edf2f4;
    color: #61757c;
}

.status-suspended {
    background: #fff3db;
    color: #8a5b12;
}

.status-disabled,
.status-archived,
.status-closed {
    background: #f6e9e7;
    color: #8f3d35;
}

@media (max-width: 760px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .admin-list-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-list-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .inline-form {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .inline-form select,
    .inline-form button {
        width: 100%;
    }

    .button-auto {
        width: 100%;
    }
}

/* =========================================================
   ATELIER MISSIONS
   ========================================================= */

.mission-admin-list,
.steps-admin-list {
    display: grid;
    gap: 10px;
}

.mission-admin-item,
.step-admin-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;

    padding: 16px 18px;

    border: 1px solid var(--border);
    border-radius: 13px;

    background: #fbfdfd;
}

.mission-admin-item:hover,
.step-admin-item:hover {
    border-color: #aac8cf;
    background: #f4f9fa;
}

.mission-code,
.step-order {
    min-width: 52px;
    padding: 7px 9px;

    border-radius: 8px;

    background: var(--navy);
    color: #fff;

    font-weight: 850;
    text-align: center;
}

.mission-admin-main strong,
.step-admin-item strong {
    display: block;
    color: var(--navy);
}

.mission-admin-main > span,
.step-admin-item div > span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: .84rem;
}

.mission-arrow {
    color: var(--cyan);
    font-size: 1.8rem;
}

.mission-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;

    margin-bottom: 16px;
}

.mission-code-large {
    display: inline-flex;
    align-items: center;

    margin-right: 8px;
    padding: 5px 10px;

    border-radius: 7px;

    background: var(--navy);
    color: #fff;

    font-weight: 850;
}

.button-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 9px 14px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: #fff;
    color: var(--navy);

    font-weight: 750;
}

.mission-tabs {
    display: flex;
    gap: 5px;
    overflow-x: auto;

    margin-bottom: 20px;
    padding: 5px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: #eaf1f3;
}

.mission-tab {
    flex: 0 0 auto;

    padding: 9px 13px;

    border-radius: 8px;

    color: #506870;

    font-size: .83rem;
    font-weight: 750;
}

.mission-tab.active {
    background: #fff;
    color: var(--navy);
    box-shadow: 0 3px 10px rgba(16,47,56,.08);
}

.editor-card {
    margin-bottom: 18px;
}

.editor-card h2,
.page-card > h2 {
    margin-top: 0;
    color: var(--navy);
    font-size: 1.08rem;
}

.code-editor {
    width: 100%;
    min-height: 340px;
    margin: 14px 0 18px;
    padding: 14px;

    border: 1px solid #bdcdd2;
    border-radius: 10px;

    background: #12282f;
    color: #deedf0;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: .84rem;
    line-height: 1.55;

    tab-size: 4;
}

.field-small {
    max-width: 260px;
}

.readiness-list {
    margin-top: 20px;
}

.readiness-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;

    padding: 12px 0;

    border-bottom: 1px solid #edf2f3;
}

.publication-note {
    margin-top: 22px;
}

.step-meta {
    display: flex;
    align-items: center;
    gap: 16px;

    margin-bottom: 20px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin: 0;
}

.checkbox-label input {
    width: auto;
    min-height: 0;
}

.back-link {
    display: inline-block;
    margin-bottom: 22px;

    color: var(--petrol);
    font-weight: 750;
}

/* PREVIEW APPRENANT */

.preview-body {
    background: #edf3f4;
}

.learner-preview {
    width: min(900px, calc(100% - 32px));
    margin: 30px auto 60px;
}

.preview-banner {
    margin-bottom: 14px;
    padding: 9px 14px;

    border-radius: 9px;

    background: #fff0cf;
    color: #805314;

    font-size: .76rem;
    font-weight: 850;
    letter-spacing: .06em;
    text-align: center;
}

.preview-header,
.preview-rich,
.preview-step {
    background: #fff;
    border: 1px solid var(--border);
}

.preview-header {
    padding: 30px;
    border-radius: 18px;
}

.preview-header h1 {
    margin: 14px 0 6px;
    color: var(--navy);
}

.preview-header p {
    margin: 0;
    color: var(--muted);
}

.preview-rich {
    margin-top: 16px;
    padding: 24px;

    border-radius: 14px;

    line-height: 1.65;
}

.preview-rich h2,
.preview-rich h3,
.preview-rich h4 {
    color: var(--navy);
}

.preview-steps {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.preview-step {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 18px;

    padding: 22px;

    border-radius: 15px;
}

.preview-step-number {
    display: grid;
    place-items: center;

    width: 42px;
    height: 42px;

    border-radius: 50%;

    background: var(--navy);
    color: #fff;

    font-weight: 850;
}

.preview-step h2 {
    margin: 9px 0 10px;
    color: var(--navy);
}

.preview-instructions {
    margin-top: 12px;
    padding: 15px 17px;

    border-left: 4px solid var(--cyan);

    background: #eef7f8;
    border-radius: 8px;

    line-height: 1.6;
}

@media (max-width: 760px) {
    .mission-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .button-link {
        justify-content: center;
    }

    .preview-step {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   GROUND TRUTH GUIDE
   ========================================================= */

.gt-intro,
.gt-card {
    margin-bottom: 16px;
}

.gt-intro p {
    max-width: 900px;
    line-height: 1.6;
}

.gt-example {
    margin-top: 7px !important;
    color: var(--petrol) !important;
    font-style: italic;
}

.gt-repeater-list {
    display: grid;
    gap: 9px;
    margin-bottom: 11px;
}

.gt-repeater-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
}

.gt-remove-button {
    padding: 8px 12px;

    border: 1px solid #eccbc6;
    border-radius: 9px;

    background: #fff6f4;
    color: #943d34;

    font-weight: 700;
}

.gt-add-button {
    width: auto;
}

.gt-textarea {
    width: 100%;
    min-height: 150px;
    margin-top: 14px;
    padding: 13px;

    resize: vertical;

    border: 1px solid #bdcdd2;
    border-radius: 10px;

    background: #fff;
    color: var(--text);

    font: inherit;
    line-height: 1.55;
}

.gt-textarea-small {
    min-height: 100px;
}

.gt-textarea:focus {
    outline: 3px solid rgba(45, 146, 163, .17);
    border-color: var(--cyan);
}

.gt-advanced summary {
    cursor: pointer;

    color: var(--navy);

    font-weight: 800;
}

.gt-json-preview {
    max-height: 430px;
    overflow: auto;

    margin-top: 16px;
    padding: 16px;

    border-radius: 10px;

    background: #11282f;
    color: #dcebee;

    white-space: pre-wrap;
    word-break: break-word;

    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: .8rem;
    line-height: 1.5;
}

@media (max-width: 760px) {
    .gt-repeater-row {
        grid-template-columns: 1fr;
    }

    .gt-remove-button,
    .gt-add-button {
        width: 100%;
    }
}

/* =========================================================
   GROUND TRUTH METIER + CRITERES
   ========================================================= */

.truth-catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.truth-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 11px;

    margin: 0;
    padding: 14px;

    border: 1px solid #dce7e9;
    border-radius: 11px;

    background: #fbfdfd;

    cursor: pointer;
}

.truth-option:has(input:checked) {
    border-color: #8fc1ca;
    background: #f0f8f9;
}

.truth-option input {
    width: auto;
    min-height: 0;
    margin-top: 3px;
}

.truth-option-content strong {
    display: block;
    color: var(--navy);
}

.truth-option-content > span {
    display: block;

    margin-top: 5px;

    color: var(--muted);

    font-size: .8rem;
    line-height: 1.45;
}

.truth-option-content em {
    display: inline-block;

    margin-top: 9px;
    padding: 3px 7px;

    border-radius: 999px;

    background: #e6f3f5;
    color: var(--petrol);

    font-size: .7rem;
    font-style: normal;
    font-weight: 750;
}

.criteria-section {
    margin-top: 22px;
}

.criteria-list {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.criterion-card {
    padding: 18px;

    border: 1px solid #dce7e9;
    border-radius: 13px;

    background: #fbfdfd;
}

.criterion-description {
    width: 100%;
    min-height: 90px;

    padding: 11px;

    resize: vertical;

    border: 1px solid #bdcdd2;
    border-radius: 10px;

    background: #fff;

    font: inherit;
    line-height: 1.5;
}

.criterion-settings {
    display: grid;
    grid-template-columns:
        minmax(190px, .8fr)
        140px
        auto;

    gap: 14px;
    align-items: end;
}

.criterion-required {
    min-height: 46px;
}

.evaluation-explanation {
    margin-top: 4px;
    padding: 10px 12px;

    border-radius: 9px;

    background: #eef4f5;
    color: #526a72;

    font-size: .78rem;
}

.evaluation-explanation strong {
    margin-right: 5px;

    color: var(--navy);
}

@media (max-width: 900px) {
    .truth-catalog-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .criterion-settings {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   CATALOGUE GROUND TRUTH - LISIBILITE
   ========================================================= */

.catalog-subtitle {
    margin: 2px 0 11px;

    color: var(--petrol);

    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.catalog-other {
    margin-top: 16px;
    padding: 13px 15px;

    border: 1px dashed #bdd0d4;
    border-radius: 11px;

    background: #f8fbfc;
}

.catalog-other summary {
    cursor: pointer;

    color: var(--navy);

    font-weight: 800;
}

.catalog-other[open] summary {
    margin-bottom: 12px;
}

.catalog-other .truth-catalog-grid {
    margin-top: 12px;
}

/* =========================================================
   CENTRE D'AIDE
   ========================================================= */

.help-hero {
    margin-bottom: 20px;
    padding: 28px 30px;

    border-radius: 17px;

    background:
        linear-gradient(
            135deg,
            var(--navy),
            #175d68
        );

    color: #fff;
}

.help-eyebrow {
    display: block;

    margin-bottom: 9px;

    color: #b9dce2;

    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .12em;
}

.help-hero h1 {
    margin: 0 0 8px;

    font-size: 1.65rem;
}

.help-hero p {
    max-width: 720px;

    margin: 0;

    color: #d9eaed;

    line-height: 1.55;
}

.help-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;
}

.help-card {
    display: grid;
    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto;

    align-items: center;
    gap: 15px;

    padding: 20px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: #fff;

    transition:
        transform .12s ease,
        border-color .12s ease,
        box-shadow .12s ease;
}

.help-card:hover {
    transform: translateY(-2px);

    border-color: #9ec6cd;

    box-shadow:
        0 8px 25px rgba(17, 56, 65, .08);
}

.help-card-icon {
    display: grid;
    place-items: center;

    width: 42px;
    height: 42px;

    border-radius: 11px;

    background: #e9f4f5;
    color: var(--petrol);

    font-size: 1.2rem;
    font-weight: 850;
}

.help-card h2 {
    margin: 0;

    color: var(--navy);

    font-size: 1rem;
}

.help-card p {
    margin: 5px 0 0;

    color: var(--muted);

    font-size: .81rem;
    line-height: 1.45;
}

.help-article {
    max-width: 1000px;
}

.help-rich-content {
    line-height: 1.7;
}

.help-rich-content h2 {
    margin-top: 26px;
    margin-bottom: 10px;

    color: var(--navy);

    font-size: 1.35rem;
}

.help-rich-content h3 {
    margin-top: 24px;
    margin-bottom: 8px;

    color: var(--petrol);

    font-size: 1.05rem;
}

.help-rich-content p {
    max-width: 860px;
}

.help-rich-content li {
    margin: 5px 0;
}

.help-rich-content code {
    padding: 2px 5px;

    border-radius: 5px;

    background: #edf2f3;

    font-family: monospace;
}

@media (max-width: 760px) {
    .help-grid {
        grid-template-columns: 1fr;
    }

    .help-hero {
        padding: 22px;
    }
}


/* =========================================================
   ASSURLAB - APERCU APPRENANT
   ========================================================= */

.learner-preview-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 52px;
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: #7c2d12;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.learner-preview-bar form {
    margin: 0;
}

.learner-preview-bar .button {
    margin: 0;
}

.learner-progress {
    margin-top: 0.75rem;
}

.learner-progress progress {
    width: 100%;
    max-width: 420px;
}

.learner-progress-value {
    margin-left: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.learner-mission-progress {
    width: 100%;
    margin-bottom: 1.5rem;
}

.learner-step-title {
    margin-top: 1rem;
}

.learner-step-instructions {
    margin-top: 1.25rem;
}

.learner-step-form {
    margin-top: 1.5rem;
}

.learner-preview-identity {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
}

.learner-preview-identity strong {
    font-size: 0.85rem;
}

.learner-preview-identity span {
    margin-top: 0.2rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.7;
}

@media (max-width: 760px) {
    .learner-preview-bar {
        justify-content: space-between;
        font-size: 0.8rem;
    }
}


/* Aperçu apprenant : le bandeau est extérieur à la grille principale. */
.learner-preview-bar + .app-layout {
    min-height: calc(100vh - 52px);
}

.learner-preview-bar .button {
    background: #fff;
    color: #7c2d12;
    border-color: rgba(255, 255, 255, 0.75);
}

.learner-preview-bar .button:hover {
    background: #fff7ed;
}


/* =========================================================
   ASSURLAB - SIDEBAR / HAUTEUR ECRAN
   Le footer reste toujours visible.
   ========================================================= */

.sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.nav-section {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.sidebar-footer {
    flex: 0 0 auto;
    margin-top: auto;
}


/* Avec le bandeau d'aperçu, la grille utilise uniquement
   la hauteur restante de la fenêtre. */
.learner-preview-bar + .app-layout {
    height: calc(100dvh - 52px);
    min-height: 0;
}

.learner-preview-bar + .app-layout .sidebar {
    height: 100%;
    min-height: 0;
}


/* Sans aperçu : la sidebar occupe normalement tout l'écran. */
body:not(:has(.learner-preview-bar)) .app-layout {
    min-height: 100dvh;
}


/* =========================================================
   ASSURLAB - REPONSES ET REVUE DE MISSION
   ========================================================= */

.learner-response-field {
    padding: 1.25rem;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 14px;
    background: rgba(15, 118, 110, 0.035);
}

.learner-response-help {
    margin: 0.35rem 0 0.8rem;
    font-size: 0.85rem;
    opacity: 0.72;
}

.learner-response-textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    resize: vertical;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 10px;
    background: #fff;
    font: inherit;
    line-height: 1.55;
}

.learner-response-textarea:focus {
    outline: 2px solid rgba(15, 118, 110, 0.22);
    outline-offset: 2px;
    border-color: rgba(15, 118, 110, 0.65);
}

.learner-review-score {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.learner-review-score strong {
    font-size: 1.4rem;
}

.learner-review-score span {
    font-size: 0.72rem;
    opacity: 0.65;
}

.learner-review-step {
    margin-top: 1rem;
    padding: 1.25rem;
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.65);
}

.learner-review-step-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.learner-review-step-header h3 {
    margin: 0.45rem 0 0;
}

.learner-review-prompt,
.learner-review-answer,
.learner-review-feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
}

.learner-review-prompt {
    background: rgba(15, 23, 42, 0.035);
}

.learner-review-answer {
    background: rgba(15, 118, 110, 0.07);
    border-left: 4px solid rgba(15, 118, 110, 0.65);
}

.learner-review-answer p,
.learner-review-feedback p {
    margin-bottom: 0;
}

.learner-review-feedback {
    background: rgba(217, 119, 6, 0.08);
}

.learner-review-empty {
    margin-top: 1rem;
    font-style: italic;
    opacity: 0.62;
}

.learner-review-done {
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.7;
}

.learner-review-correction {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: 14px;
    border: 1px solid rgba(15, 118, 110, 0.2);
    background: rgba(15, 118, 110, 0.05);
}


/* =========================================================
   ASSURLAB - CHOIX PEDAGOGIQUES
   ========================================================= */

.learner-choice-group {
    margin-top: 1.25rem;
    padding: 1rem;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 14px;
    background: rgba(15, 118, 110, 0.035);
}

.learner-choice-group legend {
    padding: 0 .35rem;
    font-weight: 700;
}

.learner-choice {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-top: .65rem;
    padding: .8rem .9rem;
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    cursor: pointer;
}

.learner-choice:hover {
    border-color: rgba(15, 118, 110, 0.35);
    background: rgba(15, 118, 110, 0.045);
}

.learner-choice input {
    margin-top: .2rem;
    flex: 0 0 auto;
}

.learner-choice span {
    line-height: 1.45;
}


/* =========================================================
   ASSURLAB 027 - QCM & EDITEUR AUTO-EVALUATION
   ========================================================= */

.learner-choice {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: .85rem !important;
    min-height: 0 !important;
    width: 100%;
    padding: .85rem 1rem !important;
}

.learner-choice input[type="radio"],
.learner-choice input[type="checkbox"] {
    display: inline-block !important;
    flex: 0 0 18px !important;
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    padding: 0 !important;
    margin: 0 !important;
}

.learner-choice span {
    display: block !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
}

.response-admin-card {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    border: 1px solid rgba(15,118,110,.2);
    border-radius: 14px;
    background: rgba(15,118,110,.035);
}

.response-admin-section {
    margin-top: 1.4rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(15,23,42,.08);
}

.response-option-row {
    display: grid;
    grid-template-columns: 24px minmax(0,1fr) auto;
    align-items: center;
    gap: .75rem;
    margin-top: .6rem;
}

.response-option-row input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    padding: 0 !important;
    margin: 0 !important;
}

.response-number-grid {
    display: grid;
    grid-template-columns:
        repeat(2,minmax(0,1fr));
    gap: 1rem;
}

@media (max-width: 760px) {
    .response-number-grid {
        grid-template-columns: 1fr;
    }

    .response-option-row {
        grid-template-columns: 24px minmax(0,1fr);
    }

    .response-option-row .small {
        grid-column: 2;
    }
}


/* =========================================================
   ASSURLAB 028 - COCKPIT DIFFUSION
   ========================================================= */

.publication-legend {
    display: grid;
    grid-template-columns:
        repeat(auto-fit,minmax(180px,1fr));
    gap: .75rem;
    margin-top: 1rem;
}

.publication-legend > div {
    padding: .8rem;
    border-radius: 10px;
    background: rgba(15,23,42,.035);
}

.publication-legend strong,
.publication-legend span {
    display: block;
}

.publication-legend span {
    margin-top: .25rem;
    font-size: .82rem;
    opacity: .72;
}

.publication-cohort-form {
    margin-top: 1.25rem;
    max-width: 540px;
}

.publication-card {
    margin-top: 1rem;
}

.publication-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.publication-card-head h2 {
    margin: .65rem 0 .25rem;
}

.publication-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    padding: .75rem 0;
    border-top: 1px solid rgba(15,23,42,.07);
    border-bottom: 1px solid rgba(15,23,42,.07);
    font-size: .86rem;
}

.publication-grid {
    display: grid;
    grid-template-columns:
        repeat(2,minmax(0,1fr));
    gap: 1rem;
}

.publication-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin-top: 1rem;
}

.status-scheduled {
    background: rgba(217,119,6,.13);
}

.status-closed {
    background: rgba(71,85,105,.13);
}

.status-archived {
    background: rgba(100,116,139,.13);
}

@media (max-width: 760px) {
    .publication-grid {
        grid-template-columns: 1fr;
    }

    .publication-card-head {
        flex-direction: column;
    }
}


/* =========================================================
   ASSURLAB 029 - DATA EXPLORER
   ========================================================= */

.data-explorer {
    margin-top: 1.5rem;
    padding: 1.2rem;
    border: 1px solid rgba(15,118,110,.22);
    border-radius: 16px;
    background: rgba(15,118,110,.025);
}

.data-explorer-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.data-explorer-head h3 {
    margin: .25rem 0;
    font-size: 1.25rem;
}

.data-explorer-head p {
    margin: 0;
}

.data-eyebrow {
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .09em;
    opacity: .6;
}

.data-kpi-grid {
    display: grid;
    grid-template-columns:
        repeat(4,minmax(120px,1fr));
    gap: .7rem;
    margin-top: 1rem;
}

.data-kpi {
    padding: .85rem;
    border-radius: 12px;
    background: rgba(255,255,255,.8);
    border: 1px solid rgba(15,23,42,.07);
}

.data-kpi span,
.data-kpi strong {
    display: block;
}

.data-kpi span {
    font-size: .76rem;
    opacity: .68;
}

.data-kpi strong {
    margin-top: .2rem;
    font-size: 1.2rem;
}

.data-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.data-search-label {
    flex: 1 1 520px;
    max-width: 700px;
    font-weight: 650;
}

.data-search-label input {
    display: block;
    width: 100%;
    margin-top: .4rem;
}

.data-table-wrap {
    width: 100%;
    max-height: 520px;
    margin-top: 1rem;
    overflow: auto;
    border: 1px solid rgba(15,23,42,.1);
    border-radius: 12px;
    background: white;
}

.data-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
}

.data-table th,
.data-table td {
    padding: .62rem .72rem;
    text-align: left;
    border-right: 1px solid rgba(15,23,42,.055);
    border-bottom: 1px solid rgba(15,23,42,.07);
    white-space: nowrap;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    cursor: pointer;
    user-select: none;
    background: #f7faf9;
    font-weight: 750;
}

.data-table th:hover {
    background: #edf5f3;
}

.data-table tbody tr:hover {
    background: rgba(15,118,110,.045);
}

.data-table tbody tr[hidden] {
    display: none;
}

.data-sort-icon {
    margin-left: .25rem;
    opacity: .4;
}

.data-security-note {
    display: flex;
    gap: .55rem;
    margin-top: .9rem;
    padding: .75rem .85rem;
    border-radius: 10px;
    background: rgba(15,23,42,.035);
    font-size: .78rem;
}

.data-security-note span {
    opacity: .74;
}

.data-limit-note {
    margin-top: .7rem;
}

@media (max-width: 900px) {
    .data-kpi-grid {
        grid-template-columns:
            repeat(2,minmax(120px,1fr));
    }

    .data-explorer-head,
    .data-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 520px) {
    .data-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
}


/* =========================================================
   ASSURLAB 030c - NAVIGATION ETAPES
   ========================================================= */

.learner-step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .65rem;
    margin: .85rem 0 1.15rem;
}

.learner-step-navigation-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .65rem;
    margin-left: auto;
}

.learner-number-field {
    margin-top: 1rem;
}

.learner-number-field input {
    width: min(320px, 100%);
    font-size: 1.05rem;
    font-weight: 650;
}

@media (max-width: 640px) {
    .learner-step-navigation,
    .learner-step-navigation-right {
        align-items: stretch;
        flex-direction: column;
    }

    .learner-step-navigation-right {
        width: 100%;
        margin-left: 0;
    }
}


/* =========================================================
   ASSURLAB 030e - PERFORMANCE
   ========================================================= */

.learner-performance-box {
    display: flex;
    gap: .65rem;
    margin: .75rem 0 1rem;
}

.learner-performance-box > div {
    min-width: 130px;
    padding: .65rem .8rem;
    border-radius: 10px;
    background: rgba(15,23,42,.04);
    border: 1px solid rgba(15,23,42,.07);
}

.learner-performance-box span,
.learner-performance-box strong {
    display: block;
}

.learner-performance-box span {
    font-size: .72rem;
    opacity: .68;
}

.learner-performance-box strong {
    margin-top: .15rem;
    font-size: 1rem;
}


/* =========================================================
   ASSURLAB 030h - CORRECTION / ABANDON / VALIDATION PROF
   ========================================================= */

.learner-abandon-form {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(15,23,42,.08);
}

.learner-abandon-warning {
    margin: .55rem 0 0;
    font-size: .84rem;
    opacity: .78;
}

.button-danger-secondary {
    appearance: none;
    border: 1px solid rgba(185,28,28,.34);
    border-radius: 9px;
    background: transparent;
    padding: .65rem .9rem;
    cursor: pointer;
    font: inherit;
}

.teacher-validation-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .65rem;
    margin: 1rem 0;
    padding: .85rem;
    border: 1px dashed rgba(8,145,178,.35);
    border-radius: 10px;
}

.learner-correction-card {
    margin-top: 1.2rem;
    padding: 1.1rem;
    border-radius: 12px;
    border: 1px solid rgba(5,150,105,.22);
    background: rgba(5,150,105,.04);
}

.learner-correction-card h3 {
    margin-top: 1rem;
    margin-bottom: .3rem;
}

.teacher-correction-note {
    margin-top: 1rem;
    padding: .85rem;
    border-radius: 9px;
    border: 1px dashed rgba(8,145,178,.35);
}
