/* =====================================================
   QRST GESTION : systeme de design repris de Conversa
   (assets/css/style.css, refonte 2026-10-03), le 2026-10-18.
   Seules les parties utiles a une admin sont reprises : jetons,
   coquille, en-tete, cartes, tableaux, formulaires, boutons,
   pastilles, pagination, utilitaires, pages-listes, grilles.
   Polices hebergees localement (/_font/) : aucun appel a un tiers.
   ===================================================== */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/_font/inter-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/_font/inter-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* --- JETONS --- */
:root {
    /* Neutres (fixes) */
    --fond:        #f6f6f7;
    --surface:     #ffffff;
    --bord:        #e5e5e8;
    --bord-fort:   #d4d4d8;
    --texte:       #18181b;
    --texte-2:     #52525b;
    --texte-3:     #68686f;   /* RGAA 3.2 (2026-10-17) : #71717a donnait 4,47 sur le fond, 4,5 exige ; celui-ci 4,72 au plus bas */
    --survol:      #f4f4f5;
    --rayon:       10px;
    --ombre:       0 1px 2px rgba(16,16,20,.04);
    --ombre-haute: 0 12px 40px rgba(16,16,20,.14);

    /* Marque (surchargee par /assets/css/theme.php) */
    --marque-police:           'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --marque-primaire:         #1f48c7;
    --marque-primaire-texte:   #ffffff;
    --marque-primaire-doux:    #e9edf9;
    --marque-menu-actif:       #18181b;
    --marque-menu-actif-texte: #ffffff;
    --marque-accent:           #1f48c7;
    --marque-accent-texte:     #ffffff;
    --marque-lateral:          #ffffff;
    --marque-lateral-texte:    #27272a;

    /* Semantiques (fixes, toujours doublees d'un libelle) */
    --succes: #067647; --succes-fond: #ecfdf3; --succes-bord: #abefc6;
    --alerte: #b54708; --alerte-fond: #fffaeb; --alerte-bord: #fedf89;
    --danger: #b42318; --danger-fond: #fef3f2; --danger-bord: #fecdca;
    --info:   #175cd3; --info-fond:   #eff8ff; --info-bord:   #b2ddff;
    /* Les trois services, une couleur chacun (seance, credits, reservation) */
    --service-audio:     #067647;
    --service-ia:        var(--marque-primaire);
    --service-formateur: #b03a0a;   /* RGAA 3.2 : #c2410c donnait 4,35 sur son fond teinte */

    /* Anciens noms : les styles ecrits en ligne dans les pages suivent la marque */
    --green:       var(--marque-primaire);
    --green-dark:  var(--marque-menu-actif);
    --green-light: var(--marque-primaire);
    --orange:      var(--marque-accent);
    --orange-l:    var(--marque-accent);
    --gray-bg:     var(--fond);
    --gray-light:  var(--survol);
    --gray-mid:    var(--texte-3);
    --text:        var(--texte);
    --text-light:  var(--texte-2);
    --white:       #ffffff;
    --noir:        #000000;   /* QR codes : noir sur blanc quel que soit le theme */
    --border:      var(--bord);
    --success:     var(--succes);
    --warning:     #f5b400;
    --radius:      var(--rayon);
    --shadow:      var(--ombre-haute);
    --shadow-sm:   var(--ombre);
}

/* --- BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--marque-police); background: var(--fond); color: var(--texte); line-height: 1.5; font-size: 14px; }
a { color: var(--marque-primaire); text-decoration: none; }
a:hover { text-decoration: underline; }
/* RGAA 10.6 (2026-10-17) : un lien place dans un texte courant se distingue autrement que par sa couleur. Menus, boutons et
   liens portant une classe gardent leur style. */
