/* ==========================================================================
   Boulangerie RH & Paie – système de design
   Thème clair / sombre, mouvement (désactivé si « réduire les animations »)
   ========================================================================== */

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

/* ---------- Jetons ---------- */

:root {
    color-scheme: light;
    --police: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    --fond: #f6f4f1;
    --surface: #ffffff;
    --surface-2: #faf8f6;
    --surface-3: #f1ede8;
    --bord: #e8e2da;
    --bord-fort: #d7cec3;
    --texte: #1c1714;
    --texte-2: #5d544d;
    --texte-3: #8f857c;

    --marque: #a24a10;
    --marque-vif: #c45d17;
    --marque-fonce: #873c0b;
    --marque-doux: #fbefe4;
    --marque-texte: #8a3f0e;
    --dore: #e9a23b;
    --anneau: rgba(196, 93, 23, .28);

    --ok: #15803d;
    --ok-fond: #e8f6ec;
    --attention: #b45309;
    --attention-fond: #fdf3e2;
    --alerte: #c4321c;
    --alerte-fond: #fdecea;
    --info: #1d5fc9;
    --info-fond: #e9f0fd;
    --neutre-fond: #efebe6;

    --graphe-1: #c45d17;
    --graphe-2: #e9a23b;
    --graphe-3: #15803d;
    --graphe-4: #1d5fc9;
    --graphe-5: #c4321c;
    --graphe-6: #a8a29e;
    --graphe-grille: #ece6df;

    --nav-fond: #18120e;
    --nav-fond-2: #211812;
    --nav-texte: #e8ddd2;
    --nav-texte-2: #a39282;
    --nav-survol: rgba(255, 255, 255, .06);
    --nav-bord: rgba(255, 255, 255, .07);

    --verre: rgba(246, 244, 241, .78);
    --voile: rgba(20, 14, 10, .45);

    --ombre-1: 0 1px 2px rgba(28, 23, 20, .06);
    --ombre-2: 0 1px 2px rgba(28, 23, 20, .05), 0 6px 20px -6px rgba(28, 23, 20, .10);
    --ombre-3: 0 2px 6px rgba(28, 23, 20, .06), 0 24px 48px -12px rgba(28, 23, 20, .22);
    --ombre-btn: 0 1px 2px rgba(110, 48, 8, .25), inset 0 1px 0 rgba(255, 255, 255, .18);
    --btn-haut: var(--marque-vif);
    --btn-bas: var(--marque);

    --rayon-s: 8px;
    --rayon: 12px;
    --rayon-l: 16px;
    --sidebar: 264px;
    --topbar: 60px;

    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-in: cubic-bezier(.7, 0, .84, 0);
    --ease-in-out: cubic-bezier(.65, 0, .35, 1);
    --ease-ressort: cubic-bezier(.34, 1.56, .64, 1);
    --d-1: 120ms;
    --d-2: 200ms;
    --d-3: 320ms;
    --d-4: 520ms;
    --d-5: 900ms;
}

/* Thème sombre réservé à l'écran : impression et PDF restent toujours en clair */
@media screen {
    :root[data-theme="dark"] {
        color-scheme: dark;
        --fond: #0f0c0a;
        --surface: #171310;
        --surface-2: #1c1714;
        --surface-3: #241e19;
        --bord: #2b241f;
        --bord-fort: #3b322b;
        --texte: #f4eee8;
        --texte-2: #bcb0a5;
        --texte-3: #8a7e74;
        --marque: #e0782c;
        --marque-vif: #f08a3c;
        --marque-fonce: #c9661d;
        --marque-doux: rgba(224, 120, 44, .14);
        --marque-texte: #f4a05f;
        --anneau: rgba(240, 138, 60, .35);
        --ok: #4ade80;
        --ok-fond: rgba(74, 222, 128, .12);
        --attention: #fbbf24;
        --attention-fond: rgba(251, 191, 36, .12);
        --alerte: #f87171;
        --alerte-fond: rgba(248, 113, 113, .12);
        --info: #60a5fa;
        --info-fond: rgba(96, 165, 250, .12);
        --neutre-fond: #2a241f;
        --graphe-1: #f08a3c;
        --graphe-2: #f5b95c;
        --graphe-3: #4ade80;
        --graphe-4: #60a5fa;
        --graphe-5: #f87171;
        --graphe-6: #78716c;
        --graphe-grille: #2b241f;
        --nav-fond: #0b0907;
        --nav-fond-2: #120e0b;
        --verre: rgba(15, 12, 10, .72);
        --voile: rgba(0, 0, 0, .6);
        --ombre-1: 0 1px 2px rgba(0, 0, 0, .4);
        --ombre-2: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -8px rgba(0, 0, 0, .55);
        --ombre-3: 0 2px 6px rgba(0, 0, 0, .4), 0 28px 56px -12px rgba(0, 0, 0, .7);
        --ombre-btn: 0 1px 2px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .14);
        --btn-haut: #b85a16;
        --btn-bas: #94440c;
    }
}

