/* ===================================
   FORMALEO - Styles
   =================================== */

:root {
    /* === CHARTE FORMALEO === */
    --bleu-nuit: #053e8b;         /* Bleu royal FORMALEO (logo) */
    --bleu-nuit-light: #0b55c4;   /* Bleu moyen */
    --bleu-cerulean: #1a6bc9;     /* Bleu interactif (focus, actif) */
    --primary: #053e8b;           /* Couleur principale (tabs, badges) */
    --primary-light: #ddeaf7;     /* Fond bleu clair */
    --ocre-jaune: #f68712;        /* Orange FORMALEO */
    --ocre-dark: #e0720a;         /* Orange foncé (hover) */
    --white: #ffffff;
    --gris-light: #f5f7fa;
    --gris-border: #e0e4eb;
    --gris-text: #4a5568;
    --text-muted: #9ca3af;
    --vert: #2d7a3a;
    --vert-light: #e8f5e9;
    --rouge: #c0392b;
    --rouge-light: #fdecea;
    --orange: #f68712;            /* Orange FORMALEO (même que ocre-jaune) */
    --orange-light: #fff3e0;      /* Fond orange clair */
    --sidebar-width: 220px;
    --navbar-height: 60px;
    --shadow: 0 2px 8px rgba(5,62,139,0.12);
    --shadow-md: 0 4px 16px rgba(5,62,139,0.18);
    --radius: 10px;
    --radius-sm: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    background: var(--gris-light);
    color: var(--gris-text);
    font-size: 14px;
    line-height: 1.5;
}

/* ===== PAGES ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== LOGIN ===== */
.login-bg {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bleu-nuit) 0%, var(--bleu-cerulean) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 20px;
    padding: 0;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.login-logo {
    text-align: center;
    padding: 36px 32px 20px;
    margin-bottom: 0;
}

.login-logo-img {
    width: 100%;
    max-width: 340px;
    height: auto;
    display: inline-block;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(5,62,139,0.25);
}

.login-container .login-tabs,
.login-container .login-form,
.login-container #loginError,
.login-container .login-subtitle {
    padding-left: 40px;
    padding-right: 40px;
}

.login-container .login-tabs {
    padding-top: 8px;
    margin-bottom: 20px;
}

.login-container .login-form {
    padding-bottom: 36px;
}

.login-container .login-form.active {
    display: block;
}

.login-form label {
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--bleu-nuit);
}

.login-form .btn-primary {
    background: var(--ocre-jaune);
    border-color: var(--ocre-jaune);
}

.login-form .btn-primary:hover {
    background: var(--ocre-dark);
    border-color: var(--ocre-dark);
}

.logo {
    max-height: 70px;
    margin-bottom: 10px;
}

.brand-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--bleu-nuit);
    text-transform: uppercase;
}

.brand-title span { color: var(--bleu-cerulean); }

.login-subtitle {
    text-align: center;
    color: var(--gris-text);
    margin-bottom: 24px;
    font-size: 13px;
}

.login-tabs {
    display: flex;
    border-bottom: 2px solid var(--gris-border);
    margin-bottom: 24px;
}

.login-tab {
    flex: 1;
    padding: 12px 10px;
    border: none;
    background: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--gris-text);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.login-tab.active {
    color: var(--bleu-cerulean);
    border-bottom-color: var(--bleu-cerulean);
}

.login-form { display: none; }
.login-form.active { display: block; }

.info-box {
    background: var(--primary-light);
    border-left: 4px solid var(--bleu-cerulean);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--bleu-nuit);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    color: var(--bleu-nuit);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gris-border);
    border-radius: var(--radius-sm);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: var(--gris-text);
    background: white;
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--bleu-cerulean);
    box-shadow: 0 0 0 3px rgba(29,112,183,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    max-width: 500px;
}

/* ===== BOUTONS ===== */
.btn-primary {
    background: var(--orange);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover:not(:disabled) { background: var(--ocre-dark); }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
    background: var(--gris-light);
    color: var(--bleu-nuit);
    border: 1.5px solid var(--gris-border);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover { background: var(--gris-border); }

.btn-danger {
    background: var(--rouge);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-full { width: 100%; }

.btn-logout {
    background: transparent;
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--bleu-nuit);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-logo {
    height: 44px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.nav-logo { height: 32px; }

.nav-title {
    font-weight: 800;
    font-size: 16px;
    color: white;
    letter-spacing: 0.5px;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-username {
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    font-weight: 600;
}

.nav-role-badge {
    background: var(--ocre-jaune);
    color: var(--bleu-nuit);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ===== DASHBOARD LAYOUT ===== */
.dashboard-page {
    display: none;
    padding-top: var(--navbar-height);
    min-height: 100vh;
}

.dashboard-page.active { display: flex; }

.sidebar {
    width: var(--sidebar-width);
    min-height: calc(100vh - var(--navbar-height));
    background: white;
    border-right: 1px solid var(--gris-border);
    padding: 16px 0;
    flex-shrink: 0;
    position: fixed;
    top: var(--navbar-height);
    bottom: 0;
    overflow-y: auto;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--gris-text);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-btn:hover { background: var(--gris-light); color: var(--bleu-nuit); }
.sidebar-btn.active {
    background: var(--primary-light);
    color: var(--bleu-cerulean);
    border-left-color: var(--bleu-cerulean);
}

.sidebar-btn .icon { font-size: 16px; }

/* ═══ Toggle bascule admin FORMALEO / 2D+ ═══ */
.sidebar-toggle-space {
    display: flex; align-items: center; gap: 8px;
    width: calc(100% - 32px); margin: 4px 16px; padding: 10px 14px;
    background: rgba(246,135,18,0.08);
    border: 1px solid rgba(246,135,18,0.25);
    border-radius: 8px; cursor: pointer;
    font-size: 12px; font-weight: 700;
    color: #f68712; text-align: left;
    transition: all 0.2s;
}
.sidebar-toggle-space:hover {
    background: rgba(246,135,18,0.15);
    border-color: rgba(246,135,18,0.5);
}

/* ═══ Thème Admin 2D+ Formation ═══ */
body.admin2dplus-theme #admin2dplusPage .sidebar {
    background: #0c1f3f;
}
body.admin2dplus-theme #admin2dplusPage .sidebar-btn {
    color: rgba(255,255,255,0.7);
    border-left-color: transparent;
}
body.admin2dplus-theme #admin2dplusPage .sidebar-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
body.admin2dplus-theme #admin2dplusPage .sidebar-btn.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-left-color: #f68712;
}
body.admin2dplus-theme #admin2dplusPage .sidebar-toggle-space {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
}
body.admin2dplus-theme #admin2dplusPage .sidebar-toggle-space:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.sidebar-group-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #94a3b8;
    padding: 14px 20px 3px;
}
.sidebar-sep {
    border: none;
    border-top: 1px solid var(--gris-border);
    margin: 6px 14px;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 24px;
    min-height: calc(100vh - var(--navbar-height));
}

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

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--bleu-nuit);
}

