/* =============================================================================
   Portail CTR Île-de-France — feuille de style unique
   Couleurs institutionnelles FFESSM (SPEC) : bleu #0055A4, rouge #EF4135,
   gris encadré #F2F2F2, gris contour #D0D0D0. Contrastes conformes WCAG 2.1 AA.
   ============================================================================= */
:root {
    /* Palette de la charte graphique FFESSM 2024 (pages 19-20). Utiliser ces noms plutôt
       que les codes. Nuances 80/60/40/20 % = mélange avec du blanc (calculé, pas dans la charte). */
    --ffessm-marine: #223A5D;          /* corporate — Pantone 540 C */
    --ffessm-marine-80: #4E617D;
    --ffessm-marine-60: #7A899E;
    --ffessm-marine-40: #A7B0BE;
    --ffessm-marine-20: #D3D8DF;
    --ffessm-bleu-roi: #1962A1;        /* corporate — Pantone 7684 C */
    --ffessm-bleu-roi-80: #4781B4;
    --ffessm-bleu-roi-60: #75A1C7;
    --ffessm-bleu-roi-40: #A3C0D9;
    --ffessm-bleu-roi-20: #D1E0EC;
    --ffessm-rouge: #DD281F;           /* secondaire — Pantone 179 C */
    --ffessm-rouge-80: #E4534C;
    --ffessm-rouge-60: #EB7E79;
    --ffessm-rouge-40: #F1A9A5;
    --ffessm-rouge-20: #F8D4D2;
    /* Dégradé de bleu du logo (la charte ne donne pas de code : teintes relevées sur le visuel, page 20) */
    --ffessm-marine-nuit: #16263C;     /* marine assombri (hors charte) : fond du menu en mode sombre */
    --ffessm-ciel: #3EA8E0;            /* début du dégradé */
    --ffessm-cyan: #00A7E6;            /* point clair du dégradé */
    --ffessm-bleu-vague: #165991;      /* fin du dégradé */
    --ffessm-gradient: linear-gradient(90deg, var(--ffessm-ciel), var(--ffessm-cyan) 13%, var(--ffessm-bleu-vague));
    --blue: #0055A4;
    --blue-dark: #003E7A;
    --blue-soft: #E8F0FA;
    --red: #EF4135;
    --red-text: #C42A1F;
    --grey-bg: #F2F2F2;
    --grey-line: #D0D0D0;
    --ink: #1B2430;
    --muted: #5A6472;
    --white: #FFFFFF;
    --ok: #1E7B45;
    --ok-soft: #E5F4EB;
    --warn: #8A5A00;
    --warn-soft: #FFF4DA;
    --err-soft: #FDECEA;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    --heading: #003E7A;
    --surface: #FFFFFF;
    --line-soft: #E6E6E6;
    --input-line: #A9B1BC;
    --track: #E3E6EA;
    --ok-ink: #14532D;
    --warn-ink: #5C3D00;
    --err-ink: #7F1D1D;
    --maint-bg: #C62828;
    --sidebar-w: 260px;
    --side-bg: var(--ffessm-bleu-roi);
    --side-line: var(--ffessm-bleu-roi-80);
    --side-ink: var(--white);
    --side-strong: var(--white);
    --side-muted: var(--ffessm-bleu-roi-20);
    --side-hover: var(--ffessm-marine);
    --side-active: var(--ffessm-cyan);
    --side-active-ink: #06263D;        /* marine foncé : #223A5D sur le cyan ne donne que 4,2:1 (< 4,5) */
    --c0: #0A84D0; --c1: #E5484D; --c2: #1BAF7A; --c3: #E8A400;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Mode sombre : choisi par la personne (bouton ☀️/🌙) ou, à défaut, réglage du système */
:root[data-theme="dark"] {
    --blue-soft: #15304F; --grey-bg: #0E1726; --grey-line: #263650; --ink: #E4EAF2; --muted: #95A3B7;
    --link: #8EC1F7; --link-hover: #B9D9FB;
    --heading: #9CC8F5; --surface: #131D2E; --line-soft: #1E2B40; --input-line: #3A4B66; --track: #24324A;
    --ok: #34C27A; --ok-soft: #10331F; --ok-ink: #9BE3BB; --warn: #E8B54A; --warn-soft: #3A2C0B; --warn-ink: #F3D58F;
    --err-soft: #3A1517; --err-ink: #F6B1AC; --red-text: #FF7A70;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    --side-bg: var(--ffessm-marine-nuit); --side-line: var(--ffessm-marine); --side-ink: var(--ffessm-marine-20);
    --side-muted: var(--ffessm-marine-40); --side-hover: var(--ffessm-marine);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --blue-soft: #15304F; --grey-bg: #0E1726; --grey-line: #263650; --ink: #E4EAF2; --muted: #95A3B7;
        --link: #8EC1F7; --link-hover: #B9D9FB;
    --heading: #9CC8F5; --surface: #131D2E; --line-soft: #1E2B40; --input-line: #3A4B66; --track: #24324A;
        --ok: #34C27A; --ok-soft: #10331F; --ok-ink: #9BE3BB; --warn: #E8B54A; --warn-soft: #3A2C0B; --warn-ink: #F3D58F;
        --err-soft: #3A1517; --err-ink: #F6B1AC; --red-text: #FF7A70;
        --shadow: 0 1px 2px rgba(0,0,0,.4);
        --side-bg: var(--ffessm-marine-nuit); --side-line: var(--ffessm-marine); --side-ink: var(--ffessm-marine-20);
        --side-muted: var(--ffessm-marine-40); --side-hover: var(--ffessm-marine);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--grey-bg); }
a { color: var(--blue); }
a:hover { color: var(--heading); }
h1 { font-size: 1.75rem; line-height: 1.2; margin: .25rem 0 1rem; color: var(--heading); }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .875em; }
pre.code { background: var(--grey-bg); padding: .75rem; border-radius: 6px; overflow-x: auto; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--blue); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.empty { color: var(--muted); font-style: italic; }