@media screen and (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --fond: #0f0c0a;
        --surface: #171310;
        --surface-2: #1c1714;
        --surface-3: #241e19;
        --bord: #2b241f;
        --bord-fort: #3b322b;
        --texte: #f4eee8;
        --texte-2: #bcb0a5;
        --texte-3: #8a7e74;
        --marque: #e0782c;
        --marque-vif: #f08a3c;
        --marque-fonce: #c9661d;
        --marque-doux: rgba(224, 120, 44, .14);
        --marque-texte: #f4a05f;
        --anneau: rgba(240, 138, 60, .35);
        --ok: #4ade80;
        --ok-fond: rgba(74, 222, 128, .12);
        --attention: #fbbf24;
        --attention-fond: rgba(251, 191, 36, .12);
        --alerte: #f87171;
        --alerte-fond: rgba(248, 113, 113, .12);
        --info: #60a5fa;
        --info-fond: rgba(96, 165, 250, .12);
        --neutre-fond: #2a241f;
        --graphe-1: #f08a3c;
        --graphe-2: #f5b95c;
        --graphe-3: #4ade80;
        --graphe-4: #60a5fa;
        --graphe-5: #f87171;
        --graphe-6: #78716c;
        --graphe-grille: #2b241f;
        --nav-fond: #0b0907;
        --nav-fond-2: #120e0b;
        --verre: rgba(15, 12, 10, .72);
        --voile: rgba(0, 0, 0, .6);
        --ombre-1: 0 1px 2px rgba(0, 0, 0, .4);
        --ombre-2: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -8px rgba(0, 0, 0, .55);
        --ombre-3: 0 2px 6px rgba(0, 0, 0, .4), 0 28px 56px -12px rgba(0, 0, 0, .7);
        --ombre-btn: 0 1px 2px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .14);
        --btn-haut: #b85a16;
        --btn-bas: #94440c;
    }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--police);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--texte);
    background: var(--fond);
    font-feature-settings: 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
a { color: var(--marque-texte); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.018em; font-weight: 650; }
h1 { font-size: 1.6rem; letter-spacing: -.025em; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
p { margin: 0 0 .8em; }
small, .muet { color: var(--texte-2); }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; }
kbd {
    display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px; border-radius: 6px;
    border: 1px solid var(--bord-fort); border-bottom-width: 2px; background: var(--surface); color: var(--texte-2); font-size: .75rem; line-height: 1.5;
}
::selection { background: var(--marque-doux); color: var(--texte); }
:focus-visible { outline: 2px solid var(--marque-vif); outline-offset: 2px; border-radius: 6px; }
.ico { width: 18px; height: 18px; flex: none; }
.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; }
.lien-evitement {
    position: fixed; top: 8px; left: 8px; z-index: 100; padding: 8px 14px; border-radius: var(--rayon-s);
    background: var(--marque); color: #fff; transform: translateY(-150%); transition: transform var(--d-2) var(--ease-out);
}
.lien-evitement:focus { transform: none; }

/* ---------- Structure : barre latérale ---------- */