/* ===== CARDS ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gris-border);
    transition: box-shadow 0.2s;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--bleu-nuit);
    margin-bottom: 6px;
}

.card-subtitle {
    font-size: 12px;
    color: var(--gris-text);
    margin-bottom: 12px;
}

.card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.badge-blue { background: var(--primary-light); color: var(--bleu-cerulean); }
.badge-green { background: var(--vert-light); color: var(--vert); }
.badge-red { background: var(--rouge-light); color: var(--rouge); }
.badge-orange { background: var(--orange-light); color: var(--orange); }
.badge-gold { background: #fef9e7; color: var(--ocre-dark); }
.badge-purple { background: #ede9fe; color: #6d28d9; }

/* Badges disponibilité intérimaire */
.badge-worker-available   { background: #d1fae5; color: #065f46; }
.badge-worker-on_mission  { background: #fef3c7; color: #92400e; }
.badge-worker-unavailable { background: #fee2e2; color: #991b1b; }

.card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.token-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ocre-jaune);
    color: var(--bleu-nuit);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 12px;
}

/* ===== STICKY ACTION BAR ===== */
.sticky-actions {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 12px 0;
    border-top: 1px solid var(--gris-border);
    margin-top: 16px;
    z-index: 10;
}

/* ===== TABLES ===== */
.table-container { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

th {
    background: var(--bleu-nuit);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background 0.15s;
}
th.sortable:hover {
    background: #1a2d5a;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gris-border);
    font-size: 13px;
    color: var(--gris-text);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gris-light); }

.score-cell {
    font-weight: 700;
    font-size: 14px;
}

.score-pass { color: var(--vert); }
.score-fail { color: var(--rouge); }

/* ===== FILTER BAR ===== */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    margin-left: auto;
    padding: 5px 14px;
    border: 1.5px solid var(--gris-border);
    border-radius: 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    min-width: 230px;
    outline: none;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--text-dark);
}
.search-input:focus {
    border-color: var(--bleu-cerulean);
    box-shadow: 0 0 0 3px rgba(30, 100, 200, 0.08);
}
.search-input::placeholder {
    color: #aab;
    font-weight: 400;
}

/* ===== CHECKBOX GROUP (habilitations stagiaire) ===== */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    background: #f8f9ff;
    border: 1.5px solid var(--gris-border);
    border-radius: 8px;
    min-height: 44px;
    align-items: center;
}
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: white;
    border: 1.5px solid var(--gris-border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}
.checkbox-group label:hover {
    border-color: var(--bleu-cerulean);
    background: #eef3ff;
}
.checkbox-group input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--bleu-cerulean);
    cursor: pointer;
}
.checkbox-group label:has(input:checked) {
    border-color: var(--bleu-cerulean);
    background: #e8f0fb;
    color: var(--bleu-cerulean);
    font-weight: 600;
}

.filter-btn {
    padding: 6px 16px;
    border: 1.5px solid var(--gris-border);
    border-radius: 20px;
    background: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--bleu-cerulean);
    color: white;
    border-color: var(--bleu-cerulean);
}

/* ===== QUIZ PAGE ===== */
.quiz-wrapper {
    min-height: 100vh;
    background: var(--gris-light);
    display: flex;
    flex-direction: column;
    padding-top: var(--navbar-height);
}

.quiz-header-bar {
    background: var(--bleu-nuit);
    border-bottom: 3px solid var(--ocre-jaune);
    padding: 12px 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.quiz-brand-logo {
    height: 36px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.quiz-info h2 {
    font-size: 16px;
    color: #fff;
    font-weight: 700;
}

.habilitation-badge {
    background: var(--ocre-jaune);
    color: var(--bleu-nuit);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.quiz-progress-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
}

.progress-bar-container {
    width: 200px;
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bleu-cerulean), var(--ocre-jaune));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.quiz-body {
    flex: 1;
    padding: 32px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.question-card {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    max-width: 700px;
    width: 100%;
    box-shadow: var(--shadow);
}

.question-text {
    font-size: 17px;
    font-weight: 700;
    color: var(--bleu-nuit);
    margin-bottom: 24px;
    line-height: 1.5;
}

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-option {
    padding: 14px 18px;
    border: 2px solid var(--gris-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.answer-option:hover {
    border-color: var(--bleu-cerulean);
    background: var(--primary-light);
}

.answer-option.selected {
    border-color: var(--bleu-cerulean);
    background: var(--primary-light);
    color: var(--bleu-nuit);
    font-weight: 700;
}

.answer-option .answer-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gris-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.answer-option.selected .answer-letter {
    background: var(--bleu-cerulean);
    color: white;
}

/* ── Timer quiz ──────────────────────────────────────────────────────────── */
.quiz-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 17px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #4b5563;
    background: #f3f4f6;
    padding: 5px 14px;
    border-radius: 20px;
    transition: color .3s, background .3s;
    white-space: nowrap;
}
.quiz-timer--warning {
    color: #92400e;
    background: #fef3c7;
}
.quiz-timer--danger {
    color: #dc2626;
    background: #fee2e2;
    animation: timerPulse 1s ease-in-out infinite;
}
@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.06); }
}