p a:not([class]), .alert a:not([class]), dd a:not([class]), main li > a:not([class]):not(nav a) { text-decoration: underline; text-underline-offset: 2px; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, h5, h6 { font-family: var(--marque-police); font-weight: 700; color: var(--texte); line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: 26px; } h2 { font-size: 18px; } h3 { font-size: 15px; } h4 { font-size: 14px; }
:focus-visible { outline: 2px solid var(--marque-primaire); outline-offset: 2px; border-radius: 6px; }
.evitement { position: absolute; left: -9999px; top: 8px; z-index: 1000; background: var(--surface); padding: 8px 14px; border-radius: 8px; box-shadow: var(--ombre-haute); }
.evitement:focus { left: 8px; }

/* =====================================================
   COQUILLE (barre laterale + contenu)
   ===================================================== */
.coquille { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.lateral {
    background: var(--marque-lateral); color: var(--marque-lateral-texte);
    border-right: 1px solid var(--bord); padding: 16px 12px;
    display: flex; flex-direction: column; gap: 2px;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.lateral-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px 14px; min-height: 48px; }
.marque-logo { display: flex; align-items: center; color: inherit; text-decoration: none !important; min-width: 0; }
.marque-logo img { max-height: 36px; max-width: 170px; width: auto; }
.marque-texte { font-weight: 800; font-size: 17px; letter-spacing: .02em; }
.marque-texte-nom { white-space: normal; line-height: 1.2; overflow-wrap: anywhere; }
.marque-texte span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--marque-accent); margin-left: 3px; vertical-align: super; }
.marque-espace { font-size: 11px; font-weight: 500; opacity: .65; padding: 0 10px 6px; }
/* Intitules de rubrique (ESPACE, APPRENTISSAGE, COMPTE) dans la couleur de base de la marque. */
.rubrique { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--marque-primaire); padding: 18px 10px 6px; }
.entree {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px;
    font-weight: 500; color: inherit; white-space: nowrap; text-decoration: none !important;
}
.entree:hover { background: color-mix(in srgb, var(--marque-lateral-texte) 8%, transparent); }
.entree svg { width: 18px; height: 18px; flex-shrink: 0; }
.entree.actif { background: var(--marque-menu-actif); color: var(--marque-menu-actif-texte); }
.entree .compte { margin-left: auto; font-size: 12px; color: inherit; opacity: .82; font-variant-numeric: tabular-nums; }
.lateral-pied {
    margin-top: auto; border-top: 1px solid color-mix(in srgb, var(--marque-lateral-texte) 16%, transparent);
    padding: 12px 8px 0; display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.lateral-pied .qui { flex: 1; min-width: 0; line-height: 1.3; }
.lateral-pied .qui small { display: block; opacity: .65; font-size: 12px; }
.lateral-pied a.qui { color: inherit; text-decoration: none; border-radius: 7px; padding: 2px 4px; }
.lateral-pied a.qui:hover, .lateral-pied a.qui.actif { text-decoration: underline; text-underline-offset: 3px; }
.lateral-pied form { display: inline-block; }
.lateral-pied .sortie { background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 6px; border-radius: 7px; display: grid; place-items: center; }
.lateral-pied .sortie:hover { opacity: 1; background: color-mix(in srgb, var(--marque-lateral-texte) 8%, transparent); }
.lateral-pied .sortie svg { width: 18px; height: 18px; }
.lateral-pied .sortie-form { margin: 0; display: flex; }
.rond-photo { object-fit: cover; padding: 0; background: var(--surface); }
.rond { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 12px; background: var(--survol); color: var(--texte); border: 1px solid var(--bord); flex-shrink: 0; }

.principal, .main-content { padding: 24px 32px 56px; min-width: 0; }

/* Barre du haut sur mobile + menu repliable en CSS pur (case a cocher) */
.mobile-barre { display: none; }
.voile { display: none; }
.menu-bascule { position: absolute; opacity: 0; pointer-events: none; }
@media (max-width: 900px) {
    .coquille { grid-template-columns: 1fr; }
    .mobile-barre {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        position: sticky; top: 0; z-index: 60; background: var(--marque-lateral); color: var(--marque-lateral-texte);
        border-bottom: 1px solid var(--bord); padding: 10px 16px;
    }
    .mobile-barre label { cursor: pointer; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
    .mobile-barre svg { width: 22px; height: 22px; }
    .lateral { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 70; transform: translateX(-100%); transition: transform .2s; visibility: hidden; }
    .menu-bascule:checked ~ .coquille .lateral { transform: none; visibility: visible; box-shadow: var(--ombre-haute); }
    .menu-bascule:checked ~ .coquille .voile { display: block; }
    .voile { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 65; }
    .principal, .main-content { padding: 16px 16px 48px; }
    .menu-bascule:focus-visible ~ .mobile-barre label { outline: 2px solid var(--marque-primaire); }
}

/* Anciens noms de coquille (pages autonomes eventuelles) */
.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar-nav { background: var(--marque-lateral); color: var(--marque-lateral-texte); border-right: 1px solid var(--bord); padding: 16px 12px; }
.snav-section { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; opacity: .62; padding: 18px 10px 6px; }
.snav-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; font-weight: 500; color: inherit; }
.snav-item:hover { background: var(--survol); text-decoration: none; }
.snav-item.active { background: var(--marque-menu-actif); color: var(--marque-menu-actif-texte); }
.snav-badge { margin-left: auto; font-size: 12px; opacity: .7; }
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--bord); }
.navbar-brand, .navbar-right { display: flex; align-items: center; gap: 12px; }
.logo-text { font-weight: 800; font-size: 17px; color: var(--texte); letter-spacing: .02em; }
.logo-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--marque-accent); margin-left: 3px; vertical-align: super; }
.navbar-badge, .navbar-org-badge, .navbar-credits, .navbar-tagline { font-size: 12px; color: var(--texte-2); }

