/* =====================================================================
   Liste de présence numérique - MENAET
   Feuille de style unique : formulaire public, connexion, tableau de bord,
   impression de la liste de présence.

   Repère visuel : le bandeau tricolore (orange · blanc · vert) en tête de
   chaque écran et de chaque document imprimé. Tout le reste reste sobre.
   ===================================================================== */

/* ---------- Police (hébergée localement, licence OFL) ---------- */
@font-face {
    font-family: "Source Sans 3";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/source-sans-3-latin-400-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Source Sans 3";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/source-sans-3-latin-600-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Source Sans 3";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/source-sans-3-latin-700-normal.woff2") format("woff2");
}

/* ---------- Jetons ---------- */
:root {
    /* Couleurs du drapeau : réservées aux repères (bandeau, accents). */
    --drapeau-orange: #F77F00;
    --drapeau-vert: #009E60;

    /* Vert institutionnel : navigation, titres, actions principales. */
    --vert-nuit: #0B5D3B;
    --vert-nuit-fonce: #084A2F;
    --vert: #007A45;
    --vert-survol: #00653A;
    --vert-pale: #E6F2EB;

    /* Orange lisible sur fond clair (texte, focus). */
    --orange-texte: #A84F00;
    --orange-pale: #FFF3E6;

    /* Neutres. */
    --encre: #1B2420;
    --gris: #5B6762;
    --gris-clair: #8A958F;
    --fond: #F3F5F2;
    --papier: #FFFFFF;
    --trait: #D6DDD8;
    --trait-fort: #B9C3BD;

    /* États. */
    --rouge: #B42318;
    --rouge-pale: #FDECEA;
    --ambre-texte: #8A5A10;
    --ambre-pale: #FDF0D8;
    --bleu-texte: #1F5F8B;
    --bleu-pale: #E3EEF6;

    --tricolore: linear-gradient(90deg, var(--drapeau-orange) 0 33.34%, #FFFFFF 33.34% 66.67%, var(--drapeau-vert) 66.67% 100%);

    --police: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --r-champ: 6px;
    --r-panneau: 10px;
    --r-pastille: 999px;
    --ombre: 0 1px 2px rgba(11, 93, 59, .06), 0 6px 18px rgba(11, 93, 59, .06);
    --focus: 0 0 0 3px rgba(247, 127, 0, .45);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--accessibility-scale, 100%); -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    color: var(--encre);
    background: var(--fond);
    font-family: var(--police);
    font-size: 1rem;
    line-height: 1.5;
}
/* Bandeau tricolore commun à tous les écrans. */
body::before {
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--tricolore);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
    content: "";
}
h1, h2, h3, h4 { margin: 0; color: var(--vert-nuit); line-height: 1.25; }
p { margin: 0; }
a { color: var(--vert); text-underline-offset: 2px; }
a:hover { color: var(--vert-survol); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Champs ---------- */
label, .field-label { display: block; margin-bottom: 4px; color: var(--encre); font-size: .88rem; font-weight: 700; }
.label-hint { color: var(--gris); font-weight: 400; }
input, select, textarea {
    width: 100%;
    min-height: 40px;
    padding: 7px 11px;
    color: var(--encre);
    background: var(--papier);
    border: 1px solid var(--trait-fort);
    border-radius: var(--r-champ);
    font: inherit;
    font-size: 1rem;
}
input::placeholder { color: var(--gris-clair); }
input:focus, select:focus, textarea:focus { border-color: var(--vert); outline: none; box-shadow: var(--focus); }
input:disabled, select:disabled { color: var(--gris); background: #EDF0EE; border-color: var(--trait); cursor: not-allowed; }
input[type="checkbox"] { width: auto; min-height: 0; accent-color: var(--vert); }
input[type="range"] { min-height: 0; padding: 0; border: 0; accent-color: var(--vert); }
.field { margin-bottom: 12px; }
.field-hint { margin-top: 4px; color: var(--gris); font-size: .84rem; }
.field-hint:empty { display: none; }

/* ---------- Boutons ---------- */
button { font: inherit; cursor: pointer; }
.primary, .btn-submit, .btn-excel, .primary-action,
.btn-secondary, .btn-pdf, .btn-directory, .btn-danger, .btn-clear-signature {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid transparent;
    border-radius: var(--r-champ);
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.primary, .btn-submit, .btn-excel, .primary-action { color: #FFFFFF; background: var(--vert); border-color: var(--vert); }
.primary:hover, .btn-submit:hover, .btn-excel:hover, .primary-action:hover { background: var(--vert-survol); border-color: var(--vert-survol); }
.btn-secondary, .btn-pdf, .btn-directory, .btn-clear-signature { color: var(--vert-nuit); background: var(--papier); border-color: var(--trait-fort); }
.btn-secondary:hover, .btn-pdf:hover, .btn-directory:hover, .btn-clear-signature:hover { color: var(--vert-nuit); background: var(--vert-pale); border-color: var(--vert); }
.btn-danger { color: var(--rouge); background: var(--papier); border-color: #E7B7B1; }
.btn-danger:hover { color: #FFFFFF; background: var(--rouge); border-color: var(--rouge); }
button:disabled, button[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.text-action { padding: 4px 2px; color: var(--vert); background: none; border: 0; font-size: .9rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.text-action:hover { color: var(--vert-survol); }

/* ---------- Messages ---------- */
.form-status { margin: 0; font-size: .9rem; }
.form-status:empty { display: none; }
.form-status-success, .form-status-error, .dashboard-feedback, .error-msg {
    display: block;
    margin: 10px 0;
    padding: 8px 12px;
    border-left: 4px solid;
    border-radius: 0 var(--r-champ) var(--r-champ) 0;
    font-size: .92rem;
    font-weight: 700;
}
.form-status-success, .dashboard-feedback { color: var(--vert-nuit); background: var(--vert-pale); border-color: var(--vert); }
.form-status-error, .dashboard-feedback-error, .error-msg { color: var(--rouge); background: var(--rouge-pale); border-color: var(--rouge); }
.dashboard-feedback:empty { display: none; }
.empty-state { padding: 18px; color: var(--gris); text-align: center; }

.meeting-status { display: inline-block; padding: 2px 10px; border-radius: var(--r-pastille); font-size: .85rem; font-weight: 700; }
.status-open { color: var(--vert-nuit); background: var(--vert-pale); }
.status-pending { color: var(--ambre-texte); background: var(--ambre-pale); }
.status-completed, .status-cancelled { color: var(--rouge); background: var(--rouge-pale); }

.app-footer { padding: 16px 16px 20px; color: var(--gris); font-size: .82rem; text-align: center; }

/* =====================================================================
   Formulaire public d'émargement
   ===================================================================== */
/* Fond blanc : le logo officiel (JPEG sur fond blanc) s'y fond sans cadre. */
.public-page { background: var(--papier); }
.public-shell { width: min(100% - 32px, 540px); margin: 0 auto; padding-top: 16px; }
.public-header { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 12px; text-align: center; }
.public-logo { width: 116px; height: auto; }
.platform-name { color: var(--vert-nuit); font-size: 1.05rem; font-weight: 700; }
.public-card, .signed-panel { padding: clamp(16px, 4vw, 24px); background: var(--papier); border: 1px solid var(--trait); border-radius: var(--r-panneau); box-shadow: var(--ombre); }

.meeting-chooser h1, .meeting-heading { font-size: 1.3rem; }
.meeting-chooser-intro { margin: 4px 0 12px; color: var(--gris); }
.public-meeting-list { display: grid; gap: 10px; }
.public-meeting-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 2px 12px;
    width: 100%;
    padding: 10px 14px;
    color: var(--encre);
    background: var(--papier);
    border: 1px solid var(--trait);
    border-left: 4px solid var(--vert);
    border-radius: var(--r-champ);
    text-align: left;
}
.public-meeting-option:hover:not(:disabled) { background: var(--vert-pale); border-color: var(--vert); }
.public-meeting-option strong { color: var(--vert-nuit); font-size: 1.02rem; overflow-wrap: anywhere; }
.public-meeting-option span { grid-column: 1; color: var(--gris); font-size: .88rem; overflow-wrap: anywhere; }
.public-meeting-option em { grid-column: 2; grid-row: 1 / span 2; align-self: center; padding: 3px 10px; color: var(--vert-nuit); background: var(--vert-pale); border-radius: var(--r-pastille); font-size: .8rem; font-style: normal; font-weight: 700; }
.public-meeting-option.is-closed { border-left-color: var(--trait-fort); cursor: not-allowed; }
.public-meeting-option.is-closed strong { color: var(--gris); }
.public-meeting-option.is-closed em { color: var(--gris); background: #EDF0EE; }
.public-meeting-empty { padding: 16px; color: var(--gris); border: 1px dashed var(--trait-fort); border-radius: var(--r-champ); text-align: center; }

.meeting-info { display: flex; flex-wrap: wrap; gap: 2px 20px; margin: 6px 0 12px; padding: 0 0 10px; border-bottom: 1px solid var(--trait); font-size: .92rem; }
.meeting-info div { display: flex; align-items: baseline; gap: 8px; }
.meeting-info dt { color: var(--gris); font-size: .85rem; }
.meeting-info dd { margin: 0; font-weight: 700; }

.meeting-state { display: none; margin-bottom: 12px; padding: 8px 12px; color: var(--vert-nuit); background: var(--vert-pale); border-left: 4px solid var(--drapeau-orange); border-radius: 0 var(--r-champ) var(--r-champ) 0; font-weight: 700; }
@keyframes meeting-state-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes meeting-state-out { from { opacity: 1; } to { opacity: 0; transform: translateY(-6px); } }

.public-form { margin-top: 4px; }
/* Téléphone : indicatif du pays + numéro. */
.phone-field { display: flex; gap: 8px; }
.phone-field select { flex: 0 0 8.5rem; min-width: 0; padding-right: 6px; }
.phone-field input { flex: 1 1 auto; min-width: 0; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.signature-field { margin-top: 14px; }
.signature-head { display: flex; align-items: baseline; justify-content: space-between; }
.signature-head .field-label { margin-bottom: 6px; }
/* La zone de signature imite la ligne d'un registre papier. */
.signature-pad {
    display: block;
    width: 100%;
    height: 140px;
    background:
        linear-gradient(var(--trait-fort), var(--trait-fort)) no-repeat left 18px bottom 14px / calc(100% - 36px) 1px,
        var(--papier);
    border: 1px solid var(--trait-fort);
    border-radius: var(--r-champ);
    touch-action: none;
}
.signature-pad.signature-disabled { background-color: #F6F7F6; opacity: .6; pointer-events: none; }
.btn-submit { width: 100%; min-height: 46px; margin-top: 12px; font-size: 1.02rem; }

/* Mention d'information sur les données personnelles. */
.privacy-notice { margin-top: 12px; padding: 8px 12px; color: var(--gris); background: var(--fond); border-radius: var(--r-champ); font-size: .88rem; }
.privacy-notice summary { color: var(--vert); font-weight: 700; cursor: pointer; }
.privacy-notice ul { margin: 8px 0 0; padding-left: 18px; }
.privacy-notice li { margin-top: 4px; }
.privacy-notice li strong { color: var(--encre); }
/* Passages à faire compléter par le ministère : volontairement visibles. */
.a-completer { padding: 0 3px; color: var(--ambre-texte); background: var(--ambre-pale); border-radius: 3px; }

.signed-panel { margin-top: 0; text-align: center; background: var(--papier); border: 1px solid var(--trait); border-top: 4px solid var(--vert); border-radius: var(--r-panneau); box-shadow: var(--ombre); }
.signed-icon { display: grid; width: 64px; height: 64px; place-items: center; margin: 4px auto 12px; color: #FFFFFF; background: var(--vert); border-radius: 50%; }
.signed-icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.signed-panel h1 { font-size: 1.4rem; outline: none; }
.signed-text { margin: 6px auto 14px; max-width: 34em; color: var(--gris); }
.signed-details { display: grid; gap: 6px; margin: 0 0 16px; padding: 12px 14px; background: var(--fond); border-radius: var(--r-champ); text-align: left; }
.signed-details div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
.signed-details dt { color: var(--gris); font-size: .88rem; }
.signed-details dd { margin: 0; font-weight: 700; text-align: right; }
.signed-panel.is-already { border-top-color: var(--drapeau-orange); }
.signed-panel.is-already .signed-icon { background: var(--orange-texte); }

/* =====================================================================
   Connexion - modèle d'origine : un encart unique, compact, centré sur un
   fond vert sombre ; rien d'autre que ce qu'il faut pour entrer.
   ===================================================================== */
.portal-page { display: flex; min-height: 100vh; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px; background: linear-gradient(160deg, var(--vert-nuit-fonce), #0F6B43); }
.login-box { width: min(370px, 100%); padding: 32px 36px; background: var(--papier); border-top: 4px solid var(--drapeau-orange); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .28); }
.login-box .brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-box .brand-row img { width: 44px; height: 44px; flex-shrink: 0; object-fit: contain; }
.login-box h1 { margin: 0; color: var(--vert-nuit); font-size: 1.3rem; font-weight: 700; }
.login-box .brand-row p { margin: 2px 0 0; color: var(--gris); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.login-box input { margin: 0 0 12px; padding: 10px 12px; }
.login-box button.primary { width: 100%; min-height: 42px; }
.login-box .error-msg { margin: 0 0 14px; }
.login-aside { margin: 18px 0 0; padding-top: 15px; border-top: 1px solid var(--trait); color: var(--gris); font-size: .82rem; text-align: center; }
.login-aside a { color: var(--vert-nuit); font-weight: 700; white-space: nowrap; }
.app-footer--clair { padding: 0; color: rgba(255, 255, 255, .75); }
@media (max-width: 720px) {
    .portal-page { justify-content: flex-start; padding: 28px 16px; }
}

/* =====================================================================
   Tableau de bord
   ===================================================================== */
.dashboard-body { height: 100vh; overflow: hidden; }
.dashboard-shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); height: 100vh; }
.dashboard-shell.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); }
.dashboard-shell.sidebar-collapsed .dashboard-sidebar { display: none; }

/* --- Barre latérale --- */
.dashboard-sidebar { display: flex; min-height: 0; flex-direction: column; padding-top: 4px; color: #FFFFFF; background: var(--vert-nuit); overflow-y: auto; }
.brand-block { display: flex; align-items: center; gap: 12px; padding: 20px 18px; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.brand-block img { flex: none; width: 44px; height: 44px; padding: 4px; object-fit: contain; background: #FFFFFF; border-radius: 50%; }
.brand-block strong { display: block; font-size: .95rem; line-height: 1.25; }
.brand-block span { display: block; margin-top: 2px; color: #CFE6D9; font-size: .82rem; }
.dashboard-nav { padding: 14px 10px; }
.nav-item {
    position: relative;
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #E3F1E8;
    background: transparent;
    border: 0;
    border-radius: var(--r-champ);
    font-size: .95rem;
    text-align: left;
}
.nav-item:hover { color: #FFFFFF; background: rgba(255, 255, 255, .08); }
.nav-item.active { color: #FFFFFF; background: rgba(255, 255, 255, .14); font-weight: 700; }
.nav-item.active::before { position: absolute; top: 8px; bottom: 8px; left: 0; width: 3px; background: var(--drapeau-orange); border-radius: 2px; content: ""; }
.nav-icon { display: inline-flex; width: 20px; height: 20px; flex: none; }
.nav-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-caret { width: 8px; height: 8px; margin-left: auto; border-right: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.nav-submenu { display: none; margin: 2px 0 6px 21px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .22); }
.nav-submenu.open { display: block; }
.nav-submenu .nav-item { padding: 8px 10px; font-size: .9rem; }
.sidebar-footer { display: grid; gap: 6px; margin-top: auto; padding: 16px 18px 20px; border-top: 1px solid rgba(255, 255, 255, .14); }
.sidebar-footer a { color: #FFFFFF; font-size: .88rem; }
.sidebar-footer small { color: #A9CDB8; font-size: .78rem; }

/* --- Zone principale --- */
.dashboard-main { min-width: 0; min-height: 0; overflow-y: auto; padding: 0 28px 36px; }
.dashboard-topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 -28px 18px;
    padding: 14px 28px 12px;
    background: rgba(243, 245, 242, .96);
    border-bottom: 1px solid var(--trait);
    backdrop-filter: blur(6px);
}
.topbar-heading { display: flex; min-width: 0; align-items: center; gap: 14px; }
.sidebar-toggle { display: grid; width: 40px; height: 40px; flex: none; place-items: center; padding: 0; color: var(--vert-nuit); background: var(--papier); border: 1px solid var(--trait-fort); border-radius: var(--r-champ); font-size: 1.15rem; }
.sidebar-toggle:hover { background: var(--vert-pale); }
.page-title { font-size: 1.4rem; }
.titre-compose { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.titre-entite { font-weight: 700; }
.titre-sep { color: var(--trait-fort); font-weight: 400; }
.titre-suite { color: var(--encre); font-weight: 400; }
.page-sub { margin-top: 2px; color: var(--gris); font-size: .9rem; }
.topbar-meta { display: flex; flex: none; align-items: center; gap: 14px; color: var(--gris); font-size: .88rem; }
.topbar-meta > a { color: var(--vert); font-weight: 700; }
.logout-switch { display: grid; width: 38px; height: 38px; place-items: center; padding: 0; color: var(--vert-nuit); background: var(--papier); border: 1px solid var(--trait-fort); border-radius: 50%; }
.logout-switch:hover { color: #FFFFFF; background: var(--rouge); border-color: var(--rouge); }
.logout-switch span { font-size: 1.1rem; line-height: 1; }

.accessibility-tools { position: relative; }
.accessibility-toggle { display: grid; width: 38px; height: 38px; place-items: center; padding: 0; color: var(--vert-nuit); background: var(--papier); border: 1px solid var(--trait-fort); border-radius: 50%; font-size: 1.1rem; }
.accessibility-toggle:hover { background: var(--vert-pale); }
.accessibility-panel { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; display: grid; gap: 8px; width: 240px; padding: 14px; color: var(--encre); background: var(--papier); border: 1px solid var(--trait); border-radius: var(--r-panneau); box-shadow: var(--ombre); }
.accessibility-panel label { margin: 0; font-size: .88rem; }
.soft-light-option { display: flex; align-items: center; gap: 8px; font-weight: 400 !important; }
.soft-light { filter: brightness(.93) contrast(1.04); }

.dashboard-view { display: none; }
.dashboard-view.active { display: block; }
.view-heading { margin-bottom: 12px; color: var(--gris); }

/* --- Panneaux --- */
.card, .creation-card, .attendance-management, .user-form, .user-list-panel, .qr-panel, .meeting-archives {
    padding: 16px 20px;
    background: var(--papier);
    border: 1px solid var(--trait);
    border-radius: var(--r-panneau);
}
.section-label { margin: 0 0 10px; color: var(--gris); font-size: .9rem; font-weight: 700; }
.home-heading, .panel-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.home-heading { margin-bottom: 12px; }
.panel-heading { margin-bottom: 8px; }
.panel-heading .section-label { margin: 0; }
.meeting-intro { margin-top: 2px; color: var(--gris); font-size: .9rem; }
h3 { margin-bottom: 12px; font-size: 1.12rem; }

/* --- Accueil : chiffres du mois --- */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi-card { padding: 12px 16px; background: var(--papier); border: 1px solid var(--trait); border-top: 3px solid var(--vert); border-radius: var(--r-champ); }
.kpi-value { color: var(--vert-nuit); font-size: 1.7rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-label { margin-top: 4px; color: var(--gris); font-size: .9rem; }

/* --- Accueil : cycle d'une réunion --- */
.pipeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 6px; padding: 14px 8px 12px; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--r-panneau); }
.stage { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.stage-link { position: absolute; z-index: 0; top: 19px; height: 2px; background: var(--trait); }
.stage-link.left { left: 0; right: 50%; }
.stage-link.right { left: 50%; right: 0; }
.stage:first-child .stage-link.left, .stage:last-child .stage-link.right { display: none; }
.stage-dot { position: relative; z-index: 1; display: grid; width: 40px; height: 40px; place-items: center; margin-bottom: 6px; color: #FFFFFF; background: var(--vert); border-radius: 50%; font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stage-dot.vide { color: var(--gris); background: #EDF0EE; }
.stage-label { color: var(--encre); font-size: .9rem; font-weight: 700; }
.stage-age { margin-top: 2px; color: var(--orange-texte); font-size: .82rem; }
.pipeline-note { margin-bottom: 18px; color: var(--gris); font-size: .88rem; }

/* --- Accueil : à mon attention --- */
.alert-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-bottom: 18px; }
.alert-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--encre); background: var(--papier); border: 1px solid var(--trait); border-radius: var(--r-champ); text-align: left; }
.alert-card:hover { border-color: var(--vert); }
.alert-card .ic { display: grid; width: 38px; height: 38px; flex: none; place-items: center; border-radius: 50%; font-size: 1.05rem; }
.tone-ouvert .ic { color: var(--vert-nuit); background: var(--vert-pale); }
.tone-jour .ic { color: var(--ambre-texte); background: var(--ambre-pale); }
.tone-vide .ic { color: var(--rouge); background: var(--rouge-pale); }
.alert-body { display: grid; flex: 1; }
.alert-num { font-size: 1.3rem; font-weight: 700; line-height: 1.1; }
.alert-txt { color: var(--gris); font-size: .88rem; }
.alert-link { color: var(--gris-clair); font-size: 1.4rem; }

/* --- Accueil : dernières réunions --- */
.timeline { display: grid; }
.tl-item { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 1px 12px; padding: 9px 6px; color: var(--encre); background: none; border: 0; border-bottom: 1px solid var(--trait); text-align: left; }
.tl-item:last-child { border-bottom: 0; }
.tl-item:hover { background: var(--fond); }
.tl-dot { grid-row: 1 / span 3; width: 10px; height: 10px; margin-top: 6px; background: var(--vert); border-radius: 50%; }
.tl-actor { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tl-title { font-weight: 700; }
.tl-action, .tl-meta { color: var(--gris); font-size: .88rem; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: var(--r-pastille); font-size: .78rem; font-weight: 700; }
.badge .dot { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.etat-upcoming { color: var(--bleu-texte); background: var(--bleu-pale); }
.etat-open { color: var(--vert-nuit); background: var(--vert-pale); }
.etat-closed { color: var(--ambre-texte); background: var(--ambre-pale); }
.etat-archived { color: var(--gris); background: #EDF0EE; }
.etat-cancelled { color: var(--rouge); background: var(--rouge-pale); }

/* --- Réunions et QR codes --- */
.meeting-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); align-items: start; gap: 22px; }
.meeting-list { display: grid; gap: 6px; margin-bottom: 18px; color: var(--gris); }
.meeting-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 3px 12px;
    width: 100%;
    padding: 10px 14px;
    color: var(--encre);
    background: var(--papier);
    border: 1px solid var(--trait);
    border-radius: var(--r-champ);
    text-align: left;
}
.meeting-item:hover { border-color: var(--vert); }
.meeting-item.selected { background: var(--vert-pale); border-color: var(--vert); box-shadow: inset 4px 0 0 var(--vert); }
.meeting-item strong { color: var(--vert-nuit); overflow-wrap: anywhere; }
.meeting-item span { grid-column: 1; color: var(--gris); font-size: .88rem; }
.meeting-item em { grid-column: 2; grid-row: 1; color: var(--vert); font-size: .85rem; font-style: normal; font-weight: 700; }
.meeting-priority { grid-column: 1; justify-self: start; margin-top: 4px; padding: 1px 9px; color: var(--gris); background: #EDF0EE; border-radius: var(--r-pastille); font-size: .78rem; font-weight: 700; }
.meeting-priority[data-priority="important"] { color: var(--orange-texte); background: var(--orange-pale); }
.archive-priority { display: inline-block; margin: 0 0 0 8px; vertical-align: middle; }

.qr-panel { position: sticky; top: 100px; text-align: center; }
.qr-panel h3 { margin-bottom: 14px; }
#qrCanvas { display: grid; place-items: center; margin: 0 auto 12px; padding: 14px; background: #FFFFFF; border: 1px solid var(--trait); border-radius: var(--r-champ); }
#qrCanvas canvas, #qrCanvas img { width: 100% !important; max-width: 220px; height: auto !important; }
#qrDetails { margin-bottom: 14px; color: var(--gris); font-size: .9rem; }
.qr-note { margin: -4px 0 8px; color: var(--gris-clair); font-size: .8rem; }
.qr-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qr-actions button { width: 100%; }
.qr-actions #downloadQr { grid-column: 1 / -1; }

.registration-panel { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--trait); text-align: left; }
.registration-panel h4 { margin-bottom: 4px; font-size: 1rem; }
#registrationHint { margin-bottom: 12px; color: var(--gris); font-size: .88rem; }
#registrationForm { display: grid; gap: 8px; }
.registration-table-wrapper { margin-top: 12px; overflow-x: auto; }
.registration-remove { padding: 4px 8px; color: var(--rouge); background: none; border: 1px solid transparent; border-radius: var(--r-champ); font-size: .85rem; font-weight: 700; }
.registration-remove:hover { border-color: #E7B7B1; }

.meeting-archives { margin-top: 8px; }
.section-heading { margin-bottom: 14px; }
.archive-toolbar { margin-bottom: 12px; }
.archive-toolbar input { max-width: 340px; }
.archive-table-wrapper { overflow-x: auto; }
.archive-actions { text-align: center; }
.archive-pdf-download { display: inline-grid; width: 36px; height: 36px; place-items: center; padding: 0; color: var(--vert-nuit); background: var(--papier); border: 1px solid var(--trait-fort); border-radius: var(--r-champ); }
.archive-pdf-download:hover { color: #FFFFFF; background: var(--vert); border-color: var(--vert); }
.pdf-download-icon { display: grid; justify-items: center; line-height: 1; }
.download-arrow { font-size: 1rem; font-weight: 700; }
.download-tray { width: 14px; height: 4px; margin-top: 1px; border: 2px solid currentColor; border-top: 0; }
.directory-count { padding: 4px 12px; color: var(--vert-nuit); background: var(--vert-pale); border-radius: var(--r-pastille); font-size: .85rem; white-space: nowrap; }

/* --- Création / modification --- */
.creation-card { max-width: 860px; }
.meeting-creation-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
.meeting-creation-form .field { margin-bottom: 10px; }
.meeting-creation-form .field-wide { grid-column: 1 / -1; }
.meeting-creation-form .field-half { grid-column: span 2; }
.meeting-creation-form .field-hint { margin: -2px 0 0; }
.creation-actions { display: flex; flex-wrap: wrap; grid-column: 1 / -1; gap: 10px; margin-top: 14px; }
.creation-reminder { margin-top: 14px; padding: 10px 14px; color: var(--ambre-texte); background: var(--ambre-pale); border-radius: var(--r-champ); font-size: .9rem; }
.priority-important { border-color: var(--drapeau-orange); }

/* --- Émargements --- */
.attendance-print-header { display: none; }
.attendance-filters { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.attendance-field { flex: 1 1 320px; }
.attendance-field label { margin-bottom: 6px; }
.attendance-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.attendance-meeting-info { margin-bottom: 12px; padding: 10px 14px; color: var(--vert-nuit); background: var(--vert-pale); border-radius: var(--r-champ); font-weight: 700; }
.stats { display: flex; gap: 10px; margin-bottom: 12px; }
.stat { color: var(--gris); }
.stat strong { color: var(--vert-nuit); font-size: 1.25rem; }
.attendance-search-row, .directory-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 14px; }
.attendance-search-row label, .directory-toolbar label { margin: 0; }
.attendance-search-row input, .directory-toolbar input { flex: 1 1 260px; max-width: 420px; }

/* --- Tableaux --- */
.table-wrapper { overflow-x: auto; border: 1px solid var(--trait); border-radius: var(--r-champ); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { padding: 8px 10px; color: var(--encre); background: #EEF2EF; border-bottom: 1px solid var(--trait); font-size: .85rem; font-weight: 700; text-align: left; white-space: nowrap; }
td { padding: 7px 10px; border-bottom: 1px solid var(--trait); vertical-align: middle; overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #F8FAF8; }
.archive-table, .registration-table-wrapper table { border: 1px solid var(--trait); }
.signature-thumbnail { display: block; width: 96px; max-height: 40px; object-fit: contain; }
.signature-cell { color: var(--gris-clair); text-align: center; }
.print-spacer { display: none; }
.signature-cell .signature-thumbnail { margin: 0 auto; }
/* Atelier de plusieurs jours : une colonne de signature par journée. */
.is-multiday th:nth-child(n+7) { text-align: center; }
.is-multiday .signature-thumbnail { width: 72px; max-height: 32px; }

/* --- Statistiques --- */
.stats-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.stats-filters-label { margin-right: 4px; color: var(--gris); font-size: .88rem; font-weight: 700; }
.segment { min-height: 34px; padding: 5px 14px; color: var(--vert-nuit); background: var(--papier); border: 1px solid var(--trait-fort); border-radius: var(--r-pastille); font-size: .9rem; font-weight: 700; }
.segment:hover { background: var(--vert-pale); }
.segment[aria-pressed="true"] { color: #FFFFFF; background: var(--vert); border-color: var(--vert); }
.stats-period { margin-left: 8px; color: var(--gris); font-size: .88rem; }
.stats-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.stats-card { margin: 0; }
.stats-card figcaption { margin-bottom: 6px; }
.stats-card h3 { margin: 0; font-size: 1rem; }
.stats-card figcaption p { color: var(--gris); font-size: .84rem; }
.stats-chart { position: relative; min-height: 220px; }
.stats-svg { display: block; overflow: visible; }
.stats-bar { fill: var(--vert); }
.stats-grid { stroke: #E6EBE7; stroke-width: 1; }
.stats-baseline { stroke: var(--trait-fort); stroke-width: 1; }
.stats-tick { fill: var(--gris); font-family: var(--police); font-size: 11px; font-variant-numeric: tabular-nums; }
.stats-hit { fill: transparent; cursor: default; outline: none; }
.stats-hit.is-active { fill: rgba(0, 122, 69, .07); }
.stats-tooltip { position: absolute; z-index: 5; display: grid; gap: 1px; padding: 6px 10px; color: var(--encre); background: var(--papier); border: 1px solid var(--trait); border-radius: var(--r-champ); box-shadow: var(--ombre); font-size: .82rem; white-space: nowrap; transform: translate(-50%, -100%); pointer-events: none; }
.stats-tooltip strong { font-size: .95rem; }
.stats-tooltip span { color: var(--gris); }
.stats-table-card summary { color: var(--vert); font-weight: 700; cursor: pointer; }
.stats-table-card .table-wrapper { margin-top: 10px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.stats-note { margin-top: 10px; color: var(--gris); font-size: .84rem; }
[data-view-panel="stats"].is-loading .stats-chart { opacity: .5; }

/* --- Comptes --- */
.user-management { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); align-items: start; gap: 20px; }
.user-forms { display: grid; gap: 14px; align-content: start; }
.user-form h2, .user-list-panel h2 { margin-bottom: 14px; font-size: 1.12rem; }
.user-form label { margin-top: 10px; }
.user-form .btn-excel { width: 100%; margin-top: 16px; }
.user-actions { min-width: 180px; }
.user-actions .user-action { margin: 2px 6px 2px 0; }
.user-action { min-height: 32px; padding: 5px 10px; font-size: .85rem; }
.user-active { color: var(--vert); font-weight: 700; }
.user-disabled { color: var(--rouge); font-weight: 700; }

/* =====================================================================
   Tableau de bord compact : texte de base à 15 px et espacements resserrés,
   pour voir davantage d'informations sans faire défiler.
   ===================================================================== */
html:has(.dashboard-body) { font-size: calc(var(--accessibility-scale, 100%) * .9375); }
.dashboard-body .dashboard-shell { grid-template-columns: 228px minmax(0, 1fr); }
.dashboard-body .dashboard-shell.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); }
.dashboard-body .brand-block { gap: 10px; padding: 14px 14px; }
.dashboard-body .brand-block img { width: 38px; height: 38px; padding: 3px; }
.dashboard-body .brand-block strong { font-size: .9rem; }
.dashboard-body .dashboard-nav { padding: 10px 8px; }
.dashboard-body .nav-item { gap: 9px; padding: 7px 10px; font-size: .93rem; }
.dashboard-body .nav-submenu .nav-item { padding: 6px 10px; }
.dashboard-body .sidebar-footer { padding: 12px 14px 14px; }
.dashboard-body .dashboard-main { padding: 0 22px 24px; }
.dashboard-body .dashboard-topbar { margin: 0 -22px 14px; padding: 10px 22px 8px; }
.dashboard-body .page-title { font-size: 1.25rem; }
.dashboard-body .page-sub { margin-top: 0; font-size: .84rem; }
.dashboard-body .sidebar-toggle, .dashboard-body .logout-switch, .dashboard-body .accessibility-toggle { width: 34px; height: 34px; }
.dashboard-body .card, .dashboard-body .creation-card, .dashboard-body .attendance-management, .dashboard-body .user-form,
.dashboard-body .user-list-panel, .dashboard-body .qr-panel, .dashboard-body .meeting-archives { padding: 12px 16px; }
.dashboard-body .primary, .dashboard-body .btn-excel, .dashboard-body .primary-action, .dashboard-body .btn-secondary,
.dashboard-body .btn-pdf, .dashboard-body .btn-directory, .dashboard-body .btn-danger { min-height: 34px; padding: 5px 12px; font-size: .88rem; }
.dashboard-body input, .dashboard-body select { min-height: 36px; padding: 6px 10px; font-size: .95rem; }
.dashboard-body h3 { margin-bottom: 8px; font-size: 1.02rem; }
.dashboard-body .section-label { margin-bottom: 6px; font-size: .86rem; }
.dashboard-body .home-heading { margin-bottom: 8px; }
.dashboard-body .card-grid { gap: 8px; margin-bottom: 14px; }
.dashboard-body .kpi-card { padding: 9px 14px; }
.dashboard-body .kpi-value { font-size: 1.45rem; }
.dashboard-body .kpi-label { margin-top: 2px; font-size: .84rem; }
.dashboard-body .pipeline { padding: 10px 6px 8px; }
.dashboard-body .stage-dot { width: 32px; height: 32px; margin-bottom: 4px; font-size: .92rem; }
.dashboard-body .stage-link { top: 15px; }
.dashboard-body .stage-label { font-size: .85rem; }
.dashboard-body .pipeline-note { margin-bottom: 14px; font-size: .84rem; }
.dashboard-body .alert-row { gap: 8px; margin-bottom: 14px; }
.dashboard-body .alert-card { gap: 10px; padding: 7px 10px; }
.dashboard-body .alert-card .ic { width: 30px; height: 30px; font-size: .95rem; }
.dashboard-body .alert-num { font-size: 1.1rem; }
.dashboard-body .tl-item { padding: 6px 4px; }
.dashboard-body .tl-action, .dashboard-body .tl-meta { font-size: .84rem; }
.dashboard-body .meeting-layout { gap: 16px; }
.dashboard-body .meeting-list { gap: 5px; margin-bottom: 14px; }
.dashboard-body .meeting-item { padding: 7px 12px; }
.dashboard-body .meeting-item span { font-size: .84rem; }
.dashboard-body .qr-panel { top: 70px; }
.dashboard-body .qr-panel h3 { margin-bottom: 8px; }
.dashboard-body #qrCanvas { margin-bottom: 8px; padding: 8px; }
.dashboard-body #qrCanvas canvas, .dashboard-body #qrCanvas img { max-width: 170px; }
.dashboard-body #qrDetails { margin-bottom: 10px; font-size: .84rem; }
.dashboard-body .qr-actions { gap: 6px; }
.dashboard-body .registration-panel { margin-top: 14px; padding-top: 12px; }
.dashboard-body .section-heading { margin-bottom: 8px; }
.dashboard-body .archive-toolbar { margin-bottom: 8px; }
.dashboard-body th { padding: 6px 9px; font-size: .82rem; }
.dashboard-body td { padding: 5px 9px; font-size: .9rem; }
.dashboard-body .signature-thumbnail { width: 80px; max-height: 32px; }
.dashboard-body .archive-pdf-download { width: 30px; height: 30px; }
.dashboard-body .attendance-filters { margin-bottom: 8px; }
.dashboard-body .attendance-meeting-info { margin-bottom: 8px; padding: 7px 12px; }
.dashboard-body .stats { margin-bottom: 8px; }
.dashboard-body .attendance-search-row, .dashboard-body .directory-toolbar { margin-bottom: 8px; }
.dashboard-body .view-heading { margin-bottom: 8px; }
.dashboard-body .stats-filters { margin-bottom: 10px; }
.dashboard-body .segment { min-height: 30px; padding: 3px 12px; }
.dashboard-body .stats-charts { gap: 10px; margin-bottom: 10px; }
.dashboard-body .stats-chart { min-height: 190px; }
.dashboard-body .user-management { gap: 14px; }
.archive-more { display: block; margin: 10px auto 0; }

/* =====================================================================
   Écrans étroits
   ===================================================================== */
@media (max-width: 1100px) {
    .meeting-layout, .user-management, .stats-charts { grid-template-columns: minmax(0, 1fr); }
    .qr-panel { position: static; }
}
@media (max-width: 900px) {
    .dashboard-body { height: auto; overflow: visible; }
    .dashboard-shell { display: block; height: auto; }
    .dashboard-sidebar { padding-top: 4px; }
    .brand-block { padding: 14px 16px; }
    .dashboard-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px 12px; }
    .dashboard-nav .nav-item { width: auto; }
    .nav-parent { display: none !important; }
    .nav-submenu, .nav-submenu.open { display: contents; }
    .nav-item.active::before { top: auto; right: 10px; bottom: 2px; left: 10px; width: auto; height: 3px; }
    .sidebar-footer { display: none; }
    .dashboard-main { overflow: visible; padding: 0 16px 40px; }
    .dashboard-topbar { flex-wrap: wrap; margin: 0 -16px 18px; padding: 14px 16px 12px; }
    .topbar-meta > a, #dashboardClock { display: none; }
    .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .kpi-value { font-size: 1.35rem; }
    .kpi-label { font-size: .8rem; }
    .meeting-creation-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
    .stage-link { display: none; }
    .card, .creation-card, .attendance-management, .user-form, .user-list-panel, .qr-panel, .meeting-archives { padding: 18px 16px; }
}
@media (max-width: 560px) {
    .page-title { font-size: 1.25rem; }
    .meeting-creation-form { grid-template-columns: minmax(0, 1fr); }
    .meeting-creation-form .field-half { grid-column: 1 / -1; }
    .public-shell { width: min(100% - 24px, 560px); padding-top: 20px; }
    .public-logo { width: 80px; }
    .platform-name { font-size: .95rem; }
    .public-form .field { margin-bottom: 10px; }
    .public-meeting-option { grid-template-columns: minmax(0, 1fr); }
    .public-meeting-option em { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 6px; }
    .qr-actions { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   Impression de la liste de présence (A4 paysage, 10 lignes par page)
   ===================================================================== */
@media print {
    /* Marges de page à zéro : le navigateur n'a alors plus de place pour ajouter
       ses propres en-têtes et pieds de page (titre, date, adresse de la page).
       L'espacement est reporté à l'intérieur de la liste, sur chaque feuille. */
    @page { size: A4 landscape; margin: 0; }
    body::before { display: none; }
    html, body { background: #FFFFFF !important; }
    body { color: #111111; font-size: 9pt; }
    .dashboard-body { height: auto; overflow: visible; }
    .dashboard-shell { display: block; height: auto; }
    .dashboard-main { overflow: visible; padding: 0; }
    .dashboard-sidebar, .dashboard-topbar, .dashboard-feedback, .view-heading,
    .attendance-filters, .attendance-meeting-info, .stats, .attendance-search-row, #attendanceEmpty,
    .dashboard-view:not([data-view-panel="attendance"]) { display: none !important; }
    .dashboard-view[data-view-panel="attendance"] { display: block !important; }
    .attendance-management { padding: 0 10mm; border: 0; border-radius: 0; }

    /* En-tête de la première feuille, compact pour laisser place à 10 lignes. */
    .attendance-print-header { display: block; margin: 8mm 0 3mm; padding-top: 2mm; border-top: 2.5mm solid transparent; border-image: var(--tricolore) 1; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .print-institution { text-align: center; }
    .print-institution img { width: 30mm; height: auto; }
    .print-document-heading { margin-top: 1.5mm; text-align: center; }
    .print-document-heading h1 { color: #0B5D3B; font-size: 14pt; letter-spacing: .04em; }
    .print-meeting-meta { display: grid; grid-template-columns: 2.4fr 1.4fr 1fr 1fr; gap: 1mm 4mm; margin-top: 2.5mm; padding: 1.8mm 0; border-top: 1px solid #111111; border-bottom: 1px solid #111111; font-size: 8.5pt; }
    .print-meeting-meta span:first-child { grid-column: 1 / -1; }

    .table-wrapper { overflow: visible; border: 0; border-radius: 0; }
    table { table-layout: fixed; font-size: 8pt; }
    thead { display: table-header-group; }
    tfoot { display: table-footer-group; }
    tr { break-inside: avoid; }
    th, td { padding: 1.5mm 1.8mm; color: #111111; background: #FFFFFF !important; border: 1px solid #333333; white-space: normal; }
    th { background: #EEF2EF !important; text-align: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    td { height: 10.5mm; }
    td:first-child { text-align: center; }
    /* Espace répété en haut et en bas de chaque feuille. */
    .print-spacer { display: table-row; }
    .print-spacer th, .print-spacer td { height: 8mm; padding: 0; border: 0 !important; background: none !important; }
    tfoot .print-spacer td { height: 12mm; }
    /* Largeurs (réunion d'une journée). */
    col:nth-child(1) { width: 8mm; }
    col:nth-child(2) { width: 20%; }
    col:nth-child(3) { width: 14%; }
    col:nth-child(4) { width: 14%; }
    col:nth-child(5) { width: 13%; }
    col:nth-child(6) { width: 16%; }
    col:nth-child(7) { width: 12%; }
    .signature-thumbnail { width: 100%; max-height: 8.5mm; margin: 0 auto; }
    /* Liste récapitulative : identité resserrée, le reste partagé entre les jours. */
    table.is-multiday { font-size: 7.5pt; }
    table.is-multiday col:nth-child(2) { width: 15%; }
    table.is-multiday col:nth-child(3) { width: 11%; }
    table.is-multiday col:nth-child(4) { width: 11%; }
    table.is-multiday col:nth-child(5) { width: 11%; }
    table.is-multiday col:nth-child(6) { width: 12%; }
    table.is-multiday col:nth-child(n+7) { width: auto; }
    table.is-multiday td:nth-child(n+7) { padding: 1mm; }
    tbody tr:last-child td { border-bottom: 1px solid #333333; }
    .attendance-management tbody tr:nth-child(10n) { break-after: page; }
    /* Pied de page répété sur chaque feuille. */
    .attendance-management::after { position: fixed; right: 0; bottom: 5mm; left: 0; color: #5B6762; font-size: 7.5pt; text-align: center; content: "MENAET · Liste de présence numérique"; }
}
.user-self { color: var(--gris); font-size: .85rem; }

/* Identité dans la barre du haut : « Espace … » puis le nom du titulaire. */
.account-chip { display: grid; justify-items: end; gap: 1px; max-width: 220px; padding: 3px 4px; color: var(--vert-nuit); text-align: right; background: none; border: 0; border-radius: 6px; cursor: pointer; }
.account-chip:hover .account-chip-name, .account-chip.active .account-chip-name { text-decoration: underline; }
.account-chip-role { color: var(--gris); font-size: .74rem; line-height: 1.2; }
.account-chip-name { max-width: 100%; overflow: hidden; font-size: .9rem; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.account-management { display: grid; grid-template-columns: repeat(2, minmax(0, 380px)); align-items: start; gap: 14px; }
.account-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 12px 0 0; font-size: .9rem; }
.account-facts dt { color: var(--gris); }
.account-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 900px) {
    .account-management { grid-template-columns: minmax(0, 1fr); }
    .account-chip { max-width: 150px; }
}

/* Formulaire de compte en mode modification. */
.user-form.is-editing { border-color: var(--drapeau-orange); box-shadow: inset 4px 0 0 var(--drapeau-orange); }
.user-form .user-form-cancel { width: 100%; margin-top: 8px; }
.user-actions .user-self { display: inline-block; margin: 2px 0; }
#userTable td:not(:first-child):not(:last-child) { white-space: nowrap; }
.user-holder strong { display: block; font-weight: 700; }
.user-holder small { display: block; color: var(--gris); font-size: .82rem; overflow-wrap: anywhere; }
.user-holder .user-name-missing { color: var(--drapeau-orange); font-style: italic; font-weight: 600; }

/* ---------- Agenda ---------- */
.agenda { display: grid; gap: 10px; }
.agenda-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.agenda-nav { display: flex; align-items: center; gap: 6px; }
.agenda-month { min-width: 9.5em; margin: 0 4px; color: var(--vert-nuit); font-size: 1.15rem; text-align: center; }
.agenda .agenda-arrow { width: 34px; min-height: 34px; padding: 0; font-size: 1.2rem; line-height: 1; }
.agenda-help { padding: 8px 12px; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--r-champ); font-size: .88rem; }
.agenda-help summary { color: var(--vert); font-weight: 700; cursor: pointer; }
.agenda-help ol { margin: 8px 0 6px; padding-left: 20px; }
.agenda-help p { margin: 0; color: var(--gris); }
.agenda-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: start; gap: 14px; }
.agenda-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: hidden; background: var(--trait); border: 1px solid var(--trait); border-radius: var(--r-panneau); gap: 1px; }
.agenda-weekday { padding: 6px 8px; color: var(--gris); background: #EEF2EF; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.agenda-day { display: flex; min-width: 0; min-height: 96px; flex-direction: column; gap: 3px; padding: 4px 5px 6px; background: var(--papier); }
.agenda-day.is-other-month { background: #F7F9F7; }
.agenda-day.is-other-month .agenda-daynum { color: var(--gris-clair); }
.agenda-day.is-selected { box-shadow: inset 0 0 0 2px var(--vert); }
.agenda-daynum { align-self: flex-start; min-width: 26px; height: 26px; padding: 0 6px; color: var(--encre); background: none; border: 0; border-radius: var(--r-pastille); font-size: .85rem; font-weight: 700; cursor: pointer; }
.agenda-daynum:hover { background: var(--vert-pale); }
.agenda-day.is-today .agenda-daynum { color: #FFFFFF; background: var(--drapeau-orange); }
.agenda-chip { display: flex; width: 100%; min-width: 0; align-items: baseline; gap: 5px; padding: 2px 6px; color: var(--vert-nuit); text-align: left; background: var(--vert-pale); border: 0; border-left: 3px solid var(--vert); border-radius: 4px; font-size: .78rem; line-height: 1.35; cursor: pointer; }
.agenda-chip:hover, .agenda-chip.is-selected { filter: brightness(.95); box-shadow: 0 0 0 1px currentColor; }
.agenda-chip-time { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.agenda-chip-title { display: -webkit-box; min-width: 0; overflow: hidden; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.agenda-grid .agenda-chip { display: -webkit-box; overflow: hidden; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.agenda-grid .agenda-chip-time { margin-right: 4px; }
.agenda-grid .agenda-chip-title { display: inline; }
.agenda-detail .agenda-chip-title, .agenda-list .agenda-chip-title { -webkit-line-clamp: 3; line-clamp: 3; }
.agenda-chip.is-private { color: #FFFFFF; background: var(--vert-nuit); border-left-color: var(--vert-nuit-fonce); }
.agenda-chip--event { color: var(--bleu-texte); background: var(--bleu-pale); border-left-color: var(--bleu-texte); }
.agenda-chip.is-cancelled { color: var(--gris); background: #F1F3F2; border-left-color: var(--gris-clair); text-decoration: line-through; }
.agenda-more { align-self: flex-start; padding: 0 4px; color: var(--vert); background: none; border: 0; font-size: .76rem; font-weight: 700; cursor: pointer; }
.agenda-more:hover { text-decoration: underline; }
.agenda-list { display: none; }
.agenda-detail { position: sticky; top: 0; display: grid; gap: 8px; align-content: start; padding: 14px 16px; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--r-panneau); }
.agenda-detail .agenda-chip { padding: 5px 8px; font-size: .86rem; }
.agenda-detail-title { margin: 0; color: var(--encre); font-size: 1.05rem; line-height: 1.3; }
.agenda-detail-hint { margin: 0; color: var(--gris); font-size: .9rem; }
.agenda-back { justify-self: start; padding: 0; font-size: .85rem; }
.agenda-badge { justify-self: start; padding: 2px 10px; border-radius: var(--r-pastille); font-size: .75rem; font-weight: 700; }
.agenda-badge--meeting { color: var(--vert-nuit); background: var(--vert-pale); }
.agenda-badge--event { color: var(--bleu-texte); background: var(--bleu-pale); }
.agenda-badge--cancelled { color: var(--gris); background: #F1F3F2; }
.agenda-detail-facts { display: grid; gap: 4px; margin: 0; font-size: .88rem; }
.agenda-detail-row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 8px; }
.agenda-detail-row dt { color: var(--gris); }
.agenda-detail-row dd { margin: 0; overflow-wrap: anywhere; }
.agenda-detail-description { max-height: 9em; margin: 0; overflow: auto; padding: 8px; color: var(--encre); background: #F7F9F7; border-radius: var(--r-champ); font-size: .84rem; white-space: pre-line; }
.agenda-detail-actions { display: grid; gap: 6px; margin-top: 4px; }
.agenda-detail-actions .field-hint { margin: 0; font-size: .8rem; }
.agenda-legend { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: .85rem; }
.agenda-legend li { display: flex; align-items: center; gap: 8px; }
.agenda-swatch { width: 14px; height: 14px; flex: none; border-radius: 3px; }
.agenda-swatch--meeting { background: var(--vert-pale); box-shadow: inset 3px 0 0 var(--vert); }
.agenda-swatch--private { background: var(--vert-nuit); }
.agenda-swatch--event { background: var(--bleu-pale); box-shadow: inset 3px 0 0 var(--bleu-texte); }
.agenda-swatch--cancelled { background: #F1F3F2; box-shadow: inset 3px 0 0 var(--gris-clair); }
@media (max-width: 1100px) {
    .agenda-layout { grid-template-columns: minmax(0, 1fr); }
    .agenda-detail { position: static; }
}
@media (max-width: 720px) {
    .agenda-grid { display: none; }
    .agenda-list { display: grid; gap: 8px; }
    .agenda-list-day { display: grid; gap: 4px; padding: 8px 10px; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--r-champ); }
    .agenda-list-day.is-today { border-color: var(--drapeau-orange); }
    .agenda-list-day h4 { margin: 0 0 2px; color: var(--vert-nuit); font-size: .9rem; }
    .agenda-list-day h4::first-letter { text-transform: uppercase; }
    .agenda-list .agenda-chip { padding: 5px 8px; font-size: .86rem; }
    .agenda-month { min-width: 0; font-size: 1rem; }
    .agenda-import, .agenda-import .btn-excel { width: 100%; }
}
@media print { .agenda-detail, .agenda-toolbar, .agenda-help { display: none; } }

/* Compte en bas du menu, pied de page sur une ligne. */
.sidebar-user { display: grid; gap: 8px; margin-top: auto; padding: 10px 10px 12px; border-top: 1px solid rgba(255, 255, 255, .14); }
.sidebar-form-link { padding: 0 6px; color: #CFE6D8; font-size: .82rem; }
.sidebar-form-link:hover { color: #FFFFFF; }
.sidebar-account { display: flex; align-items: center; gap: 6px; }
.sidebar-identity { display: flex; flex: 1; min-width: 0; align-items: center; gap: 9px; padding: 6px; color: #FFFFFF; text-align: left; background: none; border: 0; border-radius: 8px; cursor: pointer; }
.sidebar-identity:hover, .sidebar-identity.active { background: rgba(255, 255, 255, .1); }
.sidebar-avatar { display: grid; flex: none; width: 32px; height: 32px; place-items: center; color: var(--vert-nuit); background: #FFFFFF; border-radius: 50%; font-size: .78rem; font-weight: 700; }
.sidebar-identity-text { display: grid; min-width: 0; }
.sidebar-identity .account-chip-role { color: #A9CDB8; }
.sidebar-identity .account-chip-name { color: #FFFFFF; }
.sidebar-logout { display: grid; flex: none; width: 32px; height: 32px; place-items: center; padding: 0; color: #FFFFFF; background: none; border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%; cursor: pointer; }
.sidebar-logout:hover { background: var(--rouge); border-color: var(--rouge); }
.dashboard-main { display: flex; flex-direction: column; }
.dashboard-main > * { flex: none; }
.dashboard-footer { margin-top: auto; padding: 14px 0 0; color: var(--gris); font-size: .76rem; text-align: center; }
.dashboard-body .dashboard-main { padding-bottom: 10px; }
@media (max-width: 900px) {
    .sidebar-user { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 6px 12px 10px; }
    .sidebar-form-link { display: none; }
    .sidebar-account { flex: 1; }
}
@media print {
    .dashboard-main { display: block; }
    .dashboard-footer, .sidebar-user { display: none; }
}

/* Agenda : sélecteur de vue, Semaine, Planning. */
.agenda [hidden] { display: none !important; }
.agenda-views { display: inline-flex; overflow: hidden; border: 1px solid var(--trait-fort); border-radius: var(--r-champ); }
.agenda-views button { min-height: 34px; padding: 0 14px; color: var(--vert-nuit); background: var(--papier); border: 0; font-size: .88rem; font-weight: 700; cursor: pointer; }
.agenda-views button + button { border-left: 1px solid var(--trait-fort); }
.agenda-views button.active { color: #FFFFFF; background: var(--vert-nuit); }
.agenda-toolbar { justify-content: flex-start; }
.agenda-import { margin-left: auto; }

.agenda-week { overflow: hidden; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--r-panneau); }
.agenda-week-row { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); }
.agenda-week-head { background: #EEF2EF; border-bottom: 1px solid var(--trait); }
.agenda-week-dayname { display: flex; align-items: baseline; justify-content: center; gap: 5px; padding: 6px 4px; color: var(--gris); background: none; border: 0; border-left: 1px solid var(--trait); font-size: .8rem; text-transform: uppercase; cursor: pointer; }
.agenda-week-dayname strong { color: var(--encre); font-size: 1rem; }
.agenda-week-dayname.is-today strong { padding: 0 7px; color: #FFFFFF; background: var(--drapeau-orange); border-radius: var(--r-pastille); }
.agenda-week-dayname.is-selected { box-shadow: inset 0 -3px 0 var(--vert); }
.agenda-week-allday { border-bottom: 1px solid var(--trait); }
.agenda-week-label { padding: 6px 4px; color: var(--gris); font-size: .7rem; text-align: right; }
.agenda-week-allday-cell { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 3px; border-left: 1px solid var(--trait); }
.agenda-week-body { position: relative; overflow: hidden; background-image: repeating-linear-gradient(to bottom, var(--trait) 0 1px, transparent 1px var(--hour-height)); }
.agenda-week-hours { position: relative; }
.agenda-week-hours span { position: absolute; right: 6px; color: var(--gris); font-size: .7rem; transform: translateY(2px); }
.agenda-week-col { position: relative; min-width: 0; border-left: 1px solid var(--trait); }
.agenda-week-col.is-today { background: rgba(247, 127, 0, .04); }
.agenda .agenda-week-event { position: absolute; display: block; overflow: hidden; padding: 2px 5px; font-size: .76rem; line-height: 1.25; }
.agenda-week-event .agenda-chip-time { display: block; }
.agenda-week-event .agenda-chip-title { display: block; -webkit-line-clamp: 3; line-clamp: 3; }
.agenda-now { position: absolute; z-index: 2; right: 0; left: 0; height: 2px; background: var(--rouge); pointer-events: none; }
.agenda-now::before { position: absolute; top: -4px; left: -5px; width: 10px; height: 10px; background: var(--rouge); border-radius: 50%; content: ""; }

.agenda-planning { display: grid; gap: 8px; }
.planning-day { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; padding: 10px 12px; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--r-panneau); }
.planning-day.is-today { border-color: var(--drapeau-orange); box-shadow: inset 4px 0 0 var(--drapeau-orange); }
.planning-day.is-past { opacity: .72; }
.planning-date { display: grid; align-content: start; justify-items: center; padding: 2px 0; color: var(--vert-nuit); background: none; border: 0; cursor: pointer; }
.planning-date strong { font-size: 1.5rem; line-height: 1; }
.planning-date span { color: var(--gris); font-size: .78rem; text-transform: uppercase; }
.planning-items { display: grid; gap: 4px; }
.planning-item { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 10px; color: var(--encre); text-align: left; background: var(--vert-pale); border: 0; border-left: 3px solid var(--vert); border-radius: 4px; cursor: pointer; }
.planning-item:hover, .planning-item.is-selected { box-shadow: 0 0 0 1px var(--vert); }
.planning-item--event { background: var(--bleu-pale); border-left-color: var(--bleu-texte); }
.planning-item--event:hover, .planning-item--event.is-selected { box-shadow: 0 0 0 1px var(--bleu-texte); }
.planning-item.is-private { border-left-color: var(--vert-nuit); box-shadow: inset 3px 0 0 var(--vert-nuit); }
.planning-item.is-cancelled { color: var(--gris); background: #F1F3F2; border-left-color: var(--gris-clair); }
.planning-item.is-cancelled strong { text-decoration: line-through; }
.planning-time { color: var(--vert-nuit); font-size: .86rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.planning-item--event .planning-time { color: var(--bleu-texte); }
.planning-main { display: grid; min-width: 0; }
.planning-main strong { overflow-wrap: anywhere; font-size: .92rem; }
.planning-main small { color: var(--gris); font-size: .8rem; }
.planning-badge { padding: 1px 8px; color: var(--gris); background: rgba(255, 255, 255, .7); border-radius: var(--r-pastille); font-size: .72rem; font-weight: 700; white-space: nowrap; }
@media (max-width: 720px) {
    .agenda-week { display: none !important; }
    .agenda-calendar[data-agenda-mode="planning"] .agenda-list { display: none !important; }
    .agenda-views { width: 100%; }
    .agenda-views button { flex: 1; }
    .planning-day { grid-template-columns: 44px minmax(0, 1fr); padding: 8px; }
    .planning-item { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .planning-badge { justify-self: start; }
}
.agenda-week-event .agenda-chip-title { overflow-wrap: break-word; hyphens: auto; }

/* Agenda : synchronisation Google. */
.agenda-sync { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--gris); font-size: .85rem; }
.agenda-sync-dot { width: 9px; height: 9px; flex: none; background: var(--gris-clair); border-radius: 50%; }
.agenda-sync[data-state="ok"] .agenda-sync-dot { background: var(--drapeau-vert); }
.agenda-sync[data-state="error"] .agenda-sync-dot { background: var(--rouge); }
.agenda-sync[data-state="error"] .agenda-sync-text { color: var(--rouge); }
.agenda-sync[data-state="running"] .agenda-sync-dot { background: var(--drapeau-orange); animation: agenda-pulse 1s ease-in-out infinite alternate; }
@keyframes agenda-pulse { from { opacity: .35; } to { opacity: 1; } }
.agenda-sync .text-action { padding: 0; font-size: .85rem; }
.agenda-sync-text { min-width: 0; }
.agenda-sync-form { display: grid; gap: 8px; max-width: 760px; padding: 14px 16px; background: var(--papier); border: 1px solid var(--trait); border-left: 4px solid var(--bleu-texte); border-radius: var(--r-panneau); }
.agenda-sync-form h3 { margin: 0; color: var(--vert-nuit); font-size: 1rem; }
.agenda-sync-form ol { margin: 0; padding-left: 20px; font-size: .88rem; }
.agenda-sync-form .field-hint { margin: 0; font-size: .82rem; }
.agenda-sync-row { display: flex; gap: 8px; }
.agenda-sync-row input { flex: 1; min-width: 0; }
.agenda-sync-form .btn-danger { justify-self: start; }
@media (max-width: 720px) { .agenda-sync-row { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { .agenda-sync[data-state="running"] .agenda-sync-dot { animation: none; } }

/* Horloge de l'en-tête : cadran à aiguilles + heure et date en chiffres. */
.clock-widget { display: flex; align-items: center; gap: 10px; padding: 4px 14px 4px 5px; background: var(--papier); border: 1px solid var(--trait); border-radius: 12px; box-shadow: var(--ombre); }
.clock-face { width: 40px; height: 40px; flex: none; }
.clock-text { display: grid; line-height: 1.1; }
.clock-text strong { color: var(--vert-nuit); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.clock-text span { color: var(--gris); font-size: .72rem; white-space: nowrap; }
@media print { .clock-widget { display: none; } }
.signed-panel h1:focus, .signed-panel h1:focus-visible { outline: none; box-shadow: none; }

/* Statistiques : indicateurs du mois, courbes, classement des structures. */
.stats-month-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.stats-section-title { margin: 0; color: var(--vert-nuit); font-size: 1.05rem; }
.stats-month-head .stats-period { margin-left: 0; }
.stats-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi-tile { padding: 10px 14px 8px; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--r-panneau); box-shadow: var(--ombre); }
.kpi-tile-label { color: var(--gris); font-size: .82rem; }
.kpi-tile-value { margin: 2px 0 1px; color: var(--encre); font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-tile-delta { color: var(--gris); font-size: .78rem; }
.kpi-tile-delta b { font-weight: 700; }
.kpi-tile-delta .is-up { color: var(--vert-nuit); }
.kpi-tile-delta .is-down { color: var(--rouge); }
.kpi-tile-delta .is-flat { color: var(--gris); }
.kpi-spark { display: block; width: 100%; height: 28px; margin-top: 6px; overflow: visible; }
.kpi-spark-line { fill: none; stroke: var(--vert); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.stats-area { fill: var(--vert); opacity: .1; }
.stats-line { fill: none; stroke: var(--vert); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.stats-dot { fill: var(--papier); stroke: var(--vert); stroke-width: 2; }
.stats-dot.is-active { fill: var(--vert); }
.stats-crosshair { stroke: var(--trait-fort); stroke-width: 1; stroke-dasharray: 3 3; }
.stats-value { fill: var(--encre); font-family: var(--police); font-size: 12px; font-weight: 700; }
.stats-hit.is-active { fill: transparent; }
.stats-structures-card { margin-bottom: 14px; }
.rank-list { display: grid; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.rank-list li { display: grid; grid-template-columns: minmax(90px, 200px) minmax(0, 1fr) 3.5em; align-items: center; gap: 10px; padding: 2px 4px; border-radius: 4px; outline: none; }
.rank-list li:hover, .rank-list li:focus-visible { background: var(--vert-pale); }
.rank-name { overflow: hidden; color: var(--encre); font-size: .88rem; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.rank-track { display: block; height: 16px; }
.rank-bar { display: block; height: 100%; background: var(--vert); border-radius: 0 4px 4px 0; }
.rank-value { color: var(--encre); font-size: .88rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-list li.is-other .rank-bar { background: var(--gris-clair); }
.rank-list li.is-other .rank-name { color: var(--gris); }
@media (max-width: 1100px) { .stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .rank-list li { grid-template-columns: minmax(70px, 110px) minmax(0, 1fr) 3em; } }

/* QR code unique en tête de la page Réunions ; fiche de la réunion à droite. */
.qr-strip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; margin-bottom: 14px; padding: 10px 16px 10px 10px; background: var(--papier); border: 1px solid var(--trait); border-left: 4px solid var(--drapeau-orange); border-radius: var(--r-panneau); box-shadow: var(--ombre); }
.dashboard-body #qrCanvas.qr-strip-code, #qrCanvas.qr-strip-code { width: 84px; height: 84px; margin: 0; padding: 4px; }
#qrCanvas.qr-strip-code canvas, #qrCanvas.qr-strip-code img { max-width: 76px !important; }
.qr-strip-text h3 { margin: 0 0 2px; color: var(--vert-nuit); font-size: 1rem; }
.qr-strip-text p { margin: 0; color: var(--gris); font-size: .86rem; }
.qr-strip-actions { display: grid; gap: 6px; }
.qr-strip-actions button { min-height: 34px; white-space: nowrap; }
.meeting-detail-panel { text-align: left; }
.meeting-detail-facts { display: grid; gap: 4px; margin: 0 0 12px; font-size: .88rem; }
.meeting-detail-facts div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 8px; }
.meeting-detail-facts dt { color: var(--gris); }
.meeting-detail-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.meeting-detail-panel .qr-actions #viewAttendance { grid-column: 1 / -1; }
@media (max-width: 720px) {
    .qr-strip { grid-template-columns: auto minmax(0, 1fr); }
    .qr-strip-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}

/* Page Archives : filtres et résultats. */
.inline-link { padding: 0; font-size: inherit; }
.archives-page { margin-top: 0; }
.archive-filters { display: grid; grid-template-columns: minmax(160px, 1.3fr) minmax(180px, 1.6fr) 150px 150px 130px auto; align-items: end; gap: 10px; margin-bottom: 10px; }
.archive-filters .field { margin: 0; }
.archive-reset { align-self: center; margin-top: 18px; white-space: nowrap; }
.archive-summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.archive-summary { margin: 0; color: var(--gris); font-size: .86rem; }
.archive-title-cell strong { display: block; }
.archive-title-cell small { display: block; color: var(--gris); font-size: .8rem; }
.archive-match { display: block; margin-top: 3px; padding: 2px 8px; color: var(--vert-nuit); background: var(--vert-pale); border-radius: var(--r-champ); font-size: .8rem; }
.archive-priority[data-priority="cancelled"] { color: var(--gris); background: #EDF0EE; }
.archive-actions { white-space: nowrap; }
.archive-actions .archive-view { min-height: 30px; margin-right: 6px; padding: 3px 10px; font-size: .82rem; vertical-align: middle; }
@media (max-width: 1100px) { .archive-filters { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 560px) { .archive-filters { grid-template-columns: 1fr 1fr; } .archive-filter-wide { grid-column: 1 / -1; } }
.archive-table td .archive-priority { margin: 0; }

/* Page Réunions : bouton « Nouvelle réunion ». */
.meetings-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.meetings-list-head h3 { margin: 0; }
.meetings-new { min-height: 34px; padding: 5px 14px; }
.qr-strip-actions { grid-template-columns: repeat(3, auto); }
#qrCanvas.qr-strip-code { cursor: zoom-in; }
#qrCanvas.qr-strip-code:hover, #qrCanvas.qr-strip-code:focus-visible { border-color: var(--vert); box-shadow: var(--focus); outline: none; }

/* Volet latéral : création / modification d'une réunion. */
.drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(11, 30, 22, .35); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; display: flex; width: min(480px, 100vw); flex-direction: column; overflow-y: auto; background: var(--fond); border-left: 1px solid var(--trait); box-shadow: -12px 0 30px rgba(11, 30, 22, .18); transform: translateX(100%); transition: transform .2s ease; }
.drawer.is-open { transform: none; }
.drawer-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 12px; background: var(--papier); border-bottom: 1px solid var(--trait); box-shadow: inset 0 3px 0 var(--vert); }
.drawer-head h2 { margin: 0; color: var(--vert-nuit); font-size: 1.15rem; }
.drawer-close { display: grid; width: 34px; height: 34px; place-items: center; padding: 0; color: var(--vert-nuit); background: var(--papier); border: 1px solid var(--trait-fort); border-radius: 50%; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.drawer-close:hover { color: #FFFFFF; background: var(--vert-nuit); }
.drawer-intro { margin: 12px 18px 0; color: var(--gris); font-size: .86rem; }
.drawer-body.creation-card { margin: 10px 18px 18px; }
.drawer .meeting-creation-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.drawer .meeting-creation-form .field-wide, .drawer .meeting-creation-form .field-half, .drawer .creation-actions, .drawer .field-hint { grid-column: 1 / -1; }
.drawer .creation-actions { display: flex; gap: 8px; }
.drawer .creation-actions .btn-excel { flex: 1; }
body.drawer-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } }

/* QR code agrandi. */
.qr-zoom { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(11, 30, 22, .78); }
.qr-zoom[hidden] { display: none; }
.qr-zoom-card { position: relative; display: grid; justify-items: center; gap: 6px; padding: 28px 28px 22px; background: #FFFFFF; border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); text-align: center; }
.qr-zoom-card::before { position: absolute; top: 0; right: 0; left: 0; height: 6px; border-radius: 16px 16px 0 0; background: var(--tricolore); content: ""; }
.qr-zoom-card img { width: min(70vh, 80vw, 560px); height: auto; image-rendering: pixelated; }
.qr-zoom-title { margin: 6px 0 0; color: var(--vert-nuit); font-size: clamp(1.1rem, 2.6vh, 1.6rem); font-weight: 700; }
.qr-zoom-text { margin: 0; color: var(--gris); font-size: clamp(.9rem, 2vh, 1.1rem); }
.qr-zoom-close { position: absolute; top: 12px; right: 12px; }
@media (max-width: 720px) { .qr-strip-actions { grid-template-columns: 1fr 1fr 1fr; } }
.drawer[hidden], .drawer-backdrop[hidden] { display: none; }
.qr-zoom-card .qr-zoom-close { top: -14px; right: -14px; box-shadow: var(--ombre); }

/* Icône de téléchargement sous le QR code agrandi. */
.qr-zoom-download { display: grid; width: 44px; height: 44px; place-items: center; margin-top: 6px; padding: 0; color: #FFFFFF; background: var(--vert); border: 0; border-radius: 50%; box-shadow: var(--ombre); cursor: pointer; }
.qr-zoom-download:hover, .qr-zoom-download:focus-visible { background: var(--vert-nuit); }
.qr-zoom-download svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.qr-strip-actions { grid-template-columns: auto; }
@media (max-width: 720px) { .qr-strip-actions { grid-template-columns: 1fr; } }

/* Suppression définitive (administrateur). */
.qr-actions .meeting-delete { grid-column: 1 / -1; color: #FFFFFF; background: var(--rouge); border-color: var(--rouge); }
.qr-actions .meeting-delete:hover { background: #8F1B12; border-color: #8F1B12; }
.archive-actions .archive-delete { min-height: 30px; margin-left: 6px; padding: 3px 10px; font-size: .82rem; vertical-align: middle; }

/* Bandeau « nouvelle version disponible ». */
.update-banner { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 10px 12px 10px 16px; color: #FFFFFF; background: var(--vert-nuit); border-radius: var(--r-panneau); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-size: .9rem; }
.update-banner .btn-excel { min-height: 34px; color: var(--vert-nuit); background: #FFFFFF; border-color: #FFFFFF; white-space: nowrap; }
@media print { .update-banner { display: none; } }

/* Lieu déjà prévu sur le même créneau (avertissement, non bloquant). */
.conflict-warning { margin: 0 0 10px; padding: 8px 12px; color: var(--ambre-texte); background: var(--ambre-pale); border-left: 4px solid var(--drapeau-orange); border-radius: 0 var(--r-champ) var(--r-champ) 0; font-size: .86rem; }
.conflict-warning strong { display: block; }
.conflict-warning ul { margin: 4px 0; padding-left: 18px; color: var(--encre); }
.conflict-warning span { color: var(--gris); font-size: .82rem; }

/* ---------- Droits des profils ---------- */
/* Élément masqué faute de droit (data-perm, voir common.js). */
.perm-hidden { display: none !important; }

.settings-management { display: grid; gap: 1rem; }
.settings-tabs { display: flex; gap: .5rem; border-bottom: 1px solid var(--bordure, #d9e1dc); }
.settings-tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: .6rem .9rem; font: inherit; font-weight: 600; color: inherit; cursor: pointer; }
.settings-tab.active { border-bottom-color: var(--vert, #0B5D3B); color: var(--vert-nuit, #0B5D3B); }
.settings-intro h2 { margin: 0 0 .35rem; }
.settings-intro p { margin: 0 0 .75rem; max-width: 70ch; }
.permissions-table { width: 100%; border-collapse: collapse; }
.permissions-table th[scope="row"] { text-align: left; font-weight: 500; }
.permissions-table th[scope="row"] small { display: block; font-weight: 400; opacity: .7; font-size: .82em; }
.permissions-table .perm-col { text-align: center; width: 8.5rem; }
.permissions-table input[type="checkbox"] { width: 1.15rem; height: 1.15rem; cursor: pointer; accent-color: var(--vert, #0B5D3B); }
.permissions-table input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .55; }
.permissions-module th { text-align: left; background: var(--vert-pale, #e8f3ed); color: var(--vert-nuit, #0B5D3B); font-weight: 700; padding-top: .55rem; padding-bottom: .55rem; }
.permissions-table td.perm-changed { background: #fff6d6; box-shadow: inset 0 0 0 2px #e0b100; }
.settings-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.settings-history summary { cursor: pointer; font-weight: 600; }
.settings-history table { margin-top: .75rem; }
@media (max-width: 640px) {
    .permissions-table .perm-col { width: auto; }
    .permissions-table th:nth-child(2), .permissions-table td:nth-child(2) { display: none; }
}