.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, var(--nav-fond-2), var(--nav-fond) 40%);
    color: var(--nav-texte);
    border-right: 1px solid var(--nav-bord);
    view-transition-name: barre-laterale;
}
.marque { display: flex; align-items: center; gap: 12px; padding: 18px 18px 16px; text-decoration: none; color: inherit; }
.marque strong { display: block; font-size: .95rem; font-weight: 650; letter-spacing: -.01em; color: #fff; }
.marque small { display: block; color: var(--nav-texte-2); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.marque-logo {
    width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center;
    background: linear-gradient(145deg, #f6c46e, #d9792a 70%, #b85a16);
    box-shadow: 0 6px 18px -6px rgba(217, 121, 42, .65), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.marque-logo svg { width: 26px; height: 26px; color: #fff7ea; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .12) transparent; }
.nav-titre { display: block; padding: 16px 10px 6px; font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--nav-texte-2); opacity: .8; }
.sidebar nav a {
    position: relative; display: flex; align-items: center; gap: 11px;
    padding: 8px 10px; margin: 1px 0; border-radius: 9px;
    color: var(--nav-texte); text-decoration: none; font-size: .9rem; font-weight: 500;
    transition: background var(--d-2) var(--ease-out), color var(--d-2) var(--ease-out);
}
.sidebar nav a .ico { opacity: .75; transition: opacity var(--d-2), transform var(--d-3) var(--ease-ressort); }
.sidebar nav a:hover { background: var(--nav-survol); color: #fff; }
.sidebar nav a:hover .ico { opacity: 1; transform: translateX(1px); }
.sidebar nav a.actif {
    color: #fff;
    background: linear-gradient(135deg, rgba(240, 138, 60, .26), rgba(233, 162, 59, .10));
    box-shadow: inset 0 0 0 1px rgba(240, 138, 60, .22);
    view-transition-name: nav-actif;
}
.sidebar nav a.actif::before {
    content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #f6c46e, #e0782c);
}
.sidebar nav a.actif .ico { opacity: 1; color: #f6c46e; }
.nav-pastille { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--marque); color: var(--surface); font-size: .7rem; font-weight: 700; display: grid; place-items: center; }
.sidebar-pied { padding: 12px; border-top: 1px solid var(--nav-bord); }
.carte-utilisateur { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.carte-utilisateur .avatar { background: rgba(240, 138, 60, .18); color: #f6c46e; }
.carte-utilisateur strong { display: block; font-size: .85rem; color: #fff; }
.carte-utilisateur small { display: block; color: var(--nav-texte-2); font-size: .74rem; }

/* ---------- Structure : barre du haut et contenu ---------- */

.app-main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30; height: var(--topbar);
    display: flex; align-items: center; gap: 12px; padding: 0 28px;
    background: var(--verre);
    -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--bord);
    view-transition-name: barre-haut;
}
.topbar .topbar-menu { display: none; }
.fil { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .86rem; color: var(--texte-3); }
.fil strong { color: var(--texte); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fil .ico { width: 14px; height: 14px; }
.topbar-outils { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.recherche-declencheur {
    display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px 0 12px; min-width: 240px;
    border: 1px solid var(--bord); border-radius: 10px; background: var(--surface); color: var(--texte-3);
    font: inherit; font-size: .86rem; cursor: pointer; box-shadow: var(--ombre-1);
    transition: border-color var(--d-2), box-shadow var(--d-2), transform var(--d-2) var(--ease-out);
}
.recherche-declencheur:hover { border-color: var(--bord-fort); box-shadow: var(--ombre-2); }
.recherche-declencheur kbd { margin-left: auto; }
.horloge { font-size: .84rem; color: var(--texte-2); font-variant-numeric: tabular-nums; padding: 0 8px; white-space: nowrap; }
.btn-icone {
    width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; flex: none;
    border: 1px solid transparent; background: transparent; color: var(--texte-2); cursor: pointer;
    transition: background var(--d-2), color var(--d-2), transform var(--d-2) var(--ease-out);
}
.btn-icone:hover { background: var(--surface-3); color: var(--texte); }
.btn-icone:active { transform: scale(.94); }
.theme-clair, .theme-sombre { display: contents; }
:root[data-theme="dark"] .theme-clair, :root:not([data-theme="dark"]) .theme-sombre { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-clair { display: none; }
    :root:not([data-theme="light"]) .theme-sombre { display: contents; }
}
.menu-utilisateur { position: relative; }
.menu-utilisateur > button { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.menu-utilisateur > button .avatar { width: 34px; height: 34px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--bord); transition: box-shadow var(--d-2); }
.menu-utilisateur > button:hover .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--marque-vif); }
.menu-deroulant {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 6px; z-index: 50;
    background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre-3);
    transform-origin: top right; opacity: 0; transform: translateY(-4px) scale(.97); pointer-events: none; visibility: hidden;
    transition: opacity var(--d-2) var(--ease-out), transform var(--d-2) var(--ease-out), visibility 0s linear var(--d-2);
}
.menu-utilisateur.ouvert .menu-deroulant { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.menu-deroulant .entete-menu { padding: 8px 10px 10px; border-bottom: 1px solid var(--bord); margin-bottom: 6px; }
.menu-deroulant .entete-menu strong { display: block; font-size: .88rem; }
.menu-deroulant .entete-menu small { font-size: .78rem; }
.menu-deroulant a, .menu-deroulant button {
    display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px;
    background: none; color: var(--texte); font: inherit; font-size: .88rem; text-decoration: none; cursor: pointer; text-align: left;
}
.menu-deroulant a:hover, .menu-deroulant button:hover { background: var(--surface-3); }
.menu-deroulant .danger { color: var(--alerte); }

.contenu { width: 100%; max-width: 1440px; padding: 28px 28px 72px; }
.contenu-seul { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }

.page-entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-entete h1 { margin: 0; }
.surtitre { margin: 0 0 6px; font-size: .74rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--marque-texte); }
.sous-titre { margin: 6px 0 0; color: var(--texte-2); font-size: .92rem; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.entete-page { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.entete-page h1 { margin: 0; }

.nav-toggle, .voile { display: none; }

@media (max-width: 1000px) {
    :root { --topbar: 56px; }
    .sidebar { transform: translateX(-102%); visibility: hidden; transition: transform var(--d-3) var(--ease-out), visibility 0s linear var(--d-3); box-shadow: none; }
    .nav-toggle:checked ~ .sidebar { transform: none; visibility: visible; transition-delay: 0s; box-shadow: var(--ombre-3); }
    .nav-toggle:checked ~ .voile {
        display: block; position: fixed; inset: 0; z-index: 35; background: var(--voile);
        -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: fondu var(--d-2) var(--ease-out);
    }
    .app-main { margin-left: 0; }
    .topbar { padding: 0 12px; gap: 8px; }
    .topbar .topbar-menu { display: grid; }
    .recherche-declencheur { min-width: 0; width: 36px; padding: 0; justify-content: center; border-color: transparent; background: none; box-shadow: none; }
    .recherche-declencheur span, .recherche-declencheur kbd, .horloge { display: none; }
    .fil > span, .fil > .ico { display: none; }
    .contenu { padding: 18px 16px 72px; }
    h1, .page-entete h1 { font-size: 1.3rem; }
}

/* ---------- Cartes et grilles ---------- */

.carte {
    background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon-l);
    box-shadow: var(--ombre-1); padding: 20px 22px; margin-bottom: 18px;
}
.carte > h2:first-child { margin-top: 0; }
.carte-entete { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.carte-entete h2 { margin: 0; }
.carte-entete p { margin: 2px 0 0; color: var(--texte-2); font-size: .86rem; }
.carte-interactive { transition: transform var(--d-3) var(--ease-out), box-shadow var(--d-3) var(--ease-out), border-color var(--d-2); }
.carte-interactive:hover { transform: translateY(-2px); box-shadow: var(--ombre-2); border-color: var(--bord-fort); }

.grille { display: grid; gap: 18px; }
.grille-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grille-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grille-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grille > .carte { margin-bottom: 0; }
@media (max-width: 1100px) { .grille-3, .grille-2-1 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .grille-2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Indicateurs ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-lien { text-decoration: none; color: inherit; display: block; border-radius: var(--rayon-l); }
.stat {
    position: relative; overflow: hidden; height: 100%; min-width: 0;
    display: flex; flex-direction: column; gap: 4px; padding: 16px 18px;
    background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon-l); box-shadow: var(--ombre-1);
    transition: transform var(--d-3) var(--ease-out), box-shadow var(--d-3) var(--ease-out), border-color var(--d-2);
}
.stat::after {
    content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
    background: linear-gradient(90deg, var(--ton, var(--marque-vif)), transparent 80%); opacity: .9;
}
.stat.ok { --ton: var(--ok); }
.stat.attention { --ton: var(--dore); }
.stat.alerte { --ton: var(--alerte); }
.stat.info { --ton: var(--info); }
.stat-lien:hover .stat { transform: translateY(-2px); box-shadow: var(--ombre-2); border-color: var(--bord-fort); }
.stat-haut { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-libelle { font-size: .8rem; color: var(--texte-2); font-weight: 550; }
.stat-icone {
    width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none;
    color: var(--ton, var(--marque-vif)); background: color-mix(in srgb, var(--ton, var(--marque-vif)) 12%, transparent);
}
.stat-icone .ico { width: 17px; height: 17px; }
.stat-valeur { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1.15; overflow-wrap: anywhere; }
.stat-valeur .unite { font-size: .52em; font-weight: 600; color: var(--texte-3); letter-spacing: 0; }
.stat-aide { font-size: .78rem; color: var(--texte-3); }
.stat-graphe { height: 34px; margin-top: 6px; }
@media (max-width: 1000px) {
    .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
    .stat { padding: 13px 14px; }
    .stat-valeur { font-size: 1.32rem; }
    .stat-icone { width: 28px; height: 28px; }
}

/* ---------- Boutons ---------- */

.btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 38px; padding: 8px 15px; border-radius: 10px; border: 1px solid transparent;
    background: linear-gradient(180deg, var(--btn-haut), var(--btn-bas)); color: #fff;
    font: inherit; font-size: .88rem; font-weight: 600; letter-spacing: -.005em; text-decoration: none; white-space: nowrap; cursor: pointer;
    box-shadow: var(--ombre-btn);
    transition: transform var(--d-2) var(--ease-out), box-shadow var(--d-2) var(--ease-out), filter var(--d-2), background var(--d-2);
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: var(--ombre-btn), 0 6px 16px -6px rgba(196, 93, 23, .55); }
.btn:active { transform: translateY(0) scale(.98); filter: brightness(.97); }
.btn .ico { width: 17px; height: 17px; }
.btn-leger { background: var(--surface); color: var(--texte); border-color: var(--bord-fort); box-shadow: var(--ombre-1); }
.btn-leger:hover { background: var(--surface-2); border-color: var(--texte-3); box-shadow: var(--ombre-2); filter: none; }
.btn-ok { background: linear-gradient(180deg, #1f9a4c, #15803d); }
.btn-ok:hover { box-shadow: var(--ombre-btn), 0 6px 16px -6px rgba(21, 128, 61, .55); }
.btn-danger { background: var(--surface); color: var(--alerte); border-color: color-mix(in srgb, var(--alerte) 35%, transparent); box-shadow: none; }
.btn-danger:hover { background: var(--alerte-fond); box-shadow: none; filter: none; }
.btn.btn-icone { width: 38px; min-height: 38px; padding: 0; font-size: 1.1rem; }
.btn-petit { min-height: 30px; padding: 4px 11px; font-size: .8rem; border-radius: 8px; }
.btn-grand { min-height: 50px; padding: 12px 22px; font-size: 1rem; border-radius: 12px; }
.btn[disabled], .btn.desactive { opacity: .5; pointer-events: none; }
.btn.charge { color: transparent !important; pointer-events: none; }
.btn.charge::after {
    content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: tourne .7s linear infinite;
}
.btn-leger.charge::after, .btn-danger.charge::after { border-color: var(--bord-fort); border-top-color: var(--texte); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.en-ligne { display: inline; }

/* ---------- Pastilles et messages ---------- */

.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 999px;
    font-size: .76rem; font-weight: 600; line-height: 1.6; white-space: nowrap;
    background: var(--neutre-fond); color: var(--texte-2);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; flex: none; }
.badge-ok { background: var(--ok-fond); color: var(--ok); }
.badge-attention { background: var(--attention-fond); color: var(--attention); }
.badge-alerte { background: var(--alerte-fond); color: var(--alerte); }
.badge-info { background: var(--info-fond); color: var(--info); }

.message {
    position: relative; display: block; padding: 12px 14px 12px 32px; border-radius: var(--rayon); margin-bottom: 16px;
    border: 1px solid; font-size: .9rem;
}
.message::before { content: ''; position: absolute; left: 14px; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.message-ok { background: var(--ok-fond); border-color: color-mix(in srgb, var(--ok) 25%, transparent); color: var(--ok); }
.message-erreur { background: var(--alerte-fond); border-color: color-mix(in srgb, var(--alerte) 25%, transparent); color: var(--alerte); }
.message-info { background: var(--info-fond); border-color: color-mix(in srgb, var(--info) 25%, transparent); color: var(--info); }
.message-attention { background: var(--attention-fond); border-color: color-mix(in srgb, var(--attention) 25%, transparent); color: var(--attention); }
.message ul { margin: 6px 0 0; padding-left: 18px; }
.message strong { color: inherit; }

/* Notifications (messages flash) */
.toasts {
    position: fixed; top: calc(var(--topbar) + 12px); right: 20px; z-index: 80;
    display: flex; flex-direction: column; gap: 10px; width: min(400px, calc(100vw - 32px)); pointer-events: none;
}
.toast.message {
    position: relative; overflow: hidden; margin: 0; padding: 13px 40px 13px 34px; pointer-events: auto;
    background: var(--surface); color: var(--texte); border-color: var(--bord); box-shadow: var(--ombre-3);
    animation: toast-entree var(--d-4) var(--ease-ressort) both;
}
.toast.message::before { width: 9px; height: 9px; left: 15px; top: 19px; }
.toast.message-ok::before { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-fond); }
.toast.message-erreur::before { background: var(--alerte); box-shadow: 0 0 0 4px var(--alerte-fond); }
.toast.message-info::before { background: var(--info); box-shadow: 0 0 0 4px var(--info-fond); }
.toast.message-attention::before { background: var(--attention); box-shadow: 0 0 0 4px var(--attention-fond); }
.toast-fermer {
    position: absolute; top: 9px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 7px;
    background: none; color: var(--texte-3); cursor: pointer; display: grid; place-items: center;
}
.toast-fermer:hover { background: var(--surface-3); color: var(--texte); }
.toast-progression { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--marque-vif); transform-origin: left; opacity: .7; }
.toast.sortie { animation: toast-sortie var(--d-3) var(--ease-in) forwards; }
@media (max-width: 640px) { .toasts { left: 16px; right: 16px; width: auto; top: calc(var(--topbar) + 8px); } }

/* ---------- Tableaux ---------- */

.tableau-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -22px; padding: 0 22px; }
table.tableau { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .875rem; }
.tableau th, .tableau td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.tableau th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-3); font-weight: 600;
    background: var(--surface-2); white-space: nowrap; border-top: 1px solid var(--bord);
}
.tableau th:first-child { border-top-left-radius: 10px; border-left: 1px solid var(--bord); }
.tableau th:last-child { border-top-right-radius: 10px; border-right: 1px solid var(--bord); }
.tableau tbody tr { transition: background var(--d-1); }
.tableau tbody tr:hover { background: var(--surface-2); }
.tableau tbody tr:last-child td { border-bottom-color: transparent; }
.tableau .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--bord-fort); }
.tableau td.vide { text-align: center; color: var(--texte-3); padding: 34px; }
.tableau input, .tableau select { min-width: 0; }

.personne { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
    font-weight: 650; font-size: .76rem; letter-spacing: .02em;
    color: var(--marque-texte); background: linear-gradient(145deg, var(--marque-doux), color-mix(in srgb, var(--dore) 22%, var(--surface)));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--marque-vif) 18%, transparent);
}
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.personne a { font-weight: 600; text-decoration: none; color: var(--texte); }
.personne a:hover { color: var(--marque-texte); }
.personne small { display: block; font-size: .78rem; }

/* ---------- Formulaires ---------- */

label { display: block; font-weight: 550; font-size: .84rem; margin-bottom: 5px; color: var(--texte); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time],
input[type=month], input[type=tel], input[type=search], input[type=url], input[type=file], select, textarea {
    width: 100%; min-height: 40px; padding: 9px 12px; border: 1px solid var(--bord-fort); border-radius: 10px;
    font: inherit; font-size: .9rem; background: var(--surface); color: var(--texte);
    box-shadow: var(--ombre-1);
    transition: border-color var(--d-2), box-shadow var(--d-2), background var(--d-2);
}
input::placeholder, textarea::placeholder { color: var(--texte-3); }
input:hover, select:hover, textarea:hover { border-color: var(--texte-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--marque-vif); box-shadow: 0 0 0 4px var(--anneau); }
select { appearance: none; padding-right: 34px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238f857c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; }
textarea { min-height: 88px; resize: vertical; }
input[type=file] { padding: 6px; }
input[type=file]::file-selector-button { border: 0; border-radius: 7px; padding: 6px 12px; margin-right: 10px; background: var(--surface-3); color: var(--texte); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--marque-vif); }
.champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px 18px; }
.champ-large { grid-column: 1 / -1; }
.aide { font-size: .78rem; color: var(--texte-3); margin-top: 4px; }
.case { display: flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; }
.case input { width: 18px; height: 18px; }
fieldset { border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px 18px 18px; margin: 0 0 18px; min-width: 0; }
legend { font-weight: 650; padding: 0 8px; color: var(--marque-texte); font-size: .9rem; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.filtres { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filtres > div { min-width: 160px; }
.filtres input[type=text] { min-width: 240px; }
.selecteur { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.selecteur input[type=month], .selecteur input[type=date], .selecteur select { width: auto; }

.onglets { display: flex; gap: 4px; padding: 4px; margin-bottom: 18px; overflow-x: auto; background: var(--surface-3); border-radius: 12px; width: fit-content; max-width: 100%; scrollbar-width: none; }
.onglets a {
    padding: 7px 14px; border-radius: 9px; text-decoration: none; color: var(--texte-2); white-space: nowrap; font-weight: 550; font-size: .88rem;
    transition: color var(--d-2), background var(--d-2);
}
.onglets a:hover { color: var(--texte); }
.onglets a.actif { color: var(--texte); background: var(--surface); box-shadow: var(--ombre-2); view-transition-name: onglet-actif; }

.liste-simple { list-style: none; margin: 0; padding: 0; }
.liste-simple li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--bord); align-items: center; }
.liste-simple li:last-child { border-bottom: 0; }
.liste-simple .num { flex: none; }

dl.infos { display: grid; grid-template-columns: max-content 1fr; gap: 9px 22px; margin: 0; }
dl.infos dt { color: var(--texte-3); font-size: .86rem; }
dl.infos dd { margin: 0; font-weight: 550; }

.etat-vide { text-align: center; padding: 36px 16px; color: var(--texte-2); }
.etat-vide-icone {
    width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center;
    background: var(--surface-3); color: var(--texte-3);
}
.etat-vide-icone .ico { width: 24px; height: 24px; }
.etat-vide strong { display: block; color: var(--texte); font-size: .98rem; margin-bottom: 4px; }
.etat-vide p { margin: 0 auto 14px; max-width: 420px; font-size: .88rem; }

.progression { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progression > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--marque-vif), var(--dore)); transform-origin: left; animation: barre-grandit var(--d-5) var(--ease-out) both; }