/* =====================================================
   EN-TETE DE PAGE, ONGLETS, BANDEAU
   ===================================================== */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.page-subtitle { color: var(--texte-2); margin-top: 4px; max-width: 760px; }
.ariane { font-size: 13px; color: var(--texte-3); display: flex; gap: 8px; align-items: center; margin-bottom: 2px; }
.ariane a { color: inherit; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--bord); margin-bottom: 20px; overflow-x: auto; }
.onglet { padding: 10px 16px 12px; color: var(--texte-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.onglet:hover { color: var(--texte); text-decoration: none; }
.onglet.actif { color: var(--texte); border-bottom-color: var(--marque-primaire); font-weight: 600; }
.onglet .nb { font-size: 12px; color: var(--texte-3); }

/* =====================================================
   CARTES
   ===================================================== */
.card { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); margin-bottom: 20px; overflow-x: auto; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--bord); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); }
.card-header h2, .card-header h3 { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: -.01em; color: var(--texte); }
.card-header svg { width: 18px; height: 18px; }
.card-header.orange, .card-header.dark { background: var(--surface); }
.card-header.orange h2, .card-header.orange h3, .card-header.dark h2, .card-header.dark h3 { color: var(--texte); }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--bord); background: #fafafa; display: flex; justify-content: flex-end; gap: 8px; }

/* Bandeaux en degrade (option de marque « Cartes de l'espace apprenant », 2026-10-17) : pose par
   coquilleDebut() sur body[data-cartes="degrade"], espace apprenant seulement. Le titre est a gauche,
   sur la couleur principale ; le lien a droite, sur l'accent : chacun prend le texte calcule pour SA
   couleur (theme.php), jamais un blanc impose qui deviendrait illisible sur un accent clair. */
body[data-cartes="degrade"] .card { border-color: transparent; border-radius: 8px; box-shadow: 0 2px 10px color-mix(in srgb, var(--texte) 9%, transparent); }
body[data-cartes="degrade"] .card-header { background: linear-gradient(90deg, var(--marque-primaire), var(--marque-accent)); border-bottom: 0; padding-top: 11px; padding-bottom: 11px; color: var(--marque-primaire-texte); }
body[data-cartes="degrade"] .card-header h2, body[data-cartes="degrade"] .card-header h3 { color: inherit; font-weight: 700; }
body[data-cartes="degrade"] .card-header > :is(span, small, p):not(:first-child) { color: var(--marque-accent-texte); }
/* Pastille assombrie sous le lien : un accent vif (orange) ne donne que 3,2:1 en blanc pour un texte de 11 px ;
   22 % de fonce dessous le porte au-dela de 4,5:1, que le texte calcule soit blanc ou noir. */
body[data-cartes="degrade"] .card-header a:not(.btn) { color: var(--marque-accent-texte); background: color-mix(in srgb, var(--texte) 22%, transparent); padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
body[data-cartes="degrade"] .card-header a:not(.btn):hover { background: color-mix(in srgb, var(--texte) 34%, transparent); }
body[data-cartes="degrade"] .card-header a:not(.btn)::before { content: "› "; content: "› " / ""; }
body[data-cartes="degrade"] .card-header .text-muted { color: inherit; opacity: .9; }
body[data-cartes="degrade"] .card-header :focus-visible { outline-color: currentColor; }
body[data-cartes="degrade"] .card-header .btn { background: var(--surface); color: var(--marque-primaire); border-color: transparent; }

/* Chiffres */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 16px 18px; }
.stat-card:hover { border-color: var(--bord-fort); }
.stat-val { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--texte); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-card.orange .stat-val, .stat-card.purple .stat-val { color: var(--marque-accent); }
.stat-card.green .stat-val  { color: var(--succes); }
.stat-card.red .stat-val    { color: var(--danger); }
.stat-card.blue .stat-val, .stat-card.teal .stat-val { color: var(--info); }
.stat-label { font-size: 12px; color: var(--texte-3); margin-top: 2px; }