.container { width: 100%; max-width: 1360px; margin: 0 auto; padding: 1.5rem 1.5rem 3rem; flex: 1; }

/* --- Structure : menu latéral + barre supérieure (maquette) ---------------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--side-bg); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--side-line); }
.sidebar__brand { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1.1rem 1.1rem 1rem; text-align: center; text-decoration: none; color: var(--side-ink); border-bottom: 4px solid var(--ffessm-rouge); }
/* Charte p. 7-8 : zone de protection autour du logo, et carré blanc sur fond coloré.
   logo.png est carré avec ses marges blanches : on l'affiche entier, sans le recadrer. */
.sidebar__brand img { width: 100%; max-width: 150px; aspect-ratio: 1 / 1; height: auto; border-radius: 8px; background: #fff; }
.sidebar__brand strong { display: block; color: var(--side-strong); line-height: 1.15; }
.sidebar__brand small { color: var(--side-muted); font-size: .95rem; }
.sidenav { padding: .5rem 0 1rem; flex: 1; }
.sidenav__group { margin: 1rem 1.1rem .35rem; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--side-muted); }
.sidenav a { display: flex; align-items: center; gap: .65rem; padding: .55rem 1.1rem; color: var(--side-ink); text-decoration: none; font-size: .93rem; border-left: 3px solid transparent; }
.sidenav a:hover { background: var(--side-hover); color: var(--side-strong); }
.sidenav a[aria-current="page"] { background: var(--side-active); color: var(--side-active-ink); border-left-color: var(--side-strong); font-weight: 600; }
.sidenav__icon { width: 1.3rem; text-align: center; flex: none; }
.sidenav .badge-count { position: static; margin-left: auto; }
.sidebar__user { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem; border-top: 1px solid var(--side-line); }
.sidebar__user .avatar { flex: none; }
.sidebar__who { flex: 1; min-width: 0; line-height: 1.2; font-size: .875rem; }
.sidebar__who b { display: block; color: var(--side-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__who small { color: var(--side-muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-toggle { background: var(--side-hover); border: 1px solid var(--side-line); color: var(--side-ink); border-radius: 8px; width: 36px; height: 36px; cursor: pointer; font-size: 1rem; flex: none; }
.theme-toggle:hover { border-color: var(--blue); }
.main { min-width: 0; display: flex; flex-direction: column; }
/* Bandeau « mode maintenance » : dans l'en-tête collant, donc visible sur toute la page */
.maintenance-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .25rem 1rem; padding: .65rem 1rem; background: var(--maint-bg); color: #fff; font-size: .95rem; text-align: center; }
.maintenance-bar form { margin: 0; }
.maintenance-bar__link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: #fff; text-decoration: underline; cursor: pointer; }
.maintenance-bar__link:hover, .maintenance-bar__link:focus-visible { text-decoration: none; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--grey-line); position: sticky; top: 0; z-index: 20; }
.topbar__inner { padding: .6rem 1.5rem; display: flex; align-items: center; gap: .75rem; min-height: 60px; }
.topbar__title { font-size: 1.05rem; font-weight: 700; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.usermenu { display: flex; align-items: center; gap: .5rem; }
.bell { position: relative; color: var(--blue); padding: .45rem; border-radius: 8px; display: inline-flex; border: 1px solid var(--grey-line); background: var(--surface); }
.bell:hover { background: var(--blue-soft); }
.badge-count { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 0 .35rem; min-width: 1.2rem; text-align: center; line-height: 1.2rem; }
.dropdown { position: relative; }
.dropdown summary { list-style: none; cursor: pointer; }
.dropdown summary::-webkit-details-marker { display: none; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #0A84D0, var(--blue)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.avatar--lg { width: 52px; height: 52px; border-radius: 12px; font-size: 1.05rem; }
.dropdown__panel { position: absolute; right: 0; top: calc(100% + .5rem); background: var(--surface); border: 1px solid var(--grey-line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.18); min-width: 240px; padding: .5rem; display: flex; flex-direction: column; z-index: 30; }
.dropdown__panel a, .dropdown__panel .linklike { padding: .5rem .75rem; border-radius: 6px; text-decoration: none; color: var(--ink); text-align: left; }
.dropdown__panel a:hover, .dropdown__panel .linklike:hover { background: var(--blue-soft); }
.dropdown__name { margin: .25rem .75rem .5rem; padding-bottom: .5rem; border-bottom: 1px solid var(--grey-line); font-weight: 600; }
.dropdown__name small { font-weight: 400; color: var(--muted); }
.quick summary { display: inline-flex; }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; width: 100%; }
.nav-toggle { display: none; background: none; border: 1px solid var(--grey-line); border-radius: 6px; width: 42px; height: 38px; cursor: pointer; flex: none; }
.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after { display: block; height: 2px; width: 20px; background: var(--ink); margin: 0 auto; position: relative; content: ""; }
.nav-toggle__bar::before { position: absolute; top: -6px; }
.nav-toggle__bar::after { position: absolute; top: 6px; }

/* --- Bandeau défilant ------------------------------------------------------ */
.banner { background: var(--blue); color: #fff; overflow: hidden; white-space: nowrap; font-size: .9rem; }
.banner__track { display: inline-block; padding: .4rem 0; animation: marquee 40s linear infinite; }
.banner:hover .banner__track { animation-play-state: paused; }
.banner__item { display: inline-block; margin-right: 3rem; }
.banner__item b { display: inline-block; background: rgba(255,255,255,.18); padding: 0 .4rem; border-radius: 4px; margin-right: .35rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; }
.banner__item--alerte b, .tag.banner__item--alerte { background: var(--red); color: #fff; }
.banner__item--reglementaire b { background: #FFD24D; color: #3A2C00; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
    .banner { white-space: normal; }
    .banner__track { animation: none; padding: .4rem 1rem; }
    .banner__item[aria-hidden="true"] { display: none; }
}

/* --- Composants ------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--grey-line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.card--narrow { max-width: 640px; }
.card--alert { border-left: 4px solid var(--red); }
.card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .5rem; }
.card__head h2 { margin: 0; }
details.card > summary { cursor: pointer; }
details.card[open] > summary { margin-bottom: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 { margin-bottom: 1.25rem; }
.grid-2--wide { grid-template-columns: 3fr 2fr; align-items: start; }
.grid-2--wide .card { margin-bottom: 1.25rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.breadcrumb { font-size: .875rem; color: var(--muted); margin-bottom: .25rem; }
.breadcrumb a { color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--grey-line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: .925rem; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn--primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); color: #fff; }
.btn--danger { color: var(--red-text); border-color: #F2B8B3; }
.btn--danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn--ok { color: var(--ok); border-color: #A9D8BB; }
.btn--ok:hover { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--sm { padding: .3rem .6rem; font-size: .825rem; }
.btn--block { width: 100%; }
.btn-group, .btn-stack { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-stack { flex-direction: column; align-items: flex-start; }

.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.alert--success { background: var(--ok-soft); border-color: #A9D8BB; color: var(--ok-ink); }
.alert--error { background: var(--err-soft); border-color: #F2B8B3; color: var(--err-ink); }
.alert--warning { background: var(--warn-soft); border-color: #F0D28A; color: var(--warn-ink); }
.alert--info { background: var(--blue-soft); border-color: #B7CDE8; color: var(--heading); }
.hint { background: var(--blue-soft); border-radius: 8px; padding: .6rem .9rem; font-size: .875rem; color: var(--heading); margin: .75rem 0; }
.hint ul { margin: .25rem 0 0; padding-left: 1.2rem; }

/* Formulaires */
.form { display: flex; flex-direction: column; gap: .9rem; }
.form--row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; }
.field { display: flex; flex-direction: column; gap: .3rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-weight: 600; font-size: .875rem; }
.field--full { grid-column: 1 / -1; }
.field--grow { flex: 1 1 220px; }
.field--inline { min-width: 150px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=number], input[type=tel], input[type=url], select, textarea {
    width: 100%; padding: .55rem .7rem; border: 1px solid var(--input-line); border-radius: 8px; font: inherit; background: var(--surface); color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 2px solid rgba(0, 85, 164, .25); outline-offset: 0; }
input[type=color] { width: 48px; height: 36px; padding: 2px; border: 1px solid var(--input-line); border-radius: 6px; background: var(--surface); }
.input--code { font-size: 1.5rem; letter-spacing: .3em; text-align: center; font-family: ui-monospace, monospace; }
.input--xs { width: 80px !important; }
.input--sm { width: 140px !important; }
.check, .radio { display: flex; align-items: center; gap: .5rem; font-size: .925rem; cursor: pointer; }
.check input, .radio input { width: 18px; height: 18px; accent-color: var(--blue); }
.form-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding-top: .5rem; border-top: 1px solid var(--grey-line); }
.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; background: var(--surface); border: 1px solid var(--grey-line); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .925rem; }
.table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border-bottom: 2px solid var(--grey-line); padding: .5rem; }
.table td { border-bottom: 1px solid var(--line-soft); padding: .6rem .5rem; vertical-align: top; }
.table tr.is-muted td { opacity: .55; }
.table tr.is-alert td { background: var(--err-soft); }
.table--compact td { padding: .35rem .5rem; }
.table .actions { display: flex; gap: .35rem; flex-wrap: wrap; }

/* Étiquettes et statuts */
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; background: var(--grey-bg); color: var(--ink); border: 1px solid var(--grey-line); white-space: nowrap; }
.tag--section { background: var(--c, var(--blue)); color: #fff; border-color: transparent; }
.tag--type { border-color: var(--c, var(--grey-line)); color: var(--ink); background: var(--surface); box-shadow: inset 3px 0 0 var(--c, var(--blue)); }
.tag--status-draft { background: var(--grey-bg); }
.tag--status-submitted { background: var(--warn-soft); border-color: #F0D28A; color: var(--warn-ink); }
.tag--status-published { background: var(--ok-soft); border-color: #A9D8BB; color: var(--ok-ink); }
.tag--status-cancelled { background: var(--err-soft); border-color: #F2B8B3; color: var(--err-ink); }
.tag--status-closed { background: var(--grey-bg); }
.tag--lock { background: var(--surface); }
.status { display: inline-block; font-size: .8rem; font-weight: 600; padding: .15rem .55rem; border-radius: 6px; }
.status--pending { background: var(--warn-soft); color: var(--warn-ink); }
.status--titulaire { background: var(--ok-soft); color: var(--ok-ink); }
.status--suppleant { background: var(--blue-soft); color: var(--heading); }
.status--refused, .status--withdrawn { background: var(--grey-bg); color: var(--muted); }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: var(--blue-soft); color: var(--heading); }
.pill--alert { background: var(--red); color: #fff; }

/* Listes */
.list { list-style: none; margin: 0; padding: 0; }
.list__item { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; padding: .65rem 0 .65rem .75rem; border-bottom: 1px solid var(--line-soft); border-left: 3px solid var(--c, transparent); }
.list__item:last-child { border-bottom: 0; }
.list__item .muted { flex: 1 1 100%; font-size: .875rem; }
.list__item > form { margin-left: auto; }

/* Accueil */
.hero { background: linear-gradient(120deg, var(--blue) 0%, var(--blue-dark) 100%); color: #fff; border-radius: var(--radius); padding: 1.75rem; margin-bottom: 1.25rem; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid rgba(239, 65, 53, .35); }
.hero h1 { color: #fff; margin: 0 0 .5rem; position: relative; }
.hero__text { max-width: 760px; opacity: .95; position: relative; }
.eyebrow { text-transform: uppercase; font-size: .8rem; letter-spacing: .08em; margin: 0; opacity: .85; }
.todo { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.todo__item { background: var(--surface); border: 1px solid var(--grey-line); border-left: 4px solid var(--blue); padding: .6rem 1rem; border-radius: 8px; text-decoration: none; color: var(--ink); }
.todo__item b { color: var(--blue); font-size: 1.1rem; }
.todo__item--red { border-left-color: var(--red); }
.todo__item--red b { color: var(--red-text); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.tile { background: var(--surface); border: 1px solid var(--grey-line); border-radius: var(--radius); padding: 1rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: .15rem; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.tile:hover { transform: translateY(-2px); border-color: var(--blue); color: var(--ink); }
.tile__icon { font-size: 1.5rem; }
.tile b { color: var(--heading); }
.tile small { color: var(--muted); }
.tile--ext { border-style: dashed; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--grey-line); border-radius: var(--radius); padding: 1rem; }
.stat b { display: block; font-size: 1.75rem; color: var(--blue); }
.stat span { color: var(--muted); font-size: .875rem; }
.stat--alert b { color: var(--red-text); }

/* Planning */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.segmented { display: inline-flex; border: 1px solid var(--grey-line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.segmented a { padding: .45rem .9rem; text-decoration: none; color: var(--ink); font-weight: 500; font-size: .9rem; }
.segmented a + a { border-left: 1px solid var(--grey-line); }
.segmented a[aria-current="true"] { background: var(--blue); color: #fff; }
.monthnav { display: flex; align-items: center; gap: .5rem; }
.monthnav b { min-width: 140px; text-align: center; }
.month-title { font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 1.25rem 0 .5rem; }
.activity-list { display: flex; flex-direction: column; gap: .6rem; }
.activity { display: flex; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--grey-line); border-left: 5px solid var(--c, var(--blue)); border-radius: var(--radius); padding: .8rem 1rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.activity:hover { border-color: var(--blue); border-left-color: var(--c, var(--blue)); color: var(--ink); }
.activity__date { text-align: center; min-width: 52px; }
.activity__date b { display: block; font-size: 1.5rem; line-height: 1; color: var(--heading); }
.activity__date small { text-transform: uppercase; color: var(--muted); font-size: .75rem; }
.activity__body { flex: 1; display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.activity__title { font-size: 1.05rem; }
.activity__tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.activity__side { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; text-align: right; }
.activity-detail { border-top: 5px solid var(--c, var(--blue)); }
.activity-detail h1 { margin-top: .5rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: 0 0 1rem; }
.facts div { background: var(--grey-bg); border-radius: 8px; padding: .5rem .75rem; }
.facts dt { font-size: .75rem; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
.facts dd { margin: 0; font-weight: 600; }
.facts--stack { grid-template-columns: 1fr; }
.prose { max-width: 75ch; }
.manage-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding-top: 1rem; margin-top: 1rem; border-top: 1px solid var(--grey-line); }
.team { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.team li { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.team .tag { margin-left: auto; }
.decision { display: flex; flex-direction: column; gap: .35rem; min-width: 210px; }
.decision__btns { display: flex; gap: .25rem; flex-wrap: wrap; }
.calendar { background: var(--surface); border: 1px solid var(--grey-line); border-radius: var(--radius); overflow: hidden; }
.calendar__head, .calendar__week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar__head span { padding: .5rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; color: var(--muted); background: var(--grey-bg); text-align: center; }
.calendar__day { min-height: 110px; border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); padding: .3rem; display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.calendar__day:first-child { border-left: 0; }
.calendar__day.is-out { background: var(--grey-bg); color: #A0A7B1; }
.calendar__day.is-today .calendar__num { background: var(--red); color: #fff; border-radius: 999px; }
.calendar__num { font-size: .8rem; font-weight: 700; align-self: flex-start; padding: 0 .4rem; }
.chip { display: block; font-size: .72rem; line-height: 1.25; padding: .15rem .35rem; border-radius: 4px; background: var(--c, var(--blue)); color: #fff; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip:hover { color: #fff; filter: brightness(1.1); }
.chip--muted { opacity: .6; background-image: repeating-linear-gradient(45deg, transparent 0 4px, rgba(255,255,255,.25) 4px 8px); }

/* Documents */
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem; }
.folder { background: var(--surface); border: 1px solid var(--grey-line); border-radius: var(--radius); padding: 1rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: .25rem; box-shadow: var(--shadow); }
.folder:hover { border-color: var(--blue); color: var(--ink); }
.folder__icon { font-size: 1.6rem; }
.folder b { color: var(--heading); }
.folder__meta { font-size: .8rem; color: var(--muted); margin-top: auto; padding-top: .5rem; }

/* Notifications */
.notifs { list-style: none; padding: 0; margin: 0; }
.notif { border-bottom: 1px solid var(--line-soft); }
.notif__btn { display: flex; flex-direction: column; gap: .15rem; width: 100%; text-align: left; background: none; border: 0; padding: .8rem .75rem; font: inherit; color: var(--ink); cursor: pointer; border-left: 3px solid transparent; }
.notif__btn:hover { background: var(--blue-soft); }
.notif.is-unread .notif__btn { border-left-color: var(--blue); background: var(--blue-soft); }
.notif.is-unread .notif__title { font-weight: 700; }
.notif.is-ack .notif__btn { border-left-color: var(--red); }
.notif__body { font-size: .9rem; color: var(--muted); }
.notif__date { font-size: .8rem; color: var(--muted); }

/* Divers */
.faq details { background: var(--surface); border: 1px solid var(--grey-line); border-radius: 8px; padding: .75rem 1rem; margin-bottom: .5rem; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq h2 { margin-top: 1.5rem; color: var(--heading); }
.steps { padding-left: 1.2rem; display: flex; flex-direction: column; gap: .75rem; }
.secret { font-family: ui-monospace, monospace; font-size: 1.2rem; letter-spacing: .08em; background: var(--grey-bg); border: 1px dashed var(--grey-line); border-radius: 8px; padding: .6rem .8rem; margin: .4rem 0; cursor: copy; word-break: break-all; }
.secret.is-copied::after { content: "  ✓ copié"; color: var(--ok); font-size: .85rem; }
.danger-zone { margin-top: 1rem; border-top: 1px solid var(--grey-line); padding-top: .75rem; }
.danger-zone summary { color: var(--red-text); cursor: pointer; font-weight: 600; }
/* Rôles et droits (back-office) */
.caps-group { margin: 0 0 1rem; padding: .5rem 1rem .75rem; border: 1px solid var(--grey-line); border-radius: 8px; min-width: 0; }
.caps-group > legend { font-weight: 600; padding: 0 .4rem; }
.caps-group .check { align-items: flex-start; margin: .4rem 0; }
.caps-group code, .matrix code { color: var(--muted); font-size: .8rem; }
.matrix__role { text-align: center; }
.matrix__cell { text-align: center; }
.matrix__group th { background: var(--grey-bg); text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--ink); }
.ref-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ref-row input[type=text] { flex: 1 1 180px; width: auto; }
.pager { display: flex; justify-content: center; gap: 1rem; align-items: center; margin-top: 1rem; }

.footer { border-top: 1px solid var(--grey-line); background: var(--surface); font-size: .85rem; color: var(--muted); }
.footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding-top: 1rem; padding-bottom: 1rem; }
.footer a { color: var(--muted); }

/* Pages hors connexion */
.minimal { background: linear-gradient(160deg, var(--blue) 0%, var(--blue-dark) 55%, #00274D 100%); min-height: 100vh; }
.auth-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.auth-card { background: var(--surface); width: 100%; max-width: 440px; border-radius: 14px; padding: 2rem; box-shadow: 0 20px 50px rgba(0,0,0,.3); border-top: 5px solid var(--red); }
.auth-card__brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }
.auth-card__brand div { display: flex; flex-direction: column; line-height: 1.2; }
.auth-card__brand strong { color: var(--blue); font-size: 1.15rem; }
.auth-card__brand span { color: var(--muted); font-size: .85rem; }
.auth-title { font-size: 1.4rem; margin: 0 0 1rem; }
.auth-links { text-align: center; font-size: .9rem; margin: 1rem 0 0; }
.auth-foot { color: rgba(255,255,255,.75); font-size: .8rem; margin-top: 1.25rem; text-align: center; }

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 900px) {
    .grid-2, .grid-2--wide { grid-template-columns: minmax(0, 1fr); }
    .shell { grid-template-columns: 1fr; }
    .nav-toggle { display: block; }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.35); }
    .sidebar.is-open { transform: none; }
    .topbar__inner { padding: .5rem 1rem; }
}
@media (max-width: 640px) {
    h1 { font-size: 1.4rem; }
    .container { padding: 1rem .75rem 2rem; }
    .form-grid { grid-template-columns: 1fr; }
    .container { padding: 1rem .75rem 2rem; }
    .topbar__title { font-size: .95rem; }
    .quick__label { display: none; }
    .activity { flex-wrap: wrap; }
    .activity__side { flex-direction: row; align-items: center; width: 100%; justify-content: flex-start; text-align: left; }
    .calendar__day { min-height: 70px; }
    .chip { font-size: 0; padding: 0; height: 6px; }
    .hero { padding: 1.25rem; }
    .table th:nth-child(3), .table td:nth-child(3) { display: none; }
}
@media print {
    .topbar, .sidebar, .footer, .filters, .manage-bar, form { display: none !important; }
    .shell { display: block; }
    body { background: var(--surface); }
    .card { box-shadow: none; }
}

/* --- Cursus IRS ------------------------------------------------------------ */
.dots { display: inline-flex; gap: 3px; flex-wrap: wrap; vertical-align: middle; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--track); border: 1px solid #C9CED6; vertical-align: middle; }
.dot--ok { background: var(--ok); border-color: var(--ok); }
.dot--wip { background: #F5C451; border-color: #D9A21B; }
.cursus { display: inline-block; font-size: .8rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; background: var(--grey-bg); color: var(--ink); white-space: nowrap; }
.cursus--en_attente { background: var(--warn-soft); color: var(--warn-ink); }
.cursus--en_cours { background: var(--blue-soft); color: var(--heading); }
.cursus--termine { background: var(--ok); color: #fff; }
.cursus--abandon { background: var(--grey-bg); color: var(--muted); }
.cursus--lg { font-size: .95rem; padding: .35rem .9rem; }
.avis { font-weight: 700; font-size: .85rem; }
.avis--favorable { color: var(--ok); }
.avis--defavorable { color: var(--red-text); }
.avis--non_vu, .avis--attente { color: var(--warn); }
.green-flag { color: var(--ok); font-weight: 700; margin: .75rem 0 0; }
.irs-head { border-top: 5px solid var(--blue); }
.irs-head--green { border-top-color: var(--ok); }
.irs-head h1 { margin-bottom: .25rem; }
.card--accent { border-left: 4px solid var(--blue); }
.stat--link { text-decoration: none; color: inherit; }
.stat--link:hover, .stat--link.is-active { border-color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); }
.letter { white-space: normal; background: var(--grey-bg); border-radius: 8px; padding: .75rem 1rem; font-size: .925rem; margin-top: .5rem; }
.letter-box { flex: 1 1 100%; }
.letter-box summary { cursor: pointer; color: var(--blue); font-size: .875rem; }
.opinion { border-left: 3px solid var(--grey-line); padding: .25rem .75rem; margin-bottom: .75rem; }
.edit-block { margin-top: .75rem; }
.edit-block > summary { list-style: none; cursor: pointer; margin-bottom: .75rem; }
.edit-block > summary::-webkit-details-marker { display: none; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 .9rem; border-left: 2px solid var(--grey-line); }
.timeline li { margin-bottom: .6rem; font-size: .9rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -1.25rem; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.evalsheet__head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.evalsheet__head h1 { flex: 1 1 100%; margin: .1rem 0 .25rem; font-size: 1.4rem; }
.evalsheet .form-grid { margin-bottom: 1rem; }
.evalgrid { margin-bottom: 1rem; }
.evalgrid th:first-child { font-size: .95rem; text-transform: none; letter-spacing: 0; color: var(--heading); width: 45%; }
.evalgrid__score { width: 190px; }
.evalgrid select, .evalgrid input { padding: .35rem .5rem; font-size: .875rem; }
.evalgrid select[data-level="4"] { background: var(--ok-soft); }
.evalgrid select[data-level="3"] { background: var(--ok-soft); }
.evalgrid select[data-level="2"] { background: var(--warn-soft); }
.evalgrid select[data-level="1"] { background: var(--err-soft); }
.radios { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.avisbox { background: var(--grey-bg); border-radius: 8px; padding: .75rem 1rem; gap: .5rem; margin: .5rem 0 1rem; }
.avisbox legend { font-weight: 700; }
.scorebar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: .5rem 0 1rem; font-size: .925rem; }
.scorebar__track { position: relative; flex: 1 1 200px; height: 12px; background: var(--track); border-radius: 999px; overflow: hidden; }
.scorebar__fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--blue); transition: width .2s; }
.scorebar__fill.is-ok { background: var(--ok); }
.scorebar__fill.is-low { background: var(--red); }
.scorebar__threshold { position: absolute; top: -2px; bottom: -2px; left: 75%; width: 2px; background: var(--ink); }
input:disabled, select:disabled, textarea:disabled { background: var(--grey-bg); color: var(--ink); opacity: 1; }
aside .card { margin-bottom: 1.25rem; }
.session-docs .list__item { border-left-color: var(--blue); }
.folders--sub { margin-bottom: 1.25rem; }
.folder--new { border-style: dashed; }
.folder--new summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: .25rem; }
.folder--new summary::-webkit-details-marker { display: none; }
.folder--new[open] summary { margin-bottom: .75rem; }

/* --- Tableau de bord & reporting ------------------------------------------ */
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--grey-line); margin: .5rem 0 1rem; flex-wrap: wrap; }
.tabs a { padding: .55rem 1rem; text-decoration: none; color: var(--ink); font-weight: 600; border-radius: 8px 8px 0 0; }
.tabs a:hover { background: var(--blue-soft); }
.tabs a[aria-current="page"] { color: var(--blue); box-shadow: inset 0 -3px 0 var(--red); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.kpi { background: var(--surface); border: 1px solid var(--grey-line); border-top: 4px solid var(--blue); border-radius: var(--radius); padding: .9rem 1rem; display: flex; flex-direction: column; gap: .1rem; box-shadow: var(--shadow); }
.kpi span { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.kpi b { font-size: 2rem; line-height: 1.1; color: var(--ink); }
.kpi small { color: var(--muted); font-size: .8rem; }
.kpi--ok { border-top-color: var(--ok); }
.kpi--wait { border-top-color: #D9A21B; }
.kpi--alert { border-top-color: var(--red); }
a.kpi { text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--blue); }
.chart { margin: 0; }
.chart__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.legend { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .8rem; color: var(--muted); }
.legend__item { display: inline-flex; align-items: center; gap: .3rem; }
.legend__swatch { display: inline-flex; }
.chart__svg { width: 100%; height: auto; display: block; }
.chart__tick { font-size: 11px; fill: var(--muted); }
.chart__val { font-size: 11px; fill: var(--ink); font-weight: 600; }
.chart__bar:hover rect[fill]:not([fill="transparent"]) { opacity: .85; }
.chart__table { margin-top: .5rem; font-size: .875rem; }
.chart__table summary { cursor: pointer; color: var(--blue); }
.matrix th[scope="row"] { text-align: left; font-size: .875rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .875rem; color: var(--muted); }
.h1like { font-size: 1.5rem; color: var(--heading); margin: .1rem 0; }
.print-only { display: none; }
.week { list-style: none; padding: 0; margin: 0; }
.week li { display: flex; gap: .75rem; padding: .45rem 0; border-bottom: 1px solid var(--line-soft); align-items: baseline; }
.week li:last-child { border-bottom: 0; }
.week__day { min-width: 92px; font-weight: 700; color: var(--heading); text-transform: capitalize; }
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { padding: .45rem 0 .45rem .9rem; border-left: 2px solid var(--blue-soft); position: relative; font-size: .925rem; }
.feed li::before { content: ""; position: absolute; left: -5px; top: .85rem; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.feed small { color: var(--muted); display: block; }
@media print {
    .no-print, .tabs, .filters, .btn-group, .chart__table summary { display: none !important; }
    .print-only { display: block; }
    .chart__table[open] { display: block; }
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .kpi, .card { break-inside: avoid; box-shadow: none; }
    @page { size: A4 landscape; margin: 10mm; }
}
.kpi__small { font-size: 1.1rem !important; }
.tabs--inline { border: 0; margin: 0; font-size: .875rem; }
.tabs--inline a { padding: .3rem .7rem; }
.grid-2--stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1500px) { .grid-2--stack { grid-template-columns: minmax(0, 1fr); } }


/* =============================================================================
   Écrans de la maquette (POC) : indicateurs, fiches membres, cursus, examens,
   messagerie, back-office
   ============================================================================= */
.greeting { margin: 0 0 1.25rem; }
.greeting h1 { margin: 0; color: var(--ink); }
.greeting p { margin: .15rem 0 0; color: var(--muted); }
.kpi--c0 { border-top-color: var(--c0); } .kpi--c1 { border-top-color: var(--c1); }
.kpi--c2 { border-top-color: var(--c2); } .kpi--c3 { border-top-color: var(--c3); }
.kpi small.up { color: var(--ok); font-weight: 600; }
.kpi small.down { color: var(--red-text); font-weight: 600; }
.kpi { position: relative; overflow: hidden; }
.kpi__icon { position: absolute; right: .9rem; top: .9rem; font-size: 1.9rem; opacity: .18; }
.seg { display: inline-flex; gap: .25rem; background: var(--grey-bg); border: 1px solid var(--grey-line); border-radius: 10px; padding: .25rem; margin-bottom: 1.25rem; }
.seg a { padding: .45rem 1rem; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; }
.seg a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.feed__dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .35rem; background: var(--c0); }
.feed--dots li { border-left: 0; padding-left: 0; border-bottom: 1px solid var(--line-soft); padding: .6rem 0; }
.feed--dots li::before { display: none; }
.feed--dots small { margin-left: 1rem; }
.feed__dot--ok { background: var(--c2); } .feed__dot--warn { background: var(--c3); } .feed__dot--alert { background: var(--c1); } .feed__dot--doc { background: #C2187A; }
.upcoming { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.upcoming li a { display: flex; align-items: center; gap: .9rem; padding: .55rem .8rem; background: var(--grey-bg); border-radius: 10px; text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.upcoming li a:hover { border-color: var(--blue); }
.datebadge { min-width: 46px; text-align: center; line-height: 1; color: var(--c, var(--blue)); }
.datebadge b { display: block; font-size: 1.3rem; }
.datebadge small { font-size: .68rem; text-transform: uppercase; color: var(--muted); }
.upcoming__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.upcoming__body small { color: var(--muted); }
.typetag { display: inline-block; font-size: .72rem; font-weight: 700; padding: .12rem .55rem; border-radius: 999px; color: var(--c, var(--blue)); background: var(--grey-bg); border: 1px solid var(--c, var(--grey-line)); white-space: nowrap; }
.toolbar--filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.toolbar--filters input[type=search] { max-width: 280px; }
.toolbar--filters select { width: auto; }
/* Fiches membres (suivi individuel) */
.mcards { display: flex; flex-direction: column; gap: 1rem; }
.mcard { background: var(--surface); border: 1px solid var(--grey-line); border-radius: 14px; padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.mcard__head { display: flex; align-items: center; gap: .9rem; margin-bottom: .9rem; }
.mcard__head h3 { margin: 0; font-size: 1.1rem; }
.mcard__head h3 a { color: var(--ink); text-decoration: none; }
.mcard__head p { margin: .1rem 0 0; color: var(--muted); font-size: .875rem; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.mcard__head .btn { margin-left: auto; }
.mstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-bottom: .9rem; }
.mstat { background: var(--grey-bg); border-radius: 10px; padding: .6rem; text-align: center; }
.mstat b { display: block; font-size: 1.35rem; line-height: 1.2; }
.mstat small { color: var(--muted); font-size: .78rem; }
.mstat--c2 b { color: var(--c2); } .mstat--c1 b { color: #D6337A; } .mstat--ok b { color: var(--ok); } .mstat--off b { color: var(--muted); }
.mcard h4 { font-size: .8rem; margin: .7rem 0 .35rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rtags { display: flex; flex-wrap: wrap; gap: .3rem; }
.rtag { font-size: .74rem; font-weight: 600; padding: .12rem .55rem; border-radius: 999px; background: var(--blue-soft); color: var(--heading); }
.grade { display: inline-block; font-size: .72rem; font-weight: 800; padding: .05rem .45rem; border-radius: 5px; background: var(--grey-bg); border: 1px solid var(--grey-line); color: var(--ink); }
.grade--IN { color: #C62828; border-color: #E8A6A6; } .grade--IR { color: var(--blue); border-color: #A9C4E6; }
.grade--IRS { color: #A66300; border-color: #EBCB8B; }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.hist li { display: flex; align-items: center; gap: .75rem; padding: .45rem .7rem; background: var(--grey-bg); border-radius: 8px; font-size: .9rem; }
.hist time { color: var(--muted); font-size: .8rem; min-width: 78px; }
.hist__title { flex: 1; min-width: 0; }
.hist__role { color: var(--muted); font-size: .82rem; }
.bar { display: block; width: 100%; height: 8px; }
.bar__bg { fill: var(--track); }
.bar__fill { fill: var(--c, var(--blue)); }
.kpi--c0 .bar__fill, li.kpi--c0 .bar__fill { fill: var(--c0); } .kpi--c1 .bar__fill { fill: var(--c1); } .kpi--c2 .bar__fill { fill: var(--c2); } .kpi--c3 .bar__fill { fill: var(--c3); }
.cursusbar { display: flex; flex-direction: column; gap: .3rem; }
.cursusbar__label { font-size: .82rem; font-weight: 600; }
/* Reporting maquette */
.colchart { width: 100%; height: 150px; background: var(--grey-bg); border-radius: 10px; padding: .5rem; margin-bottom: .75rem; }
.colchart__bar { fill: var(--c, var(--blue)); }
.sharelist, .rolebars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.sharelist li { display: grid; grid-template-columns: minmax(0, 1fr) 90px 44px; align-items: center; gap: .6rem; font-size: .9rem; }
.sharelist small { color: var(--muted); text-align: right; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--blue)); margin-right: .4rem; }
.rolebars li { display: grid; grid-template-columns: 1fr auto; gap: .35rem .6rem; background: var(--grey-bg); border-radius: 10px; padding: .6rem .8rem; border: 0; }
.rolebars li .bar { grid-column: 1 / -1; }
.rolebars li span { font-weight: 600; font-size: .9rem; }
.rolebars li b { color: var(--muted); font-size: .9rem; }
/* Cartes génériques (cursus, examens) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.xcard { background: var(--surface); border: 1px solid var(--grey-line); border-top: 4px solid var(--c, var(--blue)); border-radius: 12px; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .6rem; box-shadow: var(--shadow); }
.xcard__head { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.xcard__head h3 { margin: 0; font-size: 1.05rem; }
.xcard__head h3 a { color: var(--ink); text-decoration: none; }
.xcard dl { display: grid; grid-template-columns: auto 1fr; gap: .15rem .75rem; margin: 0; font-size: .875rem; }
.xcard dt { color: var(--muted); }
.xcard dd { margin: 0; font-weight: 600; }
.xcard__foot { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: auto; padding-top: .4rem; border-top: 1px solid var(--line-soft); }
.steps-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.step-chip { font-size: .72rem; padding: .12rem .5rem; border-radius: 999px; border: 1px solid var(--grey-line); color: var(--muted); }
.step-chip.is-ok { background: var(--ok-soft); color: var(--ok-ink); border-color: transparent; font-weight: 600; }
.step-chip.is-wip { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }
.state { font-size: .75rem; font-weight: 700; padding: .12rem .55rem; border-radius: 999px; white-space: nowrap; }
.state--upcoming { background: var(--blue-soft); color: var(--heading); }
.state--running { background: var(--warn-soft); color: var(--warn-ink); }
.state--done { background: var(--grey-bg); color: var(--muted); }
.doclist { list-style: none; margin: 0; padding: 0; font-size: .85rem; display: flex; flex-direction: column; gap: .25rem; }
.doclist li { display: flex; gap: .4rem; align-items: center; }
.doclist li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Messagerie */
.inbox { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--grey-line); border-radius: 12px; overflow: hidden; min-height: 520px; }
.inbox__list { border-right: 1px solid var(--grey-line); overflow-y: auto; max-height: 75vh; }
.inbox__list a { display: block; padding: .75rem 1rem; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); position: relative; }
.inbox__list a:hover, .inbox__list a[aria-current="page"] { background: var(--blue-soft); }
.inbox__list a.is-unread { font-weight: 700; }
.inbox__list a.is-unread::before { content: ""; position: absolute; left: .35rem; top: 1.15rem; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.inbox__list small { display: block; color: var(--muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox__pane { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
.inbox__pane h2 { margin: 0; }
.bubbles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.bubble { background: var(--grey-bg); border-radius: 12px; padding: .65rem .9rem; max-width: 85%; }
.bubble.is-mine { align-self: flex-end; background: var(--blue-soft); }
.bubble header { font-size: .78rem; color: var(--muted); margin-bottom: .2rem; }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.inbox__empty { display: grid; place-items: center; color: var(--muted); }
/* Back-office */
.bo-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.bo-tile { background: var(--surface); border: 1px solid var(--grey-line); border-radius: 12px; padding: 1.1rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: .35rem; box-shadow: var(--shadow); }
.bo-tile:hover { border-color: var(--blue); color: var(--ink); }
.bo-tile__icon { font-size: 1.6rem; }
.bo-tile b { font-size: 1.02rem; }
.bo-tile small { color: var(--muted); }
.bo-tile ul { margin: .25rem 0 0; padding-left: 1.1rem; font-size: .85rem; color: var(--muted); }
.dropzone { border: 2px dashed var(--input-line); border-radius: 12px; padding: 1.25rem; text-align: center; color: var(--muted); background: var(--grey-bg); }
.dropzone.is-over { border-color: var(--blue); background: var(--blue-soft); }
.legend-types { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .8rem; color: var(--muted); margin: .5rem 0 1rem; }
.legend-types span { display: inline-flex; align-items: center; gap: .3rem; }
@media (max-width: 900px) {
    .inbox { grid-template-columns: 1fr; }
    .inbox__list { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--grey-line); }
    .mstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.inbox__none { padding: 1rem; }
.bar--irs .bar__fill { fill: var(--c0); }
.state--ok { background: var(--ok-soft); color: var(--ok-ink); }
.who { display: inline-flex; align-items: center; gap: .6rem; }
.avatar--sm { width: 32px; height: 32px; font-size: .75rem; flex: none; }
.kpi-fill { fill: var(--c0); }
h2.mt { margin-top: 1.25rem; }
.swatch--muted { background: repeating-linear-gradient(45deg, var(--muted) 0 3px, transparent 3px 6px); }
@media (min-width: 901px) {
    /* Le menu latéral occupe toute la hauteur, même sur les pages longues */
    .shell { background: linear-gradient(to right, var(--side-bg) var(--sidebar-w), var(--grey-bg) var(--sidebar-w)); }
}
@media (max-width: 640px) {
    .hist li { flex-wrap: wrap; gap: .2rem .6rem; }
    .hist__title { flex: 1 1 100%; order: -1; }
    .kpi__icon { display: none; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mcard__head { flex-wrap: wrap; }
    .mcard__head .btn { margin-left: 0; }
    .sharelist li { grid-template-columns: minmax(0, 1fr) 60px 40px; }
}
.roles-pick { border: 1px solid var(--grey-line); border-radius: 8px; padding: .6rem .9rem; display: flex; flex-direction: column; gap: .45rem; }
.roles-pick legend { padding: 0 .3rem; }
.roles-pick__row { display: flex; flex-direction: column; gap: .25rem; }
.roles-pick__sections { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-left: 1.6rem; font-size: .875rem; color: var(--muted); }
.check--inline { display: inline-flex; font-size: .875rem; }