.point-direct { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulsation 2s var(--ease-out) infinite; }

[data-tip] { position: relative; }
/* Infobulle : absente de la page tant qu'elle n'est pas affichée (pas de défilement parasite) */
[data-tip]:hover::after, [data-tip]:focus-visible::after {
    content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 60;
    padding: 5px 9px; border-radius: 7px; background: #1c1714; color: #fff; font-size: .74rem; font-weight: 500; white-space: nowrap;
    transform: translateX(-50%); pointer-events: none; animation: info-bulle var(--d-2) var(--ease-out) both;
}
[data-tip][data-tip-pos="droite"]:hover::after, [data-tip][data-tip-pos="droite"]:focus-visible::after { left: auto; right: 0; transform: none; }
/* Barre du haut collée au bord de la fenêtre : l'infobulle s'affiche dessous */
.topbar [data-tip]:hover::after, .topbar [data-tip]:focus-visible::after,
.page-simple-haut [data-tip]:hover::after, .page-simple-haut [data-tip]:focus-visible::after { bottom: auto; top: calc(100% + 8px); }
@keyframes info-bulle { from { opacity: 0; translate: 0 4px; } }

.chargeur { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--bord-fort); border-top-color: var(--marque-vif); animation: tourne .8s linear infinite; }

/* ---------- Pointage ---------- */