/* =====================================================
   TABLEAUX (une ligne de hauteur, actions sur une ligne)
   ===================================================== */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--texte-3); padding: 11px 12px; border-bottom: 1px solid var(--bord); white-space: nowrap; background: var(--surface); text-transform: none; letter-spacing: 0; }
table td { padding: 11px 12px; border-bottom: 1px solid var(--bord); vertical-align: middle; white-space: nowrap; }
table td.retour, table td .retour { white-space: normal; }
table tr:hover td { background: #fafafa; }
table tr:last-child td { border-bottom: 0; }
table td form { display: inline-block; }
table td .btn + .btn, table td .btn + form, table td form + .btn, table td form + form { margin-left: 4px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* =====================================================
   FORMULAIRES
   ===================================================== */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
/* Boutons du bas d'un formulaire : n'existait que dans cours.css et jeux.css, les autres pages les collaient au formulaire. */
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.form-field label { font-size: 13px; font-weight: 500; color: var(--texte); }
.form-field small, .form-field .aide-champ { font-size: 12px; color: var(--texte-3); }
/* Groupe de cases dans un formulaire : sans le cadre et la legende a cheval du navigateur.
   :where() garde une specificite nulle, les groupes stylés a part (.propositions…) gardent leur regle. */
:where(fieldset.form-field) { border: 0; padding: 0; margin: 0 0 4px; min-width: 0; }
:where(fieldset.form-field) > legend { font-size: 13px; font-weight: 500; color: var(--texte); padding: 0; margin-bottom: 8px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number],
input[type=date], input[type=datetime-local], input[type=time], input[type=search], select, textarea {
    font: inherit; color: var(--texte); background: var(--surface);
    border: 1px solid var(--bord); border-radius: 9px; padding: 9px 12px; min-height: 40px; width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--marque-primaire); box-shadow: 0 0 0 3px color-mix(in srgb, var(--marque-primaire) 18%, transparent); }
input:disabled, select:disabled, textarea:disabled { background: var(--survol); color: var(--texte-3); }
input[type=checkbox], input[type=radio] { accent-color: var(--marque-primaire); width: 20px; height: 20px; }   /* cible tactile (WCAG 2.5.8), 16 px avant le 2026-10-17 */
input[type=color] { width: 40px; height: 40px; padding: 2px; border: 1px solid var(--bord); border-radius: 9px; background: var(--surface); cursor: pointer; }

/* =====================================================
   BOUTONS
   .btn = principal (couleur de marque) ; .gray / .outline = secondaire
   ===================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px; border-radius: 9px; border: 1px solid transparent;
    background: var(--marque-primaire); color: var(--marque-primaire-texte);
    font: inherit; font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap;
    text-decoration: none !important; box-shadow: var(--ombre); transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(.94); }
.btn:active { filter: brightness(.88); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.btn svg { width: 17px; height: 17px; }
.btn.gray, .btn.outline, .btn.secondaire { background: var(--surface); color: var(--texte); border-color: var(--bord); }
.btn.gray:hover, .btn.outline:hover, .btn.secondaire:hover { background: var(--survol); filter: none; }
.btn.orange { background: var(--marque-accent); color: var(--marque-accent-texte); }
.btn.green  { background: var(--succes); color: #fff; }
.btn.blue   { background: var(--info); color: #fff; }
.btn.red    { background: var(--surface); color: var(--danger); border-color: var(--bord); }
.btn.red:hover { background: var(--danger-fond); border-color: var(--danger-bord); filter: none; }
.btn.purple { background: var(--marque-primaire); }
.btn.dark   { background: var(--texte); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; box-shadow: none; gap: 6px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn.full, .btn.bloc { width: 100%; }

/* =====================================================
   PASTILLES, ALERTES
   ===================================================== */
.badge {
    display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; line-height: 1.6;
    padding: 1px 9px; border-radius: 99px; border: 1px solid var(--bord); color: var(--texte-2); background: var(--surface); white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge.green  { color: var(--succes); border-color: var(--succes-bord); background: var(--succes-fond); }
.badge.orange { color: var(--alerte); border-color: var(--alerte-bord); background: var(--alerte-fond); }
.badge.red    { color: var(--danger); border-color: var(--danger-bord); background: var(--danger-fond); }
.badge.blue   { color: var(--info); border-color: var(--info-bord); background: var(--info-fond); }
.badge.gray   { color: var(--texte-2); }
.badge.purple { color: var(--marque-primaire); border-color: color-mix(in srgb, var(--marque-primaire) 30%, transparent); background: var(--marque-primaire-doux); }

.alert { padding: 12px 16px; border-radius: var(--rayon); border: 1px solid var(--bord); background: var(--surface); margin-bottom: 16px; font-size: 14px; }
.alert.success { background: var(--succes-fond); border-color: var(--succes-bord); color: var(--succes); }
.alert.error   { background: var(--danger-fond); border-color: var(--danger-bord); color: var(--danger); }
.alert.warn    { background: var(--alerte-fond); border-color: var(--alerte-bord); color: var(--alerte); }
.alert.info    { background: var(--info-fond); border-color: var(--info-bord); color: var(--info); }

/* =====================================================
   PAGINATION, VIDE, FENETRES
   ===================================================== */
.pagination { display: flex; gap: 4px; justify-content: flex-end; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 32px; height: 32px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 7px; font-size: 13px; color: var(--texte-2); border: 1px solid transparent; }
.pagination a:hover { background: var(--survol); text-decoration: none; }
.pagination .active { background: var(--surface); color: var(--texte); border-color: var(--bord); font-weight: 600; }

.empty-state { text-align: center; padding: 48px 24px; color: var(--texte-3); }
.empty-state svg { width: 40px; height: 40px; margin: 0 auto 12px; opacity: .5; }
.empty-state p { font-size: 14px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(9,9,11,.45); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--ombre-haute); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; border: 1px solid var(--bord); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--bord); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 16px; margin: 0; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--texte-3); padding: 4px 8px; border-radius: 7px; }
.modal-close:hover { background: var(--survol); }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--bord); display: flex; justify-content: flex-end; gap: 8px; }