.quiz-footer {
    background: white;
    padding: 16px 32px;
    box-shadow: 0 -2px 8px rgba(16,44,104,0.08);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-submit {
    background: var(--vert);
}

.btn-submit:hover { background: #1e5c28; }

/* ===== RESULTS PAGE ===== */
.results-wrapper {
    min-height: 100vh;
    padding-top: var(--navbar-height);
    background: var(--gris-light);
}

.results-header {
    background: var(--bleu-nuit);
    padding: 24px 32px;
    color: white;
}

.results-header h2 { font-size: 20px; }
.results-header p { font-size: 14px; opacity: 0.8; margin-top: 4px; }

.score-display {
    background: white;
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 32px;
    box-shadow: var(--shadow);
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 6px solid var(--gris-border);
}

.score-circle.pass { border-color: var(--vert); }
.score-circle.fail { border-color: var(--rouge); }

.score-value {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
}

.score-label { font-size: 14px; }

.score-circle.pass .score-value { color: var(--vert); }
.score-circle.fail .score-value { color: var(--rouge); }

.score-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--bleu-nuit);
    margin-bottom: 6px;
}

.score-status {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 12px;
}

.score-status.pass { color: var(--vert); }
.score-status.fail { color: var(--rouge); }

.results-detail {
    padding: 24px 32px;
}

.result-item {
    background: white;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid var(--gris-border);
}

.result-item.correct { border-left-color: var(--vert); }
.result-item.incorrect { border-left-color: var(--rouge); }

.result-question {
    font-weight: 700;
    color: var(--bleu-nuit);
    margin-bottom: 8px;
    font-size: 14px;
}

.result-answer {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-answer.user-correct { background: var(--vert-light); color: var(--vert); }
.result-answer.user-wrong { background: var(--rouge-light); color: var(--rouge); }
.result-answer.correct-answer { background: #e8f5e9; color: var(--vert); font-weight: 600; }

.result-explanation {
    font-size: 12px;
    color: var(--bleu-cerulean);
    margin-top: 6px;
    font-style: italic;
}

/* ===== MODALES ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,20,50,0.5);
    z-index: 200;
}

.modal-overlay.active { display: block; }

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 300;
    box-shadow: var(--shadow-md);
}

.modal.active { display: block; }
.modal-large { max-width: 600px; }
.modal-xlarge { max-width: 1150px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gris-border);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--bleu-nuit);
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--gris-text);
    padding: 4px 8px;
    border-radius: 4px;
}

.modal-close:hover { background: var(--gris-light); }

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--gris-border);
}

/* ===== MODAL MON COMPTE — ONGLETS ===== */
.acc-tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}
.acc-tab-btn:hover { color: var(--primary); }
.acc-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

#modalClientAccount.active { display: flex !important; }
#modalClientAnalytics.active { display: flex !important; }

/* ===== MODAL PROFIL ADMIN — ONGLETS ===== */
.adm-tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}
.adm-tab-btn:hover { color: var(--primary); }
.adm-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
#modalAdminProfile.active { display: flex !important; }

/* ===== QUESTIONS MANAGER ===== */
.questions-manager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.questions-list-panel, .question-form-panel {
    max-height: 500px;
    overflow-y: auto;
}

.questions-list-panel h4, .question-form-panel h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bleu-nuit);
    margin-bottom: 12px;
    font-weight: 700;
}