.pointage td { padding: 7px 7px; }
.pointage select { min-width: 150px; }
.pointage input[type=time] { width: 124px; }
.pointage input.hs { width: 66px; text-align: right; }
.pointage tr.ligne-absent { background: color-mix(in srgb, var(--alerte-fond) 70%, transparent); }
.pointage tr.ligne-conge { background: color-mix(in srgb, var(--info-fond) 70%, transparent); }

/* ---------- Calendrier des absences ---------- */

.calendrier { border-collapse: separate; border-spacing: 0; font-size: .76rem; min-width: 100%; }
.calendrier th, .calendrier td { border-right: 1px solid var(--bord); border-bottom: 1px solid var(--bord); padding: 5px 3px; text-align: center; min-width: 28px; }
.calendrier th { color: var(--texte-3); font-weight: 600; background: var(--surface-2); }
.calendrier th.nom, .calendrier td.nom { text-align: left; white-space: nowrap; min-width: 170px; position: sticky; left: 0; background: var(--surface); z-index: 1; padding: 6px 10px; }
.calendrier .we { background: var(--surface-3); }
.calendrier .ferie { background: color-mix(in srgb, var(--dore) 18%, var(--surface)); }
.calendrier .c-annuel { background: color-mix(in srgb, var(--info) 22%, var(--surface)); color: var(--info); font-weight: 700; }
.calendrier .c-maladie { background: color-mix(in srgb, var(--attention) 22%, var(--surface)); color: var(--attention); font-weight: 700; }
.calendrier .c-autre { background: color-mix(in srgb, #8b5cf6 22%, var(--surface)); color: #8b5cf6; font-weight: 700; }
.calendrier .c-attente { background: repeating-linear-gradient(45deg, var(--attention-fond), var(--attention-fond) 4px, var(--surface) 4px, var(--surface) 8px); color: var(--attention); }
.legende { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; margin-top: 12px; color: var(--texte-2); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--bord); }

/* ---------- Pages hors application (connexion, installation, scan) ---------- */

.boite-connexion { width: 100%; max-width: 420px; }
.boite-connexion .carte { padding: 30px; box-shadow: var(--ombre-3); }
.boite-connexion .marque-logo { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 15px; }
.boite-connexion .marque-logo svg { width: 34px; height: 34px; }
.boite-connexion h1 { text-align: center; font-size: 1.35rem; }
.boite-connexion p.muet { text-align: center; }
.page-simple { min-height: 100vh; display: flex; flex-direction: column; }
.page-simple-haut { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; }
.page-simple-haut .marque { padding: 0; }
.page-simple-haut .marque strong { color: var(--texte); }
.page-simple-haut .marque small { color: var(--texte-3); }
.page-simple-contenu { flex: 1; display: grid; place-items: center; padding: 16px 16px 48px; }

/* Tracés animés (coche de validation, croix) */
.trace-cercle { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-dasharray: 152; stroke-dashoffset: 152; opacity: .35; animation: trace var(--d-5) var(--ease-out) forwards; }
.trace-coche { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: trace var(--d-4) var(--ease-out) .35s forwards; }

/* ---------- Dialogue de confirmation ---------- */

dialog.dialogue {
    width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--bord); border-radius: var(--rayon-l);
    background: var(--surface); color: var(--texte); box-shadow: var(--ombre-3);
}
dialog.dialogue[open] { animation: dialogue-entree var(--d-3) var(--ease-ressort); }
dialog.dialogue::backdrop { background: var(--voile); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fondu var(--d-2) var(--ease-out); }
.dialogue form { padding: 22px; }
.dialogue-icone { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; background: var(--attention-fond); color: var(--attention); }
.dialogue.danger .dialogue-icone { background: var(--alerte-fond); color: var(--alerte); }
.dialogue h2 { font-size: 1.05rem; margin-bottom: 6px; }
.dialogue-texte { color: var(--texte-2); margin: 0 0 20px; }
.dialogue-actions { display: flex; justify-content: flex-end; gap: 10px; }
.dialogue.danger .btn-confirmer { background: linear-gradient(180deg, #dc4a33, #c4321c); }

/* ---------- Palette de recherche (Ctrl/⌘ + K) ---------- */

.palette { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette[hidden] { display: none; }
.palette-voile { position: absolute; inset: 0; background: var(--voile); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fondu var(--d-2) var(--ease-out); }
.palette-boite {
    position: relative; width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column; overflow: hidden;
    background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon-l); box-shadow: var(--ombre-3);
    animation: dialogue-entree var(--d-3) var(--ease-ressort);
}
.palette-saisie { display: flex; align-items: center; gap: 10px; padding: 4px 16px; border-bottom: 1px solid var(--bord); color: var(--texte-3); }
.palette-saisie input { border: 0; box-shadow: none; padding: 14px 0; font-size: 1rem; background: none; }
.palette-saisie input:focus { box-shadow: none; }
.palette-liste { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.palette-groupe { padding: 10px 10px 4px; font-size: .7rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--texte-3); }
.palette-item a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; color: var(--texte); text-decoration: none; }
.palette-item .avatar { width: 28px; height: 28px; font-size: .68rem; }
.palette-item .palette-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--texte-2); flex: none; }
.palette-item small { display: block; font-size: .76rem; color: var(--texte-3); }
.palette-item[aria-selected="true"] a { background: var(--marque-doux); }
.palette-item[aria-selected="true"] .palette-ico { background: var(--marque-vif); color: #fff; }
.palette-vide { padding: 22px; text-align: center; color: var(--texte-3); font-size: .9rem; }
.palette-pied { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--bord); color: var(--texte-3); font-size: .76rem; background: var(--surface-2); }