/* =====================================================
   UTILITAIRES
   ===================================================== */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--texte-3); }
.text-green  { color: var(--succes); }
.text-orange { color: var(--marque-accent); }
.text-red    { color: var(--danger); }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 12px; }
.mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Teintes et etats calcules par PHP : une classe, jamais un style="" (regle 12b).
   Les largeurs calculees passent par data-largeur, posees par actions.js. */
.ton-bon    { color: var(--green); }
.ton-moyen  { color: var(--orange); }
.ton-faible, .ton-danger { color: var(--danger); }
.fond-bon    { background: var(--green); }
.fond-moyen  { background: var(--orange); }
.fond-faible, .fond-danger { background: var(--danger); }
.gras { font-weight: 700; }
.attenue { opacity: .6; }
.ligne-courante { background: var(--marque-accent-doux, var(--fond)); border-radius: 4px; padding-left: 8px !important; padding-right: 8px !important; }
tr.ligne-alerte td { background: var(--danger-fond); }

/* Connexion LTI (org/lti.php) : les adresses a recopier, lisibles et selectionnables. */
.lti-adresses { display: grid; gap: 4px 0; margin: 12px 0 0; }
.lti-adresses dt { font-weight: 600; font-size: 13px; margin-top: 8px; }
.lti-adresses dd { margin: 0; overflow-wrap: anywhere; }
.lti-adresses code { user-select: all; }
.titre-barre { font-size: 16px; margin: 0; }
.champ-court { width: 80px; min-width: 0; }

@media (max-width: 900px) {
    .form-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 22px; }
    .card-body { padding: 16px; }
}

/* Ecran d'attente des pages longues (assets/js/coquille.js) */
.chargement-voile { position: fixed; inset: 0; background: rgba(9,9,11,.45); z-index: 9999; display: grid; place-items: center; }
.chargement-boite { background: var(--surface); border-radius: 14px; padding: 32px 40px; text-align: center; box-shadow: var(--ombre-haute); max-width: 340px; }
.chargement-roue { width: 40px; height: 40px; border: 3px solid var(--bord); border-top-color: var(--marque-primaire); border-radius: 50%; margin: 0 auto 14px; animation: chargement-tourne .8s linear infinite; }
.chargement-titre { font-weight: 600; }
.chargement-detail { font-size: 13px; color: var(--texte-3); margin-top: 4px; }
@keyframes chargement-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .chargement-roue { animation-duration: 3s; } }