.question-item {
    background: var(--gris-light);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.question-item-text { flex: 1; font-weight: 500; }

.question-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-icon:hover { background: var(--gris-border); }

.answers-inputs { display: flex; flex-direction: column; gap: 8px; }

.answer-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.answer-input-row input[type="text"] {
    flex: 1;
    padding: 8px 10px;
    border: 1.5px solid var(--gris-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
}

/* ===== TOKEN DISPLAY ===== */
.token-display {
    text-align: center;
    padding: 20px;
}

.token-code {
    font-size: 36px;
    font-weight: 800;
    color: var(--bleu-nuit);
    letter-spacing: 4px;
    background: var(--gris-light);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin: 12px 0;
    font-family: 'Courier New', monospace;
}

.token-password {
    font-size: 24px;
    font-weight: 700;
    color: var(--bleu-cerulean);
    margin-top: 4px;
}

.token-info {
    font-size: 12px;
    color: var(--gris-text);
    margin-top: 12px;
}

/* ===== SESSION DETAIL ===== */
.session-detail-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

/* ── Accordéon stagiaires ───────────────────────────────────────────────── */
.trainee-accordion { border-bottom: 1px solid #e2e8f0; }
.trainee-accordion:last-child { border-bottom: none; }

.acc-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; cursor: pointer; user-select: none;
    transition: background .1s;
}
.acc-header:hover { background: #f8fafc; }
.acc-left { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; flex-wrap: wrap; }
.acc-name { font-weight: 600; font-size: 15px; }
.acc-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.acc-chevron { font-size: 20px; color: #94a3b8; transition: transform .2s; flex-shrink: 0; margin-left: 4px; line-height: 1; }
.acc-body { padding: 4px 12px 12px; }

/* Badges statut titre (collapsed) */
.hab-status-dot {
    display: inline-flex; align-items: center; padding: 2px 8px;
    border-radius: 12px; font-size: 11px; font-weight: 700;
}
.hab-none   { background: #f1f5f9; color: #64748b; }
.hab-active { background: #fef3c7; color: #92400e; }
.hab-theory { background: #dbeafe; color: #1e40af; }
.hab-done   { background: #dcfce7; color: #15803d; }

/* Modifier nom inline */
.trainee-name-edit { gap: 6px; align-items: center; flex-wrap: wrap; padding: 0 16px 10px; }
.trainee-name-edit input { padding: 4px 8px; border: 1px solid #c7d2fe; border-radius: 4px; font-size: 14px; min-width: 110px; }

/* ── Blocs par titre dans l'accordéon ───────────────────────────────────── */
.session-hab-card {
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-left: 4px solid #cbd5e1;
    border-radius: 8px; padding: 10px 14px; margin-bottom: 8px;
}
.session-hab-card.shc-done   { border-left-color: #16a34a; }
.session-hab-card.shc-active { border-left-color: #f59e0b; }
.session-hab-card.shc-theory { border-left-color: #3b82f6; }
.shc-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shc-theory-status { font-size: 13px; color: #475569; flex: 1; }
.shc-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.shc-quiz-gen { margin-top: 8px; padding-top: 8px; border-top: 1px solid #e2e8f0; }

/* Case à cocher sélection multi-quiz */
.hab-checkbox-wrap {
    display: flex; align-items: center; cursor: pointer; flex-shrink: 0;
}
.hab-checkbox {
    width: 16px; height: 16px; cursor: pointer; accent-color: #4338ca;
    border-radius: 4px;
}

/* Sélecteur de quiz inline sous le header de la hab */
.shc-quiz-select {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-top: 8px; padding-top: 8px; border-top: 1px solid #e2e8f0;
}

/* Toolbar sélection globale de quiz (en-tête liste stagiaires) */
.session-quiz-toolbar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.sqt-label {
    font-size: 13px; color: #5b21b6; font-weight: 600; white-space: nowrap;
}

/* Footer de génération multi-quiz par stagiaire */
.acc-gen-footer {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 8px 0; padding: 10px 14px;
    background: linear-gradient(135deg, #f0f9ff, #eff6ff);
    border: 1px solid #bfdbfe; border-radius: 8px;
}
.gen-footer-info {
    font-size: 12px; color: #4338ca; font-weight: 500; flex: 1;
    min-width: 140px;
}

.btn-add-hab {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 8px; padding: 9px 14px; width: 100%;
    background: #f0f9ff; border: 1px dashed #93c5fd; border-radius: 6px;
    color: #0369a1; font-size: 13px; cursor: pointer;
}
.btn-add-hab:hover { background: #e0f2fe; }

.acc-add-hab-row {
    display: none; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 8px 10px; background: #f0f9ff;
    border: 1px dashed #93c5fd; border-radius: 6px; margin-top: 6px;
}

.btn-danger-outline {
    background: transparent; color: #dc2626;
    border: 1px solid #fca5a5; padding: 2px 7px;
    border-radius: 4px; cursor: pointer; font-size: 13px; line-height: 1.4;
}
.btn-danger-outline:hover { background: #fee2e2; }

/* ── Charte FORMALEO — espace formateur ─────────────────────────────── */
body.trainer-theme {
    --bleu-nuit: #053e8b;
    --bleu-nuit-light: #0b55c4;
    --bleu-cerulean: #1a6bc9;
    --primary: #053e8b;
    --primary-light: #ddeaf7;
    --ocre-jaune: #f68712;
    --ocre-dark: #e0720a;
    --shadow: 0 2px 8px rgba(5,62,139,0.12);
    --shadow-md: 0 4px 16px rgba(5,62,139,0.18);
}

/* Nav mobile : couleur active FORMALEO */
body.trainer-theme .tmn-btn.active { color: #1d70b7; }

/* ── Nav mobile formateur (bottom bar) ──────────────────────────────────── */
.trainer-mobile-nav { display: none; }

@media (max-width: 768px) {
    .trainer-mobile-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0;
        background: white; border-top: 1px solid #e2e8f0;
        z-index: 200; box-shadow: 0 -2px 8px rgba(0,0,0,.08);
    }
    .tmn-btn {
        flex: 1; display: flex; flex-direction: column; align-items: center;
        padding: 8px 4px 14px; border: none; background: transparent;
        cursor: pointer; color: #94a3b8; font-size: 11px; gap: 2px;
    }
    .tmn-btn.active { color: #4338ca; }
    .tmn-icon { font-size: 22px; line-height: 1.2; }
    #trainerPage .section-content { padding-bottom: 80px; }
    #trainerPage > .sidebar { display: none; }
    .acc-header { padding: 16px; }
    .btn-primary.btn-sm, .btn-secondary.btn-sm { padding: 10px 14px; font-size: 13px; min-height: 44px; }
    .shc-actions { width: 100%; margin-top: 8px; }
    .session-hab-card { padding: 12px; }
}

/* ── Mode projecteur (plein écran) ──────────────────────────────────────── */
#modalProjector { display: none; }
#modalProjector.open {
    display: flex; position: fixed; inset: 0; background: #0f172a;
    z-index: 9999; flex-direction: column; align-items: center; justify-content: center;
}
.projector-question { max-width: 900px; width: 100%; padding: 40px; color: white; text-align: center; }
.projector-q-number { font-size: 16px; color: #94a3b8; margin-bottom: 16px; }
.projector-q-text { font-size: 26px; font-weight: 600; line-height: 1.4; margin-bottom: 36px; }
.projector-answers { display: flex; flex-direction: column; gap: 10px; }
.projector-answer {
    padding: 16px 24px; border-radius: 10px; font-size: 19px;
    border: 2px solid #334155; background: #1e293b; text-align: left; transition: all .2s;
}
.projector-answer.proj-correct { border-color: #16a34a; background: #14532d; color: #86efac; }
.projector-answer.proj-wrong   { border-color: #dc2626; background: #450a0a; color: #fca5a5; }
.projector-nav { position: fixed; bottom: 32px; display: flex; gap: 16px; align-items: center; }
.projector-nav button {
    padding: 12px 28px; border-radius: 8px; font-size: 16px;
    cursor: pointer; background: #334155; color: white; border: none;
}
.projector-nav button:hover { background: #475569; }
.projector-close {
    position: fixed; top: 20px; right: 20px; background: #334155;
    border: none; color: white; font-size: 24px; padding: 8px 14px;
    border-radius: 8px; cursor: pointer; z-index: 10000;
}
.projector-progress { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); color: #94a3b8; font-size: 14px; }

.trainee-name { flex: 1; font-weight: 600; }

.status-chip {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.status-pending { background: var(--orange-light); color: var(--orange); }
.status-pass { background: var(--vert-light); color: var(--vert); }
.status-fail { background: var(--rouge-light); color: var(--rouge); }

/* ===== LOADING / EMPTY ===== */
.loading-state, .empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--gris-text);
}

.loading-state::before {
    content: '⏳';
    display: block;
    font-size: 32px;
    margin-bottom: 12px;
}

.empty-state::before {
    content: '📭';
    display: block;
    font-size: 32px;
    margin-bottom: 12px;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bleu-nuit);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    max-width: 300px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success { background: var(--vert); }
.toast.error { background: var(--rouge); }

/* ===== ERROR MSG ===== */
.error-msg {
    color: var(--rouge);
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
    min-height: 20px;
}

/* ===== EXPIRY ALERT ===== */
.expiry-list { display: flex; flex-direction: column; gap: 8px; }

.expiry-item {
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--orange-light);
    border-left: 4px solid var(--orange);
    font-size: 13px;
}

.expiry-item.urgent {
    background: var(--rouge-light);
    border-left-color: var(--rouge);
}

/* ===== INVITE LINK ===== */
.invite-link-box {
    background: var(--gris-light);
    border: 1.5px dashed var(--bleu-cerulean);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 8px;
}

.user-no-password {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--orange-light);
    color: var(--orange);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

/* ===== RÉPONSES DYNAMIQUES ===== */
.answer-field-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.answer-field-row input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--vert);
    flex-shrink: 0;
    cursor: pointer;
}
.answer-field-row .answer-text-input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid var(--gris-border);
    border-radius: 6px;
    font-size: 14px;
}
.answer-field-row .answer-text-input:focus {
    border-color: var(--bleu-cerulean);
    outline: none;
}
.answer-field-row .btn-remove-answer {
    background: none;
    border: none;
    color: var(--rouge, #e74c3c);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}
.answer-field-row .btn-remove-answer:hover { background: #fdecea; }

/* ===== LIGNES TABLEAU CLIQUABLES ===== */
.table-hover tbody tr.clickable-row {
    cursor: pointer;
    transition: background 0.15s;
}
.table-hover tbody tr.clickable-row:hover {
    background: var(--bleu-light, #e8f4fd);
}

/* ===== ÉVALUATION PRATIQUE ===== */
.eval-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 0 16px;
    border-bottom: 1px solid var(--gris-border);
    margin-bottom: 8px;
}
.eval-legend-item {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    border: 2px solid;
}
.eval-legend-item.rating-ts { color: #22a34a; border-color: #22a34a; background: #f0faf4; }
.eval-legend-item.rating-s  { color: #1a7fc1; border-color: #1a7fc1; background: #f0f7ff; }
.eval-legend-item.rating-ps { color: #e07b00; border-color: #e07b00; background: #fff8f0; }
.eval-legend-item.rating-i  { color: #c62828; border-color: #c62828; background: #fff0f0; }
.eval-legend-item.rating-na { color: #757575; border-color: #bdbdbd; background: #f5f5f5; }

.eval-grid-rows { display: flex; flex-direction: column; }
.eval-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-bottom: 1px solid var(--gris-border);
    transition: background 0.12s;
}
.eval-row:hover { background: var(--gris-light); }
.eval-criterion-text { flex: 1; font-size: 14px; }

.rating-group { display: flex; gap: 6px; flex-shrink: 0; }
.rating-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.15s;
    white-space: nowrap;
    user-select: none;
}
.rating-btn input[type="radio"] { display: none; }
.rating-btn.rating-ts { color: #22a34a; border-color: #22a34a; }
.rating-btn.rating-s  { color: #1a7fc1; border-color: #1a7fc1; }
.rating-btn.rating-ps { color: #e07b00; border-color: #e07b00; }
.rating-btn.rating-i  { color: #c62828; border-color: #c62828; }
.rating-btn.rating-na { color: #757575; border-color: #bdbdbd; font-size: 11px; }
.rating-btn.rating-ts:has(input:checked) { background: #22a34a; color: white; }
.rating-btn.rating-s:has(input:checked)  { background: #1a7fc1; color: white; }
.rating-btn.rating-ps:has(input:checked) { background: #e07b00; color: white; }
.rating-btn.rating-i:has(input:checked)  { background: #c62828; color: white; }
.rating-btn.rating-na:has(input:checked) { background: #9e9e9e; color: white; }

.eval-preview { min-height: 40px; }
.eval-result {
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}
.eval-result.pass { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.eval-result.fail { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

/* ===== RESPONSIVE ===== */

/* Hamburger et overlay — cachés par défaut */
.hamburger-btn { display: none; }
.mobile-sidebar-overlay { display: none; }
.mobile-account-icon { display: none; }

/* ─────────────────────────────────────────────────────────
   Tablette ET mobile (≤ 768px) : hamburger + sidebar overlay
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {

    /* ── Hamburger ── */
    .hamburger-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 40px;
        height: 40px;
        padding: 8px;
        background: rgba(255,255,255,0.1);
        border: 1px solid rgba(255,255,255,0.25);
        border-radius: var(--radius-sm);
        cursor: pointer;
        flex-shrink: 0;
    }
    .hamburger-btn span {
        display: block;
        height: 2px;
        background: white;
        border-radius: 2px;
        transition: all 0.25s;
    }
    body.sidebar-open .hamburger-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    body.sidebar-open .hamburger-btn span:nth-child(2) { opacity: 0; }
    body.sidebar-open .hamburger-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* ── Sidebar → overlay slide-in ── */
    .sidebar {
        left: 0;                        /* ancrage explicite */
        transform: translateX(-100%);
        width: 280px;
        z-index: 150;
        transition: transform 0.28s ease;
    }
    body.sidebar-open .sidebar { transform: translateX(0); }

    /* ── Backdrop ── */
    .mobile-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        top: var(--navbar-height);
        background: rgba(5,20,60,0.55);
        z-index: 140;
        animation: overlayFadeIn 0.25s ease;
    }
    body.sidebar-open .mobile-sidebar-overlay { display: block; }
    @keyframes overlayFadeIn { from { opacity: 0; } to { opacity: 1; } }

    /* ── Main content : plus de marge gauche ── */
    .main-content { margin-left: 0; }

    /* ── Grille simple colonne ── */
    .questions-manager { grid-template-columns: 1fr; }
    .form-row          { grid-template-columns: 1fr; }
    .quiz-header-bar   { flex-direction: column; align-items: flex-start; }
    .score-display     { flex-direction: column; align-items: center; text-align: center; }
}

/* ─────────────────────────────────────────────────────────
   Téléphone (≤ 480px) : ajustements d'interface supplémentaires
   ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {

    /* ── Navbar ── */
    .navbar      { padding: 0 12px; }
    .navbar-logo { height: 32px; }
    #btnClientAnalytics  { display: none !important; }
    /* Compte : masquer le nom, afficher icône seule */
    #btnClientAccountLabel { display: none !important; }
    .mobile-account-icon   { display: inline; font-size: 16px; }
    #btnClientAccount { padding: 6px 10px !important; }
    .btn-logout { padding: 5px 10px; font-size: 11px; }

    /* ── Main content ── */
    .main-content { padding: 16px 12px; }

    /* ── Section header ── */
    .section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .section-header h2 { font-size: 17px; }

    /* ── Cards ── */
    .cards-grid { grid-template-columns: 1fr; }

    /* ── Tables ── */
    .table-container { display: block; -webkit-overflow-scrolling: touch; }
    th, td { padding: 8px 10px; font-size: 12px; white-space: nowrap; }

    /* ── Filter bar ── */
    .filter-bar  { flex-wrap: wrap; gap: 6px; }
    .search-input { min-width: 0 !important; width: 100%; margin-left: 0; }

    /* ── Forms ── */
    .form-grid-4, .form-grid-2 { grid-template-columns: 1fr !important; }
    input[type="text"][style*="min-width"],
    div[style*="min-width: 200px"] { min-width: 0 !important; width: 100% !important; }

    /* ── Modales ── */
    .modal {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh;
        overflow-y: auto;
        padding: 16px;
    }
    .modal-xlarge, .modal-large { max-width: 95vw !important; }
    .acc-tab-btn, .adm-tab-btn  { padding: 10px; font-size: 12px; }
    #evalModalBody { max-height: 60vh !important; }

    /* ── Quiz ── */
    .quiz-body     { padding: 12px; }
    .question-card { padding: 16px; }
    .question-text { font-size: 15px; }
    .quiz-footer {
        padding: 12px 16px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    .quiz-footer .btn-secondary,
    .quiz-footer .btn-primary { flex: 1; min-width: 0; text-align: center; }

    /* ── Résultats quiz ── */
    .results-detail { padding: 16px; }

    /* ── Boutons flottants ── */
    #supportBtn  { bottom: 16px !important; right: 16px !important; width: 48px !important; height: 48px !important; font-size: 20px !important; }
    #aiChatBtn   { bottom: 76px !important; right: 16px !important; width: 48px !important; height: 48px !important; font-size: 18px !important; }
    #aiChatPanel { width: calc(100vw - 32px) !important; right: 16px !important; bottom: 136px !important; max-height: calc(100vh - 160px) !important; }

    /* ── Toast ── */
    .toast { right: 12px; left: 12px; bottom: 80px; max-width: none; }

    /* ── Bannière abonnement (inline-styled) ── */
    #subscriptionBanner {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 10px 12px !important;
        font-size: 12px !important;
    }

    /* ── Recherche par compétences (grid inline 300px 1fr) ── */
    #client-search > div[style] { display: flex !important; flex-direction: column !important; }

    /* ── Login ── */
    .login-container { padding: 24px 20px; }

    /* ── E-learning ── */
    #elSlideBody { padding: 16px !important; }

    /* ── Recherche mission agence — layout responsive ── */
    #client-mission > div > div[style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column !important;
    }
}

/* ══ Recherche de mission agence ══════════════════════════════════════════ */
/* Carte Leaflet — z-index bas pour ne pas passer sur les modales */
#missionMap { z-index: 1; }
/* Sur mobile : forcer la carte à pleine largeur */
@media (max-width: 768px) {
    #missionMap { height: 300px !important; }
}

/* ══════════════════════════════════════════════════════
   V1.04 — Espace Intérimaire
   ══════════════════════════════════════════════════════ */

/* Badges statut demandes */
.badge-pending    { background: #fef9c3; color: #a16207; }
.badge-inprogress { background: #dbeafe; color: #1e40af; }
.badge-done       { background: #dcfce7; color: #15803d; }
.badge-rejected   { background: #fee2e2; color: #b91c1c; }

/* Badge notification rouge (sidebar agence) */
.notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: auto;
}

/* Chat bubbles (agence, dans la SPA worker.html) */
.chat-container { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 16px; }
.chat-bubble { max-width: 70%; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.chat-bubble.worker { background: #f1f5f9; color: #1e293b; align-self: flex-end; border-radius: 12px 12px 2px 12px; }
.chat-bubble.agency { background: var(--primary); color: white; align-self: flex-start; border-radius: 12px 12px 12px 2px; }
.chat-meta { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* Stat cards (utilisé dans ARGALIS, monitoring) */
.stat-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px 20px; text-align: center; }
.stat-value { font-size: 28px; font-weight: 700; color: #1e293b; line-height: 1.2; }
.stat-label { font-size: 12px; color: #64748b; margin-top: 4px; }

/* ── Calendrier sessions formateur ──────────────────────────────────────── */
.cal-toolbar { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.btn-group { display: flex; }
.btn-group .btn-secondary { border-radius: 0; margin: 0; border-right: none; }
.btn-group .btn-secondary:first-child { border-radius: 6px 0 0 6px; }
.btn-group .btn-secondary:last-child  { border-radius: 0 6px 6px 0; border-right: 1px solid var(--border); }
.btn-group .btn-secondary.active { background: var(--primary); color: white; border-color: var(--primary); }

.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
#calTitle { font-weight: 600; font-size: 15px; color: var(--text); min-width: 220px; text-align: center; }

/* Vue mois */
.cal-month { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cal-month-header { background: var(--bg-alt, #f8fafc); font-size: 11px; font-weight: 700; text-align: center; padding: 8px 4px; color: var(--text-light); text-transform: uppercase; letter-spacing: .5px; }
.cal-day { min-height: 100px; border-top: 1px solid var(--border); border-right: 1px solid var(--border); padding: 6px; background: white; }
.cal-day:nth-child(7n) { border-right: none; }
.cal-day.other-month { background: #f8fafc; }
.cal-day.today .cal-day-num { background: var(--primary); color: white; border-radius: 50%; }
.cal-day-num { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 4px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.cal-session-pill { font-size: 11px; padding: 3px 7px; border-radius: 4px; margin-bottom: 3px; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; background: var(--primary); color: white; line-height: 1.3; }
.cal-session-pill:hover { opacity: .85; }
.cal-session-pill.status-pending     { background: #f59e0b; }
.cal-session-pill.status-in_progress { background: #3b82f6; }
.cal-session-pill.status-completed   { background: #10b981; }
.cal-session-pill.status-submitted   { background: #8b5cf6; }

/* Vue semaine */
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cal-week-header { background: var(--bg-alt, #f8fafc); padding: 10px 8px; text-align: center; border-right: 1px solid var(--border); }
.cal-week-header:last-child { border-right: none; }
.week-day-name { font-size: 11px; font-weight: 700; color: var(--text-light); text-transform: uppercase; }
.week-day-num  { font-size: 20px; font-weight: 700; color: var(--text); margin-top: 2px; }
.cal-week-header.today .week-day-num { color: var(--primary); }
.cal-week-col { min-height: 180px; padding: 8px 6px; border-top: 1px solid var(--border); border-right: 1px solid var(--border); background: white; }
.cal-week-col:last-child { border-right: none; }
.cal-week-card { background: #eef2ff; border-left: 3px solid var(--primary); border-radius: 4px; padding: 6px 8px; margin-bottom: 6px; cursor: pointer; font-size: 12px; }
.cal-week-card:hover { background: #e0e7ff; }
.wc-company { font-weight: 600; color: #3730a3; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wc-meta    { color: var(--text-light); font-size: 11px; margin-top: 2px; }
.cal-week-card.status-pending     { border-left-color: #f59e0b; background: #fffbeb; }
.cal-week-card.status-pending .wc-company { color: #92400e; }
.cal-week-card.status-in_progress { border-left-color: #3b82f6; background: #eff6ff; }
.cal-week-card.status-in_progress .wc-company { color: #1e40af; }
.cal-week-card.status-completed   { border-left-color: #10b981; background: #f0fdf4; }
.cal-week-card.status-completed .wc-company { color: #065f46; }
.cal-week-card.status-submitted   { border-left-color: #8b5cf6; background: #f5f3ff; }
.cal-week-card.status-submitted .wc-company { color: #4c1d95; }
/* Carte multi-jours (spanning consécutifs) */
.cal-week-multiday {
    border-left-width: 4px;
    border-radius: 6px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    position: relative;
}
.cal-week-multiday::after {
    content: '↔';
    position: absolute;
    top: 4px; right: 6px;
    font-size: 11px;
    color: #6366f1;
    opacity: 0.7;
}
.cal-week-multiday.status-in_progress { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); }
.cal-week-multiday.status-completed   { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); }
.cal-week-multiday.status-pending     { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); }

/* ── Calendrier semaine — demi-journées ────────────────────────────────────── */
/* ── Calendrier semaine : grille unique pour un alignement parfait ────── */
.cal-week-halves {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    overflow-x: auto;
    background: #fff;
}
/* Toutes les lignes (header + données) partagent la même grille */
.cal-week-halves-header,
.cal-week-halves-row {
    display: grid;
    grid-template-columns: 60px repeat(7, minmax(0, 1fr));
    border-bottom: 1px solid #e2e8f0;
}
.cal-week-halves-row:last-child { border-bottom: none; }

/* Colonne label (☀️/🌅/🌇) */
.cal-week-half-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 2px;
    font-size: 14px;
    color: #64748b;
    border-right: 1px solid #e2e8f0;
    background: #f8fafc;
    box-sizing: border-box;
}
.cal-week-half-label small {
    font-size: 8px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 1px;
}
/* Header : pas de style sur le placeholder label */
.cal-week-halves-header .cal-week-half-label {
    background: #f8fafc;
}
/* Cellules de données : border-right uniquement (pas de left ni top) */
.cal-week-col {
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-right: 1px solid #e2e8f0;
    box-sizing: border-box;
}
.cal-week-col:last-child { border-right: none; }

/* Couleurs par type de ligne (Journée supprimée — les sessions s'affichent en Matin + Aprem) */
.cal-week-matin .cal-week-col   { background: #fffbeb; min-height: 70px; }
.cal-week-matin .cal-week-half-label { background: #fef9c3; color: #854d0e; border-right-color: #fde68a; }
.cal-week-matin { border-bottom: 1px solid #fde68a; }

.cal-week-aprem .cal-week-col   { background: #eff6ff; min-height: 70px; }
.cal-week-aprem .cal-week-half-label { background: #dbeafe; color: #1e40af; border-right-color: #bfdbfe; }

/* Header jours */
.cal-week-halves-header { background: #f8fafc; }
.cal-week-header {
    padding: 8px 6px;
    text-align: center;
    border-right: 1px solid #e2e8f0;
    box-sizing: border-box;
}
.cal-week-header:last-child { border-right: none; }
.cal-week-halves-header .cal-week-header { border-bottom: 2px solid #053e8b; }

/* ── Table sessions formateur ───────────────────────────────────────────── */
.sess-table-toolbar {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 12px; flex-wrap: wrap;
}
.sess-search-input {
    flex: 1; min-width: 220px; max-width: 420px;
    padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; outline: none; transition: border .15s;
}
.sess-search-input:focus { border-color: var(--primary); }
.sess-count { font-size: 13px; color: var(--text-light); margin-left: auto; white-space: nowrap; }
.sess-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.sess-table { width: 100%; border-collapse: collapse; font-size: 13px; background: white; }
.sess-table thead th {
    background: #f8fafc; padding: 10px 12px; text-align: left;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .4px; color: var(--text-light);
    border-bottom: 2px solid var(--border); white-space: nowrap;
}
.sess-table thead th.sortable { cursor: pointer; user-select: none; }
.sess-table thead th.sortable:hover { background: #f1f5f9; color: var(--text); }
.sort-arrow { margin-left: 4px; opacity: .4; font-size: 10px; }
.sort-arrow.active { opacity: 1; color: var(--primary); }
.sess-row { cursor: pointer; transition: background .1s; }
.sess-row:not(:last-child) td { border-bottom: 1px solid #f1f5f9; }
.sess-row:hover td { background: #f8fafc; }
.sess-table td { padding: 9px 12px; vertical-align: middle; }
.sess-ref { font-family: monospace; font-size: 12px; color: #4338ca; font-weight: 600; }
.sess-ref.muted { color: var(--text-light); font-weight: 400; }
.sess-company { font-weight: 500; max-width: 200px; }
.text-center { text-align: center; }
.sess-habs { max-width: 260px; }
.hab-chip {
    display: inline-block; font-size: 10px; font-weight: 600;
    padding: 2px 6px; border-radius: 4px; margin: 1px 2px 1px 0;
    background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe;
    white-space: nowrap;
}

/* ── Section génération tokens (formateur → stagiaire) ─────────────────── */
.quiz-gen-section { padding: 10px 0 4px; border-top: 1px solid #f1f5f9; margin-top: 8px; }
.quiz-gen-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quiz-type-label { font-size: 12px; font-weight: 600; color: #4338ca; min-width: 130px; }
.quiz-type-label.quiz-type-pos { color: #0369a1; }
.quiz-gen-select { font-size: 12px; padding: 4px 8px; border: 1px solid #ddd; border-radius: 4px; flex: 1; min-width: 180px; }
.extra-habs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; padding-left: 4px; }
.extra-hab-label { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; }

/* ── Quiz Review (revue formateur) ──────────────────────────────────────── */
.quiz-review-list { display: flex; flex-direction: column; gap: 12px; }
.quiz-review-card { border-radius: 8px; border: 1px solid #e2e8f0; overflow: hidden; }
.quiz-review-card.correct   { border-left: 4px solid #16a34a; }
.quiz-review-card.incorrect { border-left: 4px solid #dc2626; }
.quiz-review-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #f8fafc; font-weight: 600; font-size: 13px; }
.quiz-review-question { padding: 12px 14px; font-size: 14px; line-height: 1.5; }
.quiz-review-answers { display: flex; flex-direction: column; gap: 4px; padding: 0 14px 12px; }
.quiz-answer-opt { padding: 8px 12px; border-radius: 6px; font-size: 13px; border: 1px solid #e2e8f0; cursor: pointer; transition: background .15s; }
.quiz-answer-opt:hover { background: #f1f5f9; }
.quiz-answer-opt.ans-ok    { background: #dcfce7; border-color: #86efac; color: #15803d; cursor: default; }
.quiz-answer-opt.ans-wrong { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.quiz-answer-opt.ans-correct-hint { background: #fef9c3; border-color: #fde047; color: #854d0e; }
.quiz-review-explanation { margin: 0 14px 12px; padding: 8px 12px; background: #f0f9ff; border-radius: 6px; font-size: 12px; color: #0369a1; }
.badge-fund { background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 10px; margin-left: 6px; }

/* ── Panneau bulk titres ──────────────────────────────────────────────────── */
.bulk-hab-item:hover, .bulk-trainee-item:hover { background: #f1f5f9; }
.bulk-hab-item input:checked ~ span, .bulk-trainee-item input:checked ~ span { color: #4338ca; font-weight: 500; }
#bulkHabList::-webkit-scrollbar, #bulkTraineeList::-webkit-scrollbar { width: 4px; }
#bulkHabList::-webkit-scrollbar-thumb, #bulkTraineeList::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ── Page engagement stagiaire ───────────────────────────────────────────── */
.engagement-bg { min-height: 100vh; background: linear-gradient(135deg, var(--bleu-nuit) 0%, var(--bleu-cerulean) 100%); display: flex; align-items: center; justify-content: center; padding: 24px; }
.engagement-card { background: #fff; border-radius: 16px; box-shadow: 0 8px 32px rgba(16,44,104,.22); padding: 0 0 36px; max-width: 520px; width: 100%; overflow: hidden; }
.engagement-card-header { background: var(--bleu-nuit); padding: 24px 36px; border-bottom: 3px solid var(--ocre-jaune); text-align: center; }
.engagement-card-header img { height: 48px; width: auto; }
.engagement-body { padding: 28px 36px 0; }
.engagement-logo { display: none; } /* remplacé par engagement-card-header */
.engagement-title { font-size: 22px; font-weight: 700; color: var(--bleu-nuit); text-align: center; margin: 0 0 6px; }
.engagement-subtitle { font-size: 14px; color: #64748b; text-align: center; margin: 0 0 28px; }
.engagement-info-block { background: #f8fafc; border: 1px solid #e2e8f0; border-left: 4px solid var(--bleu-cerulean); border-radius: 10px; padding: 16px 20px; margin-bottom: 24px; display: flex; flex-direction: column; gap: 10px; }
.engagement-info-row { display: flex; align-items: baseline; gap: 12px; }
.engagement-info-label { font-size: 12px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .05em; min-width: 130px; }
.engagement-info-value { font-size: 15px; font-weight: 600; color: var(--bleu-nuit); }
.engagement-checkbox-label { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 16px; background: #fef9ec; border: 1px solid var(--ocre-jaune); border-radius: 10px; font-size: 14px; color: #422006; line-height: 1.5; }
.engagement-checkbox-label input[type=checkbox] { width: 20px; height: 20px; min-width: 20px; margin-top: 1px; accent-color: var(--bleu-cerulean); cursor: pointer; }
@media (max-width: 480px) { .engagement-card .engagement-body { padding: 20px 20px 0; } .engagement-info-label { min-width: 100px; } }

/* CGV Modal (RGPD) */
.cgv-scroll-container { max-height: 55vh; overflow-y: auto; padding: 20px 24px; font-size: 13px; line-height: 1.7; color: #334155; }
.cgv-scroll-container h2 { font-size: 16px; color: #1e293b; margin: 20px 0 8px; }
.cgv-scroll-container h3 { font-size: 14px; color: #334155; margin: 16px 0 6px; }
.cgv-scroll-container p { margin: 6px 0; }
.cgv-scroll-container ul { margin: 6px 0; padding-left: 20px; }
.cgv-accept-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cgv-scroll-hint { text-align: center; color: #94a3b8; font-size: 12px; transition: opacity .3s; }

/* ── Documents Légaux — Cartes admin ─────────────────────────────────────── */
.legal-doc-card { background: white; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.06); transition: box-shadow .2s; }
.legal-doc-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