/* ---------- Graphiques (rendus par app.js depuis data-graphe) ---------- */

.graphe { position: relative; width: 100%; }
.graphe svg { display: block; width: 100%; height: 100%; overflow: visible; }
.graphe-grille line { stroke: var(--graphe-grille); stroke-width: 1; }
.graphe-axe text { fill: var(--texte-3); font-size: 11px; font-family: var(--police); }
.graphe-barre { transform-box: fill-box; transform-origin: bottom; animation: barre-monte var(--d-5) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms); transition: opacity var(--d-2); }
.graphe:hover .graphe-barre { opacity: .55; }
.graphe .graphe-barre:hover { opacity: 1; }
.graphe-ligne { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--longueur, 2000); stroke-dashoffset: var(--longueur, 2000); animation: trace 1.4s var(--ease-out) .1s forwards; }
.graphe-aire { opacity: 0; animation: fondu var(--d-5) var(--ease-out) .5s forwards; }
.graphe-point { transform-box: fill-box; transform-origin: center; animation: echelle var(--d-3) var(--ease-ressort) both; animation-delay: calc(.6s + var(--i, 0) * 30ms); }
.graphe-anneau-segment { fill: none; stroke-linecap: butt; transform: rotate(-90deg); transform-origin: center; transition: stroke-width var(--d-2) var(--ease-out); animation: anneau var(--d-5) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms); }
.graphe-anneau-segment:hover { stroke-width: 16; }
.graphe-centre { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.graphe-centre strong { font-size: 1.7rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.graphe-centre small { font-size: .76rem; color: var(--texte-3); }
.graphe-bulle {
    position: absolute; z-index: 5; padding: 7px 10px; border-radius: 9px; pointer-events: none; white-space: nowrap;
    background: #1c1714; color: #fff; font-size: .78rem; box-shadow: var(--ombre-3);
    transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity var(--d-1);
}
.graphe-bulle.visible { opacity: 1; }
.graphe-bulle strong { display: block; font-size: .86rem; }
/* Redessin sans animation d'entrée (le décalage des segments d'anneau, porté par un attribut, est conservé) */
.graphe-statique .graphe-barre, .graphe-statique .graphe-aire, .graphe-statique .graphe-point,
.graphe-statique .graphe-anneau-segment { animation: none; opacity: 1; }
.graphe-statique .graphe-ligne { animation: none; stroke-dashoffset: 0; opacity: 1; }
.graphe-axe text.graphe-libelle-dernier { fill: var(--texte); font-weight: 650; }
.graphe-legende { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: .8rem; color: var(--texte-2); }
.graphe-legende span { display: inline-flex; align-items: center; gap: 7px; }
.graphe-legende i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* ---------- Bulletin de paie (papier : toujours clair, y compris en thème sombre) ---------- */

.bulletin {
    --b-bord: #cfc3b7; --b-fond: #f2ece5; --b-texte: #1c1714; --b-texte-2: #6b625b;
    background: #fff; color: var(--b-texte); max-width: 920px; margin: 0 auto; padding: 32px;
    border: 1px solid var(--bord); border-radius: var(--rayon-l); box-shadow: var(--ombre-2); font-size: .86rem; color-scheme: light;
}
.bulletin-entete { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-bottom: 2px solid var(--b-texte); padding-bottom: 12px; margin-bottom: 12px; }
.bulletin-entete h2 { margin: 0 0 4px; font-size: 1.05rem; }
.bulletin-titre { text-align: right; }
.bulletin-titre h1 { font-size: 1.2rem; margin: 0; letter-spacing: .05em; }
.bulletin-infos { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin-bottom: 14px; }
.bulletin-infos div { display: flex; justify-content: space-between; border-bottom: 1px dotted var(--b-bord); padding: 3px 0; gap: 10px; }
.bulletin-infos span { color: var(--b-texte-2); }
.bulletin-tableau { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bulletin table { width: 100%; border-collapse: collapse; }
.bulletin th, .bulletin td { border: 1px solid var(--b-bord); padding: 5px 7px; }
.bulletin th { background: var(--b-fond); font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; }
.bulletin tr.total td { font-weight: 700; background: #faf6f1; }
.bulletin .net { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border: 2px solid var(--b-texte); border-radius: 6px; padding: 10px 14px; font-size: 1.05rem; flex-wrap: wrap; }
.bulletin .net strong { font-size: 1.4rem; letter-spacing: -.02em; }
.bulletin-pied { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 14px; font-size: .78rem; }
.bulletin-pied div { border: 1px solid var(--b-bord); padding: 8px; min-height: 70px; }
.bulletin .mention { font-size: .72rem; color: var(--b-texte-2); margin-top: 14px; }
.bulletin .badge { background: #fdf3e2; color: #b45309; }
.barre-impression { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; max-width: 920px; margin: 0 auto 14px; }
@media (max-width: 640px) {
    .bulletin { padding: 14px; font-size: .8rem; }
    .bulletin table { min-width: 560px; }
    .bulletin-infos, .bulletin-pied { grid-template-columns: 1fr; }
    .bulletin-titre { text-align: left; }
}

/* ---------- Mouvement ---------- */

@keyframes entree { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes echelle { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes tourne { to { transform: rotate(360deg); } }
@keyframes trace { to { stroke-dashoffset: 0; } }
@keyframes barre-monte { from { transform: scaleY(0); } to { transform: none; } }
@keyframes barre-grandit { from { transform: scaleX(0); } to { transform: none; } }
@keyframes anneau { from { stroke-dasharray: 0 1000; } }
@keyframes pulsation { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
@keyframes toast-entree { from { opacity: 0; transform: translateX(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-sortie { to { opacity: 0; transform: translateX(28px) scale(.96); margin-top: -64px; } }
@keyframes dialogue-entree { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes secousse { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@keyframes vt-sortie { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-entree { from { opacity: 0; transform: translateY(8px); } }

/* Apparition échelonnée du contenu au chargement de la page */
.js .contenu > *, .js .stats > *, .js .grille > * { animation: entree var(--d-4) var(--ease-out) both; }
.js .contenu > :nth-child(2) { animation-delay: 40ms; }
.js .contenu > :nth-child(3) { animation-delay: 80ms; }
.js .contenu > :nth-child(4) { animation-delay: 120ms; }
.js .contenu > :nth-child(5) { animation-delay: 160ms; }
.js .contenu > :nth-child(n+6) { animation-delay: 200ms; }
.js .stats > :nth-child(2), .js .grille > :nth-child(2) { animation-delay: 50ms; }
.js .stats > :nth-child(3), .js .grille > :nth-child(3) { animation-delay: 100ms; }
.js .stats > :nth-child(4), .js .grille > :nth-child(4) { animation-delay: 150ms; }
.js .stats > :nth-child(5), .js .grille > :nth-child(5) { animation-delay: 200ms; }
.js .stats > :nth-child(n+6), .js .grille > :nth-child(n+6) { animation-delay: 250ms; }
.js .contenu > .toasts { animation: none; }
.secoue { animation: secousse .5s var(--ease-in-out); }

/* Transitions entre les pages (navigateurs compatibles) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-sortie 160ms var(--ease-in) both; }
::view-transition-new(root) { animation: vt-entree 280ms var(--ease-out) both; }
::view-transition-group(nav-actif), ::view-transition-group(onglet-actif) { animation-duration: 380ms; animation-timing-function: var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Impression ---------- */

@media print {
    @page { size: A4; margin: 12mm; }
    :root { color-scheme: light; }
    html, body { background: #fff; }
    body { color: #000; font-size: 12px; }
    .sidebar, .topbar, .voile, .page-entete, .entete-page, .barre-impression, .message, .toasts, .no-print, .palette, dialog, .lien-evitement { display: none !important; }
    .app-main { margin: 0; }
    .contenu { margin: 0; padding: 0; max-width: none; }
    .js .contenu > * { animation: none !important; }
    .bulletin { border: 0; padding: 0; max-width: none; box-shadow: none; border-radius: 0; }
    .carte { box-shadow: none; border: 0; padding: 0; }
    .bulletin-infos { grid-template-columns: 1fr 1fr; }
    .bulletin-pied { grid-template-columns: repeat(3, 1fr); }
    .bulletin table { min-width: 0; }
    a { color: inherit; text-decoration: none; }
}