/* =====================================================
   PERSONNALISATION (marque blanche)
   ===================================================== */
.perso-grille { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.perso-grille > .card { margin-bottom: 0; }
.perso-section { padding: 20px 22px; border-bottom: 1px solid var(--bord); }
.perso-section h2 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.perso-section .form-grid, .perso-section .perso-depot, .perso-police { margin-top: 14px; }
.perso-police { max-width: 360px; }
.perso-depot { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; border: 1px dashed var(--bord-fort); border-radius: var(--rayon); padding: 16px; }
.perso-logo-apercu { width: 180px; height: 64px; border: 1px solid var(--bord); border-radius: 8px; display: grid; place-items: center; background: #fff; padding: 6px; }
.perso-logo-apercu img { max-height: 48px; max-width: 160px; width: auto; }
.perso-couleur { display: flex; align-items: center; gap: 8px; }
.perso-couleur input[type=text] { font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; }
.perso-contraste { font-size: 12px; }
.perso-contraste.ok { color: var(--succes); }
.perso-contraste.ko { color: var(--danger); }
.perso-apercu { position: sticky; top: 24px; }
.mini { display: grid; grid-template-columns: 130px 1fr; height: 300px; font-size: 12px; font-family: var(--marque-police); }
.mini-lat { background: var(--marque-lateral); color: var(--marque-lateral-texte); border-right: 1px solid var(--bord); padding: 12px 8px; display: flex; flex-direction: column; gap: 4px; }
.mini-logo { margin-bottom: 10px; padding: 0 4px; min-height: 24px; display: flex; align-items: center; }
.mini-logo img { max-height: 24px; max-width: 110px; width: auto; }
.mini-logo .marque-texte { font-size: 12px; }
.mini-e { padding: 6px 8px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-e.actif { background: var(--marque-menu-actif); color: var(--marque-menu-actif-texte); }
.mini-main { padding: 14px; background: var(--fond); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.mini-titre { font-size: 15px; }
.mini-carte { background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: 10px 12px; display: flex; gap: 16px; align-self: stretch; }
.mini-carte b { display: block; font-size: 17px; color: var(--marque-accent); }
.mini-bouton { background: var(--marque-primaire); color: var(--marque-primaire-texte); border-radius: 7px; padding: 6px 10px; font-weight: 500; }
/* Style des cartes : l'en-tete de la mini-carte suit le choix (sobre ou bandeau en degrade). */
.mini-bandeau { align-self: stretch; display: flex; justify-content: space-between; gap: 8px; padding: 7px 12px; margin-bottom: -10px; background: #fff; border: 1px solid var(--bord); border-bottom: 0; border-radius: 8px 8px 0 0; font-weight: 600; }
.mini-bandeau + .mini-carte { border-top-left-radius: 0; border-top-right-radius: 0; }
.mini-bandeau span + span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--marque-primaire); }
.mini[data-cartes="degrade"] .mini-bandeau { background: linear-gradient(90deg, var(--marque-primaire), var(--marque-accent)); border-color: transparent; color: var(--marque-primaire-texte); }
.mini[data-cartes="degrade"] .mini-bandeau span + span { color: var(--marque-accent-texte); background: color-mix(in srgb, var(--texte) 22%, transparent); padding: 1px 7px; border-radius: 99px; }
fieldset.perso-section { border: 0; border-bottom: 1px solid var(--bord); margin: 0; min-width: 0; }
fieldset.perso-section > legend { float: left; width: 100%; padding: 0; }
fieldset.perso-section > legend + * { clear: both; }
.perso-choix { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; cursor: pointer; font-weight: 400; }
.perso-choix input { margin-top: 3px; }
.perso-choix small { display: block; color: var(--texte-3); }
.choix-organisme { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 20px; }
.choix-organisme .form-field { min-width: 280px; }
@media (max-width: 1100px) { .perso-grille { grid-template-columns: 1fr; } .perso-apercu { position: static; } }

/* =====================================================
   PAGES-LISTES (partials/_liste.php)
   ===================================================== */
.bandeau { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; margin-bottom: 20px; }
.bandeau-intro { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 16px 20px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.bandeau-intro p { color: var(--texte-2); max-width: 680px; margin: 0; }
.chiffres { display: flex; gap: 28px; flex-wrap: wrap; }
.chiffre b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--texte); font-variant-numeric: tabular-nums; line-height: 1.2; }
.chiffre b.accent { color: var(--marque-accent); }
.chiffre span { font-size: 12px; color: var(--texte-3); }
.bandeau-aide { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 0 22px; display: flex; align-items: center; gap: 10px; color: var(--texte-2); font-weight: 500; }
.bandeau-aide svg { width: 22px; height: 22px; color: var(--marque-primaire); }
.bandeau-aide:hover { text-decoration: none; border-color: var(--bord-fort); }

.barre-outils { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; margin-bottom: 16px; border-top: 1px solid var(--bord); border-bottom: 1px solid var(--bord); flex-wrap: wrap; align-items: center; }
.barre-gauche, .barre-droite { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.recherche { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--bord); border-radius: 9px; background: var(--surface); min-width: 320px; color: var(--texte-3); }
.recherche:focus-within { border-color: var(--marque-primaire); box-shadow: 0 0 0 3px color-mix(in srgb, var(--marque-primaire) 18%, transparent); }
.recherche svg { width: 16px; height: 16px; flex-shrink: 0; }
.recherche input[type=search] { border: 0; box-shadow: none; padding: 0; min-height: 0; height: 36px; background: transparent; }
.recherche input[type=search]:focus { box-shadow: none; }
.barre-droite select { width: auto; min-width: 140px; }

table th a.tri { color: inherit; display: inline-flex; gap: 2px; text-decoration: none; }
table th a.tri:hover { color: var(--texte); }
table th a.tri.actif { color: var(--texte); font-weight: 600; }
td.col-actions { width: 1%; }
.actions-ligne { display: flex; gap: 4px; white-space: nowrap; }
.actions-ligne form { display: inline-block; }
.nom-cellule { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--texte); }
a.nom-cellule:hover { text-decoration: none; color: var(--marque-primaire); }
.niveau { font-weight: 600; color: var(--marque-accent); }
.liste-pied { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--bord); color: var(--texte-3); font-size: 13px; flex-wrap: wrap; }
.liste-pied .pagination { margin: 0; }
.liste-vide { text-align: center; color: var(--texte-3); padding: 36px 16px !important; white-space: normal !important; }

