/* ============================================================
   Easygestium — feuille de style
   Pour rebrander : modifier les variables ci-dessous (ou les
   surcharger depuis les réglages plus tard).
   ============================================================ */
:root {
    --ink:        #1a2230;
    --ink-soft:   #283449;
    --bg:         #f3f5f9;
    --surface:    #ffffff;
    --line:       #e4e8f0;
    --muted:      #6b7686;
    --text:       #222a36;

    --brand:      #2b5ce6;
    --brand-700:  #1e46b8;
    --accent:     #e0a43b;   /* touche chaude : marchandise / validation */
    --danger:     #d6492f;
    --ok:         #1f9d6b;

    --radius:     12px;
    --radius-sm:  8px;
    --shadow:     0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.05);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
code { background: #eef1f6; padding: 1px 6px; border-radius: 6px; font-size: .88em; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 10px 16px; border-radius: var(--radius-sm);
    border: 1px solid transparent; font: inherit; font-weight: 600;
    cursor: pointer; transition: .15s ease; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-700); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { color: var(--text); background: #fff; }
.btn-block { width: 100%; }

/* ---------- Mode épuré (login / install) ---------- */
.is-bare { display: grid; place-items: center; min-height: 100dvh; padding: 24px;
    background: radial-gradient(1200px 600px at 50% -10%, #fff, var(--bg)); }
.bare-wrap { width: 100%; max-width: 420px; }

.auth-card, .install-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px;
}
.install-card { max-width: 560px; margin: 0 auto; }
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head h1 { margin: 12px 0 2px; font-size: 22px; }
.auth-sub { margin: 0; color: var(--muted); font-size: 14px; }
.auth-mark, .brand-mark, .install-mark {
    display: inline-grid; place-items: center; width: 48px; height: 48px;
    border-radius: 12px; background: var(--ink); color: #fff;
    font-weight: 700; font-size: 22px;
}

/* ---------- Formulaires ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
input, select, textarea {
    font: inherit; padding: 11px 12px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); background: #fff; color: var(--text);
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(43,92,230,.15);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Alertes ---------- */
.alert { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fdecea; color: #a3271a; border: 1px solid #f3c2bb; }
.alert-ok { background: #e9f7f0; color: #15704c; border: 1px solid #b9e6d2; }

/* ---------- Coque application ---------- */
.app-shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100dvh; }

.sidebar {
    background: var(--ink); color: #c4cdda; padding: 18px 14px;
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100dvh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand-name { color: #fff; font-weight: 700; font-size: 16px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section {
    font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
    color: #6f7d92; margin: 14px 10px 4px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px;
    border-radius: 8px; color: #c4cdda; font-size: 14px; font-weight: 500;
}
.nav-item:hover { background: var(--ink-soft); color: #fff; }
.nav-item.active { background: var(--brand); color: #fff; }
.nav-ico { width: 18px; text-align: center; opacity: .9; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 5;
}
.page-title { margin: 0; font-size: 18px; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.user-name { font-weight: 600; font-size: 14px; }
.user-role { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.menu-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; }

.content { padding: 24px; display: grid; gap: 20px; align-content: start; }

/* ---------- Cartes / stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: var(--shadow); display: grid; gap: 6px;
    border-left: 3px solid var(--brand);
}
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 30px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px 22px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-hint { font-size: 13px; color: var(--muted); }

/* ---------- Tableaux ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tbody tr:hover { background: #fafbfd; }
.warn { color: var(--danger); font-weight: 600; }

/* ---------- États vides ---------- */
.empty-state { text-align: center; padding: 32px 16px; display: grid; gap: 14px; justify-items: center; }
.empty-state p { margin: 0; color: var(--muted); max-width: 460px; }

/* ---------- Installeur : étapes ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 24px; }
.step { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.step.done { background: var(--brand); }
.install-head { text-align: center; margin-bottom: 20px; }
.install-head h1 { margin: 12px 0 4px; font-size: 20px; }
.check-list { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.check-list li { display: flex; justify-content: space-between; padding: 9px 12px;
    border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.badge-ok { color: var(--ok); font-weight: 600; }
.badge-no { color: var(--danger); font-weight: 600; }
.cred-box { background: #f6f8fb; border: 1px dashed var(--line); border-radius: 8px;
    padding: 14px 16px; margin: 14px 0; font-size: 14px; }

/* ---------- Responsive / mobile ---------- */
@media (max-width: 860px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; width: 252px;
        transform: translateX(-100%); transition: transform .2s ease;
        overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
        scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.55) transparent;
    }
    .sidebar::-webkit-scrollbar { width: 7px; }
    .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.55); border-radius: 4px; }
    .sidebar::-webkit-scrollbar-track { background: transparent; }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle { display: block; }
    .field-row { grid-template-columns: 1fr; }
    .user-chip { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ============================================================
   Composants des modules (produits, tiers, documents, stock…)
   ============================================================ */

/* Barre d'actions de page */
.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-actions .search { flex: 1; max-width: 420px; }
.actions-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions-group form { margin: 0; }

/* Boutons additionnels */
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: #fff; color: var(--danger); border-color: #f0c4bc; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* Panneau étroit (formulaires) */
.panel-narrow { max-width: 640px; }

/* Cases à cocher */
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: auto; }

/* Tags & badges */
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #eef1f6; color: var(--muted); margin-left: 6px; }
.tag-soft { background: #eaf0fb; color: var(--brand-700); margin: 0; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.badge-draft  { background: #fdf3e2; color: #9a6a16; }
.badge-ok2    { background: #e8f6ef; color: #15734e; }
.badge-cancel { background: #fdecea; color: #a3271a; }

/* Onglets de filtre */
.filter-tabs { display: flex; gap: 4px; }
.tab { padding: 7px 14px; border-radius: 8px; font-size: 14px; color: var(--muted); font-weight: 500; }
.tab:hover { background: #fff; }
.tab.active { background: var(--ink); color: #fff; }

/* Lignes inactives */
.row-inactive { opacity: .55; }

/* Stat accent */
.stat-accent { border-left-color: var(--accent); }
.stat-accent .stat-value { font-size: 22px; }

/* Colonnes du dashboard */
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .dash-cols { grid-template-columns: 1fr; } }

/* Accès rapides */
.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.quick { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1px solid var(--line);
    border-radius: 10px; color: var(--text); font-weight: 500; transition: .15s; }
.quick:hover { border-color: var(--brand); background: #fafbff; }
.quick-ico { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
    background: var(--ink); color: #fff; }

/* Formulaire document */
.doc-form { display: grid; gap: 20px; }
.lines-table th, .lines-table td { padding: 6px 8px; vertical-align: top; }
.lines-table input, .lines-table select { padding: 8px 9px; }
.line-product { margin-bottom: 4px; }
.line-total { padding-top: 16px; font-weight: 600; }
.btn-remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 8px; }
.btn-remove:hover { color: var(--danger); }

/* Totaux */
.totals { width: 300px; margin-left: auto; margin-top: 16px; }
.totals-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; }
.total-ttc { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 12px; font-size: 17px; }

/* Pied de formulaire */
.form-footer { display: flex; justify-content: flex-end; gap: 10px; }

/* En-tête de document */
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
    margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.doc-head h2 { margin: 0; }
.doc-number { color: var(--brand); font-weight: 700; }
.doc-head-right { text-align: right; display: grid; gap: 10px; justify-items: end; }
.party-box { text-align: right; font-size: 14px; }
.notes-box { margin-top: 14px; font-size: 14px; padding: 12px 14px; background: #fafbfd; border-radius: 8px; }

/* Ajustement de stock */
.adjust-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.adjust-form select, .adjust-form input { width: auto; flex: 1; min-width: 140px; }

@media (max-width: 860px) {
    .totals { width: 100%; }
    .doc-head { flex-direction: column; }
    .doc-head-right, .party-box { text-align: left; justify-items: start; }
    .lines-table { font-size: 13px; }
}

/* Badge neutre (rupture / état non-alarmant) */
.badge-muted { background: #eef1f6; color: #6b7686; }

/* ============================================================
   Scanner de code-barres
   ============================================================ */
.scan-overlay { position: fixed; inset: 0; background: rgba(16,22,30,.72); z-index: 100;
    display: grid; place-items: center; padding: 16px; }
.scan-box { background: var(--surface); border-radius: 14px; width: 100%; max-width: 420px;
    overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.scan-head { display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.scan-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.scan-body { position: relative; background: #000; min-height: 240px; display: grid; place-items: center; }
.scan-body video { width: 100%; max-height: 320px; object-fit: cover; display: block; }
.scan-reticle { position: absolute; inset: 22% 12%; border: 3px solid rgba(255,255,255,.9);
    border-radius: 10px; box-shadow: 0 0 0 9999px rgba(0,0,0,.25); pointer-events: none; }
.scan-msg { color: #fff; padding: 28px 22px; text-align: center; font-size: 14px; margin: 0; }
.scan-manual { display: flex; gap: 8px; padding: 14px 16px; }
.scan-manual input { flex: 1; }

/* Bouton scan dans les barres d'action */
.btn-scan { display: inline-flex; align-items: center; gap: 6px; }

/* Actions sous les lignes de document */
.lines-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   Correctifs responsive / anti-débordement horizontal
   ============================================================ */
html, body { max-width: 100%; overflow-x: hidden; }
.main, .content, .panel, .stat-card { min-width: 0; }

/* Les longues chaînes (numéros, e-mails, codes) ne débordent plus */
.table td, .table th, .stat-value, .party-box, .doc-number,
.user-name, .brand-name, .quick { overflow-wrap: anywhere; word-break: break-word; }

/* Les tableaux larges défilent DANS leur panneau au lieu de pousser la page */
.table { max-width: 100%; }
.table-scroll, .lines-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 860px) {
    /* Chaque panneau encaisse le défilement horizontal de son contenu */
    .panel { overflow-x: auto; }
    .content { padding: 14px; gap: 14px; }
    .topbar { padding: 12px 14px; gap: 10px; }
    .page-title { font-size: 16px; }
    .page-actions { gap: 8px; }
    .page-actions .search { max-width: 100%; flex: 1 1 100%; }
    .actions-group { flex: 1 1 100%; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 22px; }
    .totals { width: 100%; }
    .form-footer { flex-direction: column-reverse; }
    .form-footer .btn { width: 100%; }
    .lines-actions { width: 100%; }
    .lines-actions .btn { flex: 1; }
    .adjust-form { flex-direction: column; align-items: stretch; }
    .adjust-form select, .adjust-form input { min-width: 0; width: 100%; }
    .filter-tabs { width: 100%; overflow-x: auto; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .content { padding: 12px; }
}

/* Bouton d'installation PWA */
.btn-install { white-space: nowrap; }
@media (max-width: 600px) { .btn-install { font-size: 13px; padding: 8px 10px; } }

/* ============================================================
   Rapports : période + barres
   ============================================================ */
.period-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.period-form .field { gap: 6px; }
.period-form input { width: auto; }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 1fr; gap: 4px; }
.bar-label { font-size: 14px; }
.bar-track { background: #eef1f6; border-radius: 6px; height: 10px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 6px; }
.bar-fill-2 { background: var(--accent); }
.bar-value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .period-form { gap: 8px; } .period-form .field { flex: 1; } }

/* ============================================================
   Direction droite-à-gauche (arabe)
   ============================================================ */
[dir="rtl"] body { text-align: right; }
[dir="rtl"] .stat-card { border-left: none; border-right: 3px solid var(--brand); }
[dir="rtl"] .stat-accent { border-right-color: var(--accent); }
[dir="rtl"] .nav-section { text-align: right; }
[dir="rtl"] .table th, [dir="rtl"] .table td { text-align: right; }
[dir="rtl"] .table .num, [dir="rtl"] .num { text-align: left; }  /* chiffres restent alignés à gauche */
[dir="rtl"] .totals { margin-left: 0; margin-right: auto; }
[dir="rtl"] .party-box, [dir="rtl"] .doc-head-right { text-align: left; }
[dir="rtl"] .auth-sub, [dir="rtl"] .install-head { text-align: center; }

/* La barre latérale passe à droite (la grille en dir=rtl place
   automatiquement la 1re colonne à droite, donc rien à réordonner) */
[dir="rtl"] .nav-ico { transform: scaleX(-1); }  /* flèches inversées */

@media (max-width: 860px) {
    [dir="rtl"] .sidebar { left: auto; right: 0; transform: translateX(100%); }
    [dir="rtl"] .sidebar.open { transform: translateX(0); }
}

/* Indicateur hors-ligne / file d'attente */
.offline-badge { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.offline-badge.is-offline { background: #fdecea; color: #a3271a; }
.offline-badge.is-pending { background: #fdf3e2; color: #9a6a16; }
@media (max-width: 600px) { .offline-badge { font-size: 11px; padding: 4px 8px; } }

/* Bouton de téléchargement de l'app Android */
.quick-apk { border-color: var(--brand); background: #f4f7ff; }
.quick-apk .quick-ico { background: var(--brand); }

/* ============================================================
   Page d'authentification (v2) — connexion / mot de passe oublié
   ============================================================ */
.is-bare {
    background:
        radial-gradient(900px 500px at 15% -10%, rgba(43,92,230,.18), transparent 60%),
        radial-gradient(800px 500px at 110% 10%, rgba(224,164,59,.14), transparent 55%),
        linear-gradient(180deg, #f7f9fc, #eef1f7);
}
.auth-card-v2 {
    padding: 30px 30px 26px;
    border: 1px solid rgba(228,232,240,.9);
    box-shadow: 0 24px 60px rgba(16,24,40,.12), 0 2px 6px rgba(16,24,40,.05);
    position: relative; overflow: hidden;
}
.auth-card-v2::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
}
.auth-top { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; }
.auth-logo { width: 40px; height: 40px; border-radius: 10px; }
.auth-app { font-size: 18px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.auth-welcome { text-align: center; margin-bottom: 20px; }
.auth-welcome h1 { margin: 0 0 4px; font-size: 21px; color: var(--ink); }
.auth-welcome .auth-sub { margin: 0; color: var(--muted); font-size: 14px; }

.pwd-wrap { position: relative; display: block; }
.pwd-wrap input { padding-right: 44px; }
.pwd-toggle { position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; font-size: 16px; opacity: .5; padding: 4px; }
.pwd-toggle.on { opacity: 1; }
[dir="rtl"] .pwd-wrap input { padding-right: 12px; padding-left: 44px; }
[dir="rtl"] .pwd-toggle { right: auto; left: 8px; }

.auth-forgot { display: block; text-align: center; margin-top: 16px; font-size: 14px; }
.auth-footer { text-align: center; margin: 18px 0 0; font-size: 12px; color: var(--muted); }
.auth-footer strong { color: var(--ink-soft); }

/* ============================================================
   Mise en page « application » : en-tête fixe, contenu défilant
   ============================================================ */
.app-shell { height: 100vh; height: 100dvh; overflow: hidden; }
.main { height: 100vh; height: 100dvh; overflow: hidden; }
.topbar { position: static; flex-shrink: 0; }
.content { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }

/* En-tête mobile épuré : on masque le titre du module */
@media (max-width: 860px) {
    .page-title { display: none; }
    .topbar { justify-content: space-between; }
}

/* ============================================================
   Tableaux responsives : en cartes empilées sur mobile
   ============================================================ */
@media (max-width: 700px) {
    /* Plus besoin de défilement horizontal : les tableaux deviennent des cartes */
    .panel { overflow-x: visible; }

    /* --- Tableaux de liste (tout sauf la grille de saisie) --- */
    .table:not(.lines-table) { display: block; }
    .table:not(.lines-table) thead { display: none; }
    .table:not(.lines-table) tbody { display: block; }
    .table:not(.lines-table) tr {
        display: block; background: var(--surface);
        border: 1px solid var(--line); border-radius: 12px;
        padding: 6px 14px; margin-bottom: 12px;
    }
    .table:not(.lines-table) td {
        display: flex; align-items: center; justify-content: space-between;
        gap: 14px; padding: 9px 0; border: none; text-align: right;
    }
    .table:not(.lines-table) tr td + td { border-top: 1px solid #f0f2f6; }
    .table:not(.lines-table) td::before {
        content: attr(data-label); font-weight: 600; color: var(--muted);
        font-size: 13px; text-align: left; white-space: nowrap;
    }
    .table:not(.lines-table) td[data-label=""]::before { content: ""; }
    /* La cellule d'actions prend toute la largeur, bouton aligné à droite */
    .table:not(.lines-table) td.cell-actions { justify-content: flex-end; }
    .table:not(.lines-table) td.cell-actions .btn { width: 100%; text-align: center; }

    /* --- Grille de saisie des lignes (formulaire document) --- */
    .lines-table thead { display: none; }
    .lines-table, .lines-table tbody, .lines-table tr, .lines-table td { display: block; width: 100%; }
    .lines-table tr {
        border: 1px solid var(--line); border-radius: 12px;
        padding: 12px 14px; margin-bottom: 14px; background: #fafbfd;
    }
    .lines-table td { padding: 6px 0; border: none; }
    .lines-table td::before {
        content: attr(data-label); display: block;
        font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px;
    }
    .lines-table .line-total { text-align: right; font-size: 15px; padding-top: 8px; }
    .lines-table .btn-remove { width: 100%; border: 1px dashed #f0c4bc; border-radius: 8px; padding: 8px; color: var(--danger); }
}

/* RTL : libellés des cartes alignés à droite */
[dir="rtl"] .table:not(.lines-table) td { text-align: left; }
[dir="rtl"] .table:not(.lines-table) td::before { text-align: right; }

/* ============================================================
   Easyscol — surcharges de marque et éléments spécifiques
   ============================================================ */
:root {
    --brand: #4f46e5;   /* indigo */
    --accent: #14b8a6;  /* teal */
}
.badge-pending { background: #fdf3e2; color: #9a6a16; }
.alert-pending { background: #fdf3e2; color: #8a5d12; border: 1px solid #f3d9a6; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
.alert-pending a { color: #7a3e9c; font-weight: 600; margin-left: 8px; }
.nav-badge {
    display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 6px;
    background: #e0a43b; color: #1a2230; border-radius: 999px;
    font-size: 12px; font-weight: 700; text-align: center;
}
[dir="rtl"] .nav-badge { margin-left: 0; margin-right: 6px; }

.alert-update {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: #eef2ff; border: 1px solid #c7d2fe; color: #3730a3;
    padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.alert-update .update-info { flex: 1; min-width: 220px; }
.alert-update form { margin: 0; flex-shrink: 0; }

/* ============================================================
   Easyscol — refonte visuelle (v0.3)
   Palette violette distincte d'Easygestium + design soigné
   ============================================================ */
:root {
    --brand:      #7c3aed;   /* violet */
    --brand-700:  #6d28d9;
    --accent:     #14b8a6;   /* teal */
}

/* ---- Connexion : fond violet doux, plein écran, centré ---- */
html { min-height: 100%; }
body.is-bare {
    min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    padding: 28px 16px;
    background: linear-gradient(160deg, #ede9fe 0%, #f5f3ff 45%, #ecfeff 100%);
}
.bare-wrap { width: 100%; max-width: 430px; margin: auto; }
.auth-card-v2 { width: 100%; }
.auth-card-v2::before { background: linear-gradient(90deg, var(--brand), var(--accent)); }
.auth-mark, .install-mark { background: linear-gradient(135deg, #7c3aed, #6d28d9); }

/* ---- Barre latérale : dégradé violet ---- */
.sidebar {
    background: linear-gradient(168deg, #4c1d95 0%, #6d28d9 58%, #7c3aed 100%);
    color: rgba(255,255,255,.82);
}
.brand-name { color: #fff; }
.brand-mark { background: rgba(255,255,255,.18); color: #fff; }
.nav-section { color: rgba(255,255,255,.55); }
.nav-item { color: rgba(255,255,255,.82); }
.nav-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.20); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
[dir="rtl"] .nav-item.active { box-shadow: inset -3px 0 0 var(--accent); }
.nav-badge { background: var(--accent); color: #042f2a; }

/* ---- Tableau de bord : cartes plus vivantes ---- */
.stat-card {
    border-left: none; border-top: 3px solid var(--brand);
    transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(76,29,149,.13); }
.stat-card.stat-accent { border-top-color: var(--accent); }
.stat-value { color: #4c1d95; }
[dir="rtl"] .stat-card { border-right: none; }

/* ---- Liens rapides ---- */
.quick { transition: .15s ease; }
.quick:hover { border-color: var(--brand); background: #f5f3ff; transform: translateY(-1px); }
.quick-ico { background: linear-gradient(135deg, #7c3aed, #6d28d9); color: #fff; }

/* ---- Boutons ---- */
.btn-primary { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.btn-primary:hover { background: linear-gradient(135deg, #6d28d9, #5b21b6); }

/* ---- Onglets & étiquettes ---- */
.tab.active { background: var(--brand); color: #fff; }
.tag-soft { background: #f1ebfe; color: var(--brand-700); }

/* ---- Barre de filtres (notes / présence / emploi du temps) ---- */
.filter-bar { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin: 0; }
.filter-bar .field { margin: 0; min-width: 160px; }

/* ---- Défilement mobile naturel ---- */
@media (max-width: 860px) {
    .app-shell, .main { height: auto; min-height: 100dvh; overflow: visible; }
    .content { height: auto; overflow: visible; }
    .topbar { position: sticky; top: 0; z-index: 30; }
    .sidebar { height: 100dvh; }
    .filter-bar { gap: 10px; }
    .filter-bar .field { min-width: 0; flex: 1; }
}

/* ============================================================
   Easyscol — barre latérale blanche, connexion blanche, menu mobile
   ============================================================ */
/* Logo seul (sans titre) en haut de la barre latérale */
.brand { padding: 4px 6px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.brand-logo { width: 36px; height: 36px; border-radius: 9px; display: block; }

/* Barre latérale BLANCHE (PC + mobile) */
.sidebar { background: #ffffff; color: var(--text); border-right: 1px solid var(--line); }
[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--line); }
.nav-section { color: var(--muted); }
.nav-item { color: #3a4250; font-weight: 500; }
.nav-item .nav-ico { opacity: .6; }
.nav-item:hover { background: #f4f3fb; color: var(--ink); }
.nav-item:hover .nav-ico { opacity: 1; }
.nav-item.active { background: #f1ebfe; color: var(--brand-700); box-shadow: none; }
.nav-item.active .nav-ico { opacity: 1; }
[dir="rtl"] .nav-item.active { box-shadow: none; }
.nav-badge { background: var(--accent); color: #042f2a; }

/* Connexion : fond blanc simple */
body.is-bare { background: #ffffff; }

/* Menu mobile : fond assombri + ombre de la barre */
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(15,18,28,.45);
    opacity: 0; visibility: hidden; transition: opacity .2s ease; z-index: 35; }
.sidebar-backdrop.show { opacity: 1; visibility: visible; }
@media (min-width: 861px) { .sidebar-backdrop { display: none; } }
@media (max-width: 860px) { .sidebar { box-shadow: 0 0 40px rgba(15,18,28,.20); } }

.sidebar .nav { padding-top: 12px; }

/* ============================================================
   Menu mobile défilable + bouton « remonter en haut »
   ============================================================ */
/* La barre latérale défile (utile quand il y a beaucoup de modules) */
.sidebar { overflow-y: auto; scrollbar-width: thin; }
.sidebar::-webkit-scrollbar { width: 7px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(100,110,130,.35); border-radius: 4px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(100,110,130,.55); }
.nav { padding-bottom: 28px; }

@media (max-width: 860px) {
    .sidebar { height: 100dvh; -webkit-overflow-scrolling: touch; }
}

/* Bouton flottant : remonter tout en haut */
.scroll-top {
    position: fixed; bottom: 20px; right: 20px; z-index: 60;
    width: 48px; height: 48px; border: none; border-radius: 50%;
    background: var(--brand); color: #fff; cursor: pointer;
    font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 22px rgba(15,18,28,.30);
    opacity: 0; visibility: hidden; transform: translateY(12px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.scroll-top.show { opacity: 1; visibility: visible; transform: none; }
.scroll-top:hover { filter: brightness(1.07); }
[dir="rtl"] .scroll-top { right: auto; left: 20px; }

/* Plus d'espace sous le dernier élément du menu (surtout en mobile) */
.nav { padding-bottom: 48px; }
@media (max-width: 860px) {
    .nav { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}

/* ============================================================
   Performance scroll mobile — fluidité + espace bas du menu
   ============================================================ */
@media (max-width: 860px) {
    /* Hauteurs STABLES : 100dvh se recalcule pendant le scroll (saccades). 100vh ne bouge pas. */
    .app-shell, .main { min-height: 100vh; }
    /* Aucun effet qui repeint pendant le scroll tactile (survol « collant ») */
    .stat-card, .quick, .panel, .card { transition: none !important; }
    .stat-card:hover, .quick:hover, .card:hover, .panel:hover { transform: none !important; box-shadow: 0 1px 3px rgba(16,24,40,.06) !important; }
    .table tbody tr:hover { background: transparent !important; }
    .btn:hover, .nav-item:hover, .tab:hover { transition: none !important; }
    /* Espace généreux sous le dernier élément du menu */
    .nav { padding-bottom: 96px; }
}

/* ============================================================
   THÈME « EDUCARE FORMATION » (v2.0) — navy + or + turquoise + crème
   ============================================================ */
:root{
    --navy:#114b5f; --navy-2:#16607a; --navy-3:#1d7492;
    --gold:#e0a545; --gold-2:#c78c2e; --gold-soft:#f8ecd6;
    --teal:#2f9b9b; --teal-2:#227e7e;
    --cream:#f6f2ea; --surface:#ffffff; --line:#e9e3d8;
    --ink:#1f2a3a; --ink-soft:#33415a; --muted:#7c8698; --text:#2a3444;
    --brand:#e0a545; --brand-700:#c78c2e; --accent:#2f9b9b;
    --ok:#2f9b6b; --danger:#d6492f;
    --radius:16px; --radius-sm:10px;
    --shadow:0 1px 2px rgba(20,30,50,.05), 0 10px 30px rgba(20,30,50,.06);
    --font:"Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
body.is-app{ background:var(--cream); }

/* ---- Sidebar navy dégradé ---- */
.sidebar{ background:linear-gradient(180deg,#16304d 0%, #17334f 55%, #1a3a52 100%); color:rgba(255,255,255,.85); border:none; }
.brand{ border-bottom:1px solid rgba(255,255,255,.12); }
.nav-section{ color:rgba(201,161,90,.85); text-transform:uppercase; letter-spacing:.04em; font-size:11px; font-weight:700; }
.nav-item{ color:rgba(255,255,255,.82); font-weight:500; border-radius:11px; }
.nav-item .nav-ico{ opacity:.9; }
.nav-item:hover{ background:rgba(255,255,255,.09); color:#fff; }
.nav-item.active{ background:linear-gradient(90deg,rgba(201,161,90,.22),rgba(201,161,90,.06)); color:#fff; box-shadow:inset 3px 0 0 var(--gold); }
.nav-item.active .nav-ico{ color:var(--gold); opacity:1; }
.nav-badge{ background:var(--gold); color:#16304d; font-weight:700; }
.sidebar::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.25); }

/* ---- Logo marque ---- */
.brand{ display:flex; align-items:center; gap:11px; padding:18px 18px 16px; }
.brand-logo{ width:38px; height:38px; flex:none; }
.brand-text{ display:flex; flex-direction:column; line-height:1.05; }
.brand-text b{ color:#fff; font-size:19px; font-weight:800; letter-spacing:.02em; }
.brand-text small{ color:var(--gold); font-size:12px; font-weight:600; letter-spacing:.12em; }

/* ---- Topbar ---- */
.topbar{ background:var(--surface); border-bottom:1px solid var(--line); }
.page-title{ font-size:19px; color:var(--ink); font-weight:800; }
.user-chip{ background:var(--cream); border-radius:30px; padding:5px 14px; }
.user-name{ color:var(--ink); font-weight:600; }
.user-role{ color:var(--gold-2); }
.topbar .btn-ghost{ color:var(--navy); }

/* ---- Boutons or ---- */
.btn-primary{ background:var(--gold); color:#1a2b3f; font-weight:700; border:none; }
.btn-primary:hover{ background:var(--gold-2); color:#16233a; }
.btn-ghost{ border:1px solid var(--line); color:var(--navy); background:#fff; }
.btn-install{ background:var(--gold) !important; color:#1a2b3f !important; }

/* ---- Cartes / panneaux ---- */
.card, .panel, .stat-card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); }
.stat-card{ border-left:none; }
.stat-value{ color:var(--ink); }
.stat-label{ color:var(--muted); }
.table th{ background:#faf7f1; color:var(--ink-soft); }
.badge, .pill{ border-radius:20px; }
.nav-badge{ border-radius:20px; }
a{ color:var(--teal-2); }

/* ---- Titres ---- */
h1,h2,h3{ color:var(--ink); }

/* ---- Connexion / Inscription EDUCARE ---- */
body.is-bare{ background:
    radial-gradient(1000px 600px at 15% 10%, rgba(201,161,90,.14), transparent 60%),
    linear-gradient(140deg, #16304d 0%, #1c3a5c 45%, #24506f 100%); }
.bare-wrap{ max-width:none; width:100%; }
.edu-auth{ min-height:100dvh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:24px 16px; }
.edu-auth-card{ width:100%; max-width:430px; background:#fff; border-radius:22px; padding:34px 34px 28px;
    box-shadow:0 30px 70px rgba(8,20,40,.4); }
.edu-auth-brand{ display:flex; align-items:center; justify-content:center; gap:12px; margin-bottom:18px; }
.edu-auth-brand img{ width:46px; height:46px; }
.edu-auth-brandtext{ display:flex; flex-direction:column; line-height:1.05; }
.edu-auth-brandtext b{ font-size:24px; font-weight:800; color:var(--navy); letter-spacing:.02em; }
.edu-auth-brandtext small{ font-size:12px; font-weight:700; color:var(--gold); letter-spacing:.22em; }
.edu-auth-title{ text-align:center; font-size:23px; font-weight:800; color:var(--ink); margin:6px 0 2px; }
.edu-auth-sub{ text-align:center; color:var(--muted); font-size:14px; margin:0 0 22px; }
.edu-form{ display:block; }
.edu-label{ display:block; font-size:13px; font-weight:600; color:var(--ink-soft); margin:14px 0 7px; }
.edu-input{ width:100%; height:50px; padding:0 14px; border:1px solid var(--line); border-radius:12px; background:#faf8f4; font-size:15px; color:var(--ink); }
.edu-input:focus{ outline:none; border-color:var(--gold); background:#fff; box-shadow:0 0 0 3px rgba(201,161,90,.16); }
.edu-pwd{ position:relative; }
.edu-pwd .edu-input{ padding-inline-end:46px; }
.edu-eye{ position:absolute; inset-inline-end:8px; top:50%; transform:translateY(-50%); width:36px; height:36px; border:none; background:transparent; cursor:pointer; font-size:17px; }
.edu-submit{ height:52px; border-radius:12px; font-size:16px; margin-top:22px; }
.edu-auth-link{ display:block; text-align:center; margin-top:16px; color:var(--teal-2); font-size:14px; text-decoration:none; }
.edu-auth-link strong{ color:var(--gold-2); }
.edu-auth-foot{ color:rgba(255,255,255,.6); font-size:12.5px; margin-top:20px; }

/* ---- Dashboard EDUCARE ---- */
.edu-welcome{ display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
    background:linear-gradient(120deg,#16304d,#22496c); color:#fff; border-radius:18px; padding:24px 26px; margin-bottom:4px; }
.edu-welcome h1{ color:#fff; font-size:24px; font-weight:800; margin:0 0 4px; }
.edu-welcome p{ color:rgba(255,255,255,.75); margin:0; font-size:14px; }
.edu-welcome .btn-primary{ flex:none; }
.edu-dash-top{ display:grid; grid-template-columns:2fr 1fr; gap:18px; align-items:start; }
.stats-grid{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.stat-card{ position:relative; padding:18px 20px; overflow:hidden; }
.stat-ico{ position:absolute; top:16px; inset-inline-end:16px; width:42px; height:42px; border-radius:12px; display:grid; place-items:center; font-size:19px; }
.stat-ico.teal{ background:#e2f2f2; color:#227e7e; } .stat-ico.gold{ background:var(--gold-soft); color:var(--gold-2); } .stat-ico.navy{ background:#e6edf5; color:var(--navy); }
.stat-value{ font-size:30px; font-weight:800; }
.edu-donut-card .edu-donut-body{ display:flex; align-items:center; gap:22px; flex-wrap:wrap; justify-content:center; }
.edu-legend{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:12px; }
.edu-legend li{ display:flex; align-items:center; gap:10px; font-size:14px; color:#48546c; }
.edu-legend i{ width:12px; height:12px; border-radius:3px; }
.edu-legend b{ margin-inline-start:auto; color:var(--ink); }
.quick-links{ display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:12px; }
.quick{ display:flex; align-items:center; gap:10px; padding:14px 16px; background:#faf7f1; border:1px solid var(--line); border-radius:12px; color:var(--ink); text-decoration:none; font-weight:500; }
.quick:hover{ border-color:var(--gold); background:#fff; }
.quick-ico{ width:34px; height:34px; border-radius:9px; background:var(--gold-soft); color:var(--gold-2); display:grid; place-items:center; }
.alert-pending{ background:var(--gold-soft); border:1px solid #ecdcbd; color:#7a5b23; border-radius:12px; }
@media (max-width:860px){ .edu-dash-top{ grid-template-columns:1fr; } .stats-grid{ grid-template-columns:1fr 1fr; } }

/* ============================================================
   SITE VITRINE EDUCARE (public)
   ============================================================ */
body.edu-site{ background:var(--cream); color:var(--ink); }
.btn-lg{ height:52px; padding:0 26px; font-size:15.5px; border-radius:12px; display:inline-flex; align-items:center; }

/* En-tête */
.site-header{ position:sticky; top:0; z-index:100; transition:background .2s, box-shadow .2s; }
.site-header.scrolled{ background:rgba(255,255,255,.96); box-shadow:0 4px 20px rgba(20,30,50,.08); backdrop-filter:blur(6px); }
.site-inner{ max-width:1180px; margin:0 auto; display:flex; align-items:center; gap:20px; padding:16px 22px; }
.site-brand{ display:flex; align-items:center; gap:10px; text-decoration:none; }
.site-brand img{ width:40px; height:40px; }
.site-brandtext{ display:flex; flex-direction:column; line-height:1.05; }
.site-brandtext b{ color:var(--navy); font-size:20px; font-weight:800; }
.site-brandtext small{ color:var(--gold); font-size:11px; font-weight:700; letter-spacing:.18em; }
.site-nav{ margin-inline-start:auto; display:flex; align-items:center; gap:6px; }
.site-nav > a{ color:var(--ink-soft); text-decoration:none; font-weight:600; font-size:14.5px; padding:8px 14px; border-radius:8px; }
.site-nav > a:hover{ color:var(--navy); background:rgba(22,48,77,.06); }
.site-nav-actions{ display:flex; gap:10px; margin-inline-start:12px; }
.site-burger{ display:none; background:none; border:none; font-size:26px; color:var(--navy); cursor:pointer; margin-inline-start:auto; }

/* Hero */
.hero{ background:radial-gradient(900px 500px at 80% -10%, rgba(47,155,155,.25), transparent 60%), linear-gradient(135deg,#16304d 0%, #1d3f62 55%, #245572 100%); color:#fff; overflow:hidden; }
.hero-inner{ max-width:1180px; margin:0 auto; display:grid; grid-template-columns:1.1fr .9fr; gap:40px; align-items:center; padding:70px 22px 90px; }
.hero-badge{ display:inline-block; background:rgba(201,161,90,.18); color:var(--gold); border:1px solid rgba(201,161,90,.35); padding:6px 14px; border-radius:20px; font-size:13px; font-weight:600; margin-bottom:18px; }
.hero-text h1{ color:#fff; font-size:52px; line-height:1.08; font-weight:800; margin:0 0 18px; letter-spacing:-.01em; }
.hero-accent{ color:var(--gold); }
.hero-text > p{ color:rgba(255,255,255,.8); font-size:17px; line-height:1.6; margin:0 0 28px; max-width:520px; }
.hero-actions{ display:flex; gap:14px; flex-wrap:wrap; margin-bottom:36px; }
.hero .btn-ghost{ background:transparent; border:1px solid rgba(255,255,255,.35); color:#fff; }
.hero .btn-ghost:hover{ background:rgba(255,255,255,.1); }
.hero-stats{ display:flex; gap:34px; }
.hero-stats b{ display:block; font-size:28px; font-weight:800; color:var(--gold); }
.hero-stats span{ font-size:13px; color:rgba(255,255,255,.7); }
.hero-visual{ position:relative; height:340px; }
.hero-card{ position:absolute; background:#fff; color:var(--ink); border-radius:16px; padding:16px 18px; box-shadow:0 20px 50px rgba(8,20,40,.35); display:flex; flex-direction:column; gap:8px; min-width:210px; }
.hero-card .hc-ico{ width:44px; height:44px; border-radius:12px; background:#e2f2f2; color:#227e7e; display:grid; place-items:center; font-size:22px; }
.hero-card .hc-ico.gold{ background:var(--gold-soft); color:var(--gold-2); }
.hero-card b{ font-size:15px; } .hero-card span{ color:var(--muted); font-size:13px; }
.hero-card .hc-bar{ height:7px; background:#eee6d6; border-radius:5px; overflow:hidden; }
.hero-card .hc-bar i{ display:block; height:100%; background:linear-gradient(90deg,#2f9b9b,#c9a15a); }
.hc-1{ top:20px; inset-inline-start:10px; z-index:2; }
.hc-2{ bottom:30px; inset-inline-end:0; }
.hero-orb{ position:absolute; inset:auto; top:80px; inset-inline-end:60px; width:180px; height:180px; border-radius:50%; background:radial-gradient(circle at 30% 30%, rgba(201,161,90,.5), rgba(47,155,155,.2)); filter:blur(6px); }

/* Sections */
.section{ padding:72px 0; }
.section-alt{ background:#fff; }
.section-inner{ max-width:1180px; margin:0 auto; padding:0 22px; }
.section-head{ text-align:center; max-width:640px; margin:0 auto 44px; }
.section-head h2{ font-size:34px; font-weight:800; margin:0 0 12px; }
.section-head p{ color:var(--muted); font-size:16px; margin:0; }
.cat-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:22px; }
.cat-card{ background:#fff; border:1px solid var(--line); border-radius:18px; padding:28px; transition:transform .15s, box-shadow .15s; }
.section-alt .cat-card{ background:var(--cream); }
.cat-card:hover{ transform:translateY(-4px); box-shadow:0 18px 40px rgba(20,30,50,.1); border-color:var(--gold); }
.cat-ico{ width:60px; height:60px; border-radius:16px; background:linear-gradient(135deg,#16304d,#245572); color:#fff; display:grid; place-items:center; font-size:28px; margin-bottom:16px; }
.cat-card h3{ font-size:19px; margin:0 0 8px; }
.cat-card p{ color:var(--muted); font-size:14.5px; line-height:1.55; margin:0; }
.feat-grid{ display:grid; grid-template-columns:1fr 1fr; gap:22px; }
.feat-card{ display:flex; gap:16px; background:var(--cream); border:1px solid var(--line); border-radius:16px; padding:24px; }
.section-alt .feat-card{ background:#faf7f1; }
.feat-ico{ width:52px; height:52px; flex:none; border-radius:14px; background:var(--gold-soft); color:var(--gold-2); display:grid; place-items:center; font-size:24px; }
.feat-card h3{ font-size:17px; margin:0 0 6px; } .feat-card p{ color:var(--muted); font-size:14px; line-height:1.5; margin:0; }

/* CTA */
.cta{ background:linear-gradient(120deg,#16304d,#22496c); color:#fff; text-align:center; }
.cta-inner{ max-width:760px; margin:0 auto; padding:70px 22px; }
.cta h2{ color:#fff; font-size:34px; font-weight:800; margin:0 0 12px; }
.cta p{ color:rgba(255,255,255,.8); font-size:17px; margin:0 0 28px; }

/* Footer */
.site-footer{ background:#122539; color:rgba(255,255,255,.75); }
.site-foot-inner{ max-width:1180px; margin:0 auto; padding:48px 22px 28px; display:flex; justify-content:space-between; gap:30px; flex-wrap:wrap; }
.sf-brand{ display:flex; gap:14px; max-width:360px; } .sf-brand img{ width:44px; height:44px; }
.sf-brand b{ color:#fff; font-size:18px; } .sf-brand p{ font-size:13.5px; margin:6px 0 0; line-height:1.5; }
.sf-links{ display:flex; flex-direction:column; gap:10px; } .sf-links a{ color:rgba(255,255,255,.75); text-decoration:none; font-size:14px; } .sf-links a:hover{ color:var(--gold); }
.sf-copy{ border-top:1px solid rgba(255,255,255,.1); text-align:center; padding:18px; font-size:13px; color:rgba(255,255,255,.55); }

/* Responsive site */
@media (max-width:900px){
    .site-nav{ display:none; position:fixed; top:72px; inset-inline-end:16px; left:16px; flex-direction:column; align-items:stretch; background:#fff; border-radius:14px; box-shadow:0 20px 40px rgba(20,30,50,.15); padding:10px; }
    .site-nav.open{ display:flex; }
    .site-nav-actions{ flex-direction:column; margin:6px 0 0; }
    .site-burger{ display:block; }
    .hero-inner{ grid-template-columns:1fr; padding:48px 22px 60px; }
    .hero-text h1{ font-size:38px; }
    .hero-visual{ display:none; }
    .cat-grid{ grid-template-columns:1fr; } .feat-grid{ grid-template-columns:1fr; }
    .section-head h2, .cta h2{ font-size:27px; }
}

/* Permissions dans le formulaire utilisateur */
.perms-block{ border-top:1px solid var(--line); margin-top:8px; padding-top:8px; }
.perm-group{ margin:10px 0 4px; }
.perm-group-title{ font-size:12px; font-weight:700; color:var(--gold-2); text-transform:uppercase; letter-spacing:.03em; margin-bottom:6px; }
.perm-group-items{ display:grid; grid-template-columns:1fr 1fr; gap:6px 16px; }
.perm-group-items .check{ font-size:13.5px; }
.perm-group-items .check input{ accent-color:var(--gold); }
.check-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.check-list .check input{ accent-color:var(--gold); }
@media(max-width:560px){ .perm-group-items{ grid-template-columns:1fr; } }

/* ============================================================
   Correctifs v2.2 : overflow mobile + menu scroll + site public
   ============================================================ */
/* La colonne unique du contenu ne dépasse jamais le conteneur (fix overflow users & co) */
.content{ grid-template-columns: minmax(0, 1fr); }
.content > *{ min-width:0; max-width:100%; }
.filter-tabs{ min-width:0; }

/* Menu mobile : verrou de la page + barre de défilement visible (comme EasyGestium) */
html.menu-open, body.menu-open{ overflow:hidden; overscroll-behavior:none; }
.sidebar{ overscroll-behavior:contain; }
.sb-scrollthumb{ display:none; position:fixed; width:6px; border-radius:3px; background:rgba(255,255,255,.75); box-shadow:0 0 0 1px rgba(0,0,0,.15); z-index:120; pointer-events:none; }

/* ============================================================
   LMS — Formations en ligne (v2.3)
   ============================================================ */
.badge2{ display:inline-block; padding:3px 10px; border-radius:20px; font-size:12px; font-weight:700; }
.b-green{ background:#e2f3ea; color:#1d7a4f; } .b-orange{ background:#fdeeda; color:#a06514; }
.btn-block{ display:flex; width:100%; justify-content:center; }
.btn-danger{ background:#d6492f; color:#fff; border:none; }
.empty-state{ text-align:center; padding:30px 10px; color:var(--muted); display:flex; flex-direction:column; gap:12px; align-items:center; }

/* --- Catalogue public --- */
.cat-hero{ background:linear-gradient(120deg,#16304d,#22496c); color:#fff; padding:52px 0 40px; text-align:center; }
.cat-hero h1{ color:#fff; font-size:36px; font-weight:800; margin:0 0 8px; }
.cat-hero p{ color:rgba(255,255,255,.8); margin:0 0 18px; }
.cat-filters{ display:flex; gap:8px; justify-content:center; flex-wrap:wrap; }
.chip{ padding:7px 16px; border-radius:20px; background:rgba(255,255,255,.12); color:#fff; text-decoration:none; font-size:13.5px; font-weight:600; border:1px solid rgba(255,255,255,.2); }
.chip.active, .chip:hover{ background:var(--gold); color:#1a2b3f; border-color:var(--gold); }
.course-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:22px; }
.course-card{ background:#fff; border:1px solid var(--line); border-radius:18px; overflow:hidden; text-decoration:none; color:var(--ink); transition:transform .15s, box-shadow .15s; display:flex; flex-direction:column; }
.course-card:hover{ transform:translateY(-4px); box-shadow:0 18px 40px rgba(20,30,50,.12); border-color:var(--gold); }
.cc-cover{ height:150px; background:linear-gradient(135deg,#16304d,#2f9b9b); background-size:cover; background-position:center; position:relative; display:grid; place-items:center; }
.cc-cover-ico{ font-size:42px; }
.cc-cat{ position:absolute; top:12px; inset-inline-start:12px; background:rgba(255,255,255,.92); color:var(--navy); padding:4px 12px; border-radius:16px; font-size:12px; font-weight:700; }
.cc-body{ padding:16px 18px 18px; display:flex; flex-direction:column; gap:6px; flex:1; }
.cc-body h3{ font-size:17px; margin:0; }
.cc-body p{ color:var(--muted); font-size:13.5px; margin:0; flex:1; }
.cc-meta{ display:flex; justify-content:space-between; align-items:center; font-size:13px; color:var(--muted); margin-top:8px; }
.cc-price{ font-weight:800; color:var(--gold-2); font-size:15px; }

/* --- Détail formation --- */
.course-detail{ padding:34px 0 60px; }
.cd-inner{ max-width:1180px; margin:0 auto; padding:0 22px; display:grid; grid-template-columns:1fr 340px; gap:30px; align-items:start; }
.cd-back{ color:var(--teal-2); text-decoration:none; font-size:14px; }
.cd-cat{ display:inline-block; margin:12px 0 6px; color:var(--gold-2); font-weight:700; font-size:13px; text-transform:uppercase; letter-spacing:.04em; }
.cd-main h1{ font-size:32px; margin:0 0 8px; }
.cd-sub{ color:var(--muted); font-size:16px; margin:0 0 10px; }
.cd-instr{ color:var(--ink-soft); font-size:14px; margin-bottom:18px; }
.cd-video{ position:relative; padding-top:56.25%; border-radius:14px; overflow:hidden; margin-bottom:20px; background:#0a1626; }
.cd-video iframe{ position:absolute; inset:0; width:100%; height:100%; }
.cd-desc{ background:#fff; border:1px solid var(--line); border-radius:14px; padding:20px 22px; margin-bottom:20px; }
.cd-desc h2{ font-size:19px; margin:0 0 10px; }
.cd-desc p{ color:var(--ink-soft); line-height:1.65; margin:0; }
.cd-curriculum h2{ font-size:19px; margin:0 0 12px; }
.cd-chapter{ background:#fff; border:1px solid var(--line); border-radius:12px; margin-bottom:12px; overflow:hidden; }
.cd-chapter-title{ padding:13px 16px; font-weight:700; background:#faf7f1; border-bottom:1px solid var(--line); }
.cd-lesson{ display:flex; justify-content:space-between; padding:11px 16px; border-bottom:1px solid #f4efe6; font-size:14px; }
.cd-lesson:last-child{ border-bottom:none; }
.cd-side{ position:sticky; top:90px; }
.cd-card{ background:#fff; border:1px solid var(--line); border-radius:18px; padding:22px; box-shadow:var(--shadow); }
.cd-price-big{ font-size:30px; font-weight:800; color:var(--ink); text-align:center; margin-bottom:14px; }
.cd-enrolled{ text-align:center; color:#1d7a4f; font-weight:600; margin:10px 0 0; }
.cd-features{ list-style:none; margin:16px 0 0; padding:14px 0 0; border-top:1px solid var(--line); display:flex; flex-direction:column; gap:9px; font-size:14px; color:var(--ink-soft); }

/* --- Constructeur (formateur) --- */
.bld-chapter{ border:1px solid var(--line); border-radius:12px; margin-bottom:14px; overflow:hidden; }
.bld-chapter-head{ display:flex; align-items:center; justify-content:space-between; padding:12px 14px; background:#faf7f1; border-bottom:1px solid var(--line); }
.bld-chapter-title{ font-weight:700; }
.bld-lesson, .bld-add-lesson{ border-bottom:1px solid #f4efe6; }
.bld-lesson summary, .bld-add-lesson summary{ padding:11px 14px; cursor:pointer; display:flex; align-items:center; gap:8px; font-size:14px; }
.bld-add-lesson summary{ color:var(--teal-2); font-weight:600; }
.bld-l-form{ padding:6px 14px 14px; background:#fcfaf6; }
.bld-l-type{ width:22px; text-align:center; }
.bld-add-chapter{ display:flex; gap:10px; margin-top:6px; }
.bld-add-chapter input{ flex:1; }

/* --- Quiz (gestion + passage) --- */
.quiz-q{ border:1px solid var(--line); border-radius:10px; padding:12px 14px; margin-bottom:10px; background:#fcfaf6; }
.quiz-q-head{ display:flex; justify-content:space-between; align-items:center; gap:10px; }
.quiz-q-opts{ list-style:none; margin:8px 0 0; padding:0; display:flex; flex-direction:column; gap:4px; font-size:13.5px; color:var(--ink-soft); }
.quiz-q-opts li.ok{ color:#1d7a4f; font-weight:700; }
.quiz-opts-grid{ display:grid; grid-template-columns:1fr 1fr; gap:0 14px; }
.quiz-take-q{ border:1px solid var(--line); border-radius:12px; padding:14px 16px; margin-bottom:12px; background:#fff; }
.qtq-title{ font-weight:700; margin-bottom:10px; }
.qtq-opt{ display:flex; align-items:center; gap:10px; padding:9px 12px; border:1px solid var(--line); border-radius:9px; margin-bottom:7px; cursor:pointer; font-size:14.5px; }
.qtq-opt:hover{ border-color:var(--gold); background:#fdfaf4; }
.qtq-opt input{ width:auto; accent-color:var(--gold); }
.quiz-result{ text-align:center; padding:34px 20px; }
.qr-score b{ display:block; font-size:52px; font-weight:800; }
.qr-score.ok b{ color:#1d7a4f; } .qr-score.ko b{ color:#d6492f; }
.qr-score span{ display:block; font-size:18px; font-weight:600; margin-top:4px; }

/* --- Espace apprenant --- */
.learn-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.learn-card{ background:#fff; border:1px solid var(--line); border-radius:16px; overflow:hidden; text-decoration:none; color:var(--ink); transition:transform .15s, box-shadow .15s; }
.learn-card:hover{ transform:translateY(-3px); box-shadow:0 14px 32px rgba(20,30,50,.1); border-color:var(--gold); }
.lc-cover{ height:110px; background:linear-gradient(135deg,#16304d,#2f9b9b); background-size:cover; background-position:center; display:grid; place-items:center; font-size:34px; }
.lc-body{ padding:14px 16px 16px; display:flex; flex-direction:column; gap:6px; }
.lc-body h3{ font-size:15.5px; margin:0; }
.lc-bar{ height:7px; background:#eee6d6; border-radius:5px; overflow:hidden; margin-top:4px; }
.lc-bar i{ display:block; height:100%; background:linear-gradient(90deg,#2f9b9b,#c9a15a); }
.lc-meta{ display:flex; justify-content:space-between; font-size:12.5px; color:var(--muted); }
.lc-go{ color:var(--gold-2); font-weight:700; }
.learn-course-head{ display:flex; justify-content:space-between; gap:20px; align-items:center; flex-wrap:wrap; }
.lch-info h2{ margin:0 0 4px; } .lch-info .btn{ margin-top:10px; }
.lch-progress{ display:flex; flex-direction:column; align-items:center; gap:4px; }
.lp-chapter{ margin-bottom:14px; }
.lp-chapter-title{ font-weight:700; margin-bottom:6px; }
.lp-lesson{ display:flex; align-items:center; gap:12px; padding:11px 14px; border:1px solid var(--line); border-radius:10px; margin-bottom:7px; text-decoration:none; color:var(--ink); font-size:14.5px; }
.lp-lesson:hover{ border-color:var(--gold); background:#fdfaf4; }
.lp-lesson.done{ background:#f3f9f4; border-color:#cbe7d4; }
.lp-check{ width:24px; height:24px; flex:none; border-radius:50%; border:2px solid #cfd8cf; display:grid; place-items:center; font-size:13px; color:#1d7a4f; }
.lp-lesson.done .lp-check{ background:#1d7a4f; border-color:#1d7a4f; color:#fff; }
.lp-title{ flex:1; }

/* --- Lecteur de leçon --- */
.lesson-head{ margin-bottom:14px; } .lesson-head h2{ margin:2px 0 0; }
.lesson-video{ position:relative; padding-top:56.25%; border-radius:14px; overflow:hidden; background:#0a1626; margin-bottom:16px; }
.lesson-video iframe{ position:absolute; inset:0; width:100%; height:100%; }
.lesson-text{ line-height:1.7; color:var(--ink-soft); font-size:15.5px; background:#fcfaf6; border:1px solid var(--line); border-radius:12px; padding:18px 20px; margin-bottom:16px; }
.lesson-nav{ display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; margin-top:8px; }

/* --- Certificat --- */
.cert-wrap{ min-height:100dvh; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:18px; padding:20px; background:#eef0f3; }
.cert{ background:#fff; width:100%; max-width:860px; box-shadow:0 20px 60px rgba(10,20,40,.18); }
.cert-border{ margin:16px; border:3px double var(--gold); padding:44px 40px; text-align:center; }
.cert-logo{ width:54px; height:54px; }
.cert-school{ font-weight:800; color:var(--navy); font-size:19px; letter-spacing:.06em; margin-top:6px; }
.cert-title{ font-size:34px; font-weight:800; color:var(--gold-2); margin:16px 0 8px; }
.cert-sub{ color:var(--muted); margin:8px 0; }
.cert-name{ font-size:30px; font-weight:800; color:var(--ink); margin:6px 0; border-bottom:2px solid var(--gold); display:inline-block; padding:0 24px 6px; }
.cert-course{ font-size:20px; font-weight:700; color:var(--navy); margin:8px 0; }
.cert-score{ margin:12px 0 26px; color:var(--ink-soft); }
.cert-foot{ display:flex; justify-content:space-between; color:var(--muted); font-size:14px; border-top:1px solid var(--line); padding-top:14px; }
.cert-sign{ font-weight:700; color:var(--navy); }
@media print{ .cert-actions{ display:none; } .cert-wrap{ background:#fff; padding:0; } .cert{ box-shadow:none; } body{ background:#fff; } }

@media (max-width:980px){ .course-grid, .learn-grid{ grid-template-columns:1fr 1fr; } .cd-inner{ grid-template-columns:1fr; } .cd-side{ position:static; } }
@media (max-width:640px){ .course-grid, .learn-grid{ grid-template-columns:1fr; } .quiz-opts-grid{ grid-template-columns:1fr; } .learn-course-head{ flex-direction:column; align-items:flex-start; } }

/* ============================================================
   TCHAT (v2.4)
   ============================================================ */
.chat-rooms{ display:flex; flex-direction:column; gap:12px; }
.chat-room-card{ display:flex; align-items:center; justify-content:space-between; gap:14px; border:1px solid var(--line); border-radius:12px; padding:14px 16px; flex-wrap:wrap; }
.chat-room-card.inactive{ opacity:.6; }
.crc-name{ font-size:15.5px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.crc-actions{ display:flex; align-items:center; gap:8px; }
.crc-admin{ position:relative; }
.crc-admin summary{ list-style:none; cursor:pointer; }
.crc-admin summary::-webkit-details-marker{ display:none; }
.crc-admin-panel{ margin-top:10px; border:1px solid var(--line); border-radius:12px; padding:14px; background:#fcfaf6; min-width:min(90vw,420px); }
.crc-mods{ display:grid; grid-template-columns:1fr 1fr; gap:4px 14px; max-height:180px; overflow-y:auto; margin-bottom:8px; }
.chat-room-card > .crc-actions details[open]{ width:100%; }

.chat-panel{ display:flex; flex-direction:column; height:calc(100dvh - 190px); min-height:420px; padding:0; overflow:hidden; }
.chat-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 18px; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.chat-head h2{ margin:0; font-size:17px; }
.chat-speakers{ display:flex; gap:8px; flex-wrap:wrap; }
.chat-spk{ font-size:12.5px; padding:4px 10px; border-radius:16px; display:inline-flex; align-items:center; gap:5px; }
.chat-spk.on{ background:#e2f3ea; color:#1d7a4f; font-weight:700; }
.chat-spk.req{ background:var(--gold-soft); color:#7a5b23; }
.chat-spk button{ border:none; background:rgba(0,0,0,.08); border-radius:50%; width:20px; height:20px; cursor:pointer; font-size:11px; }
.chat-messages{ flex:1; overflow-y:auto; padding:16px 18px; display:flex; flex-direction:column; gap:10px; background:#faf8f3; }
.chat-loading{ text-align:center; color:var(--muted); padding:30px 0; }
.cm{ max-width:min(78%,560px); background:#fff; border:1px solid var(--line); border-radius:14px; padding:9px 13px; position:relative; align-self:flex-start; }
.cm.mine{ align-self:flex-end; background:#eaf5f4; border-color:#cfe6e4; }
.cm-author{ display:block; font-size:12px; font-weight:700; color:var(--gold-2); margin-bottom:2px; }
.cm.mine .cm-author{ color:var(--teal-2); }
.cm-body{ font-size:14.5px; line-height:1.45; word-wrap:break-word; }
.cm-time{ display:block; font-size:10.5px; color:var(--muted); text-align:end; margin-top:3px; }
.cm-deleted{ color:var(--muted); }
.cm-img{ max-width:100%; max-height:260px; border-radius:8px; display:block; }
.cm-video{ max-width:100%; max-height:280px; border-radius:8px; }
.cm-audio{ max-width:240px; }
.cm-system{ text-align:center; color:var(--muted); font-size:12.5px; padding:2px 0; }
.cm-tools{ position:absolute; top:6px; inset-inline-end:8px; display:none; gap:4px; }
.cm:hover .cm-tools{ display:inline-flex; }
.cm-tools button{ border:none; background:#f0ece2; border-radius:6px; cursor:pointer; font-size:12px; padding:2px 6px; }
.chat-compose{ display:flex; gap:8px; align-items:center; padding:12px 14px; border-top:1px solid var(--line); background:#fff; }
.chat-compose input[type="text"]{ flex:1; height:44px; }
.chat-icon-btn{ width:44px; height:44px; flex:none; display:grid; place-items:center; border:1px solid var(--line); background:#faf8f4; border-radius:10px; cursor:pointer; font-size:19px; }
.chat-icon-btn.active, .chat-icon-btn.speaking{ background:var(--gold-soft); border-color:var(--gold); }
.chat-icon-btn.rec{ background:#fdecea; border-color:#d6492f; animation:chatpulse 1s infinite; }
@keyframes chatpulse{ 50%{ transform:scale(1.08);} }
.chat-muted-note{ padding:10px 16px; background:#fdecea; color:#a3271a; font-size:13.5px; }
@media (max-width:700px){
    .chat-panel{ height:calc(100dvh - 150px); }
    .cm{ max-width:88%; }
    .crc-mods{ grid-template-columns:1fr; }
}

/* ---- Tchat v2.6 : liste des connectés + compose mobile ---- */
.chat-body{ flex:1; display:flex; min-height:0; position:relative; }
.chat-main{ flex:1; display:flex; flex-direction:column; min-width:0; }
.chat-online{ width:250px; flex:none; border-inline-start:1px solid var(--line); background:#fff; display:flex; flex-direction:column; }
.chat-online-head{ padding:12px 14px; font-weight:700; font-size:14px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; }
.chat-online-close{ display:none; border:none; background:none; font-size:16px; cursor:pointer; color:var(--muted); }
.chat-online-list{ flex:1; overflow-y:auto; padding:8px; }
.ro-user{ display:flex; align-items:center; gap:8px; padding:8px 9px; border-radius:9px; font-size:13.5px; flex-wrap:wrap; }
.ro-user:hover{ background:#faf7f1; }
.ro-user.me{ background:#f4f9f8; }
.ro-name{ flex:1; min-width:0; display:flex; align-items:center; gap:5px; }
.ro-badge{ font-size:10.5px; font-weight:700; padding:2px 8px; border-radius:10px; }
.ro-admin{ background:#16304d; color:#fff; }
.ro-mod{ background:var(--gold-soft); color:#7a5b23; }
.ro-prof{ background:#e2f2f2; color:#227e7e; }
.ro-el{ background:#eef1f5; color:#57657e; }
.ro-mic.on{ color:#1d7a4f; } .ro-mic.req{ color:var(--gold-2); }
.ro-actions{ display:flex; gap:4px; width:100%; margin-top:2px; }
.ro-actions button{ border:1px solid var(--line); background:#fff; border-radius:7px; padding:3px 8px; cursor:pointer; font-size:13px; }
.ro-actions button:hover{ border-color:var(--gold); background:var(--gold-soft); }
.ro-empty{ text-align:center; color:var(--muted); padding:18px 0; }
.chat-online-toggle{ border:1px solid var(--line); background:#faf8f4; border-radius:18px; padding:6px 13px; cursor:pointer; font-size:13.5px; font-weight:600; }
.chat-online-backdrop{ display:none; }

/* Compose : outils + rangée d'envoi */
.chat-compose{ display:flex; gap:8px; align-items:center; padding:10px 14px; border-top:1px solid var(--line); background:#fff; }
.chat-tools{ display:flex; gap:8px; flex:none; }
.chat-sendrow{ flex:1; display:flex; gap:8px; align-items:center; min-width:0; }
.chat-sendrow input{ flex:1; height:46px; min-width:0; }
.chat-send{ flex:none; width:52px; height:46px; padding:0; font-size:18px; border-radius:10px; display:grid; place-items:center; }

@media (max-width:900px){
    /* Liste en ligne = panneau coulissant */
    .chat-online{ position:fixed; inset-inline-end:0; top:0; bottom:0; width:min(84vw,300px); z-index:600;
        transform:translateX(105%); transition:transform .22s ease; box-shadow:-14px 0 40px rgba(10,20,40,.25); }
    [dir="rtl"] .chat-online{ transform:translateX(-105%); }
    .chat-online.open{ transform:translateX(0); }
    .chat-online-close{ display:block; }
    .chat-online-backdrop{ position:fixed; inset:0; background:rgba(12,20,35,.45); z-index:590; }
    .chat-online-backdrop.show{ display:block; }
    /* Compose : outils au-dessus, champ pleine largeur + bouton envoyer */
    .chat-compose{ flex-direction:column; align-items:stretch; gap:8px; }
    .chat-tools{ justify-content:flex-start; }
    .chat-icon-btn{ width:42px; height:42px; font-size:17px; }
    .chat-sendrow{ width:100%; }
    .chat-sendrow input{ height:48px; font-size:15px; }
    .chat-send{ width:56px; height:48px; }
}

/* ---- v2.7 : footer app + scroll-top ---- */
.app-foot{ margin-top:26px; padding:16px 10px 18px; text-align:center; color:var(--muted); font-size:12.5px; border-top:1px solid var(--line); }
.scroll-top{ bottom:72px !important; }
.chat-page .scroll-top{ display:none !important; }

/* Menu contextuel de modération du tchat */
.chat-ctx{ display:none; position:fixed; z-index:900; min-width:250px; background:#fff; border:1px solid var(--line);
    border-radius:12px; box-shadow:0 18px 44px rgba(10,20,40,.22); padding:6px; }
.chat-ctx.show{ display:block; }
.chat-ctx-name{ font-weight:800; font-size:13.5px; padding:8px 12px 6px; color:var(--navy); border-bottom:1px solid var(--line); margin-bottom:4px; }
.chat-ctx button{ display:flex; width:100%; align-items:center; gap:8px; border:none; background:none; text-align:start;
    padding:9px 12px; border-radius:8px; font-size:13.5px; cursor:pointer; color:var(--ink); }
.chat-ctx button:hover{ background:var(--gold-soft); }
.chat-ctx hr{ border:none; border-top:1px solid var(--line); margin:4px 8px; }
.ro-user.clickable{ cursor:pointer; }
.ro-user.clickable:active{ background:var(--gold-soft); }
.cm-role{ font-style:normal; font-weight:600; font-size:11px; color:var(--muted); }

/* ---- v3.0 : icônes compactes + rôle dans la sidebar ---- */
.chat-icon-btn{ width:36px; height:36px; font-size:15px; border-radius:9px; }
.chat-sendrow input{ height:42px; }
.chat-send{ width:46px; height:42px; font-size:16px; }
.ro-role{ font-style:normal; font-weight:600; font-size:11px; color:var(--muted); }
@media (max-width:900px){
    .chat-icon-btn{ width:34px; height:34px; font-size:14px; }
    .chat-sendrow input{ height:44px; }
    .chat-send{ width:50px; height:44px; }
}

/* ---- v3.1 : barre de progression d'upload + prix barrés ---- */
.chat-upbar{ display:none; padding:8px 14px 4px; background:#fff; border-top:1px solid var(--line); }
.chat-upbar.show{ display:block; }
.chat-upbar-info{ display:flex; justify-content:space-between; font-size:12.5px; color:var(--ink-soft); margin-bottom:4px; }
.chat-upbar-name{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:75%; }
.chat-upbar-pct{ font-weight:700; color:var(--gold-2); }
.chat-upbar-track{ height:6px; background:#eee6d6; border-radius:4px; overflow:hidden; }
.chat-upbar-fill{ height:100%; width:0; background:linear-gradient(90deg,#2f9b9b,#c9a15a); transition:width .15s; }
.cc-old, .cd-old{ color:var(--muted); font-size:.72em; margin-inline-end:5px; }
.learn-card.is-pending{ opacity:.75; cursor:default; }
.pay-course{ display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 14px; background:#faf7f1; border:1px solid var(--line); border-radius:12px; margin-bottom:14px; flex-wrap:wrap; }
.pay-price b{ font-size:20px; }
.pay-info{ font-size:14px; color:var(--ink-soft); background:#f2f8f8; border:1px solid #d7ebea; border-radius:12px; padding:12px 16px; margin-bottom:16px; }
.pay-info ul{ margin:8px 0 0 18px; }
.b-blue{ background:#e3edf8; color:#20558c; } .b-gray{ background:#eceff2; color:#5c6470; }