/* margin: auto rend au <dialog> le centrage natif que la remise a zero « * { margin: 0 } » lui retirait. */
.dialogue { margin: auto; max-height: calc(100vh - 32px); overflow-y: auto; border: 1px solid var(--bord); border-radius: 14px; padding: 24px; max-width: 460px; width: calc(100% - 32px); box-shadow: var(--ombre-haute); color: var(--texte); background: var(--surface); }
.dialogue::backdrop { background: rgba(9,9,11,.45); }
.dialogue h2 { font-size: 18px; margin-bottom: 8px; }
.dialogue-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* Fiche (voir) */
.fiche-grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.fiche-liste { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; font-size: 14px; }
.fiche-liste dt { color: var(--texte-3); }
.fiche-liste dd { color: var(--texte); min-width: 0; overflow-wrap: anywhere; }
.formulaire-page { max-width: 760px; }
.formulaire-actions { display: flex; gap: 8px; margin-top: 20px; }
.ariane a:hover { color: var(--texte); }

@media (max-width: 900px) {
    .bandeau, .fiche-grille { grid-template-columns: 1fr; }
    .bandeau-aide { padding: 12px 20px; }
    .recherche { min-width: 0; width: 100%; }
    .barre-gauche { width: 100%; }
}

/* Logo de marque dans la barre de la seance plein ecran */
.session-topbar-logo img { max-height: 28px; width: auto; }

/* =====================================================
   GRILLES DE CARTES (pleine largeur, une colonne sous 900px)
   ===================================================== */
.grille-1-2, .grille-2-1, .grille-1-1, .grille-3 { display: grid; gap: 20px; align-items: start; margin-bottom: 20px; }
.grille-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.grille-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grille-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grille-3   { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grille-1-2 > .card, .grille-2-1 > .card, .grille-1-1 > .card, .grille-3 > .card { margin-bottom: 0; }
@media (max-width: 900px) { .grille-1-2, .grille-2-1, .grille-1-1, .grille-3 { grid-template-columns: 1fr; } }

