/* ==========================================================================
   Pharmacy planner — modern dashboard UI
   ========================================================================== */

/* ---------- Polices, auto-hébergées ----------
   Quatre familles servies depuis ce domaine, en fontes variables sous-ensemblées
   (latin, puis latin étendu en repli par `unicode-range`). Aucune requête vers
   Google : la CSP ne l'autorise plus, et un visiteur n'a pas à dire à un tiers
   qu'il consulte ce site.

   Bricolage Grotesque et Public Sans sont la marque Oxymaitre (site public et
   page de connexion). Inter et Plus Jakarta Sans restent celles de l'application
   jusqu'à son rethème — chantier séparé — et sont servies de la même façon.

   Fichiers produits par la procédure docs/polices-et-favicons.md ; licences
   OFL dans public/assets/fonts/. */
@font-face {
    font-family: 'Bricolage Grotesque';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url(../fonts/bricolage-grotesque-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: 'Bricolage Grotesque';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url(../fonts/bricolage-grotesque-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url(../fonts/public-sans-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url(../fonts/public-sans-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: 'Public Sans';
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url(../fonts/public-sans-italic-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: 'Public Sans';
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url(../fonts/public-sans-italic-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url(../fonts/inter-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url(../fonts/inter-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url(../fonts/plus-jakarta-sans-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url(../fonts/plus-jakarta-sans-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

:root {
    /* Brand */
    --color-primary:        #0d9488;
    --color-primary-hover:  #0f766e;
    --color-primary-strong: #115e59;
    --color-primary-soft:   #ccfbf1;
    --color-primary-tint:   #f0fdfa;
    --color-accent:         #14b8a6;

    /* Neutrals */
    --color-bg:        #f7f8fa;
    --color-surface:   #ffffff;
    --color-surface-2: #fafbfc;
    --color-surface-3: #f3f5f8;
    --color-text:      #0b1220;
    --color-text-soft: #2c374a;
    --color-muted:     #6b7280;
    --color-faint:     #9aa3b2;
    --color-border:    #ebeef3;
    --color-border-strong: #dde2ea;
    --color-weekend:   #f7f8fa;

    /* Status */
    --color-danger:       #dc2626;
    --color-danger-soft:  #fee2e2;
    --color-success:      #047857;
    --color-success-soft: #d1fae5;
    --color-warning:      #92400e;
    --color-warning-mid:  #f59e0b;
    --color-warning-soft: #fef3c7;

    /* Effects */
    --shadow-xs: 0 1px 2px rgba(11, 18, 32, .04);
    --shadow-sm: 0 1px 3px rgba(11, 18, 32, .05), 0 1px 2px rgba(11, 18, 32, .03);
    --shadow-md: 0 6px 20px -8px rgba(11, 18, 32, .12), 0 2px 6px -2px rgba(11, 18, 32, .05);
    --shadow-lg: 0 24px 60px -20px rgba(11, 18, 32, .25), 0 8px 24px -10px rgba(11, 18, 32, .12);
    --ring-focus: 0 0 0 3px rgba(13, 148, 136, .18);

    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius:    12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    --topbar-h:  64px;

    /* Motion — every transition and animation in this file draws from these.
       Four curves, six durations: enough range to stay expressive, few enough
       that unrelated components still feel like one product. */
    --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);   /* default: entrances, reveals   */
    --ease-soft:  cubic-bezier(0.4, 0, 0.2, 1);    /* symmetric: colour, opacity    */
    --ease-emph:  cubic-bezier(0.22, 1, 0.36, 1);  /* emphasised: panels, overlays  */
    --ease-back:  cubic-bezier(0.34, 1.56, 0.64, 1); /* overshoot: pops, badges     */

    --dur-xs:      90ms;   /* micro feedback: press, hover tint          */
    --dur-fast:   150ms;   /* control state change                       */
    --dur:        220ms;   /* standard: dropdowns, tooltips, tabs        */
    --dur-slow:   320ms;   /* surfaces: modals, panels, page reveals     */
    --dur-slower: 480ms;   /* staged entrances, long-travel movement     */
    --dur-ambient: 660ms;  /* ambient: count-ups, staged reveals         */
    --dur-pulse:     1s;   /* attention: understaffing, edit flash       */

    /* Stagger — two rhythms, chosen by density. Dense lists need a short step
       or the tail arrives late; large tiles need a longer one to read as a
       sequence rather than a single block. */
    --stagger-row:  30ms;  /* table rows, day rows                        */
    --stagger-tile: 60ms;  /* cards, stat tiles, feature panels           */

    /* Spacing — 2px base, doubling through the mid range. */
    --sp-1:   2px;
    --sp-2:   4px;
    --sp-3:   6px;
    --sp-4:   8px;
    --sp-5:  10px;
    --sp-6:  12px;
    --sp-7:  14px;
    --sp-8:  16px;
    --sp-10: 20px;
    --sp-12: 24px;
    --sp-14: 28px;
    --sp-16: 32px;
    --sp-20: 40px;

    /* Type scale — replaces the 26 ad-hoc sizes this file used to carry. */
    --fs-3xs: 10px;
    --fs-2xs: 11px;
    --fs-xs:  12px;
    --fs-sm:  13px;
    --fs-md:  14px;   /* body */
    --fs-lg:  15px;
    --fs-xl:  16px;
    /* Display steps keep their pixel value in the name: headings are chosen
       by size, and a numeric name is unambiguous at a glance. */
    --fs-18:  18px;
    --fs-20:  20px;
    --fs-22:  22px;
    --fs-24:  24px;
    --fs-26:  26px;
    --fs-30:  30px;
    --fs-32:  32px;

    /* Breakpoints, for reference — the five the stylesheet is allowed to use:
       1280 (dense desktop) · 1024 (compact desktop) · 820 (tablet)
       · 640 (phone) · 400 (small phone). */

    /* Couleurs nommées par leur valeur — sorties du corps du fichier le
       5 septembre 2026 pour que :root reste la seule source. Leur nom dit
       la teinte tant qu'elles n'ont pas de rôle ; leur valeur est celle
       qui rendait déjà, au pixel près. */
    --color-white: #fff;
    --color-black: #000;
    --color-slate-600: #475569;
    --color-slate-800: #1e293b;
    --color-navy-900: #15233a;
    --color-ink-teal: #0e2a2a;
    --color-success-line: #a7f3d0;
    --color-danger-line: #fecaca;
    --color-danger-strong: #b91c1c;
    --color-gray-300: #d1d5db;
    --color-link-blue: #1d4ed8;
    --color-mist-1: #fbfdfd;
    --color-mist-2: #f3f7f8;
    --color-surface-soft: #f8fafc;
    --picker-red: #f00;   /* repli du sélecteur de teinte tant que JS n'a rien posé */
    --picker-hue-strip: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
    /* Transparences — même origine, même règle. Le nom porte la base et
       l'opacité en centièmes : --ink-a12 est l'encre à 12 %. */
    --black-a18: rgba(0, 0, 0, 0.18);
    --c-0f172a-a12: rgba(15, 23, 42, 0.12);
    --c-0f172a-a28: rgba(15, 23, 42, 0.28);
    --c-10b981-a12: rgba(16, 185, 129, 0.12);
    --c-14b8a6-a14: rgba(20, 184, 166, .14);
    --c-14b8a6-a25: rgba(20, 184, 166, .25);
    --c-3b82f6-a14: rgba(59, 130, 246, 0.14);
    --c-475569-a12: rgba(71, 85, 105, 0.12);
    --c-dc2626-a25: rgba(220, 38, 38, .25);
    --c-eab308-a04: rgba(234, 179, 8, 0.04);
    --c-eab308-a08: rgba(234, 179, 8, 0.08);
    --c-eab308-a10: rgba(234, 179, 8, 0.10);
    --c-eab308-a12: rgba(234, 179, 8, 0.12);
    --c-eab308-a14: rgba(234, 179, 8, 0.14);
    --c-eab308-a16: rgba(234, 179, 8, 0.16);
    --c-eab308-a22: rgba(234, 179, 8, 0.22);
    --c-eab308-a35: rgba(234, 179, 8, 0.35);
    --c-ef4444-a12: rgba(239, 68, 68, 0.12);
    --ink-a02: rgba(11, 18, 32, .02);
    --ink-a04: rgba(11, 18, 32, .04);
    --ink-a06: rgba(11, 18, 32, .06);
    --ink-a08: rgba(11, 18, 32, .08);
    --ink-a10: rgba(11, 18, 32, .10);
    --ink-a12: rgba(11, 18, 32, .12);
    --ink-a15: rgba(11, 18, 32, .15);
    --ink-a18: rgba(11, 18, 32, .18);
    --ink-a22: rgba(11, 18, 32, .22);
    --ink-a25: rgba(11, 18, 32, .25);
    --ink-a30: rgba(11, 18, 32, .3);
    --ink-a35: rgba(11, 18, 32, .35);
    --ink-a45: rgba(11, 18, 32, .45);
    --ink-a50: rgba(11, 18, 32, .5);
    --primary-a00: rgba(13, 148, 136, 0);
    --primary-a04: rgba(13, 148, 136, 0.04);
    --primary-a07: rgba(13, 148, 136, 0.07);
    --primary-a08: rgba(13, 148, 136, .08);
    --primary-a10: rgba(13, 148, 136, 0.10);
    --primary-a12: rgba(13, 148, 136, 0.12);
    --primary-a14: rgba(13, 148, 136, 0.14);
    --primary-a22: rgba(13, 148, 136, 0.22);
    --primary-a25: rgba(13, 148, 136, .25);
    --primary-a35: rgba(13, 148, 136, .35);
    --primary-a40: rgba(13, 148, 136, .4);
    --slate-a10: rgba(100, 116, 139, 0.10);
    --slate-a12: rgba(100, 116, 139, 0.12);
    --slate-a18: rgba(100, 116, 139, 0.18);
    --white-a35: rgba(255, 255, 255, .35);
    --white-a45: rgba(255, 255, 255, .45);
    --white-a60: rgba(255, 255, 255, .6);
    --white-a65: rgba(255, 255, 255, .65);
    --white-a82: rgba(255, 255, 255, .82);
    --white-a95: rgba(255,255,255,.95);
    --white-a98: rgba(255, 255, 255, .98);

    /* ---------- Marque Oxymaitre — 5 septembre 2026 ----------
       Source : docs/charte.md. Contrastes mesurés sur le blanc chaud. Ces
       jetons ne sont consommés que par les gabarits public et connexion ;
       l'application garde les siens jusqu'à son rethème. */
    --brand-ink:          #191924;  /* texte, titres, anneau — 16,7:1 */
    --brand-paper:        #fcfaf6;  /* fond de page */
    --brand-surface:      #f5f1ea;  /* cartes, encarts */
    --brand-line:         #e1ded7;  /* bordures */
    --brand-muted:        #67677a;  /* texte secondaire — 5,3:1 */
    --brand-accent:       #683ecf;  /* point du symbole, boutons, focus — 6,3:1 ; blanc dessus 6,6:1 */
    --brand-accent-text:  #5a30b9;  /* liens, libellés colorés — 7,9:1 */
    --brand-accent-light: #ad9ffa;  /* sur fond sombre uniquement — 7,6:1 sur l'encre */
    --brand-accent-tint:  #eae7ff;  /* fonds discrets */

    /* Alerte : le rouge d'une erreur de formulaire, et son fond.
       #b3261e — 6,5:1 sur blanc, 6,3:1 sur le papier, 5,6:1 sur sa teinte ;
       l'encre sur la teinte, 14,9:1. */
    --danger:       #b3261e;
    --danger-tint:  #fbe9e7;
    /* Modules — une teinte par module, pour pastilles, bordures et blocs de
       planning ; jamais pour du texte courant (variante -text). La marque
       n'emprunte jamais une couleur de module. */
    --module-pharmaouss:       #0d9488;  /* fixé : la couleur du planning en production */
    --module-pharmaouss-text:  #00756b;  /* 5,2:1 */
    --module-pharmaouss-tint:  #e6f6f3;
    --module-trod:             #c16d45;  /* fixée : la terre cuite d'Antigêne (code trod) */
    --module-trod-text:        #8f4a25;
    --module-trod-tint:        #f8ebe3;
    --module-location:         #527599;  /* ardoise — 4,6:1 */
    --module-location-text:    #2e5072;  /* 8,0:1 */
    --module-location-tint:    #e9eef4;
    /* Rayons de la marque. Distincts des rayons de l'application, que le
       brief demandait de changer : les toucher aurait déplacé des pixels dans
       le planning, qui doit rester identique jusqu'au rethème. */
    --brand-radius-sm: 8px;    /* boutons */
    --brand-radius-md: 10px;   /* cartes */
    --brand-radius-lg: 14px;   /* fenêtres, grands encarts */

    /* L'ombre d'un panneau qui s'ouvre au-dessus de la page (menu déroulant).
       Sur l'encre de la marque, pas sur celle de l'application. */
    --brand-shadow-menu: 0 12px 32px rgba(25, 25, 36, .10), 0 2px 6px rgba(25, 25, 36, .06);
    /* Polices de la marque. Les noms --font-display et --font-ui restent ceux
       de l'application ; ils sont remappés vers ceux-ci sous .public-body et
       .auth-body. */
    --font-brand-display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
    --font-brand-body:    'Public Sans', 'Helvetica Neue', Arial, sans-serif;
    /* Échelle publique — H1 54 (36 sous 640), H2 36 (26 sous 640), corps 17. */
    --fs-17: 17px;
    --fs-36: 36px;
    --fs-54: 54px;
}

* { box-sizing: border-box; }

:root {
    --font-ui:      "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- La marque, appliquée aux gabarits public et connexion ----------
   Les règles de ces gabarits consomment les jetons de l'application
   (--color-primary, --radius-lg, --font-display…). Plutôt que de réécrire
   chacune, on redéfinit ces jetons dans leur périmètre : tout ce qui est
   public devient Oxymaitre d'un coup, et rien de ce qui est dans
   l'application ne bouge. Le teal ne subsiste ici que comme couleur du
   module Pharmaouss. */
.public-body,
.auth-body {
    --color-primary:        var(--brand-accent);
    --color-primary-hover:  var(--brand-accent-text);
    --color-primary-strong: var(--brand-accent-text);
    --color-primary-soft:   var(--brand-accent-tint);
    --color-primary-tint:   var(--brand-accent-tint);
    --color-accent:         var(--brand-accent);
    --color-bg:             var(--brand-paper);
    --color-surface-2:      var(--brand-surface);
    --color-surface-3:      var(--brand-surface);
    --color-text:           var(--brand-ink);
    --color-text-soft:      var(--brand-muted);
    --color-muted:          var(--brand-muted);
    --color-border:         var(--brand-line);
    --color-border-strong:  var(--brand-line);
    --ring-focus:           0 0 0 3px var(--brand-accent-tint);
    --radius-sm:            var(--brand-radius-sm);
    --radius-md:            var(--brand-radius-md);
    --radius:               var(--brand-radius-md);
    --radius-lg:            var(--brand-radius-lg);
    --radius-xl:            var(--brand-radius-lg);
    --font-display:         var(--font-brand-display);
    --font-ui:              var(--font-brand-body);
}

/* Le logotype : le mot en Bricolage 600 dont le O est l'anneau. Le SVG est
   recadré sur la boîte du O (viewBox 195 157 610 687), mesure 0,61 × 0,687 em,
   s'aligne sur la ligne de base et déborde dessous de 0,013 em comme la
   lettre. Jamais de fond, jamais de dégradé, jamais l'anneau seul dans une
   barre de navigation. */
.logotype {
    display: inline-flex;
    align-items: baseline;
    gap: .02em;
    font-family: var(--font-brand-display);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--brand-ink);
    text-decoration: none;
}
.logotype-mark { display: block; flex: none; width: .61em; height: .687em; transform: translateY(.013em); }
.logotype-ring { fill: var(--brand-ink); }
.logotype-dot  { fill: var(--brand-accent); }
.logotype.on-dark { color: var(--brand-paper); }
.logotype.on-dark .logotype-ring { fill: var(--brand-paper); }
.logotype.on-dark .logotype-dot  { fill: var(--brand-accent-light); }
.public-brand .logotype { font-size: var(--fs-24); }
.auth-title  .logotype { font-size: var(--fs-26); }
@media (max-width: 640px) { .public-brand .logotype { font-size: var(--fs-20); } }

/* Boutons de la marque : plein indigo à texte blanc, ou contour encre de
   1,5 px ; rayon 8 px ; aucune ombre portée, aucun dégradé. */
.public-body .btn,
.auth-body .btn { border-radius: var(--brand-radius-sm); box-shadow: none; }
.public-body .btn-primary,
.auth-body .btn-primary { background: var(--brand-accent); color: var(--color-white); border-color: var(--brand-accent); }
.public-body .btn-primary:hover,
.auth-body .btn-primary:hover { background: var(--brand-accent-text); border-color: var(--brand-accent-text); box-shadow: none; }
.public-body .btn-outline,
.auth-body .btn-outline { background: transparent; color: var(--brand-ink); border: 1.5px solid var(--brand-ink); }
.public-body .btn-outline:hover,
.auth-body .btn-outline:hover { background: var(--brand-accent-tint); color: var(--brand-ink); border-color: var(--brand-ink); }
.public-body .btn-lg { min-height: 48px; padding: 0 22px; font-size: var(--fs-lg); }


html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-ui);
    color: var(--color-text);
    background: var(--color-bg);
    font-size: var(--fs-md);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* The native [hidden] behaviour is only a UA `display: none`, so any
   component rule setting `display` (flex, grid, inline-flex…) silently wins
   and the element stays on screen. Enforce it once, globally. */
[hidden] { display: none !important; }

/* Display typography for headings & feature numbers */
.brand-name,
.page-header h2,
.panel h2,
.auth-title,
.home-greeting,
.home-action-body h3,
.home-stat-value,
.card-value,
.form-card h3 {
    font-family: var(--font-display);
    font-feature-settings: "ss01", "ss02";
}

a { color: var(--color-primary); text-decoration: none; transition: color var(--dur-fast) var(--ease-soft); }
a:hover { color: var(--color-primary-hover); text-decoration: none; }

::selection { background: var(--color-primary-soft); color: var(--color-primary-strong); }

/* ---------- Reveal-on-load ---------- */
body .content,
body .top-bar {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity var(--dur-slow) var(--ease-out),
                transform var(--dur-slow) var(--ease-out);
}
body.is-ready .top-bar,
body.is-ready .content {
    opacity: 1;
    transform: none;
}
body.is-ready .top-bar { transition-delay: 0ms; }
body.is-ready .content { transition-delay: var(--stagger-tile); }

/* ---------- Top bar ---------- */
.top-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: var(--white-a82);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    color: var(--color-text);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 18px;
    z-index: 50;
    border-bottom: 1px solid var(--color-border);
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    flex-shrink: 0;
    color: var(--color-text);
    user-select: none;
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-soft);
}
/* Au survol, le vert du site plutôt qu'un fondu : l'opacité réduite éclaircit
   un texte foncé sur fond blanc, ce qui se lit comme du gris et non comme un
   état actif. La teinte retenue est celle de l'onglet actif juste à côté, plus
   sombre que le vert de base : à 16px gras, celui-ci n'atteindrait pas le
   contraste minimal sur blanc. */
a.brand:hover,
a.brand:focus-visible { color: var(--color-primary-strong); }
a.brand:hover .brand-name,
a.brand:focus-visible .brand-name { color: var(--color-primary-strong); }
.brand-name {
    font-weight: 700;
    font-size: var(--fs-xl);
    letter-spacing: -0.02em;
    color: var(--color-text);
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease-soft);
}

/* ---------- Header navigation ---------- */
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--color-surface-3);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    margin-left: 8px;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.topbar-nav::-webkit-scrollbar { display: none; }
.topbar-nav-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    color: var(--color-text-soft);
    font-size: var(--fs-sm);
    font-weight: 500;
    letter-spacing: -0.005em;
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-soft),
                background var(--dur-fast) var(--ease-soft);
    white-space: nowrap;
}
.topbar-nav-item:hover {
    color: var(--color-text);
    background: var(--color-surface);
    text-decoration: none;
}
.topbar-nav-item.active {
    color: var(--color-primary-strong);
    font-weight: 600;
}
.topbar-nav-item.active:hover { background: transparent; }
.topbar-nav-text { position: relative; z-index: 1; }
/* The pill is a separate layer so that, on browsers with cross-document
   View Transitions, it morphs (slides + resizes) from the previously
   active item to the new one as you navigate between pages. */
.topbar-nav-pill {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    box-shadow: var(--shadow-xs);
    z-index: 0;
    transform-origin: top left;
    will-change: transform;
}

.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
/* The logout control is a CSRF-protected POST form; let its button sit in the
   top-bar flex row exactly as the old anchor did. */
.logout-form { display: contents; margin: 0; }

/* ---------- Notification centre ---------- */
.notif-center { position: relative; display: inline-flex; }
.notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text-soft);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft),
                border-color var(--dur-fast) var(--ease-soft);
}
.notif-bell:hover { background: var(--color-surface-3); color: var(--color-text); }
.notif-center.is-open .notif-bell {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-primary-strong);
}
.notif-badge {
    position: absolute;
    top: 4px; right: 4px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill);
    background: var(--color-danger);
    color: var(--color-white);
    font-size: var(--fs-3xs);
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 2px var(--color-surface-2, var(--color-white));
}
.notif-badge.is-visible { display: inline-flex; animation: notifBadgePop var(--dur-slow) var(--ease-back); }
@keyframes notifBadgePop { 0% { transform: scale(0); } 100% { transform: scale(1); } }

.notif-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 24px);
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1200;
    overflow: hidden;
    animation: notifPanelIn var(--dur) var(--ease-out);
}
.notif-panel[hidden] { display: none; }
@keyframes notifPanelIn {
    from { opacity: 0; transform: translateY(-8px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
.notif-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
}
.notif-panel-head h3 {
    margin: 0;
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
}
.notif-readall {
    border: 0;
    background: transparent;
    color: var(--color-primary-strong);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 600;
    cursor: pointer;
    padding: 2px;
}
.notif-readall:hover { text-decoration: underline; }
.notif-list { max-height: min(60vh, 440px); overflow-y: auto; overscroll-behavior: contain; }
.notif-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--color-muted);
    font-size: var(--fs-sm);
}
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text);
    position: relative;
    transition: background var(--dur-fast) var(--ease-soft);
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--color-surface-2); text-decoration: none; }
.notif-item.is-unread { background: color-mix(in srgb, var(--color-primary) 6%, transparent); }
.notif-item.is-unread:hover { background: color-mix(in srgb, var(--color-primary) 10%, transparent); }
.notif-item-icon {
    flex-shrink: 0;
    width: 30px; height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--color-surface-2);
    font-size: var(--fs-lg);
    line-height: 1;
}
.notif-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-item-title { font-size: var(--fs-sm); font-weight: 600; color: var(--color-text); }
.notif-item-text { font-size: var(--fs-xs); color: var(--color-text-soft); line-height: 1.4; }
.notif-item-time { font-size: var(--fs-2xs); color: var(--color-muted); margin-top: 2px; }
.notif-item-dot {
    flex-shrink: 0;
    width: 8px; height: 8px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--color-primary);
}
.notif-panel-foot {
    display: block;
    padding: 12px 16px;
    text-align: center;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--color-primary-strong);
    text-decoration: none;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface-2);
    transition: background var(--dur-fast) var(--ease-soft);
}
.notif-panel-foot:hover { background: var(--color-surface-3); text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
    .notif-panel, .notif-badge.is-visible { animation: none; }
}
@media (max-width: 640px) {
    .notif-panel { position: fixed; top: 64px; right: 12px; left: 12px; width: auto; }
}

.topbar-pharmacy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: var(--color-surface-3);
    color: var(--color-text-soft);
    font-size: var(--fs-xs);
    font-weight: 500;
    line-height: 1;
    border-radius: var(--radius-pill);
    letter-spacing: -0.005em;
    border: 1px solid var(--color-border);
    user-select: none;
    max-width: 260px;
    overflow: hidden;
}
.topbar-pharmacy svg { display: block; flex-shrink: 0; color: var(--color-primary); }
.topbar-pharmacy-name {
    display: block;
    transform: translateY(1px);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-right: 12px;
    border-right: 1px solid var(--color-border);
}
.topbar-user-name {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.005em;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.topbar-user-badge {
    font-size: var(--fs-3xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-primary-strong);
    background: var(--color-primary-tint);
    padding: 3px 8px;
    border-radius: var(--radius-pill);
}

/* ---------- Icon button + tooltip ---------- */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: var(--radius-md);
    color: var(--color-text-soft);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft),
                border-color var(--dur-fast) var(--ease-soft),
                transform var(--dur-fast) var(--ease-soft);
}
.icon-btn:hover {
    background: var(--color-surface-3);
    color: var(--color-text);
}
.icon-btn:active { transform: scale(.94); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring-focus); }

/* ---------- Tooltips ---------- */
/* Anchor: lets .has-tooltip parents be the positioning context for any
   visual badges (under-staff icon, etc.). The tooltip bubble itself is
   rendered by JS as a single floating element appended to <body>,
   positioned with full viewport-clamping. */
.has-tooltip { position: relative; }

/* Floating tooltip element managed in JS. One per document.
   Two variants:
     - default (dark pill, used for icons and CTAs)
     - .is-card  (white card with a red accent, for the under-staff alert) */
.floating-tooltip {
    position: fixed;
    z-index: 2000;
    max-width: calc(100vw - 24px);
    padding: 6px 11px;
    border-radius: var(--radius-sm);
    background: var(--color-text);
    color: var(--color-white);
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: 0.005em;
    line-height: 1.4;
    box-shadow: var(--shadow-md);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px) scale(.96);
    transform-origin: top center;
    white-space: nowrap;
    transition: opacity var(--dur-fast) var(--ease-out),
                transform var(--dur) var(--ease-out);
}
.floating-tooltip.is-shown {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.floating-tooltip.is-multiline {
    white-space: normal;
}
.floating-tooltip.is-prelines {
    white-space: pre-line;
    text-align: left;
}
.floating-tooltip-arrow {
    position: absolute;
    width: 10px;
    height: 10px;
    background: inherit;
    transform: rotate(45deg);
    z-index: -1;
    border: inherit;
}
.floating-tooltip:not(.is-above) .floating-tooltip-arrow {
    top: -4px;
}
.floating-tooltip.is-above .floating-tooltip-arrow {
    bottom: -4px;
}

/* Card variant — under-staffing alert. Same height as the default pill
   (6px 11px / 12px), with the badge's red palette: red border, light-red
   background, red text. */
.floating-tooltip.is-card {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
    padding: 6px 11px;
    font-size: var(--fs-xs);
    font-weight: 500;
    line-height: 1.4;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    max-width: none;
}
.floating-tooltip.is-card .floating-tooltip-arrow {
    display: none;
}

/* ---------- Accessibility utilities ---------- */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: var(--sp-4);
    left: var(--sp-4);
    z-index: 2000;
    padding: var(--sp-5) var(--sp-8);
    background: var(--color-surface);
    color: var(--color-primary-strong);
    font-size: var(--fs-sm);
    font-weight: 600;
    border-radius: var(--radius-sm);
    transform: translateY(calc(-100% - var(--sp-10)));
    transition: transform var(--dur) var(--ease-out);
}
/* The shadow only exists while the link is on screen: at rest its blur
   radius reaches past the off-screen element and greys the page corner. */
.skip-link:focus-visible {
    transform: translateY(0);
    box-shadow: var(--shadow-lg);
}

/* ---------- Application shell ----------
   The footer used to sit directly after the content, leaving 140-280px of
   empty background beneath it on any page shorter than the viewport. */
.app-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}
/* width + min-width are load-bearing: as a bare flex item, .content would
   otherwise be sized to its min-content width and the widest page (the
   planning grid) would push the whole column past the viewport. */
.app-body > .content { flex: 1 0 auto; width: 100%; min-width: 0; }
.app-body > .app-footer { flex: none; width: 100%; }

/* ---------- Content area ---------- */
.content {
    /* La barre est fixe : sa hauteur fait partie du calage, seul ce qui
       s'ajoute derrière se voit comme un blanc sous l'en-tête. */
    padding: calc(var(--topbar-h) + 16px) 36px 64px;
    min-width: 0;
    max-width: 1400px;
    margin: 0 auto;
}

/* ---------- Flashes ---------- */
.flashes { margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: var(--shadow-xs);
    font-size: var(--fs-sm);
    font-weight: 500;
    animation: slideDown var(--dur-slow) var(--ease-out);
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.flash-success { background: var(--color-success-soft); border-color: var(--color-success-line); color: var(--color-success); }
.flash-error   { background: var(--color-danger-soft);  border-color: var(--color-danger-line); color: var(--color-danger); }
/* Variante neutre : ni faute ni réussite, un fait à porter à la connaissance
   du lecteur — un module encore en développement, un périmètre de page. */
.flash-info {
    border-color: var(--color-primary-soft);
    background: var(--color-primary-soft);
    color: var(--color-text);
}

.flash { cursor: pointer; }
.flash.is-dismissing { animation: flashOut var(--dur-slower) var(--ease-out) both; }
@keyframes flashOut {
    from { opacity: 1; transform: translateY(0); max-height: 80px; margin-bottom: 0; }
    to   { opacity: 0; transform: translateY(-8px); max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .flash.is-dismissing { animation: none; opacity: 0; }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: var(--fs-sm);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    background: var(--color-surface);
    color: var(--color-text);
    text-decoration: none;
    line-height: 1;
    letter-spacing: -0.005em;
    transition: background var(--dur-fast) var(--ease-soft),
                border-color var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft),
                box-shadow var(--dur-fast) var(--ease-soft),
                transform var(--dur-fast) var(--ease-soft);
    white-space: nowrap;
    user-select: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(0.97); transition-duration: var(--dur-xs); }
.btn:focus-visible { outline: none; box-shadow: var(--ring-focus); }

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
    box-shadow: 0 1px 2px var(--ink-a08);
}
.btn-primary:hover {
    background: var(--color-primary-hover);
    color: var(--color-white);
    box-shadow: 0 4px 12px -2px var(--primary-a40);
}

.btn-outline {
    border-color: var(--color-border-strong);
    color: var(--color-text);
    background: var(--color-surface);
}
.btn-outline:hover {
    background: var(--color-surface-3);
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.btn-danger {
    background: var(--color-surface);
    color: var(--color-danger);
    border-color: var(--color-border-strong);
}
.btn-danger:hover {
    background: var(--color-danger);
    color: var(--color-white);
    border-color: var(--color-danger);
}

/* Solid destructive button, for a confirmed irreversible action. */
.btn-danger-solid {
    background: var(--color-danger);
    color: var(--color-white);
    border-color: var(--color-danger);
}
.btn-danger-solid:hover:not(:disabled) { filter: brightness(.93); color: var(--color-white); }
.btn-danger-solid:disabled { opacity: .5; cursor: not-allowed; }

.btn-icon { padding: 8px 11px; font-size: var(--fs-xl); line-height: 1; }
.btn-sm { padding: 6px 12px; font-size: var(--fs-xs); border-radius: var(--radius-sm); }
.btn-block { width: 100%; padding: 12px 16px; }
.btn-lg { padding: 14px 28px; font-size: var(--fs-lg); border-radius: var(--radius); }

/* ---------- Public (landing + login) ---------- */
.public-body {
    margin: 0;
    min-height: 100vh;
    color: var(--brand-ink);
    font-family: var(--font-ui);
    font-size: var(--fs-17);
    line-height: 1.5;
    /* Le blanc chaud, uni. La version précédente posait deux halos et un
       dégradé : la charte n'en veut aucun. */
    background: var(--brand-paper);
}
.public-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 32px 64px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.public-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 48px;
    padding-bottom: var(--sp-12);
    border-bottom: 1px solid var(--brand-line);
}
.public-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    /* La hauteur d'un lien de la navigation, écrite avec ses propres jetons :
       c'est elle qui donne sa hauteur à la rangée. Sans cela, une page qui
       masque la navigation — la connexion — remonterait le logotype de cinq
       pixels. Au passage, la zone cliquable dépasse les 24 px exigés, même
       quand le logotype descend à 20 px sous 640. */
    min-height: calc(var(--fs-lg) * 1.5 + var(--sp-3) * 2);
    color: var(--color-text);
    text-decoration: none;
}
.public-brand svg { color: var(--color-primary); }
.public-brand-name {
    font-family: var(--font-display);
    font-size: var(--fs-22);
    font-weight: 600;
    letter-spacing: -0.03em;
}
.public-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 96px;
}
.public-foot {
    margin-top: 64px;
    padding-top: 40px;
    border-top: 1px solid var(--brand-line);
    display: flex;
    flex-direction: column;
    gap: 32px;
    font-size: var(--fs-sm);
    color: var(--brand-muted);
}
.public-foot-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
}
.public-foot-brand { display: flex; flex-direction: column; gap: 6px; }
.public-foot-brand .public-brand { align-self: flex-start; margin-bottom: 4px; }
.public-brand-small .logotype { font-size: var(--fs-20); }
.public-foot-nav { display: flex; flex-wrap: wrap; gap: 56px; }
.public-foot-col { display: flex; flex-direction: column; gap: 2px; }
.public-foot-head {
    margin-bottom: 6px;
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand-muted);
}
/* Les liens légaux ne sont pas une rubrique du site : ils vivent en bas de
   page, à côté de l'année, en retrait — comme sur les sites qui font foi. */
.public-foot-legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 20px;
    padding-top: 20px;
    border-top: 1px solid var(--brand-line);
    font-size: var(--fs-xs);
}
.public-foot a { color: var(--brand-ink); text-decoration: none; }
.public-foot-legal a { color: var(--brand-muted); }   /* 5,3:1 — secondaire, mais lisible */
.public-foot a:hover,
.public-foot a:focus-visible { color: var(--brand-accent-text); }

/* Hero */
.public-hero {
    text-align: center;
    max-width: 760px;
    margin: 28px auto 0;
    animation: publicFadeUp var(--dur-ambient) var(--ease-out) both;
}
.public-eyebrow {
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 18px;
    background: var(--brand-accent-tint);
    color: var(--brand-accent-text);
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.public-hero-title {
    margin: 0 0 18px;
    font-family: var(--font-display);
    font-size: var(--fs-54);
    font-weight: 600;
    line-height: 1.02;
    letter-spacing: -0.03em;
    color: var(--brand-ink);
    text-wrap: pretty;
}
.public-hero-accent {
    /* Plus de dégradé découpé dans le texte : l'indigo des liens, uni. */
    color: var(--brand-accent-text);
}
.public-hero-lead {
    margin: 0 auto 28px;
    max-width: 580px;
    font-size: var(--fs-17);
    line-height: 1.55;
    color: var(--brand-muted);
}
.public-hero-cta {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

/* Features grid */
.public-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}
.public-feature {
    padding: 26px 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 0 var(--ink-a02);
    transition: transform var(--dur-fast) var(--ease-soft),
                box-shadow var(--dur-fast) var(--ease-soft),
                border-color var(--dur-fast) var(--ease-soft);
    animation: publicFadeUp var(--dur-ambient) var(--ease-out) both;
}
.public-feature:nth-child(1) { animation-delay: calc(var(--stagger-tile) * 1); }
.public-feature:nth-child(2) { animation-delay: calc(var(--stagger-tile) * 2); }
.public-feature:nth-child(3) { animation-delay: calc(var(--stagger-tile) * 3); }
.public-feature:nth-child(4) { animation-delay: calc(var(--stagger-tile) * 4); }
.public-feature:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-border));
    box-shadow: 0 12px 30px -18px var(--ink-a18);
}
.public-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 14px;
    border-radius: var(--brand-radius-md);
    background: var(--brand-accent-tint);
    color: var(--brand-accent-text);
}
.public-feature h3 {
    margin: 0 0 6px;
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
}
.public-feature p {
    margin: 0;
    font-size: var(--fs-lg);
    line-height: 1.5;
    color: var(--brand-muted);
}

/* Final CTA */
.public-cta {
    text-align: center;
    padding: 56px 32px;
    /* Un encart sur la surface chaude, à la place du dégradé teal. */
    background: var(--brand-surface);
    border: 1px solid var(--brand-line);
    border-radius: var(--brand-radius-lg);
}
.public-cta h2 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: var(--fs-36);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.08;
    color: var(--brand-ink);
}
.public-cta p {
    margin: 0 auto 22px;
    max-width: 520px;
    color: var(--brand-muted);
    font-size: var(--fs-17);
}

/* Login card */
.public-login {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40px;
}
.public-login-card {
    width: 100%;
    max-width: 440px;
    padding: 40px 36px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl, 18px);
    box-shadow: 0 24px 60px -28px var(--ink-a22),
                0 6px 18px -10px var(--ink-a12);
    animation: publicFadeUp var(--dur-slower) var(--ease-out) both;
}
.public-login-head { text-align: center; margin-bottom: 24px; }
.public-login-head h1 {
    margin: 0 0 6px;
    font-family: var(--font-display);
    font-size: var(--fs-26);
    font-weight: 600;
    color: var(--brand-ink);
    letter-spacing: -0.03em;
}
.public-login-head p {
    margin: 0;
    color: var(--color-text-soft);
    font-size: var(--fs-md);
}
.public-login-form { display: flex; flex-direction: column; gap: 14px; }
.public-login-form label { display: flex; flex-direction: column; gap: 6px; }
.public-login-form label > span {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--color-text-soft);
}
.public-login-form input {
    padding: 11px 14px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: var(--fs-md);
    transition: border-color var(--dur-fast) var(--ease-soft),
                box-shadow var(--dur-fast) var(--ease-soft);
}
.public-login-form input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.public-login-form .btn { margin-top: 6px; }
.public-login-hint {
    margin: 18px 0 0;
    text-align: center;
    font-size: var(--fs-xs);
}
.public-login-aside {
    margin: 16px 0 0;
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--color-text-soft);
}
.public-link {
    color: var(--color-primary-strong, var(--color-primary));
    text-decoration: none;
    font-weight: 600;
    transition: color var(--dur-fast) var(--ease-soft);
}
.public-link:hover { text-decoration: underline; }

@keyframes publicFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Reveal-on-scroll: hidden until the element enters the viewport, then
   eased up into place by JS toggling .is-revealed. */
[data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity var(--dur-ambient) var(--ease-out), transform var(--dur-ambient) var(--ease-out);
    will-change: opacity, transform;
}
[data-reveal].is-revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 640px) {
    .public-shell { padding: 20px 18px 40px; }
    .public-top { margin-bottom: 32px; }
    .public-nav { order: 3; flex-basis: 100%; margin: 0; gap: var(--sp-8); }
    .public-login-link { margin-left: auto; }
    .public-foot { gap: 24px; }
    .public-foot-main { flex-direction: column; gap: 24px; }
    .public-foot-nav { gap: 32px; }
    .public-main { gap: 64px; }
    .public-cta { padding: 40px 22px; }
    .public-login-card { padding: 32px 24px; }
}

/* ---------- Auth ---------- */
.auth-body {
    /* La page de connexion prend la marque : le blanc chaud, uni, à la place
       du fond sombre à halos. C'est la couture entre le site et
       l'application. */
    background: var(--brand-paper);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: var(--font-ui);
    color: var(--brand-ink);
}
.auth-card {
    background: var(--color-surface);
    width: 100%;
    max-width: 420px;
    padding: 40px 36px;
    border-radius: var(--brand-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--brand-line);
    position: relative;
    animation: cardEnter var(--dur-slower) var(--ease-out);
}
@keyframes cardEnter {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.auth-title {
    display: flex;
    justify-content: center;
    font-size: var(--fs-26);
    margin: 0 0 4px;
    color: var(--brand-ink);
    text-align: center;
    font-weight: 600;
    letter-spacing: -0.03em;
}
.auth-subtitle {
    margin: 0 0 24px;
    font-size: var(--fs-md);
    text-align: center;
    color: var(--color-muted);
    font-weight: 400;
}
.auth-form { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Forms ---------- */
label { display: block; }
label > span {
    display: block;
    margin-bottom: 6px;
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--color-text-soft);
}
/* That bottom margin is meant for stacked fields (caption above the input).
   In labels laid out as a *row*, it lands under every span and pushes the
   whole line 3px above the centre of its box — so clear it wherever the
   label is a flex row. */
.planning-filter-row > span,
.planning-clear-member > span,
.cap-row > span,
.switch-toggle > span,
.tpl-has-b > span,
.hours-field > span { margin-bottom: 0; }
label.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease-soft),
                background var(--dur-fast) var(--ease-soft);
}
label.checkbox:hover { border-color: var(--color-border-strong); background: var(--color-surface-3); }
label.checkbox > span { margin: 0; font-weight: 500; color: var(--color-text); font-size: var(--fs-sm); }
/* ---------- Checkboxes ----------
   One look for every checkbox in the app, taken from the planning's employee
   filter: rounded box, tinted fill with a white tick once checked. Lists that
   carry a colour (roles, employees) set --role-color and the box follows it;
   everywhere else it falls back to the primary colour.
   Components that hide the native input and draw their own control (the
   switch toggle, the filter's own box) re-assert `width/height: 0` further
   down the file and are unaffected. */
input[type=checkbox] {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    margin: 0;
    border: 1.5px solid var(--color-border-strong);
    border-radius: var(--radius-xs);
    background: var(--color-surface);
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease-soft),
                background-color var(--dur-fast) var(--ease-soft),
                box-shadow var(--dur-fast) var(--ease-soft);
}
input[type=checkbox]:hover:not(:disabled) {
    border-color: var(--role-color, var(--color-primary));
}
input[type=checkbox]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--role-color, var(--color-primary)) 30%, transparent);
}
input[type=checkbox]:checked {
    background: var(--role-color, var(--color-primary));
    border-color: var(--role-color, var(--color-primary));
    animation: cbBoxPop var(--dur) var(--ease-out);
}
input[type=checkbox]:checked::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
    animation: cbCheckPop var(--dur-slow) var(--ease-back) both;
}
input[type=checkbox]:disabled { opacity: .5; cursor: not-allowed; }
@keyframes cbBoxPop {
    0%   { transform: scale(0.9); }
    50%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}
@keyframes cbCheckPop {
    0%   { opacity: 0; transform: scale(0.4); }
    100% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    input[type=checkbox]:checked,
    input[type=checkbox]:checked::after { animation: none; }
}

input[type=text], input[type=email], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=tel], input[type=search],
input[type=color], select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    font: inherit;
    font-size: var(--fs-md);
    color: var(--color-text);
    transition: border-color var(--dur-fast) var(--ease-soft),
                box-shadow var(--dur-fast) var(--ease-soft),
                background var(--dur-fast) var(--ease-soft);
}
input::placeholder, textarea::placeholder { color: var(--color-faint); }
input[type=color] { padding: 4px; height: 42px; cursor: pointer; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--ring-focus);
}
/* Firefox paints its own red halo on a field it judges invalid, which lingers
   on an empty required field and is not ours to control. The app already owns
   that signal — the refusal flash and the message beside the caption — so the
   browser's copy is switched off and the focus ring restored. The selector is
   Firefox-only: every other engine discards these two rules whole. */
input:-moz-ui-invalid { box-shadow: none; }
input:-moz-ui-invalid:focus { box-shadow: var(--ring-focus); }

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="%236b7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 8 10 12 14 8"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 36px;
}

/* ---------- Custom select (drop-in replacement for <select data-select>) ---------- */
.select-wrap { position: relative; width: 100%; }

/* Hide the native control once enhanced; keep it focusable-by-form via name */
.select-wrap > select.select-native {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    pointer-events: none;
}

.select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: var(--fs-md);
    cursor: pointer;
    text-align: left;
    line-height: 1.2;
    transition: border-color var(--dur) var(--ease-soft),
                background var(--dur) var(--ease-soft),
                box-shadow var(--dur) var(--ease-soft);
}
.select-trigger:hover {
    border-color: var(--color-border-strong);
    background: var(--color-surface-2);
}
.select-trigger:focus-visible {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--ring-focus);
}
.select-wrap.is-open .select-trigger {
    border-color: var(--color-primary);
    box-shadow: var(--ring-focus);
    background: var(--color-surface);
}

.select-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--white-a95), 0 0 0 3px var(--ink-a08);
}
.select-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text);
    font-weight: 500;
    transition: color var(--dur-fast) var(--ease-soft);
}
.select-value.is-placeholder { color: var(--color-faint); font-weight: 400; }

.select-chevron {
    flex-shrink: 0;
    color: var(--color-muted);
    transition: transform var(--dur-slow) var(--ease-out),
                color var(--dur) var(--ease-soft);
}
.select-wrap.is-open .select-chevron {
    transform: rotate(180deg);
    color: var(--color-primary);
}

/* Dropdown panel — enter & exit animations */
.select-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 100%;
    width: max-content;
    max-width: calc(100vw - 16px);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 70;
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;

    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(.97);
    transform-origin: top center;
    transition: opacity var(--dur-fast) var(--ease-soft),
                transform var(--dur) var(--ease-soft),
                visibility 0s linear 180ms;
}
.select-wrap.is-anchor-right .select-panel { left: auto; right: 0; }
.select-wrap.is-open .select-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition: opacity var(--dur) var(--ease-out),
                transform var(--dur-slow) var(--ease-out),
                visibility 0s linear 0s;
}

.select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: var(--fs-sm);
    cursor: pointer;
    text-align: left;
    line-height: 1.3;
    transition: background var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft);
}
.select-option:focus-visible { outline: none; }
.select-option.is-active {
    background: var(--color-surface-3);
}
.select-option:hover { background: var(--color-surface-3); }
.select-option[aria-selected="true"] {
    background: var(--color-primary-tint);
    color: var(--color-primary-strong);
    font-weight: 600;
}
.select-option[aria-selected="true"]:hover,
.select-option[aria-selected="true"].is-active {
    background: color-mix(in srgb, var(--color-primary) 15%, transparent);
}
.select-option.is-placeholder-option {
    color: var(--color-muted);
    font-style: italic;
}

.select-option-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--white-a95), 0 0 0 3px var(--ink-a08);
    transition: transform var(--dur-fast) var(--ease-soft);
}
.select-option-dot.is-empty {
    background: transparent;
    box-shadow: none;
}
.select-option:hover .select-option-dot,
.select-option.is-active .select-option-dot { transform: scale(1.15); }

.select-option-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.select-option-check {
    flex-shrink: 0;
    color: var(--color-primary);
    opacity: 0;
    transform: scale(.6);
    transition: opacity var(--dur-fast) var(--ease-out),
                transform var(--dur) var(--ease-out);
}
.select-option[aria-selected="true"] .select-option-check {
    opacity: 1;
    transform: scale(1);
}


/* ---------- Custom time field (HH:MM stepper) ---------- */
.time-field { position: relative; width: 100%; }
.time-field > select.time-field-native {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; pointer-events: none;
}
.time-stepper {
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    padding: 3px 6px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    transition: border-color var(--dur) var(--ease-soft),
                box-shadow var(--dur) var(--ease-soft);
    font-variant-numeric: tabular-nums;
}
/* No focus ring on the time stepper container — the inputs themselves
   already show a caret while editing, which is enough. */
.time-stepper-unit {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 12px auto 12px;
    justify-items: center;
    gap: 0;
    padding: 0;
}
.time-sep {
    display: inline-flex;
    align-items: center;
    padding: 0 2px;
    color: var(--color-text-soft);
    font-size: var(--fs-lg);
    font-weight: 600;
    line-height: 1;
    user-select: none;
}
.time-input {
    width: 26px;
    border: 0;
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: var(--fs-lg);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    text-align: center;
    padding: 4px 0;
    outline: none;
    caret-color: var(--color-primary);
}
.time-input::-webkit-outer-spin-button,
.time-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.time-input::placeholder { color: var(--color-faint); }
/* Selection is still made (so typing replaces the digits) but invisible:
   no teal rectangle on focus. */
.time-input::selection      { background: transparent; color: inherit; }
.time-input::-moz-selection { background: transparent; color: inherit; }
/* Override the global input:focus ring — the time stepper is its own
   compound control, so no inner focus halo on its individual digits. */
.time-input:focus, .time-input:focus-visible {
    outline: none;
    border: 0;
    box-shadow: none;
}
.time-field.is-empty .time-input { color: var(--color-faint); }
.time-step {
    width: 18px;
    height: 12px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--color-text-soft);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center; /* horizontally centered above/below the digits */
    transition: background var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft),
                opacity var(--dur-fast) var(--ease-soft);
}
.time-step:hover:not(:disabled) { background: var(--color-surface-3); color: var(--color-primary); }
.time-step:active:not(:disabled) { background: var(--color-primary-soft); color: var(--color-primary-strong); }
.time-step:disabled, .time-step.is-disabled { opacity: .25; cursor: not-allowed; }
.time-step svg { display: block; }
.time-step-up   { grid-row: 1; align-self: stretch; }
.time-stepper-unit .time-input { grid-row: 2; }
.time-step-down { grid-row: 3; align-self: stretch; }

.time-clear {
    margin-left: 4px;
    align-self: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--color-text-soft) 14%, transparent);
    color: var(--color-text-soft);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: scale(.85);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--dur-fast) var(--ease-soft),
                transform var(--dur-fast) var(--ease-soft),
                background var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft);
}
.time-clear.is-visible { opacity: 1; pointer-events: auto; transform: scale(1); }
.time-clear:hover { background: var(--color-text-soft); color: var(--color-surface); }
.time-clear svg { display: block; }

/* ---------- Custom date picker ---------- */
.datepicker-wrap { position: relative; width: 100%; }

/* Native input sits over the trigger but is invisible.
   Keeps it focusable so HTML5 validation tooltips still anchor correctly. */
.datepicker-wrap > input.datepicker-native {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: transparent;
    opacity: 0;
    pointer-events: none;
}

.datepicker-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: var(--fs-md);
    cursor: pointer;
    text-align: left;
    line-height: 1.2;
    transition: border-color var(--dur) var(--ease-soft),
                background var(--dur) var(--ease-soft),
                box-shadow var(--dur) var(--ease-soft);
}
.datepicker-trigger:hover {
    border-color: var(--color-border-strong);
    background: var(--color-surface-2);
}
.datepicker-trigger:focus-visible {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--ring-focus);
}
.datepicker-wrap.is-open .datepicker-trigger {
    border-color: var(--color-primary);
    box-shadow: var(--ring-focus);
    background: var(--color-surface);
}
.datepicker-icon {
    color: var(--color-primary);
    flex-shrink: 0;
}
.datepicker-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.datepicker-value.is-placeholder { color: var(--color-faint); font-weight: 400; }
.datepicker-chevron {
    color: var(--color-muted);
    flex-shrink: 0;
    transition: transform var(--dur-slow) var(--ease-out),
                color var(--dur) var(--ease-soft);
}
.datepicker-wrap.is-open .datepicker-chevron {
    transform: rotate(180deg);
    color: var(--color-primary);
}

/* Panel */
.datepicker-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 320px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 14px;
    z-index: 70;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(.97);
    transform-origin: top left;
    transition: opacity var(--dur-fast) var(--ease-soft),
                transform var(--dur) var(--ease-soft),
                visibility 0s linear 180ms;
}
.datepicker-wrap.is-open .datepicker-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition: opacity var(--dur) var(--ease-out),
                transform var(--dur-slow) var(--ease-out),
                visibility 0s linear 0s;
}

.datepicker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.datepicker-month {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-md);
    color: var(--color-text);
    text-transform: capitalize;
    letter-spacing: -0.005em;
    flex: 1;
    text-align: center;
}
.datepicker-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-soft);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft),
                transform var(--dur-fast) var(--ease-soft);
}
.datepicker-nav:hover { background: var(--color-surface-3); color: var(--color-text); }
.datepicker-nav:active { transform: scale(.92); }
.datepicker-nav:focus-visible { outline: none; box-shadow: var(--ring-focus); }

.datepicker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 6px;
    font-size: var(--fs-2xs);
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
}
.datepicker-weekdays span { padding: 6px 0; }

.datepicker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.datepicker-day {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    height: 36px;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    transition: background var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft),
                transform var(--dur-fast) var(--ease-soft);
}
.datepicker-day:hover {
    background: var(--color-surface-3);
}
.datepicker-day:focus-visible {
    outline: none;
    box-shadow: var(--ring-focus);
}
.datepicker-day.is-out {
    color: var(--color-faint);
    font-weight: 400;
}
.datepicker-day.is-weekend { color: var(--color-text-soft); }
.datepicker-day.is-out.is-weekend { color: var(--color-faint); }
.datepicker-day.is-today {
    color: var(--color-primary-strong);
    font-weight: 700;
}
.datepicker-day.is-today::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 4px;
    transform: translateX(-50%);
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--color-primary);
}
.datepicker-day.is-selected {
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
    box-shadow: 0 4px 10px -2px var(--primary-a35);
}
.datepicker-day.is-selected.is-today::after { background: var(--color-white); }
.datepicker-day.is-selected:hover { background: var(--color-primary-hover); }

.datepicker-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
}
.datepicker-link {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--color-primary);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: background var(--dur-fast) var(--ease-soft);
}
.datepicker-link:hover { background: var(--color-primary-tint); }
.datepicker-link.is-muted { color: var(--color-muted); }
.datepicker-link.is-muted:hover { background: var(--color-surface-3); color: var(--color-text); }

@media (max-width: 640px) {
    .datepicker-panel { width: 290px; left: 50%; transform-origin: top center; transform: translate(-50%, -8px) scale(.97); }
    .datepicker-wrap.is-open .datepicker-panel { transform: translate(-50%, 0) scale(1); }
}

/* ---------- Generic UI ---------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
/* Plusieurs actions dans l'en-tête : elles restent groupées à droite et
   passent à la ligne ensemble plutôt que de se séparer. */
.page-header-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    flex-wrap: wrap;
}

.page-header h2 {
    margin: 0;
    font-size: var(--fs-24);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.025em;
}

/* Pages dont le titre reprend mot pour mot l'entrée de menu surlignée
   (Absences, Équipe, Rôles, Réglages). Le répéter en haut du corps de page
   n'apprend rien : on le retire de l'écran dès que la barre montre toute la
   navigation, sans le sortir du document — c'est le seul titre de la page,
   et les lecteurs d'écran s'en servent pour entrer dans le contenu.
   En dessous, la barre de navigation défile et les dernières entrées passent
   hors champ : le titre redevient le seul repère, il reste donc affiché. */
@media (min-width: 641px) {
    .page-title-echo {
        position: absolute;
        width: 1px; height: 1px;
        margin: -1px; padding: 0; border: 0;
        overflow: hidden; clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    /* Ne reste que le bouton d'action, qui garde sa place à droite. */
    .page-header-echo { justify-content: flex-end; }
    /* Titre seul dans l'en-tête : son blanc n'a plus lieu d'être. */
    .page-header-echo-only { margin-bottom: 0; }
}
.muted { color: var(--color-muted); }
.hint {
    font-size: var(--fs-xs);
    color: var(--color-muted);
    margin-top: 14px;
    padding: 11px 14px;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    border: 1px dashed var(--color-border-strong);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
    transition: transform var(--dur) var(--ease-soft),
                box-shadow var(--dur) var(--ease-soft),
                border-color var(--dur) var(--ease-soft);
}
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: 0 0 0 1px var(--color-primary) inset;
    opacity: 0;
    transition: opacity var(--dur) var(--ease-soft);
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.card:hover::before { opacity: .15; }
.card-label {
    font-size: var(--fs-2xs);
    color: var(--color-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.card-value {
    font-size: var(--fs-32);
    font-weight: 700;
    color: var(--color-text);
    margin-top: 8px;
    letter-spacing: -0.03em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-xs);
}
.panel h2 {
    margin: 0 0 4px;
    font-size: var(--fs-18);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.015em;
}
.panel h3 {
    margin: 18px 0 10px;
    font-size: var(--fs-2xs);
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
}
.panel h3:first-of-type { margin-top: 16px; }

.chip-list {
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.chip {
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    color: var(--color-white);
    font-size: var(--fs-xs);
    font-weight: 600;
    box-shadow: 0 1px 2px var(--ink-a12);
    letter-spacing: -0.005em;
    transition: transform var(--dur-fast) var(--ease-soft);
}
.chip:hover { transform: translateY(-1px); }

.form-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 26px 28px;
    max-width: 720px;
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow-xs);
}
.form-card-wide { max-width: none; }
.form-card-wide .grid-form { grid-template-columns: 1fr 1fr; }
.form-card-cols-4 .grid-form { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) {
    .form-card-cols-4 .grid-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .form-card-wide .grid-form,
    .form-card-cols-4 .grid-form { grid-template-columns: 1fr; }
}
.form-card h3 {
    margin: 0;
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
}
.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.grid-form .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; }

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

/* ---------- Colour picker ---------- */
.color-field { width: 100%; }
.color-field-label {
    display: block;
    margin-bottom: 8px;
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--color-text-soft);
}
.color-picker { position: relative; display: inline-block; }

.color-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px 7px 8px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease-soft),
                box-shadow var(--dur-fast) var(--ease-soft);
}
.color-trigger:hover { border-color: var(--color-primary); }
.color-trigger[aria-expanded="true"] {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.color-trigger-swatch {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    background: var(--swatch);
    box-shadow: inset 0 0 0 1px var(--ink-a12);
}
.color-trigger-value {
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.color-pop {
    position: absolute;
    z-index: 60;
    top: 0;
    left: calc(100% + 8px);
    width: 236px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.color-pop[hidden] { display: none; }
.color-pop > .cp-hue,
.color-pop > .cp-seg,
.color-pop > .cp-fields { flex: 0 0 auto; }

.cp-area {
    position: relative;
    width: 100%;
    height: 110px;
    flex: 0 0 auto;
    border-radius: var(--radius-sm);
    cursor: crosshair;
    touch-action: none;
    background:
        linear-gradient(to top, var(--color-black), transparent),
        linear-gradient(to right, var(--color-white), transparent),
        var(--cp-hue-color, var(--picker-red));
    box-shadow: inset 0 0 0 1px var(--ink-a10);
}
.cp-hue {
    position: relative;
    width: 100%;
    height: 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    touch-action: none;
    background: var(--picker-hue-strip);
    box-shadow: inset 0 0 0 1px var(--ink-a10);
}
.cp-area-thumb, .cp-hue-thumb {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--color-white);
    box-shadow: 0 0 0 1px var(--ink-a35), 0 1px 3px var(--ink-a30);
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.cp-hue-thumb { top: 50%; }

.cp-seg {
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--color-text-soft) 9%, transparent);
}
.cp-seg-btn {
    flex: 1;
    padding: 5px 0;
    border: 0;
    border-radius: var(--radius-xs);
    background: transparent;
    font-family: inherit;
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--color-text-soft);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft);
}
.cp-seg-btn:hover { color: var(--color-text); }
.cp-seg-btn.is-active {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 1px 2px var(--ink-a12);
}

.cp-fields { display: flex; gap: 6px; }
.cp-fields[hidden] { display: none; }
.cp-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.cp-field-wide { flex: 1 1 100%; align-items: stretch; }
.cp-field > span {
    font-size: var(--fs-3xs);
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--color-text-soft);
}
.cp-field input {
    width: 100%;
    padding: 6px 4px;
    text-align: center;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: inherit;
    font-size: var(--fs-xs);
    font-variant-numeric: tabular-nums;
}
.cp-field-wide input { text-align: left; text-transform: uppercase; letter-spacing: .02em; }
.cp-field input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.cp-field input[type=number]::-webkit-inner-spin-button,
.cp-field input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cp-field input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* ---------- Roles table: reorder controls ---------- */
.roles-table .col-order { width: 64px; }
.roles-table .col-count { text-align: center; }
.roles-table .count-badge { cursor: help; font-variant-numeric: tabular-nums; }
.order-controls { display: inline-flex; gap: 4px; }
.btn-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text-soft);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft),
                border-color var(--dur-fast) var(--ease-soft);
}
.btn-order:hover:not(:disabled) {
    background: var(--color-primary-tint);
    color: var(--color-primary-strong);
    border-color: var(--color-primary-soft);
}
.btn-order:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- List toolbar (search / filter / sort) ---------- */
.list-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.list-search-wrap {
    position: relative;
    /* Basis sized on the placeholder rather than on a round number: below
       it the toolbar wraps, sending the role chips to their own row and
       leaving the field a full line. A smaller basis kept them side by side
       on laptop widths and squeezed the field under its own label. */
    flex: 1 1 470px;
    min-width: 200px;
}
.list-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-faint);
    pointer-events: none;
}
/* Matched on the type as well as the class: the global field rule above
   selects input[type=search], which outranks a bare class and would reset
   the side padding that reserves room for the icon and the clear button —
   the placeholder then ran underneath both. */
input[type=search].list-search {
    width: 100%;
    padding: 10px 38px 10px 36px;
    /* The toolbar shares its row with the role chips, so the field is often
       narrower than its own placeholder. Signal the cut with an ellipsis
       instead of slicing a word in half. Applies to the typed value too,
       while the field is not focused. */
    text-overflow: ellipsis;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    font: inherit;
    font-size: var(--fs-md);
    color: var(--color-text);
    transition: border-color var(--dur-fast) var(--ease-soft),
                box-shadow var(--dur-fast) var(--ease-soft);
}
.list-search::placeholder { color: var(--color-faint); }
.list-search:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--ring-focus);
}
.list-search::-webkit-search-cancel-button,
.list-search::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.list-search::-ms-clear { display: none; width: 0; height: 0; }

.list-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--color-text-soft) 14%, transparent);
    color: var(--color-text-soft);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(.85);
    transition: background var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft),
                opacity var(--dur-fast) var(--ease-soft),
                transform var(--dur-fast) var(--ease-soft);
}
.list-search-wrap.is-filled .list-search-clear {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) scale(1);
}
.list-search-clear:hover { background: var(--color-text-soft); color: var(--color-surface); }
.list-search-clear:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.list-search-clear svg { display: block; }
.list-toolbar .select-wrap { flex: 0 0 auto; width: auto; min-width: 180px; }
.data-table th, .data-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}
.data-table thead th {
    background: var(--color-surface-2);
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    color: var(--color-muted);
    letter-spacing: .08em;
    font-weight: 600;
}
.data-table thead th.th-sort { padding-top: 0; padding-bottom: 0; }
.th-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 14px 0;
    padding: 0;
    background: transparent;
    border: 0;
    font: inherit;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    text-align: left;
    cursor: pointer;
    transition: color var(--dur-fast) var(--ease-soft);
}
.th-sort-btn:hover { color: var(--color-text); }
.th-sort-icon {
    opacity: .35;
    transition: opacity var(--dur-fast) var(--ease-soft),
                transform var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft);
}
.th-sort:hover .th-sort-icon { opacity: .7; }
.th-sort.is-active .th-sort-btn { color: var(--color-text); }
.th-sort.is-active .th-sort-icon { opacity: 1; color: var(--color-primary); }
.th-sort.is-desc .th-sort-icon { transform: rotate(180deg); }
.data-table tbody tr { transition: background var(--dur-fast) var(--ease-soft); }
.data-table tbody tr:hover { background: var(--color-surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td { font-size: var(--fs-sm); color: var(--color-text); }

/* Staggered top-to-bottom row reveal on first load (class removed by JS
   afterwards so list filtering/sorting doesn't re-trigger it). */
.data-table.is-revealing tbody tr { animation: tableRowIn var(--dur-slower) var(--ease-emph) both; }
.data-table.is-revealing tbody tr:nth-child(1)  { animation-delay: calc(var(--stagger-row) * 1); }
.data-table.is-revealing tbody tr:nth-child(2)  { animation-delay: calc(var(--stagger-row) * 2); }
.data-table.is-revealing tbody tr:nth-child(3)  { animation-delay: calc(var(--stagger-row) * 3); }
.data-table.is-revealing tbody tr:nth-child(4)  { animation-delay: calc(var(--stagger-row) * 4); }
.data-table.is-revealing tbody tr:nth-child(5)  { animation-delay: calc(var(--stagger-row) * 5); }
.data-table.is-revealing tbody tr:nth-child(6)  { animation-delay: calc(var(--stagger-row) * 6); }
.data-table.is-revealing tbody tr:nth-child(7)  { animation-delay: calc(var(--stagger-row) * 7); }
.data-table.is-revealing tbody tr:nth-child(8)  { animation-delay: calc(var(--stagger-row) * 8); }
.data-table.is-revealing tbody tr:nth-child(9)  { animation-delay: calc(var(--stagger-row) * 9); }
.data-table.is-revealing tbody tr:nth-child(10) { animation-delay: calc(var(--stagger-row) * 10); }
.data-table.is-revealing tbody tr:nth-child(11) { animation-delay: calc(var(--stagger-row) * 11); }
.data-table.is-revealing tbody tr:nth-child(n+12) { animation-delay: calc(var(--stagger-row) * 12); }
@keyframes tableRowIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
/* Soft fade of the result set when the list is filtered / sorted. */
.data-table tbody.is-filtering tr:not([hidden]) { animation: tableFilterIn var(--dur-slow) var(--ease-out) both; }
@keyframes tableFilterIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Keep the actions cell a real table-cell (vertical-align: middle from
   .data-table td) so its row height stays in sync with the other columns.
   The buttons sit inline-flex with a small gap. */
.actions { white-space: nowrap; }
.actions > * { display: inline-flex; align-items: center; vertical-align: middle; }
.actions > * + * { margin-left: 6px; }
.inline-form { display: inline; }

/* Employee cell (team table) */
.employee-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.employee-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    color: var(--color-white);
    font-weight: 600;
    font-size: var(--fs-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--white-a95), 0 1px 3px var(--ink-a15);
    transition: transform var(--dur-fast) var(--ease-soft);
}
.data-table tbody tr:hover .employee-avatar { transform: scale(1.05); }
.employee-name {
    font-weight: 600;
    color: var(--color-text);
    font-size: var(--fs-sm);
    letter-spacing: -0.005em;
}
.employee-email {
    font-size: var(--fs-xs);
    color: var(--color-muted);
    margin-top: 2px;
}
.color-dot {
    display: inline-block;
    width: 12px; height: 12px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 8px;
    box-shadow: 0 0 0 2px var(--white-a95), 0 0 0 3px var(--ink-a08);
}

/* ---------- Absence status + requests ---------- */
.abs-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: 0.01em;
}
.abs-status.is-pending  { background: var(--color-warning-soft); color: var(--color-warning); }
.abs-status.is-approved { background: var(--color-success-soft); color: var(--color-success); }
.abs-status.is-rejected { background: var(--color-danger-soft); color: var(--color-danger); }

.abs-pending {
    margin-bottom: 22px;
    padding: 18px 20px;
    background: color-mix(in srgb, var(--color-warning-mid) 7%, var(--color-surface));
    border: 1px solid color-mix(in srgb, var(--color-warning-mid) 28%, var(--color-border));
    border-radius: var(--radius-lg);
}
.abs-pending-title {
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--color-text);
}
.abs-pending-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px; height: 22px;
    padding: 0 7px;
    border-radius: var(--radius-pill);
    background: var(--color-warning-mid);
    color: var(--color-white);
    font-size: var(--fs-xs);
    font-weight: 700;
}
.abs-pending-list { display: flex; flex-direction: column; gap: 10px; }
.abs-request-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.abs-request-main { display: flex; align-items: flex-start; gap: 4px; min-width: 0; }
.abs-request-who { font-size: var(--fs-md); font-weight: 600; color: var(--color-text); }
.abs-request-dates { font-size: var(--fs-sm); color: var(--color-text-soft); margin-top: 2px; }
.abs-request-note { font-size: var(--fs-xs); color: var(--color-muted); margin-top: 3px; font-style: italic; }
.abs-request-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.abs-decision-note {
    padding: 7px 11px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: var(--fs-sm);
    width: 180px;
    max-width: 100%;
}
.abs-decision-note:focus { outline: none; border-color: var(--color-primary); box-shadow: var(--ring-focus); }

/* ---------- Member access fieldset ---------- */
.member-access {
    margin: 0;
    padding: 16px 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface-2);
}
.member-access > legend {
    padding: 0 8px;
    margin-left: -8px;
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--color-text);
}
.member-access-on {
    margin-left: 4px;
    font-size: var(--fs-2xs);
    font-weight: 600;
    color: var(--color-success);
}
.member-access .hint { margin: 0 0 12px; }

/* Refusal note, on the field caption's own line. Empty when idle — the
   :not(:empty) guard keeps it from reserving any space, so showing and
   hiding it never moves the form. */
.field-note:not(:empty) {
    margin-left: 8px;
    color: var(--color-danger);
    font-weight: 600;
    animation: fieldNoteIn var(--dur) var(--ease-out);
}
@keyframes fieldNoteIn {
    from { opacity: 0; transform: translateY(-2px); }
    to   { opacity: 1; transform: none; }
}
/* A brief flash on the field itself: the note explains, this points. */
input.is-rejected {
    animation: fieldReject var(--dur-slower) var(--ease-soft);
}
/* A lasting mark, for a value that stays wrong rather than a keystroke that
   was refused: it holds through focus and goes only once the value is fixed. */
input.is-invalid,
input.is-invalid:focus {
    border-color: var(--color-danger);
}
input.is-invalid:focus {
    box-shadow: 0 0 0 3px var(--color-danger-soft);
}
@keyframes fieldReject {
    0%, 100% { border-color: var(--color-border-strong); box-shadow: none; }
    30%      { border-color: var(--color-danger); box-shadow: 0 0 0 3px var(--color-danger-soft); }
}
@media (prefers-reduced-motion: reduce) {
    .field-note:not(:empty) { animation: none; }
    input.is-rejected { animation: none; border-color: var(--color-danger); }
}

/* Two ways of granting access, the safe one visually first. */
.access-option {
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, var(--radius-md));
    background: var(--color-surface);
}
.access-option + .access-option { margin-top: 12px; }
.access-option-primary {
    border-color: var(--color-primary-soft);
    background: var(--color-primary-tint);
}
.access-option-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--color-text);
}
.access-badge {
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: var(--color-white);
    font-size: var(--fs-3xs);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.access-option .hint:last-of-type { margin-bottom: 12px; }
.access-option-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.access-warn { color: var(--color-danger, var(--color-danger)); font-weight: 600; }
.btn-quiet { color: var(--color-text-soft); }

/* The code is read aloud across a counter: big, spaced, unambiguous. */
.enrol-code {
    margin: 0 0 6px;
    font-family: var(--font-mono, ui-monospace, "SFMono-Regular", Menlo, monospace);
    font-size: var(--fs-30);
    font-weight: 700;
    letter-spacing: .16em;
    color: var(--color-primary-strong, var(--color-primary));
    user-select: all;
}
.enrol-code-meta { margin-bottom: 12px; }
input[type=text].enrol-code-input {
    font-family: var(--font-mono, ui-monospace, "SFMono-Regular", Menlo, monospace);
    font-size: var(--fs-20);
    letter-spacing: .14em;
    text-align: center;
    text-transform: uppercase;
}
.enrol-hint { margin: -2px 0 4px; }
@media (max-width: 640px) {
    .enrol-code { font-size: var(--fs-24); letter-spacing: .12em; }
}

/* ---------- Notifications page ---------- */
.notif-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
}
.notif-search-wrap { flex: 1 1 240px; min-width: 240px; }
.notif-type-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.notif-type-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    color: var(--color-text-soft);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-soft),
                border-color var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft);
}
.notif-type-chip:hover { border-color: var(--color-primary); }
.notif-type-chip.is-active {
    background: var(--primary-a12);
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.notif-page-no-results {
    border: 1px dashed var(--color-border);
    background: transparent;
}

.notif-page {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}
.notif-page-empty {
    padding: 56px 20px;
    text-align: center;
    color: var(--color-muted);
}
.notif-page-empty-icon { font-size: var(--fs-32); display: block; margin-bottom: 10px; }
.notif-page-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text);
    position: relative;
    transition: background var(--dur-fast) var(--ease-soft);
}
.notif-page-item:last-child { border-bottom: 0; }
.notif-page-item:hover { background: var(--color-surface-2); text-decoration: none; }
.notif-page-item.is-unread { background: color-mix(in srgb, var(--color-primary) 6%, transparent); }
.employee-access {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    color: var(--color-primary);
    vertical-align: middle;
    cursor: help;
}
.pill {
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: 0.005em;
    display: inline-block;
}
.pill-on  { background: var(--color-success-soft); color: var(--color-success); }
.pill-off { background: var(--color-danger-soft);  color: var(--color-danger); }

/* Role badge tinted with the role's own color */
.role-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--role-color, var(--color-text-soft));
    background: color-mix(in srgb, var(--role-color, var(--color-text-soft)) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--role-color, var(--color-text-soft)) 25%, transparent);
    letter-spacing: -0.005em;
    white-space: nowrap;
}

/* ---------- Planning filter (roles + members popover) ---------- */
.planning-filter { position: relative; }
.planning-filter-btn { gap: 6px; display: inline-flex; align-items: center; }
.planning-filter.is-active .planning-filter-btn {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-tint);
}
.planning-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: var(--color-white);
    font-size: var(--fs-2xs);
    font-weight: 700;
    margin-left: 4px;
}
.planning-filter-panel {
    /* Fixed, not absolute: `overflow-x: hidden` on <body> turns it into a
       clipping box that ends at the bottom of the page content, which cut the
       panel off on short pages. The script anchors it under the button. */
    position: fixed;
    top: 0;
    right: 12px;
    width: 320px;
    max-width: calc(100vw - 24px);
    /* Height is capped to the room left under (or above) the button — the
       script keeps --filter-max-h in sync. Laying the panel out as a column
       keeps the footer pinned while the list scrolls. */
    display: flex;
    flex-direction: column;
    max-height: var(--filter-max-h, 460px);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 18px 50px -12px var(--c-0f172a-a28), 0 4px 14px -6px var(--c-0f172a-a12);
    z-index: 50;
    overflow: hidden;
    transform-origin: top right;
    animation: filterPanelIn var(--dur-fast) var(--ease-out, var(--ease-emph));
}
/* Opened upwards when the space below the button is too tight — the script
   sets the offsets, this only flips the animation's origin. */
.planning-filter-panel.is-above { transform-origin: bottom right; }
@keyframes filterPanelIn {
    from { opacity: 0; transform: translateY(-6px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
.planning-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--color-border);
}
.planning-filter-head h3 {
    margin: 0;
    font-size: var(--fs-md);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--color-text);
}
.planning-filter-clear {
    background: transparent;
    border: 0;
    padding: 2px 4px;
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--color-primary);
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: color var(--dur-fast) var(--ease-soft);
}
.planning-filter-clear:hover { color: var(--color-primary-hover); text-decoration: underline; }
.planning-filter-scroll {
    /* Takes whatever height the panel has left, so the head and foot stay
       visible however short the window is. */
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 10px 10px;
    overscroll-behavior: contain;
}
.planning-filter-head,
.planning-filter-foot { flex: 0 0 auto; }
.planning-filter-scroll::-webkit-scrollbar { width: 9px; }
.planning-filter-scroll::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--color-text-soft) 30%, transparent);
    border-radius: var(--radius-pill);
    border: 3px solid var(--color-surface);
}
.planning-filter-section + .planning-filter-section { margin-top: 6px; }
.planning-filter-label {
    margin: 8px 6px 4px;
    font-size: var(--fs-3xs);
    font-weight: 700;
    color: var(--color-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}
.planning-filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.planning-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--fs-sm);
    color: var(--color-text);
    transition: background var(--dur-fast) var(--ease-soft);
}
.planning-filter-row:hover {
    background: color-mix(in srgb, var(--role-color, var(--color-primary)) 9%, transparent);
}
/* Custom checkbox */
/* This input is replaced by .planning-filter-box below, so it must stay
   collapsed — `input.` keeps it ahead of the global checkbox styling. */
input.planning-filter-check {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
    margin: 0;
    border: 0;
    appearance: none;
    pointer-events: none;
}
.planning-filter-box {
    flex-shrink: 0;
    width: 19px;
    height: 19px;
    border-radius: var(--radius-xs);
    border: 1.5px solid var(--color-border-strong);
    background: var(--color-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    transition: background var(--dur-fast) var(--ease-soft),
                border-color var(--dur-fast) var(--ease-soft),
                transform var(--dur-fast) var(--ease-soft);
}
.planning-filter-box svg { opacity: 0; transform: scale(.6); transition: opacity var(--dur-fast) var(--ease-soft), transform var(--dur-fast) var(--ease-soft); }
.planning-filter-check:checked + .planning-filter-box {
    background: var(--role-color, var(--color-primary));
    border-color: var(--role-color, var(--color-primary));
}
.planning-filter-check:checked + .planning-filter-box svg { opacity: 1; transform: none; }
.planning-filter-check:focus-visible + .planning-filter-box {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--role-color, var(--color-primary)) 30%, transparent);
}
.planning-filter-row:has(.planning-filter-check:checked) {
    background: color-mix(in srgb, var(--role-color, var(--color-primary)) 8%, transparent);
}
.planning-filter-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--role-color, var(--color-text-soft)) 16%, transparent);
}
.planning-filter-avatar {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-size: var(--fs-2xs);
    font-weight: 700;
    letter-spacing: 0.01em;
}
.planning-filter-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.planning-filter-foot {
    border-top: 1px solid var(--color-border);
    padding: 10px 14px;
    background: var(--color-surface-2);
}
.planning-filter-reset,
.planning-filter-all {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
/* Stacked: the bulk select/deselect action sits above the reset. */
.planning-filter-all + .planning-filter-reset { margin-top: 8px; }
.planning-filter-reset:disabled {
    opacity: .5;
    cursor: not-allowed;
}
.planning-filter-reset svg,
.planning-filter-all svg { flex-shrink: 0; }

/* Multi-select role chips used in the Équipe filter toolbar. */
.list-filter-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--color-text-soft);
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-soft),
                border-color var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft);
}
.role-chip:hover {
    border-color: color-mix(in srgb, var(--role-color, var(--color-text-soft)) 50%, var(--color-border));
}
.role-chip .role-chip-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--role-color, var(--color-text-soft));
}
.role-chip.is-active {
    color: var(--role-color, var(--color-text));
    background: color-mix(in srgb, var(--role-color, var(--color-text-soft)) 14%, transparent);
    border-color: color-mix(in srgb, var(--role-color, var(--color-text-soft)) 45%, transparent);
}

/* "Tous" — reset chip placed first in the row. Uses a neutral slate
   so it can never collide visually with the teal-tinted "Pharmacien"
   chip or any other role color. */
.role-chip-all { padding-left: 14px; padding-right: 14px; }
.role-chip-all:hover { border-color: var(--color-slate-600); }
.role-chip-all.is-active {
    color: var(--color-slate-800);
    background: var(--c-475569-a12);
    border-color: var(--color-slate-600);
}

/* ---------- Planning ---------- */
.planning-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px 18px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}
.planning-nav { display: flex; gap: 6px; }
.planning-week-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
    color: var(--color-text);
    font-size: var(--fs-md);
    letter-spacing: -0.005em;
    font-variant-numeric: tabular-nums;
}
.planning-week-label.is-under-staffed { color: var(--color-danger); }
.planning-actions { display: flex; gap: 6px; }

.planning-exports {
    display: inline-flex;
    gap: 6px;
    margin-left: auto;
}
.planning-exports .btn { gap: 6px; }

/* View switcher (Jour / Semaine / Mois) */
.planning-view-switcher {
    display: inline-flex;
    background: var(--color-surface-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 2px;
}
.planning-view-tab {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--color-text-soft);
    text-decoration: none;
    transition: background var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft);
}
.planning-view-tab:hover {
    color: var(--color-text);
    background: var(--color-surface);
    text-decoration: none;
}
.planning-view-tab.active {
    background: var(--color-surface);
    color: var(--color-primary-strong);
    font-weight: 600;
    box-shadow: var(--shadow-xs);
}

.legend {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    font-size: var(--fs-sm);
    box-shadow: var(--shadow-xs);
    animation: slideDown var(--dur) var(--ease-out);
}
.legend strong { font-weight: 600; color: var(--color-text); }
.legend-swatch {
    display: inline-block;
    width: 18px; height: 10px;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 6px;
}
.legend-help { color: var(--color-muted); font-size: var(--fs-xs); }

.planning-wrap {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
/* Shown instead of the planning when the filter leaves nobody. */
.planning-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 48px 24px 52px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: var(--color-text-soft);
}
.planning-empty svg { color: var(--color-faint); }
.planning-empty h3 {
    margin: 2px 0 0;
    font-size: var(--fs-xl);
    font-weight: 650;
    color: var(--color-text);
}
.planning-empty p { margin: 0; max-width: 46ch; font-size: var(--fs-sm); }

/* Keep the week/day tables from collapsing too far on small screens —
   they scroll horizontally inside their card instead. */
.planning-week { min-width: 720px; }
.planning-day  { min-width: 520px; }

/* The wrapper is rounded and clips its content, so the square corners of
   the outermost header cells get cut off — which chopped the red
   under-staffed outline at the top-right corner. Round those cells to the
   wrapper's inner radius (16px card − 1px border) so backgrounds and
   inset-shadow outlines follow the same curve. */
.planning thead tr:first-child th:first-child { border-top-left-radius: 15px; }
.planning thead tr:first-child th:last-child  { border-top-right-radius: 15px; }


/* ---------- Page navigation transitions ----------
   Cross-document View Transitions opt-in: only the page chrome (root) is
   snapped instantly to suppress the white flash between pages. The active
   nav pill (FLIP) and the planning content (class-based enter animation,
   below) drive their own motion deterministically on every navigation,
   independent of the View Transitions API. */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Planning content directional slide-in ----------
   Applied on load via .is-entering-<dir>; fires every navigation. */
.planning-anim-host {
    animation-fill-mode: both;
    transform-origin: center top;
    will-change: opacity, transform, filter;
}
.planning-anim-host.is-entering-next {
    animation: planningEnterRight var(--dur-slower) var(--ease-emph) both;
}
.planning-anim-host.is-entering-prev {
    animation: planningEnterLeft var(--dur-slower) var(--ease-emph) both;
}
.planning-anim-host.is-entering-today {
    animation: planningEnterFade var(--dur-slower) var(--ease-emph) both;
}

@keyframes planningEnterRight {
    from { opacity: 0; transform: translate3d(22px, 0, 0); }
    to   { opacity: 1; transform: none; }
}
@keyframes planningEnterLeft {
    from { opacity: 0; transform: translate3d(-22px, 0, 0); }
    to   { opacity: 1; transform: none; }
}
@keyframes planningEnterFade {
    from { opacity: 0; transform: scale(0.992); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .planning-anim-host,
    .planning-anim-host.is-entering-next,
    .planning-anim-host.is-entering-prev,
    .planning-anim-host.is-entering-today,
    .tpl-variant,
    .tpl-variant .tpl-day-row { animation: none !important; }
}
.planning {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}
.planning th, .planning td {
    border-bottom: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    padding: 6px 8px;
    vertical-align: middle;
    background: var(--color-surface);
}
.planning thead th {
    background: var(--color-surface-2);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--color-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 14px 10px;
    vertical-align: middle;
    text-align: center;
}
.planning thead .col-member { text-align: left; }
.planning .col-member {
    width: 160px;
    background: var(--color-surface-2);
    font-weight: 600;
    color: var(--color-text);
    font-size: var(--fs-sm);
}
/* The name occupies its own line so the "Modèle" button drops below
   with breathing room (avoids a cramped header on each member row). */
.planning .col-member .member-name { display: block; }
/* Icon only in the planning: this button repeats on every employee row, and a
   labelled, tinted one turns the first column into a stack of buttons that
   competes with the schedule itself. It stays quiet until pointed at. */
.planning .col-member .btn-tpl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-top: 8px;
    padding: 0;
    gap: 0;
    background: transparent;
    border-color: transparent;
    color: var(--color-faint);
}
/* The icons sit centred on their own line, under the name that owns the one
   above: left-aligned they hung off the corner of the cell. */
.planning .col-member-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.planning .col-member .btn-tpl svg { color: currentColor; }
.planning .col-member .btn-tpl:hover,
.planning .col-member .btn-tpl:focus-visible {
    background: var(--color-primary-tint);
    border-color: color-mix(in srgb, var(--color-primary) 28%, transparent);
    color: var(--color-primary-strong);
}
.planning .col-member .btn-tpl:hover svg,
.planning .col-member .btn-tpl:focus-visible svg { color: var(--color-primary); }
/* The employee's own screen keeps the neutral colour it has in Équipe, where
   the same action is an outline button; the template keeps its teal. Both stay
   quiet until pointed at. */
.planning .col-member .btn-member-edit:hover,
.planning .col-member .btn-member-edit:focus-visible {
    background: var(--color-surface-3);
    border-color: var(--color-border-strong);
    color: var(--color-text);
}
.planning .col-member .btn-member-edit:hover svg,
.planning .col-member .btn-member-edit:focus-visible svg { color: var(--color-text); }
.tpl-edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin: 6px 0 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--color-text-soft);
    cursor: pointer;
    opacity: .55;
    transition: opacity var(--dur-fast) var(--ease-soft),
                background var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft);
}
.tpl-edit-btn:hover { opacity: 1; background: var(--color-surface-3); color: var(--color-primary); }
.tpl-edit-btn:focus-visible {
    outline: none;
    opacity: 1;
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.tpl-edit-btn svg { display: block; }

/* Weekly schedule template editor page */
.page-subtitle {
    margin: 4px 0 0;
    font-size: var(--fs-md);
    font-weight: 500;
    color: var(--color-text-soft);
}
.tpl-form { max-width: none; gap: 22px; }
/* The form itself carries [hidden] in view mode — the flex display of
   .form-card would otherwise override the native hidden attribute. */
.tpl-form[hidden] { display: none !important; }
.tpl-form [hidden] { display: none !important; }
.tpl-section {
    border: 0;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tpl-section > legend {
    padding: 0;
    margin-bottom: 6px;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--color-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.tpl-period { display: flex; gap: 14px; flex-wrap: wrap; }
.tpl-period-field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; min-width: 0; }
.tpl-period-field > span {
    font-size: var(--fs-xs); font-weight: 500; color: var(--color-text-soft);
}
.tpl-has-b {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: var(--fs-md);
    line-height: 1;
    color: var(--color-text);
}
/* No translateY here any more: the 3px nudge only compensated the stray
   `label > span` bottom margin, now cleared for row labels. */
.tpl-has-b > span { display: inline-block; line-height: 1; }
/* The A/B checkbox now inherits the shared checkbox look defined near the
   top of this file — only its hover colour cue stays local. */
.tpl-has-b:hover input[type="checkbox"]:not(:disabled) { border-color: var(--color-primary); }
.tpl-tabs {
    display: inline-flex; gap: 2px; padding: 3px;
    background: color-mix(in srgb, var(--color-text-soft) 9%, transparent);
    border-radius: var(--radius-sm);
    align-self: flex-start;
}
.tpl-tab {
    padding: 7px 18px; border: 0; border-radius: var(--radius-xs);
    background: transparent; cursor: pointer; font: inherit;
    font-size: var(--fs-xs); font-weight: 600; color: var(--color-text-soft);
    transition: background var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft);
}
.tpl-tab:hover { color: var(--color-text); }
.tpl-tab.is-active { background: var(--color-surface); color: var(--color-text); box-shadow: 0 1px 2px var(--ink-a12); }
.tpl-days { display: flex; flex-direction: column; gap: 8px; }

/* Variant fade base — replaces the monolithic slide so each day row
   can stagger in for a more refined "wow" effect. */
.tpl-variant {
    animation-fill-mode: both;
    transform-origin: top center;
}
.tpl-variant.is-anim-from-right {
    animation: tplVariantIn var(--dur-slower) var(--ease-emph) both;
}
.tpl-variant.is-anim-from-left {
    animation: tplVariantIn var(--dur-slower) var(--ease-emph) both;
}
@keyframes tplVariantIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Staggered day rows on variant switch. The seven rows fan in one after
   another with a smooth cubic ease, with a subtle slide + scale + blur
   release so the change feels like a soft camera glide. */
.tpl-variant.is-anim-from-right .tpl-day-row {
    animation: tplDayRowIn var(--dur-slower) var(--ease-emph) both;
}
.tpl-variant.is-anim-from-left .tpl-day-row {
    animation: tplDayRowInLeft var(--dur-slower) var(--ease-emph) both;
}
.tpl-variant .tpl-day-row:nth-child(1) { animation-delay: calc(var(--stagger-row) * 0); }
.tpl-variant .tpl-day-row:nth-child(2) { animation-delay: calc(var(--stagger-row) * 1); }
.tpl-variant .tpl-day-row:nth-child(3) { animation-delay: calc(var(--stagger-row) * 2); }
.tpl-variant .tpl-day-row:nth-child(4) { animation-delay: calc(var(--stagger-row) * 3); }
.tpl-variant .tpl-day-row:nth-child(5) { animation-delay: calc(var(--stagger-row) * 4); }
.tpl-variant .tpl-day-row:nth-child(6) { animation-delay: calc(var(--stagger-row) * 5); }
.tpl-variant .tpl-day-row:nth-child(7) { animation-delay: calc(var(--stagger-row) * 6); }

@keyframes tplDayRowIn {
    0%   { opacity: 0; transform: translateX(28px) scale(0.97); filter: blur(3px); }
    55%  { opacity: 1; filter: blur(0); }
    100% { opacity: 1; transform: translateX(0)    scale(1);    filter: blur(0); }
}
@keyframes tplDayRowInLeft {
    0%   { opacity: 0; transform: translateX(-28px) scale(0.97); filter: blur(3px); }
    55%  { opacity: 1; filter: blur(0); }
    100% { opacity: 1; transform: translateX(0)     scale(1);    filter: blur(0); }
}
.tpl-day-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}
.tpl-day-name {
    font-weight: 600; font-size: var(--fs-sm); color: var(--color-text);
}
/* Per-day on/off switch: the weekday name doubles as its label. */
.tpl-day-switch { gap: 10px; }
.tpl-day-switch .switch-label {
    font-weight: 600;
    font-size: var(--fs-sm);
    color: var(--color-text);
}
/* A day switched off keeps its fields visible but plainly inactive. */
.tpl-day-row.is-off { background: var(--color-surface-2, var(--color-surface)); }
.tpl-day-row.is-off .tpl-day-fields {
    opacity: .45;
    pointer-events: none;
}
.tpl-day-row.is-off .tpl-day-switch .switch-label { color: var(--color-text-soft); }
.tpl-day-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.tpl-day-fields > label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tpl-day-fields > label > span {
    font-size: var(--fs-2xs); font-weight: 600; color: var(--color-text-soft);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.tpl-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.tpl-actions-right { display: flex; gap: 10px; }

/* ---------- Template recap (read-only view of a saved model) ---------- */
.tpl-recap { max-width: none; display: flex; flex-direction: column; gap: 20px; }
.tpl-recap-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.tpl-recap-title { margin: 0 0 4px; font-size: var(--fs-xl); font-weight: 650; letter-spacing: -0.01em; }
.tpl-recap-period { margin: 0; font-size: var(--fs-sm); }
.tpl-recap-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    background: var(--color-surface-3);
    border: 1px solid var(--color-border);
    font-size: var(--fs-2xs);
    font-weight: 600;
    color: var(--color-text-soft);
}
.tpl-recap-head .btn { flex: 0 0 auto; }
.tpl-recap-variant + .tpl-recap-variant { margin-top: 4px; }
.tpl-recap-variant-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.tpl-recap-variant-title {
    margin: 0;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-soft);
}
.tpl-recap-total {
    margin-left: auto;
    font-size: var(--fs-xs);
    color: var(--color-text-soft);
}
.tpl-recap-total strong {
    color: var(--color-primary-strong, var(--color-text));
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.tpl-recap-days {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
}
.tpl-recap-day {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface-2, var(--color-surface));
}
.tpl-recap-day-name { font-weight: 600; font-size: var(--fs-sm); color: var(--color-text); }
.tpl-recap-day-hours { font-size: var(--fs-sm); color: var(--color-text); font-variant-numeric: tabular-nums; text-align: right; }
.tpl-recap-day.is-off { opacity: 0.62; }
.tpl-recap-day.is-off .tpl-recap-day-hours { color: var(--color-text-soft); font-style: italic; }
/* « Modifier » à gauche, la suppression à droite, nettement détachés du
   trait qui les sépare du corps de la carte. */
.tpl-recap-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border-top: 1px solid var(--color-border);
    margin-top: 8px;
    padding-top: 20px;
}
.tpl-recap-actions form { margin: 0; }

@media (max-width: 640px) {
    .tpl-day-row { grid-template-columns: 1fr; }
    .tpl-day-fields { grid-template-columns: 1fr 1fr; }
    .tpl-recap-days { grid-template-columns: 1fr; }
    .tpl-recap-head .btn { width: 100%; }
}
.planning .col-day { width: auto; }
.planning .col-day.weekend { background: var(--color-weekend); }
.planning .col-day.today { box-shadow: inset 0 -3px 0 var(--color-primary); }
.planning thead .col-day.today { color: var(--color-primary-strong); }

/* Under-staffed day (< 4 employés sur au moins une tranche 09:00–20:00).
   Only the header cell is tinted — the body keeps its normal background. */
.planning thead .col-day.is-under-staffed {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}
/* The "today" bottom bar turns red when the current day is under-staffed. */
.planning-week thead .col-day.today.is-under-staffed {
    box-shadow: inset 0 -3px 0 var(--color-danger);
}

/* Refined under-staff alert badge: filled red disc with a clean "!"
   character and a soft pink halo. Subtle bump on hover/focus.
   Used both in the week header and in the month cell. */
.under-staff-icon {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
    background: var(--color-danger);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--color-danger-soft),
                0 1px 2px var(--ink-a12);
    cursor: help;
    flex-shrink: 0;
    vertical-align: middle;
    transition: transform var(--dur-fast) var(--ease-soft),
                box-shadow var(--dur-fast) var(--ease-soft);
    user-select: none;
    /* Two quick attention pulses when it first appears. */
    animation: underStaffPulse var(--dur-pulse) var(--ease-out) 2;
}
@keyframes underStaffPulse {
    0%   { box-shadow: 0 0 0 4px var(--color-danger-soft), 0 1px 2px var(--ink-a12); }
    35%  { box-shadow: 0 0 0 4px var(--color-danger-soft), 0 0 0 8px color-mix(in srgb, var(--color-danger) 22%, transparent), 0 1px 2px var(--ink-a12); }
    100% { box-shadow: 0 0 0 4px var(--color-danger-soft), 0 0 0 14px transparent, 0 1px 2px var(--ink-a12); }
}
@media (prefers-reduced-motion: reduce) {
    .under-staff-icon { animation: none; }
}
.under-staff-icon:hover,
.under-staff-icon:focus-visible {
    transform: scale(1.12);
    box-shadow: 0 0 0 5px var(--color-danger-soft),
                0 2px 4px var(--c-dc2626-a25);
    outline: none;
}
/* The "!" is drawn geometrically (bar + dot) for pixel-perfect centring,
   independent of any font baseline. The 8px-tall mark is centred in the
   16px disc (4px margin top & bottom). */
.under-staff-icon::before,
.under-staff-icon::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: var(--color-white);
}
.under-staff-icon::before {   /* vertical bar */
    top: 4px;
    height: 5px;
    border-radius: 1px;
}
.under-staff-icon::after {    /* dot */
    top: 10px;
    height: 2px;
    border-radius: 50%;
}
/* Month cell: day number + under-staff badge inline (like day/week views). */
.planning-month-top {
    display: flex;
    align-items: center;
    gap: 7px;
}

/* Header day label links to /planning?view=day for that date. */
/* Header day cell: label + optional under-staff badge centered both ways.
   The height:1px on the cell lets the inner flex wrapper resolve height:100%
   to the actual (row) height, giving reliable vertical centering in a
   table-layout: fixed table. */
.planning thead .col-day {
    height: 1px;
    padding-left: 12px;
    padding-right: 12px;
}
.planning thead .col-day .col-day-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 7px;
    height: 100%;
    padding: 6px 0;
}
.planning thead .col-day .col-day-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

/* Hover: only the border (inset box-shadow) changes — green normally,
   red when the day is under-staffed. No background / text change. */
.planning-week thead .col-day {
    transition: box-shadow var(--dur-fast) var(--ease-soft);
}
.planning-week thead .col-day:hover {
    box-shadow: inset 0 0 0 1px var(--color-primary-soft);
}
.planning-week thead .col-day.is-under-staffed:hover {
    box-shadow: inset 0 0 0 1px var(--color-danger);
}
/* Keep the "today" bottom bar visible while hovering the current day —
   and on top of the hover border so the latter doesn't cover the band. */
.planning-week thead .col-day.today:hover {
    box-shadow: inset 0 -3px 0 var(--color-primary),
                inset 0 0 0 1px var(--color-primary-soft);
}
.planning-week thead .col-day.today.is-under-staffed:hover {
    box-shadow: inset 0 -3px 0 var(--color-danger),
                inset 0 0 0 1px var(--color-danger);
}

/* Section title rows tinted with each role's own colour. */
.planning .role-row td {
    background: color-mix(in srgb, var(--role-color, var(--color-primary)) 13%, var(--color-surface));
    color: color-mix(in srgb, var(--role-color, var(--color-primary)) 72%, var(--color-navy-900));
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    padding: 8px 16px;
    border-right: 0;
    box-shadow: inset 3px 0 0 var(--role-color, var(--color-primary));
}

.day-slots {
    display: grid;
    grid-template-columns: repeat(48, 1fr);
    gap: 1px;
    height: 24px;
    border-radius: var(--radius-xs);
    background: var(--color-surface-3);
    overflow: hidden;
    padding: 1px;
}
.slot {
    background: var(--color-white);
    cursor: default;
    transition: background var(--dur-fast) var(--ease-soft);
}
.slot:hover { background: var(--color-primary-soft); }
.planning[data-can-edit="1"] .slot { cursor: pointer; }
.slot.on {
    background: var(--member-color, var(--color-primary));
}
.slot:nth-child(4n) { box-shadow: inset -1px 0 0 var(--ink-a04); }

.abs-badge {
    color: var(--color-white);
    font-size: var(--fs-2xs);
    font-weight: 600;
    border-radius: var(--radius-xs);
    padding: 3px 6px;
    margin-bottom: 3px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.005em;
    box-shadow: 0 1px 3px var(--ink-a12);
}

/* ---------- Planning: day view ---------- */
.planning-day .col-day-single {
    width: auto;
    padding: 8px 14px;
}
.planning-day thead .col-day-single { padding: 10px 14px 12px; }

/* Harmonised member-row height across week & day views.
   Day: timeline 44px + 8px padding = 60px. Week content fits in the same
   box (it grows only when several shifts stack, which is unavoidable). */
.planning tbody .member-row > td { height: 60px; }
.day-hour-scale {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    width: 100%;
    color: var(--color-muted);
    font-size: var(--fs-2xs);
    font-weight: 500;
    letter-spacing: 0.005em;
    text-transform: none;
    font-variant-numeric: tabular-nums;
}
.day-hour-tick {
    text-align: left;
    padding-left: 2px;
    border-left: 1px dashed var(--color-border);
}
.day-hour-tick:first-child { border-left: 0; }
/* ---------- Day view: calendar timeline ---------- */
.day-timeline {
    position: relative;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--color-surface-3);
    cursor: cell;
    /* hour gridlines via repeating background — light dashed verticals */
    background-image: linear-gradient(to right,
        var(--ink-a06) 1px, transparent 1px);
    background-repeat: repeat-x;
    background-position: 0 0;
    background-size: calc(100% / 12) 100%;
}
.planning-day:not(.is-full-day) .day-timeline {
    background-size: calc(100% / 11.5) 100%;
}

/* Day view: under-staffed slot band rendered behind the shift blocks. */
.day-timeline-shortage {
    position: absolute;
    top: 0;
    bottom: 0;
    background: var(--color-danger-soft);
    border-radius: var(--radius-xs);
    pointer-events: none;
    z-index: 0;
}

.day-timeline-block {
    position: absolute;
    top: 4px;
    bottom: 4px;
    background: var(--member-color, var(--color-primary));
    color: var(--color-white);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 6px -2px var(--ink-a25);
    display: flex;
    align-items: center;
    justify-content: center;
    /* overflow:visible — let the .has-tooltip pseudo-elements render
       below the block. The label inside clips itself via flex + ellipsis. */
    cursor: grab;
    user-select: none;
    transition: box-shadow var(--dur-fast) var(--ease-soft),
                transform var(--dur-fast) var(--ease-soft);
    z-index: 1;
    /* Establish a container so the label can hide itself when the block
       gets too narrow to read the time range. */
    container-type: inline-size;
}

/* Hide the time label entirely (rather than showing truncated text) when
   the block isn't wide enough to fit "HH:MM – HH:MM" with breathing room. */
@container (max-width: 100px) {
    .day-timeline-block-label { display: none; }
}
.day-timeline-block:hover {
    box-shadow: 0 4px 10px -2px var(--ink-a35);
}
.day-timeline-block.is-dragging {
    cursor: grabbing;
    z-index: 3;
    box-shadow: 0 8px 16px -4px var(--ink-a35);
}
.day-timeline-block.is-clipped-left  {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    box-shadow: 0 2px 6px -2px var(--ink-a25),
                inset 12px 0 8px -8px var(--ink-a45);
}
.day-timeline-block.is-clipped-right {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 2px 6px -2px var(--ink-a25),
                inset -12px 0 8px -8px var(--ink-a45);
}
.day-timeline-block.is-clipped-left.is-clipped-right {
    box-shadow: 0 2px 6px -2px var(--ink-a25),
                inset 12px 0 8px -8px var(--ink-a45),
                inset -12px 0 8px -8px var(--ink-a45);
}

/* On the clipped side, beef up the handle into a "more content" affordance:
   wider, brighter, square-cornered, with a chevron pointing outward. */
.day-timeline-block.is-clipped-left .day-timeline-handle-left,
.day-timeline-block.is-clipped-right .day-timeline-handle-right {
    width: 14px;
    background: var(--white-a65);
    border-radius: 0;
}
.day-timeline-block.is-clipped-left .day-timeline-handle-left::after,
.day-timeline-block.is-clipped-right .day-timeline-handle-right::after {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--member-color, var(--color-primary));
    font-size: var(--fs-md);
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
}
.day-timeline-block.is-clipped-left .day-timeline-handle-left::after  { content: '‹'; }
.day-timeline-block.is-clipped-right .day-timeline-handle-right::after { content: '›'; }

.day-timeline-block-label {
    flex: 1;
    min-width: 0;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: -0.005em;
    font-variant-numeric: tabular-nums;
    padding: 0 10px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 0 var(--ink-a15);
    pointer-events: none;
}

.day-timeline-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    background: var(--white-a35);
    cursor: ew-resize;
    z-index: 2;
    transition: background var(--dur-fast) var(--ease-soft);
}
.day-timeline-handle:hover,
.day-timeline-block.is-dragging .day-timeline-handle {
    background: var(--white-a60);
}
.day-timeline-handle-left  { left:  0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.day-timeline-handle-right { right: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.day-timeline-handle::before {
    content: '';
    position: absolute;
    inset: 0 -4px;
}
@media (max-width: 820px) {
    .day-timeline-handle { width: 12px; }
    .day-timeline-handle::before { inset: 0 -8px; }
}

/* Two hour scales, only one visible per mode. */
.day-hour-scale-bounded {
    grid-template-columns: repeat(23, 1fr);
}
.day-hour-scale-bounded .day-hour-tick {
    border-left: 0;
    padding-left: 0;
}
.day-hour-scale-bounded .day-hour-tick-end {
    text-align: right;
    padding-right: 2px;
}
.planning-day:not(.is-full-day) .day-hour-scale-full,
.planning-day.is-full-day        .day-hour-scale-bounded {
    display: none;
}

.day-fullspan-toggle[aria-pressed="true"] {
    background: var(--color-primary-tint);
    border-color: var(--color-primary-soft);
    color: var(--color-primary-strong);
}

/* Transient feedback toast for drag-resize boundary events. */
.planning-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 14px);
    background: var(--color-text);
    color: var(--color-white);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: 500;
    letter-spacing: -0.005em;
    box-shadow: var(--shadow-lg);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--dur) var(--ease-out),
                transform var(--dur) var(--ease-out),
                visibility 0s linear 220ms;
}
.planning-toast.is-shown {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition: opacity var(--dur) var(--ease-out),
                transform var(--dur) var(--ease-out),
                visibility 0s linear 0s;
}

/* Member name + net work duration in the day-view first column.
   The name inherits `display: block` from the week rule above; its
   line-wrapping is measured from the text range, not from the box. */
.planning-day .col-member .member-name { font-weight: 600; }
.planning-day .col-member .member-day-net {
    display: block;
    margin-top: 2px;
    color: var(--color-muted);
    font-weight: 500;
    font-size: var(--fs-xs);
    font-variant-numeric: tabular-nums;
}

/* Day-view block hover / drag tooltip suppression is now handled by the
   JS floating-tooltip controller (via the is-block-hovered class and an
   active-drag check). No CSS pseudo-elements involved. */

/* ---------- Planning: month view ---------- */
.planning-month {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.planning-month-head {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--color-surface-2);
    border-bottom: 1px solid var(--color-border);
}
.planning-month-head-cell {
    padding: 12px 14px;
    font-size: var(--fs-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-muted);
    text-align: left;
    border-right: 1px solid var(--color-border);
}
.planning-month-head-cell:last-child { border-right: 0; }

.planning-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(120px, auto);
}
.planning-month-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
    transition: background var(--dur-fast) var(--ease-soft);
    overflow: hidden;
}
.planning-month-cell:nth-child(7n) { border-right: 0; }
.planning-month-cell:hover {
    background: var(--color-surface-2);
    text-decoration: none;
    color: var(--color-text);
}
.planning-month-cell.is-out { background: var(--color-surface-2); }
.planning-month-cell.is-out .planning-month-day { color: var(--color-faint); }
.planning-month-cell.is-out .planning-month-chip { opacity: .55; }
.planning-month-cell.is-weekend { background: var(--color-weekend); }
.planning-month-cell.is-under-staffed,
.planning-month-cell.is-under-staffed.is-weekend,
.planning-month-cell.is-under-staffed.is-out {
    background: var(--color-danger-soft);
}

/* Holiday + closed-day highlighting (planning views) ---------- */
.planning-month-cell.is-holiday {
    background: repeating-linear-gradient(
        135deg,
        var(--c-eab308-a10) 0 8px,
        var(--c-eab308-a04) 8px 16px
    );
}
.planning-month-cell.is-closed {
    background: var(--slate-a10);
}
.planning-month-cell.is-holiday.is-closed {
    background: var(--slate-a10),
                repeating-linear-gradient(135deg,
                var(--c-eab308-a12) 0 8px,
                var(--c-eab308-a04) 8px 16px);
}

.planning .col-day.is-holiday {
    background: var(--c-eab308-a08);
}
.planning .col-day.is-closed {
    background: var(--slate-a10);
}

/* Small inline tags shown in headers / month cells */
.col-day-tag,
.planning-month-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-3xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
    /* The cell clips its overflow, so a long tag (FERMÉE EXCEPTIONNELLEMENT,
       a holiday name) used to be cut mid-word with no indication. */
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.col-day-tag-holiday,
.planning-month-tag-holiday {
    background: var(--c-eab308-a16);
    color: var(--color-warning);
}
.col-day-tag-closed,
.planning-month-tag-closed {
    background: var(--slate-a18);
    color: var(--color-text-soft);
}
.planning-month-cell.is-today {
    background: var(--color-primary-tint);
    box-shadow: inset 0 0 0 2px var(--color-primary);
}
/* Round only the bottom corners when the today cell sits at the very
   bottom of the calendar grid, so the green outline matches the
   container's rounded outer edge. Top-row cells stay rectangular
   because the calendar's day-header bar covers the top edge. */
.planning-month-grid .planning-month-cell.is-today:nth-last-child(7) {
    border-bottom-left-radius: var(--radius-lg);
}
.planning-month-grid .planning-month-cell.is-today:last-child {
    border-bottom-right-radius: var(--radius-lg);
}
.planning-month-cell.is-today .planning-month-day {
    color: var(--color-primary-strong);
    font-weight: 700;
}

.planning-month-day {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--color-text-soft);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.planning-month-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}
.planning-month-chip {
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    line-height: 1.2;
    overflow: hidden;
    box-shadow: 0 1px 2px var(--ink-a10);
    min-width: 0;
}
.planning-month-chip .chip-name {
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: -0.005em;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.planning-month-chip .chip-hours {
    font-size: var(--fs-3xs);
    font-weight: 500;
    opacity: .92;
    font-variant-numeric: tabular-nums;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Grouped chip: employees sharing a role and a net working time are shown
   once, with the head-count spanning both lines.
     ┌───┬───────────────┐
     │ 3 │ Pharmaciens   │
     │   │ 10 h          │
     └───┴───────────────┘ */
.planning-month-chip.is-group {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "count name"
        "count hours";
    align-items: center;
    column-gap: 7px;
    row-gap: 0;
}
.planning-month-chip.is-group .chip-count {
    grid-area: count;
    align-self: center;
    font-size: var(--fs-md);
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    padding-right: 7px;
    border-right: 1px solid var(--white-a45);
}
.planning-month-chip.is-group .chip-name  { grid-area: name; }
.planning-month-chip.is-group .chip-hours { grid-area: hours; }

.planning-month-chip.is-absent {
    display: block;
    font-size: var(--fs-2xs);
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.005em;
    opacity: .9;
}

/* ---------- Planning: week view (shift-based) ---------- */
.planning-week .col-day { vertical-align: top; padding: 6px 8px; }
.planning-week[data-can-edit="1"] tbody .col-day {
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-soft),
                box-shadow var(--dur-fast) var(--ease-soft);
}
.planning-week[data-can-edit="1"] tbody .col-day:hover,
.planning-week[data-can-edit="1"] tbody .col-day.weekend:hover {
    background: color-mix(in srgb, var(--member-color, var(--color-primary)) 9%, var(--color-surface));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--member-color, var(--color-primary)) 40%, var(--color-surface));
}

.day-shifts {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: var(--fs-xs);
    line-height: 1.2;
    min-height: 18px;
}
.shift-chip {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    background: var(--color-surface-3);
    color: var(--color-text);
    border-left: 3px solid var(--member-color, var(--color-primary));
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: -0.005em;
}
.shift-empty { color: var(--color-faint); font-size: var(--fs-md); padding-left: 2px; }
.day-total {
    margin-top: 5px;
    font-size: var(--fs-2xs);
    font-weight: 500;
    color: var(--color-muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}
.day-bar {
    display: grid;
    grid-template-columns: repeat(23, 1fr); /* 08:30 → 20:00, half-hour ticks */
    height: 4px;
    margin-top: 5px;
    border-radius: 2px;
    background: var(--color-surface-3);
    overflow: hidden;
    pointer-events: none;
}
.bar-tick { background: transparent; }
.bar-tick.on { background: var(--member-color, var(--color-primary)); }

/* ---------- Planning: shift editor modal ---------- */
.planning-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--ink-a50);
    display: flex;
    align-items: safe center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
    animation: pmOverlayIn var(--dur-fast) var(--ease-out);
}
@keyframes pmOverlayIn { from { opacity: 0; } to { opacity: 1; } }
.planning-modal {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    margin: auto;
    overflow: visible;
    animation: pmModalIn var(--dur) var(--ease-out);
}
@keyframes pmModalIn {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
/* Exit (symmetric to the entrance). */
.planning-modal-overlay.is-closing { animation: pmOverlayOut var(--dur) var(--ease-out) both; }
.planning-modal-overlay.is-closing .planning-modal { animation: pmModalOut var(--dur) var(--ease-out) both; }
@keyframes pmOverlayOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes pmModalOut {
    from { opacity: 1; transform: none; }
    to   { opacity: 0; transform: translateY(6px) scale(.98); }
}
.planning-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}
.planning-modal .modal-header h3 {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.01em;
}
.planning-modal .modal-title-group { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.planning-modal .modal-subtitle {
    margin: 0;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--color-muted);
    letter-spacing: -0.005em;
}
.planning-modal .modal-close {
    background: transparent;
    border: 0;
    font-size: var(--fs-22);
    line-height: 1;
    cursor: pointer;
    color: var(--color-muted);
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: background var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft);
}
.planning-modal .modal-close:hover { background: var(--color-surface-3); color: var(--color-text); }
.planning-modal .modal-close:focus,
.planning-modal .modal-close:focus-visible { outline: none; box-shadow: none; }
.planning-modal .modal-body { padding: 18px 20px 20px; }

/* Reassign-then-delete role modal */
.rdm-intro { margin: 0 0 14px; color: var(--color-text-soft); line-height: 1.5; }
.rdm-members {
    margin: 0 0 16px;
    padding: 10px 14px;
    list-style: none;
    max-height: 150px;
    overflow: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-2, color-mix(in srgb, var(--color-text-soft) 5%, transparent));
}
.rdm-members li {
    padding: 3px 0;
    font-size: var(--fs-sm);
    color: var(--color-text);
}
.rdm-members li + li { border-top: 1px solid var(--color-border); }
.rdm-field { display: flex; flex-direction: column; gap: 6px; }
.rdm-field > span {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--color-text-soft);
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* ---------- Custom confirm modal ---------- */
.confirm-modal { max-width: 480px; }
.confirm-body {
    color: var(--color-text);
    font-size: var(--fs-md);
    line-height: 1.5;
}
.confirm-line { margin: 0 0 8px; }
.confirm-line:last-child { margin-bottom: 0; }
.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}
.confirm-warning .modal-header h3 {
    color: var(--color-warning);
}
/* Match the "Invitation envoyée" pill — soft amber on tinted background. */
.confirm-warning .confirm-ok,
.confirm-warning .confirm-ok:hover,
.confirm-warning .confirm-ok:focus {
    background: var(--c-eab308-a14);
    color: var(--color-warning);
    border: 1px solid var(--c-eab308-a35);
    box-shadow: none;
}
.confirm-warning .confirm-ok:hover {
    background: var(--c-eab308-a22);
}
/* Destructive variant — for irreversible bulk actions. */
.confirm-danger .modal-header h3 { color: var(--color-danger); }
.confirm-danger .confirm-ok,
.confirm-danger .confirm-ok:focus {
    background: var(--color-danger);
    color: var(--color-white);
    border: 1px solid var(--color-danger);
    box-shadow: none;
}
.confirm-danger .confirm-ok:hover {
    background: var(--color-danger);
    color: var(--color-white);
    filter: brightness(.93);
}

/* Réglages → Planning: employee scope for the bulk clear. */
.planning-clear-scope {
    border: 0;
    padding: 0;
    margin: 4px 0 6px;
}
.planning-clear-scope > legend {
    padding: 0;
    margin-bottom: 8px;
}
.planning-clear-members {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface-2, var(--color-surface));
}
.planning-clear-role {
    margin: 0 0 6px;
    font-size: var(--fs-2xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-soft);
}
.planning-clear-role-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 4px 14px;
    margin-bottom: 12px;
}
.planning-clear-role-list:last-of-type { margin-bottom: 0; }
.planning-clear-member {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 2px;
    font-size: var(--fs-sm);
    cursor: pointer;
    min-width: 0;
}
.planning-clear-member > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.planning-clear-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    flex: 0 0 auto;
}
.planning-clear-none { margin: 8px 0 0; color: var(--color-danger); }

/* Réglages → Planning: the opt-in that also removes the weekly templates. */
.planning-clear-templates {
    margin: 14px 0 4px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--color-danger) 30%, var(--color-border));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--color-danger) 4%, transparent);
}
.planning-clear-templates .cap-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
}
.planning-clear-templates .hint { margin: 8px 0 0; }

/* Réglages → Planning: date range for the bulk clear. */
.planning-clear-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-end;
    margin: 4px 0 6px;
}
.planning-clear-fields .hours-field { flex: 0 0 200px; }
.settings-danger-note { margin: 0 0 10px; }
@media (max-width: 640px) {
    .planning-clear-fields .hours-field { flex: 1 1 100%; }
}

.shifts-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.shifts-empty {
    margin: 0;
    padding: 14px;
    text-align: center;
    background: var(--color-surface-2);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius);
    font-size: var(--fs-sm);
    animation: emptyStateIn var(--dur-slow) var(--ease-out) both;
}
.list-no-results:not([hidden]) td,
.list-empty td { animation: emptyStateIn var(--dur-slow) var(--ease-out) both; }
@keyframes emptyStateIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}
.shift-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.shift-row .shift-time {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    font-size: var(--fs-md);
    letter-spacing: -0.005em;
}
.shift-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.shift-row .shift-duration { font-size: var(--fs-xs); }

.shift-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
    background: var(--color-primary-tint);
    color: var(--color-primary-strong);
    border-radius: var(--radius);
    font-size: var(--fs-sm);
    margin-bottom: 16px;
}
.shift-total > span { font-variant-numeric: tabular-nums; }
.shift-total strong { font-weight: 600; margin-right: 4px; }

/* Pause field — sits on the same row as Début/Fin, pushed to the far end
   and tinted so it reads as a duration rather than a time of day. */
.shift-add-fields .shift-pause-field { margin-left: auto; }
.shift-add-fields .shift-pause-field > span { color: var(--color-primary-strong); }
.shift-add-fields .shift-pause-field .time-stepper {
    background: var(--color-primary-tint);
    border-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-border));
}
.shift-add-fields .shift-pause-field .time-stepper:focus-within {
    border-color: var(--color-primary);
}

.shift-add {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}
.shift-add[hidden] { display: none; }
/* "Ajouter une plage horaire" — reveals the collapsed add form. */
.btn-add-range {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    padding-top: 8px;
    padding-bottom: 8px;
    width: 100%;
    justify-content: center;
    border-style: dashed;
}
.btn-add-range svg { flex-shrink: 0; }

.shift-add-fields {
    display: flex;
    justify-content: flex-start;
    align-items: end;
    gap: 6px;
    border-radius: var(--radius);
}
/* Flash applied when switching the form into "edit this range" mode. */
.shift-add-fields.is-edit-flash {
    animation: shiftEditFlash var(--dur-pulse) var(--ease-out, var(--ease-out));
}
@keyframes shiftEditFlash {
    0%   { box-shadow: 0 0 0 0 var(--primary-a00); background: var(--primary-a00); }
    25%  { box-shadow: 0 0 0 4px var(--primary-a22); background: var(--primary-a10); }
    100% { box-shadow: 0 0 0 0 var(--primary-a00); background: var(--primary-a00); }
}
@media (prefers-reduced-motion: reduce) {
    .shift-add-fields.is-edit-flash { animation: none; }
}
.shift-add-fields > label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.shift-add-fields > label > span {
    font-size: var(--fs-2xs);
    font-weight: 600;
    color: var(--color-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
}
.shift-add-hint {
    margin: 0;
    font-size: var(--fs-xs);
    color: var(--color-muted);
}
.shift-add-warning {
    margin: 0;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--c-eab308-a12);
    color: var(--color-warning);
    font-size: var(--fs-xs);
    line-height: 1.35;
    border: 1px solid var(--c-eab308-a35);
}

/* Tighter, time-tuned variant of the custom select for use in modals */
.select-wrap.is-compact .select-dot,
.select-wrap.is-compact .select-option-dot.is-empty { display: none; }
.select-wrap.is-compact .select-trigger {
    padding: 0 14px;
    height: 40px;
    font-variant-numeric: tabular-nums;
    font-size: var(--fs-md);
    font-weight: 500;
}
.select-wrap.is-compact .select-option {
    padding: 8px 12px;
    font-variant-numeric: tabular-nums;
    font-size: var(--fs-sm);
}
.select-wrap.is-compact .select-panel {
    max-height: 240px;
    padding: 4px;
}

.shift-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}
.shift-actions .btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 640px) {
    .planning-modal { max-width: 100%; border-radius: var(--radius); }
    .shift-row { grid-template-columns: 1fr auto; }
    .shift-row .shift-duration { grid-column: 1 / -1; }
}

/* ---------- Home page ---------- */
.home-hero {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 28px;
    padding: 32px 36px;
    margin-bottom: 28px;
    background:
        radial-gradient(700px 280px at 90% -20%, var(--c-14b8a6-a14), transparent 60%),
        radial-gradient(500px 220px at 0% 110%, var(--primary-a08), transparent 60%),
        var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    animation: heroFadeIn var(--dur-slower) var(--ease-out);
}
@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.home-hero-text { min-width: 260px; flex: 1; }
.home-eyebrow {
    margin: 0 0 8px;
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-primary);
}
.home-greeting {
    margin: 0;
    font-size: var(--fs-32);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--color-text);
    line-height: 1.15;
}
.home-greeting-name { color: var(--color-primary); }
.home-subtitle {
    margin: 10px 0 0;
    font-size: var(--fs-md);
    color: var(--color-muted);
    max-width: 520px;
}

.home-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(110px, 1fr));
    gap: 12px;
    align-self: center;
}
.home-stat {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 18px;
    min-width: 110px;
    text-align: center;
    transition: transform var(--dur-fast) var(--ease-soft),
                border-color var(--dur-fast) var(--ease-soft);
    animation: homeTileIn var(--dur-slower) var(--ease-emph) both;
}
.home-hero-stats .home-stat:nth-child(1) { animation-delay: calc(var(--stagger-tile) * 1); }
.home-hero-stats .home-stat:nth-child(2) { animation-delay: calc(var(--stagger-tile) * 2); }
.home-hero-stats .home-stat:nth-child(3) { animation-delay: calc(var(--stagger-tile) * 3); }
@keyframes homeTileIn {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}
.home-stat:hover { transform: translateY(-2px); border-color: var(--color-border-strong); }
.home-stat-accent {
    background: var(--color-primary-tint);
    border-color: var(--color-primary-soft);
}
.home-stat-value {
    display: block;
    font-size: var(--fs-26);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.025em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.home-stat-accent .home-stat-value { color: var(--color-primary-strong); }
.home-stat-label {
    display: block;
    margin-top: 6px;
    font-size: var(--fs-2xs);
    font-weight: 500;
    color: var(--color-muted);
    letter-spacing: 0.005em;
}

.home-actions {
    display: grid;
    /* `min()` et non `280px` seul : sur un écran de 320 px, une colonne de
       280 px déborde et la grille ne peut plus se replier. */
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 14px;
}
.home-action {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text);
    box-shadow: var(--shadow-xs);
    text-decoration: none;
    /* Exit transition: settles back smoothly when leaving */
    transition: transform var(--dur-slow) var(--ease-soft),
                box-shadow var(--dur-slow) var(--ease-soft),
                border-color var(--dur-slow) var(--ease-soft),
                background var(--dur-slow) var(--ease-soft);
    animation: homeTileIn var(--dur-slower) var(--ease-emph) both;
}
/* Staggered entrance. The base delay is the first tile's, not zero, so a card
   added later joins the end of the sequence instead of preceding it: only
   three delays were listed here, and the fourth and fifth cards ran at 0ms,
   finishing before the first had begun. The tail is clamped the same way the
   table rows are. */
/* Picks up where the hero stats leave off (3 tiles x --stagger-tile), then
   keeps the same step. The last card used to start at 800ms, so the row read
   as still loading well after the page had settled. */
.home-actions .home-action              { animation-delay: calc(var(--stagger-tile) * 4); }
.home-actions .home-action:nth-child(2) { animation-delay: calc(var(--stagger-tile) * 5); }
.home-actions .home-action:nth-child(3) { animation-delay: calc(var(--stagger-tile) * 6); }
.home-actions .home-action:nth-child(4) { animation-delay: calc(var(--stagger-tile) * 7); }
.home-actions .home-action:nth-child(5) { animation-delay: calc(var(--stagger-tile) * 8); }
.home-actions .home-action:nth-child(6) { animation-delay: calc(var(--stagger-tile) * 9); }
.home-actions .home-action:nth-child(n+7) { animation-delay: calc(var(--stagger-tile) * 10); }
.home-action:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-soft);
    text-decoration: none;
    color: var(--color-text);
    /* Entry transition: snappier, with a soft overshoot easing */
    transition: transform var(--dur-slow) var(--ease-out),
                box-shadow var(--dur-slow) var(--ease-out),
                border-color var(--dur) var(--ease-out),
                background var(--dur) var(--ease-out);
}
.home-action-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    background: var(--color-primary-tint);
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--dur-slow) var(--ease-soft),
                color var(--dur-slow) var(--ease-soft),
                transform var(--dur-slow) var(--ease-soft);
}
.home-action:hover .home-action-icon {
    background: var(--color-primary);
    color: var(--color-white);
    transform: scale(1.08);
    transition: background var(--dur-slow) var(--ease-out),
                color var(--dur-slow) var(--ease-out),
                transform var(--dur-slower) var(--ease-out);
}
.home-action-body { flex: 1; min-width: 0; }
.home-action-body h3 {
    margin: 0 0 4px;
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
}
.home-action-body p {
    margin: 0;
    font-size: var(--fs-xs);
    color: var(--color-muted);
    line-height: 1.4;
}
.home-action-arrow {
    color: var(--color-faint);
    font-size: var(--fs-18);
    transition: transform var(--dur-slow) var(--ease-soft),
                color var(--dur-slow) var(--ease-soft);
}
.home-action:hover .home-action-arrow {
    transform: translateX(6px);
    color: var(--color-primary);
    transition: transform var(--dur-slower) var(--ease-out),
                color var(--dur) var(--ease-out);
}

/* ---------- Footer ---------- */
.app-footer {
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    padding: 18px 24px;
}
.footer-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--fs-xs);
    color: var(--color-muted);
    max-width: 1400px;
    margin: 0 auto;
}
.footer-brand { font-weight: 600; color: var(--color-text-soft); }
.footer-sep { color: var(--color-faint); }
.footer-tagline { color: var(--color-muted); }
.footer-spacer { flex: 1; }
.footer-meta { color: var(--color-faint); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .topbar-pharmacy { display: none; }
    .topbar-user { display: none; }
    .top-bar { padding: 0 14px; gap: 12px; }

}

@media (max-width: 820px) {
    .brand { display: none; }
    .topbar-nav-item { padding: 7px 10px; font-size: var(--fs-sm); }
}

@media (max-width: 640px) {
    .planning-toolbar { font-size: var(--fs-sm); padding: 12px; }
    .planning-week-label { width: 100%; text-align: center; order: -1; }
    .planning-view-switcher { width: 100%; justify-content: center; }
    .planning-view-tab { flex: 1; text-align: center; }
    .auth-card { padding: 28px 22px; }
    .data-table th, .data-table td { padding: 10px 12px; }
    .card { padding: 18px 20px; }
    .card-value { font-size: var(--fs-26); }
    .page-header h2 { font-size: var(--fs-20); }
    .footer-inner { flex-wrap: wrap; gap: 6px; }
    .home-hero { padding: 24px; }
    .home-greeting { font-size: var(--fs-26); }
    .planning-month-grid { grid-auto-rows: minmax(80px, auto); }
    .planning-month-cell { padding: 6px 8px; }
    .planning-month-head-cell { padding: 8px; font-size: var(--fs-3xs); }
    .planning-month-chip { font-size: var(--fs-3xs); padding: 2px 6px; }
}

/* ---------- Settings layout & sub-nav ---------- */
.settings-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    margin-top: 18px;
}
.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: var(--color-surface, var(--color-white));
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    position: sticky;
    /* Se cale sous la barre fixe, avec le même blanc que le haut du contenu. */
    top: calc(var(--topbar-h) + 16px);
}
.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--color-text);
    font-size: var(--fs-md);
    font-weight: 500;
    transition: background var(--dur-fast) var(--ease-soft), color var(--dur-fast) var(--ease-soft);
}
.settings-nav-item:hover { background: var(--primary-a07); }
.settings-nav-item.is-active {
    background: var(--primary-a12);
    color: var(--color-primary);
    font-weight: 600;
}
.settings-nav-item svg { flex-shrink: 0; color: currentColor; }

.settings-content { min-width: 0; }
.settings-section-head {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-border);
}
.settings-section-head h3 {
    margin: 0 0 4px;
    font-size: var(--fs-20);
    font-weight: 700;
    color: var(--color-text);
}
.settings-section-head .hint { margin: 0; padding: 0; background: transparent; border: 0; }

@media (max-width: 820px) {
    .settings-layout { grid-template-columns: 1fr; }
    .settings-nav {
        flex-direction: row;
        overflow-x: auto;
        position: static;
        padding: 6px;
    }
    .settings-nav-item { white-space: nowrap; }
}

/* ---------- Settings · editable info card ---------- */
.info-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}
.info-card-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.info-card-display[hidden] { display: none; }
.info-card-label {
    font-size: var(--fs-2xs);
    font-weight: 700;
    color: var(--color-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.info-card-value {
    display: inline-block;
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    background: var(--color-primary-tint);
    border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);
    color: var(--color-primary-strong);
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: -0.005em;
}
.info-card-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.info-card-form[hidden] { display: none; }
.info-card-form > label > span {
    display: block;
    font-size: var(--fs-2xs);
    font-weight: 700;
    color: var(--color-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.info-card-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ---------- Settings · pharmacy hours ---------- */
.hours-form .data-table { margin: 8px 0 0; }
.hours-table th, .hours-table td { vertical-align: middle; }
.hours-table .hours-col-open { width: 110px; text-align: center; }
.hours-table select[data-time] { min-width: 100px; }
.hours-pause-input {
    width: 90px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: var(--fs-md);
    font-variant-numeric: tabular-nums;
    transition: border-color var(--dur) var(--ease-soft), box-shadow var(--dur) var(--ease-soft);
}
.hours-pause-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--ring-focus);
}
.hours-section-title {
    margin: 0 0 6px;
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--color-text);
}

.hours-holiday-row {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 18px;
    margin-top: 12px;
}
.hours-holiday-row .hours-field { min-width: 0; }

.hours-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 600;
}
.hours-status-open {
    background: var(--c-10b981-a12);
    color: var(--color-success);
}
.hours-status-closed {
    background: var(--c-ef4444-a12);
    color: var(--color-danger-strong);
}
.hours-holiday-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--primary-a10);
    color: var(--color-primary);
    font-size: var(--fs-2xs);
    font-weight: 600;
}

.hours-add-override {
    margin-top: 14px;
    padding: 14px 18px 16px;
    background: var(--color-surface-soft);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}
.hours-add-override > summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text);
    padding: 4px 0;
}
.hours-override-form {
    display: grid;
    grid-template-columns: minmax(0, 260px) minmax(0, 260px);
    gap: 14px 18px;
    margin-top: 14px;
    align-items: end;
}
.hours-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.hours-field-label {
    font-size: var(--fs-2xs);
    font-weight: 600;
    color: var(--color-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    /* The field wrapper is sometimes a <label> and sometimes a <div>; the
       global `label > span` margin would otherwise push the label of the
       <label> variants 6px higher than its neighbours in the same row.
       The column gap alone handles the spacing. */
    margin-bottom: 0;
}
.hours-field > input,
.hours-field > select,
.hours-field > .select-wrap,
.hours-field > .time-field {
    width: 100%;
}
/* ---------- Settings: reset-to-defaults danger zone ---------- */
.settings-danger {
    margin-top: 24px;
    border-color: color-mix(in srgb, var(--color-danger) 35%, var(--color-border));
}
.settings-danger-title {
    margin: 0 0 6px;
    font-size: var(--fs-lg);
    font-weight: 650;
    color: var(--color-danger);
}
.settings-danger-lead,
.settings-danger-safe { margin: 0 0 10px; }
/* .form-card is a flex column, so buttons would otherwise stretch edge to edge. */
.settings-danger > .btn { align-self: flex-start; }
.settings-danger-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 4px;
    max-width: 420px;
}
.settings-danger-form > label > span { font-size: var(--fs-xs); }
.settings-danger-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Dimmed state for a field whose toggle is off (e.g. the under-staffing
   threshold when the detection is disabled). */
.hours-field.is-disabled,
.hint.is-muted-off {
    opacity: 0.45;
    transition: opacity var(--dur-fast) var(--ease-soft);
}

/* Réglages → Sous-effectif: keep the toggle roomy and give the threshold
   dropdown a stable width so the row doesn't jump between values. */
.staffing-row .hours-field-toggle { flex: 0 1 auto; }
.staffing-row .hours-field-threshold { flex: 0 0 auto; }

/* Numeric threshold with its unit rendered inside the field, so the whole
   control reads as one input matching the other settings fields. */
.staffing-threshold {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Match the switch and the enhanced selects so every field label in
       the row sits on the same line. */
    height: 40px;
    margin-bottom: 0; /* neutralise the global `label > span` margin */
}
.hours-field > .staffing-threshold { width: auto; }
.staffing-threshold > input[type=number] {
    width: 84px;
    height: 100%;
    padding-top: 0;
    padding-bottom: 0;
    text-align: center;
    font-variant-numeric: tabular-nums;
    /* Native spinners render inconsistently across browsers and clash with
       the design system — keyboard entry only, like the app's other
       numeric fields. */
    -moz-appearance: textfield;
    appearance: textfield;
}
.staffing-threshold > input[type=number]::-webkit-inner-spin-button,
.staffing-threshold > input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.staffing-threshold-unit {
    font-size: var(--fs-md);
    color: var(--color-text-soft);
    white-space: nowrap;
}
@media (max-width: 640px) {
    .staffing-row .hours-field-threshold { flex: 1 1 100%; }
}
.hours-field-action {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 4px;
}
.hours-field-action .btn { white-space: nowrap; }
/* Vertically center the toggle on the same baseline as the inputs. */
.hours-field .switch-toggle {
    height: 40px;
    padding: 0 4px;
}

.hours-inline-override {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.hours-sep { color: var(--color-text-soft); padding-bottom: 0; }

@media (max-width: 640px) {
    .hours-override-form { grid-template-columns: 1fr; }
    .hours-field-action { justify-self: stretch; }
    .hours-field-action .btn { width: 100%; }
}

/* Segmented toggle (Ouverture / Fermeture exception choice) */
.seg-toggle {
    display: inline-flex;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-surface);
}
.seg-toggle .seg-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.seg-toggle .seg-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.seg-toggle .seg-option span {
    display: block;
    padding: 8px 16px;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--color-text-soft);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-soft), color var(--dur-fast) var(--ease-soft);
}
.seg-toggle .seg-option + .seg-option span { border-left: 1px solid var(--color-border); }
.seg-toggle .seg-option input:checked + span {
    background: var(--color-primary);
    color: var(--color-white);
}

/* Switch toggle */
.switch-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
/* The switch draws its own track, so the native box is collapsed — the
   border/appearance resets keep the global checkbox styling from leaving a
   sliver behind. */
.switch-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    border: 0;
    appearance: none;
    pointer-events: none;
}
.switch-track {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    background: var(--color-gray-300);
    border-radius: var(--radius-pill);
    transition: background var(--dur-fast) var(--ease-soft);
}
.switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--color-white);
    border-radius: 50%;
    transition: transform var(--dur-fast) var(--ease-soft);
    box-shadow: 0 1px 3px var(--black-a18);
}
.switch-toggle input:checked + .switch-track {
    background: var(--color-primary);
}
.switch-toggle input:checked + .switch-track::after {
    transform: translateX(16px);
}
.switch-toggle input:focus-visible + .switch-track {
    box-shadow: 0 0 0 2px var(--primary-a35);
}
.switch-toggle-inline .switch-label {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--color-text);
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--color-text-soft);
    padding: 6px 8px;
    font-size: var(--fs-xs);
    cursor: pointer;
}
.btn-text:hover { color: var(--color-text); text-decoration: underline; }

.btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-with-icon > svg { flex-shrink: 0; }

/* Template-edit affordance (Équipe > Actions) — subtle teal background +
   small calendar icon, distinct from the neutral .btn-outline so the user
   immediately distinguishes "modèle hebdo" from "modifier la fiche". */
.btn-tpl {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-primary-tint);
    color: var(--color-primary-strong);
    border: 1px solid color-mix(in srgb, var(--color-primary) 28%, transparent);
}
.btn-tpl:hover {
    background: color-mix(in srgb, var(--color-primary) 14%, transparent);
    color: var(--color-primary-strong);
    border-color: color-mix(in srgb, var(--color-primary) 42%, transparent);
}
.btn-tpl svg { color: var(--color-primary); }

/* ---------- Member manager / gestionnaire ---------- */
.employee-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}
.employee-badge-titulaire {
    background: var(--primary-a14);
    color: var(--color-primary);
}

/* Highlight the row of the pharmacy's titulaire — soft teal background +
   colored left border so they stand out among the team. */
/* ---------- Accès aux modules ---------- */
/* Une colonne par module, étroite et centrée : la lecture se fait en balayant
   une ligne, pas en déchiffrant des libellés répétés. */
.access-table th[scope="col"]:not(:first-child),
.access-table tbody td { text-align: center; width: 1%; white-space: nowrap; }
.access-table tbody th[scope="row"] { text-align: left; font-weight: 600; }
.access-table tbody th[scope="row"] .muted {
    display: block;
    font-size: var(--fs-2xs);
    font-weight: 400;
}
.access-table th[scope="col"] .pill { margin-left: var(--sp-3); }
/* L'interrupteur partagé mesure 36×20 : sous le minimum WCAG de 24 px de haut
   pour un pointeur fin. On agrandit la zone cliquable ici, par le rembourrage
   du label, sans toucher au composant lui-même — il est employé ailleurs, et
   le redimensionner déborderait de ce chantier. */
.access-table .switch-toggle { padding-block: var(--sp-3); }
.access-table + .form-actions { margin-top: var(--sp-7); }

.members-table tr.is-titulaire-row > td {
    background: var(--primary-a04);
}
.members-table tr.is-titulaire-row > td:first-child {
    position: relative;
    box-shadow: inset 3px 0 0 var(--color-primary);
}
.members-table tr.is-titulaire-row .employee-name {
    font-weight: 700;
}
.employee-badge-manager {
    background: var(--c-3b82f6-a14);
    color: var(--color-link-blue);
}

.member-manager .manager-toggle { margin-top: 8px; }
.member-manager .manager-caps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 18px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}
.member-manager .cap-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-sm);
    color: var(--color-text);
}
@media (max-width: 820px) {
    .member-manager .manager-caps { grid-template-columns: 1fr; }
}

/* ---------- Member account status ---------- */
.member-account { white-space: nowrap; }
.member-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 600;
}
.member-status-active {
    background: var(--c-10b981-a12);
    color: var(--color-success);
}
.member-status-pending {
    background: var(--c-eab308-a14);
    color: var(--color-warning);
}
.member-status-none {
    background: var(--slate-a12);
    color: var(--color-text-soft);
}
.member-status-meta {
    margin: 4px 0 6px;
    font-size: var(--fs-xs);
    color: var(--color-text-soft);
}

/* ============================================================
   Responsive overhaul — consolidated breakpoints
   (tablet ≤ 1024, large phone ≤ 768, phone ≤ 560, small ≤ 380)
   ============================================================ */

/* Dense desktop: first gutter step down from the 36px base. */
@media (max-width: 1280px) {
    .content { padding-left: 28px; padding-right: 28px; }
}

/* Tablet & small laptops */
@media (max-width: 1024px) {
    .content { padding: calc(var(--topbar-h) + 12px) 20px 60px; }
    .planning-filter-panel { width: 300px; }
}

/* Large phones / small tablets */
@media (max-width: 820px) {
    :root { --topbar-h: 56px; }
    .top-bar { padding: 0 12px; gap: 10px; }
    .topbar-nav { margin-left: 0; }
    .content { padding: calc(var(--topbar-h) + 10px) 16px 56px; }

    .page-header { gap: 12px; margin-bottom: 18px; }
    .page-header h2 { font-size: var(--fs-20); }
    .page-header .btn { width: 100%; }
    .page-header > div { width: 100%; }

    /* Toolbars wrap cleanly and their action groups span the row. */
    .planning-toolbar { padding: 12px 14px; }
    .planning-nav, .planning-exports { flex: 0 0 auto; }

    /* Settings: sub-nav already stacks (≤840); tighten the content. */
    .settings-content { min-width: 0; }

    /* Forms collapse to a single column. */
    .form-card, .form-card-wide { padding: 18px 16px; }
    .grid-form,
    .form-card-wide .grid-form,
    .form-card-cols-4 .grid-form { grid-template-columns: 1fr; }

    /* Équipe filter chips + toolbar stay tidy. */
    .list-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
    /* flex-basis follows the main axis: once the toolbar stacks, the 470px
       basis sized for the placeholder became the field's HEIGHT, opening a
       470px void between the search box and the role filters. */
    .list-search-wrap { width: 100%; flex: 0 0 auto; }

    /* Member action buttons wrap instead of overflowing. */
    .members-table td.actions { display: flex; flex-wrap: wrap; gap: 6px; }

    /* Wide data tables (hours, members, roles) scroll inside their card. */
    .hours-form, .form-card-wide { overflow-x: auto; }
}

/* Phones */
@media (max-width: 640px) {
    .content { padding-left: 12px; padding-right: 12px; }

    /* The shift-add fields wrap (Début/Fin then Pause). */
    .shift-add-fields { flex-wrap: wrap; }
    .shift-add-fields .shift-pause-field { margin-left: 0; }

    /* Confirm + editor modals use the full width. */
    .confirm-modal, .planning-modal { max-width: 100%; }
    .planning-modal-overlay { padding: 12px; }

    /* Filter popover: anchor to the screen, comfortable width. */
    .planning-filter { position: static; }
    .planning-filter-panel {
        position: fixed;
        top: auto;
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-width: none;
        max-height: 70vh;
        display: flex;
        flex-direction: column;
    }
    .planning-filter-scroll { max-height: none; flex: 1; }

    /* Home hero stacks. */
    .home-hero { flex-direction: column; align-items: flex-start; gap: 18px; }
    .home-hero-stats { width: 100%; }
    .home-actions { grid-template-columns: 1fr; }

    /* Roles/Équipe tables: trim horizontal padding. */
    .data-table th, .data-table td { padding: 10px; }
}

/* Very small phones */
@media (max-width: 400px) {
    .topbar-nav-item { padding: 7px 9px; font-size: var(--fs-xs); }
    .page-header h2 { font-size: var(--fs-18); }
    .btn { padding: 9px 14px; }
}

/* ---------- Phone: list tables become cards ----------
   Below 640px the list tables no longer fit: /members overflowed its
   container by 427px, /absences by 337px, /roles by 211px. The overflow was
   clipped rather than scrollable, so whole columns — including the action
   buttons — were unreachable on a phone. Each row becomes a card and each
   cell a labelled line. The settings hours tables keep their grid shape:
   they are a matrix of time fields, and stacking them would lose the
   day-to-day comparison that is the point of the screen. */
@media (max-width: 640px) {
    .data-table:not(.hours-table),
    .data-table:not(.hours-table) tbody { display: block; }
    .data-table:not(.hours-table) thead { display: none; }

    .data-table:not(.hours-table) tbody tr {
        display: block;
        margin-bottom: var(--sp-6);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        background: var(--color-surface);
        box-shadow: var(--shadow-xs);
        overflow: hidden;
    }
    .data-table:not(.hours-table) tbody tr:last-child { margin-bottom: 0; }

    .data-table:not(.hours-table) tbody td {
        display: flex;
        align-items: center;
        gap: var(--sp-4);
        width: auto;
        max-width: none;
        padding: var(--sp-5) var(--sp-7);
        border: 0;
        border-bottom: 1px solid var(--color-border);
        text-align: right;
        white-space: normal;
    }
    .data-table:not(.hours-table) tbody tr td:last-child { border-bottom: 0; }

    /* The label sits left, the value's parts stay grouped right — a cell may
       hold a swatch plus text, and flex would otherwise spread them apart. */
    .data-table:not(.hours-table) tbody td[data-label]:not([data-label=""])::before {
        content: attr(data-label);
        flex: none;
        margin-right: auto;
        padding-right: var(--sp-6);
        font-size: var(--fs-2xs);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--color-muted);
        text-align: left;
    }

    /* La cellule d'en-tête de ligne devient le titre de la carte : la règle
       d'empilement ci-dessus ne vise que les `td`, et un `th` laissé tel quel
       casserait la carte. */
    .access-table tbody th[scope="row"] {
        display: block;
        width: auto;
        padding: var(--sp-5) var(--sp-7);
        border: 0;
        border-bottom: 1px solid var(--color-border);
        text-align: left;
        white-space: normal;
    }
    .access-table tbody td { text-align: right; width: auto; white-space: normal; }
    /* « Dépistages TROD · non souscrit » ne tient pas sur 320 px : le libellé
       doit pouvoir se replier. La règle partagée le fige (`flex: none`), ce qui
       convient aux libellés courts des autres tableaux, pas à celui-ci. */
    .access-table.data-table:not(.hours-table) tbody td[data-label]:not([data-label=""])::before {
        flex: 1 1 auto;
        min-width: 0;
        white-space: normal;
    }

    .data-table:not(.hours-table) tbody td.actions {
        justify-content: stretch;
        background: var(--color-surface-2);
    }
    .data-table:not(.hours-table) tbody td.actions .btn { flex: 1 1 auto; }

    /* Empty-state rows span the card instead of becoming a labelled line. */
    .data-table:not(.hours-table) tbody td[colspan] {
        display: block;
        text-align: center;
        color: var(--color-muted);
    }
}

/* ---------- Small phones: the last three overflows at 320px ---------- */
@media (max-width: 400px) {
    /* 3 x 110px + gaps needs 354px; the tiles must be free to shrink. */
    .home-hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
    .home-stat { padding: var(--sp-6) var(--sp-4); }
    .home-stat-label { hyphens: auto; }

    /* Seven day columns leave ~40px each: the header padding no longer fits. */
    .planning-month-head-cell { padding: var(--sp-3) var(--sp-2); letter-spacing: 0; }

    /* Options must not out-measure the panel that lists them. */
    .select-option { max-width: 100%; }

    .home-hero { padding: var(--sp-10) var(--sp-8); }
}

/* The hours tables stay tabular — they are a matrix of time fields, and the
   day-to-day comparison is the point of the screen. They shed padding first,
   then become scrollable rather than clipped: the time steppers have an
   intrinsic width no amount of tightening gets under 320px. */
@media (max-width: 640px) {
    .hours-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }
}

@media (max-width: 400px) {
    .hours-table th,
    .hours-table td { padding-left: var(--sp-3); padding-right: var(--sp-3); }
    .hours-table { font-size: var(--fs-xs); }
}

/* ---------- Modules & abonnement ---------- */
.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-6);
    margin-bottom: var(--sp-4);
}
.card-head h3 { margin: 0; font-size: var(--fs-xl); }
.card-actions { display: flex; gap: var(--sp-4); flex-wrap: wrap; margin-top: var(--sp-8); }
.card-actions .btn { flex: 1 1 auto; }
.pill-warn {
    background: var(--color-warning-soft);
    color: var(--color-warning);
    border-color: color-mix(in srgb, var(--color-warning-mid) 30%, var(--color-border));
}

/* ---------- Coarse pointers ----------
   The compact controls are sized for a mouse: the time stepper arrows are
   12px tall, the search-clear 22px, the calendar shortcuts 26px. Rather than
   redraw them for touch — which would coarsen the desktop design — each one
   keeps its painted size and gains an invisible hit area around it.
   Stacked pairs (the stepper) expand outward only, so the two arrows never
   overlap and steal each other's taps. */
@media (pointer: coarse) {
    /* Only elements that are statically positioned need this: .list-search-clear
       is already absolute (and so already a containing block for its ::after);
       forcing it relative put it back in the flow and pushed the toolbar open. */
    .time-step,
    .datepicker-link,
    .th-sort-btn,
    .notif-type-chip { position: relative; }

    .list-search-clear::after,
    .datepicker-link::after,
    .th-sort-btn::after {
        content: '';
        position: absolute;
        inset: -10px;
    }
    /* The stepper arrows sandwich the time input, so each one may only grow
       away from it — otherwise the arrows would cover the field. */
    .time-step::after { content: ''; position: absolute; }
    .time-step-up::after   { inset: -12px -10px -2px; }
    .time-step-down::after { inset: -2px -10px -12px; }

    /* Controls that can simply grow do so; only the stepper arrows, wedged
       against the field they drive, rely on the invisible area above. */
    .btn,
    .btn-order,
    .notif-type-chip,
    .role-chip,
    .datepicker-nav,
    .datepicker-link,
    .planning-view-tab,
    .topbar-nav-item,
    .th-sort-btn,
    .list-search-clear { min-height: 36px; }

    .notif-type-chip,
    .role-chip { padding-block: var(--sp-4); }

    .th-sort-btn { display: inline-flex; align-items: center; justify-content: center; }
    /* Absolutely positioned inside the search field, so it needs both axes. */
    .list-search-clear { width: 36px; height: 36px; right: var(--sp-2); }

    .col-day-link { display: inline-flex; align-items: center; min-height: 36px; }

    /* Checkboxes ship at 19px; the label is the real target, so give the
       control itself enough room to be hit directly too. */
    input[type=checkbox] { min-width: 24px; min-height: 24px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
    body .top-bar, body .content { opacity: 1; transform: none; }
}

/* Address confirmed by having opened the link: shown, never editable. */
.enrol-confirm {
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-2);
}
.enrol-confirm-label {
    display: block;
    margin-bottom: 2px;
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--color-text-soft);
}
.enrol-confirm-value {
    display: block;
    font-weight: 600;
    color: var(--color-text);
    overflow-wrap: anywhere;
}
.enrol-confirm-note { margin: 8px 0 0; }

/* Message des gestes bloqués (guard.js). Posé au-dessus de tout, à distance du
   bord bas pour ne pas recouvrir la dernière ligne du planning. Il n'est jamais
   masqué par display:none : la zone préexiste, sans quoi les lecteurs d'écran
   n'annonceraient pas son contenu. */
.guard-notice {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 9999;
    /* Largeur explicite plutôt que rétrécie au contenu : posé en fixed avec le
       seul left, l'élément n'a pour place que la moitié droite de l'écran, et
       se repliait donc bien avant d'y être obligé. Avec max-content il prend
       la largeur du texte déroulé, que le max-width vient borner. Résultat :
       une ligne dès qu'un écran ordinaire le permet, et en dessous une coupure
       entre les deux morceaux insécables, donc avant « Copier ». */
    width: max-content;
    max-width: min(640px, calc(100vw - 32px));
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    background: var(--color-text);
    color: var(--color-surface);
    font-size: var(--fs-sm);
    font-weight: 500;
    text-align: center;
    box-shadow: var(--shadow-md);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 8px);
    transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.guard-notice.is-on {
    opacity: 1;
    transform: translate(-50%, 0);
}
/* Chaque moitié du message reste d'un seul tenant : le seul endroit où la
   ligne peut se rompre est l'espace qui les sépare. */
.guard-notice-part { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
    .guard-notice { transition: none; }
}

/* ---------- Site public : pages de contenu ---------- */
/* L'accueil existant apportait le héros, les cartes de fonctionnalité et
   l'appel à l'action. Ce bloc ajoute ce que les pages de module, d'abonnement,
   de contact et les pages légales demandent en plus. */

/* Sous 360 px, la marque, la navigation et le bouton ne tiennent pas sur une
   ligne : sans repli, l'en-tête déborde la page entière. */
.public-top { flex-wrap: wrap; row-gap: var(--sp-5); }

.public-nav {
    display: flex;
    align-items: center;
    gap: var(--sp-8);
    margin-left: auto;
    margin-right: var(--sp-8);
    flex-wrap: wrap;
}
.public-nav a {
    color: var(--brand-ink);
    text-decoration: none;
    font-size: var(--fs-lg);
    font-weight: 500;
    padding: var(--sp-3) 0;
    transition: color var(--dur-fast) var(--ease-soft);
}
.public-nav a:hover,
.public-nav a:focus-visible {
    color: var(--brand-accent-text);
}
/* La page où l'on se trouve, soulignée d'indigo. `aria-current` porte
   l'information pour un lecteur d'écran ; le soulignement la montre. */
.public-nav a[aria-current="page"] {
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--brand-accent);
}

.public-hero-compact { padding-bottom: var(--sp-10); }

.public-section-title {
    font-family: var(--font-display);
    font-size: var(--fs-36);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.08;
    margin: 0 0 var(--sp-9);
    color: var(--brand-ink);
}

.public-argument { margin: var(--sp-16) 0; }

/* Les liens de texte mesuraient 14 à 18 px de haut, sous le minimum WCAG de
   24 px. Le rembourrage vertical les y porte sans changer leur apparence ;
   `inline-block` est nécessaire pour qu'il s'applique. */
.public-link,
.public-foot a,
.public-nav a,
.public-list a,
.public-main p a { display: inline-block; padding-block: var(--sp-3); }

.public-list {
    margin: var(--sp-9) 0;
    padding-left: var(--sp-9);
    display: grid;
    gap: var(--sp-5);
    color: var(--color-muted);
    line-height: 1.7;
}
.public-list strong { color: var(--color-text); }

.public-def {
    display: grid;
    grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
    gap: var(--sp-4) var(--sp-9);
    margin: 0 0 var(--sp-12);
}
.public-def dt { font-weight: 600; color: var(--color-muted); }
.public-def dd { margin: 0; color: var(--color-text); }

.public-form { max-width: 42rem; }
.public-form .public-form-wide { grid-column: 1 / -1; }

@media (max-width: 820px) {
    .public-nav { gap: var(--sp-6); margin-right: var(--sp-5); }
    .public-def { grid-template-columns: 1fr; gap: var(--sp-2); }
    .public-def dd { margin-bottom: var(--sp-6); }
}

/* Sur les petits téléphones, un bouton d'appel à l'action dépasse la largeur
   utile une fois centré : il prend toute la ligne plutôt que de déborder. */
@media (max-width: 400px) {
    .public-hero-cta { flex-direction: column; align-items: stretch; }
    .public-hero-cta .btn,
    .public-cta .btn { width: 100%; max-width: 100%; }
}

/* Échelle publique sous 640 px : H1 36, H2 26 ; les boutons du héros
   s'empilent et gardent 48 px de haut. */
@media (max-width: 640px) {
    .public-hero-title { font-size: var(--fs-36); }
    .public-section-title,
    .public-cta h2 { font-size: var(--fs-26); }
    .public-hero-cta { flex-direction: column; align-items: stretch; }
    .public-hero-cta .btn { width: 100%; min-height: 48px; }
}

/* ---------- Accueil (chantier B, 5 septembre 2026) ----------
   Une section par bloc de la maquette accueil-bureau.html. Les couleurs et
   les polices viennent de :root ; les espacements sont ceux de la maquette. */
.accueil { display: flex; flex-direction: column; gap: 80px; }
.accueil-eyebrow,
.contact-eyebrow {
    display: block;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand-accent-text);
}
.accueil-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-36);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--brand-ink);
    text-wrap: pretty;
}
.accueil-head { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }
.accueil-section { display: flex; flex-direction: column; gap: 26px; }

/* 1. Héros scindé */
.accueil-hero {
    display: grid;
    grid-template-columns: minmax(0, 11fr) minmax(0, 10fr);
    gap: 48px;
    align-items: center;
    padding-top: 24px;
}
.accueil-hero-copy { display: flex; flex-direction: column; gap: 22px; }
.accueil-hero-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-54);
    font-weight: 600;
    line-height: 1.02;
    letter-spacing: -0.03em;
    color: var(--brand-ink);
    text-wrap: pretty;
}
.accueil-hero-lead { margin: 0; font-size: var(--fs-18); line-height: 1.55; color: var(--brand-ink); }
.accueil-hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.accueil-hero-line { margin: 0; font-size: var(--fs-sm); line-height: 1.6; color: var(--brand-muted); }
.accueil-hero-line strong { font-weight: 600; color: var(--brand-ink); }
.accueil-figure { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.accueil-figure figcaption { font-size: var(--fs-xs); color: var(--brand-muted); }
.accueil-shot {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--brand-line);
    border-radius: var(--brand-radius-md);
    background: var(--color-white);
    overflow: hidden;
}
.accueil-shot-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--brand-surface);
    border-bottom: 1px solid var(--brand-line);
    font-size: var(--fs-2xs);
    color: var(--brand-muted);
}
.accueil-shot-bar i { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--brand-line); }
.accueil-shot-bar span { margin-left: 4px; }
.accueil-shot img { display: block; width: 100%; height: auto; }
.accueil-tree-wrap { padding: 10px 14px 12px; }

/* 2. Conçu sur le terrain */
.accueil-band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
    padding: 36px 40px;
    background: var(--brand-surface);
    border-radius: var(--brand-radius-lg);
}
.accueil-band.is-single { grid-template-columns: minmax(0, 1fr); }
.accueil-band-copy { display: flex; flex-direction: column; gap: 12px; }
.accueil-band .accueil-title { font-size: var(--fs-26); }
.accueil-quote {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px 24px;
    background: var(--color-white);
    border: 1px solid var(--brand-line);
    border-radius: var(--brand-radius-md);
}
.accueil-quote blockquote {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-22);
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--brand-ink);
}
.accueil-quote figcaption { font-size: var(--fs-sm); color: var(--brand-muted); }

/* 3. Les modules */
.accueil-modules-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.accueil-module {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 28px;
    background: var(--color-white);
    border: 1px solid var(--brand-line);
    border-radius: var(--brand-radius-lg);
}
.accueil-module h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-26);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--brand-ink);
}
.accueil-module-lead { margin: 0; font-size: var(--fs-18); font-weight: 500; line-height: 1.55; color: var(--brand-ink); }
.accueil-module-sub { margin: 0; font-size: var(--fs-lg); line-height: 1.55; color: var(--brand-muted); }
.accueil-shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.accueil-pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.accueil-pill {
    font-size: var(--fs-sm);
    color: var(--brand-ink);
    padding: 6px 12px;
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-pill);
    background: var(--brand-paper);
}
.accueil-link {
    display: inline-block;
    align-self: flex-start;
    margin-top: auto;
    padding-block: var(--sp-3);
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--brand-accent-text);
    text-decoration: none;
}
.accueil-link:hover,
.accueil-link:focus-visible { color: var(--brand-ink); }
.accueil-note { margin: 0; font-size: var(--fs-lg); line-height: 1.55; color: var(--brand-muted); }
.accueil-tree { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto; }
.accueil-tree .node { fill: var(--color-white); stroke: var(--brand-line); stroke-width: 1.5; }
.accueil-tree .node.on { fill: var(--module-trod-tint); stroke: var(--module-trod); }
.accueil-tree .edge { fill: none; stroke: var(--brand-line); stroke-width: 2; }
.accueil-tree .edge.on { stroke: var(--module-trod); }
.accueil-tree text { font-family: var(--font-ui); font-size: var(--fs-2xs); fill: var(--brand-muted); }
.accueil-tree text.on { fill: var(--module-trod-text); }

/* 4. Pourquoi Oxymaitre */
.accueil-why { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; }
.accueil-why-list { display: flex; flex-direction: column; gap: 28px; }
.accueil-why-item { display: flex; flex-direction: column; gap: 8px; }
.accueil-why-item h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-22);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--brand-ink);
}
.accueil-why-item p { margin: 0; font-size: var(--fs-xl); line-height: 1.55; color: var(--brand-ink); }

/* 5. Ce que vous pouvez attendre */
.accueil-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.accueil-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 30px 24px 22px 40px;
    background: var(--color-white);
    border: 1px solid var(--brand-line);
    border-radius: var(--brand-radius-md);
}
.accueil-card::before {
    content: "";
    position: absolute;
    top: 16px;
    left: 16px;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-pill);
    background: var(--brand-accent);
}
.accueil-card h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-20);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--brand-ink);
}
.accueil-card p { margin: 0; font-size: var(--fs-lg); line-height: 1.55; color: var(--brand-ink); }

/* 6. Qui est derrière */
.accueil-who {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 32px;
    align-items: center;
    padding: 32px 36px;
    background: var(--brand-surface);
    border-radius: var(--brand-radius-lg);
}
.accueil-who.is-single { grid-template-columns: minmax(0, 1fr); }
.accueil-who img { display: block; width: 120px; height: 120px; object-fit: cover; border-radius: var(--brand-radius-lg); }
.accueil-who-copy { display: flex; flex-direction: column; gap: 10px; }
.accueil-who-text {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-20);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--brand-ink);
}
.accueil-who-name { font-size: var(--fs-md); font-weight: 600; color: var(--brand-ink); }

/* 7. Questions fréquentes — tout est lisible sans clic */
.accueil-faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 40px; }
.accueil-faq-item { display: flex; flex-direction: column; gap: 6px; padding: 18px 0; border-top: 1px solid var(--brand-line); }
.accueil-faq-item h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-18);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--brand-ink);
}
.accueil-faq-item p { margin: 0; font-size: var(--fs-lg); line-height: 1.55; color: var(--brand-ink); }

/* 8. Appel final, sur l'encre */
.accueil-final {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 56px 40px;
    background: var(--brand-ink);
    border-radius: var(--brand-radius-lg);
}
.accueil-final h2 {
    margin: 0;
    max-width: 640px;
    font-family: var(--font-display);
    font-size: var(--fs-36);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--brand-paper);
}
.accueil-final p { margin: 0; max-width: 560px; font-size: var(--fs-17); line-height: 1.55; color: var(--brand-paper); }
.accueil-final-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px; }
.public-body .accueil-final .btn-light {
    background: var(--brand-accent-light);
    color: var(--brand-ink);
    border: 1px solid var(--brand-accent-light);
    border-radius: var(--brand-radius-sm);
    box-shadow: none;
}
.public-body .accueil-final .btn-light:hover,
.public-body .accueil-final .btn-light:focus-visible {
    background: var(--brand-paper);
    border-color: var(--brand-paper);
    color: var(--brand-ink);
}
.accueil-final .accueil-link {
    /* .accueil-link s'aligne en haut dans les cartes de module ; ici la
       rangée est horizontale, et le lien se centre sur le bouton. */
    align-self: center;
    margin: 0;
    color: var(--brand-accent-light);
}
.accueil-final .accueil-link:hover,
.accueil-final .accueil-link:focus-visible { color: var(--brand-paper); }

/* Points de rupture : les cinq du système, pas un de plus. */
@media (max-width: 1024px) {
    .accueil-hero { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .accueil-why { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .accueil-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .accueil-modules-grid,
    .accueil-faq,
    .accueil-band { grid-template-columns: minmax(0, 1fr); }
    .accueil-band { padding: 28px 24px; }
}
@media (max-width: 640px) {
    .accueil { gap: 44px; }
    .accueil-hero { padding-top: 8px; }
    .accueil-hero-title { font-size: var(--fs-36); line-height: 1.04; }
    .accueil-title { font-size: var(--fs-26); }
    .accueil-band .accueil-title { font-size: var(--fs-20); }
    .accueil-hero-lead { font-size: var(--fs-xl); }
    .accueil-hero-cta { flex-direction: column; align-items: stretch; }
    .accueil-hero-cta .btn { width: 100%; min-height: 48px; }
    .accueil-shots { grid-template-columns: minmax(0, 1fr); }
    .accueil-cards { grid-template-columns: minmax(0, 1fr); }
    .accueil-module { padding: 20px; }
    .accueil-module h3 { font-size: var(--fs-22); }
    .accueil-who { grid-template-columns: minmax(0, 1fr); padding: 22px 20px; }
    .accueil-final { padding: 32px 22px; }
    .accueil-final h2 { font-size: var(--fs-26); }
    .accueil-final-cta { flex-direction: column; align-items: stretch; width: 100%; }
    .accueil-final .btn { width: 100%; min-height: 48px; }
}

/* ---------- Contact (6 septembre 2026) ----------
   Le gabarit public espace ses sections de 96 px, ce qui convient à une page
   qui se parcourt ; une page qu'on remplit se tient plus serrée. */
.contact { display: flex; flex-direction: column; gap: 40px; }
.contact-confirme { gap: 28px; }

   Le formulaire est la page : il occupe la colonne large, et le rappel des
   trois pages qui répondent peut-être déjà reste à côté. Sur téléphone, le
   formulaire passe devant — on est venu pour écrire. */
.contact-tete {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 720px;
}
.contact-titre {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-54);
    font-weight: 600;
    line-height: 1.04;
    letter-spacing: -0.03em;
    color: var(--brand-ink);
    text-wrap: pretty;
}
.contact-grille {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 48px;
    align-items: start;
}

/* La carte du formulaire */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 32px 36px;
    background: var(--color-white);
    border: 1px solid var(--brand-line);
    border-radius: var(--brand-radius-lg);
}
.contact-legende { margin: 0; font-size: var(--fs-sm); color: var(--brand-muted); }
.contact-requis  { color: var(--brand-accent-text); }
.contact-champ   { display: flex; flex-direction: column; gap: 8px; }
.contact-label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--brand-ink);
}
.contact-aide { font-size: var(--fs-sm); font-weight: 400; color: var(--brand-muted); }

/* Les champs. Le texte ne descend jamais sous 16 px : en dessous, un iPhone
   agrandit la page tout seul à la mise au point, et la mise en page saute. */
.contact-form .contact-saisie {
    width: 100%;
    box-sizing: border-box;
    height: 48px;
    padding: 0 14px;
    background: var(--color-white);
    border: 1.5px solid var(--brand-line);
    border-radius: var(--brand-radius-sm);
    font: inherit;
    font-size: var(--fs-xl);
    line-height: 1.5;
    color: var(--brand-ink);
}
.contact-form .contact-zone {
    height: auto;
    min-height: 150px;
    padding: 12px 14px;
    resize: vertical;
}
.contact-form .contact-saisie:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: var(--ring-focus);
}
.contact-form .contact-saisie[aria-invalid="true"],
.contact-form .menu[aria-invalid="true"] { border-color: var(--danger); }

/* Le message sous le libellé, avant le champ : on le lit avant de corriger. */
.contact-erreur {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--danger);
}
.contact-erreur svg { flex-shrink: 0; }

/* Le résumé en tête : ce qui est à corriger, et un lien vers chaque champ. */
.contact-resume {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px;
    border: 2px solid var(--danger);
    border-radius: var(--brand-radius-md);
    background: var(--danger-tint);
}
.contact-resume:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.contact-resume-titre {
    font-family: var(--font-display);
    font-size: var(--fs-18);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--brand-ink);
}
.contact-resume-texte { margin: 0; font-size: var(--fs-lg); color: var(--brand-ink); }
.contact-resume-liste {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.contact-resume-liste a {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--danger);
}
.contact-resume-liste a:hover,
.contact-resume-liste a:focus-visible { color: var(--brand-ink); }

.contact-envoyer { align-self: flex-start; min-height: 48px; padding: 0 22px; }
.contact-mention {
    margin: 0;
    font-size: var(--fs-sm);
    line-height: 1.55;
    color: var(--brand-muted);
}

/* Avant d'écrire : trois pages qui répondent peut-être déjà. */
.contact-avant {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 24px;
}
.contact-avant-intro { margin: 0; font-size: var(--fs-lg); line-height: 1.5; color: var(--brand-ink); }
.contact-carte {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    background: var(--color-white);
    border: 1px solid var(--brand-line);
    border-radius: var(--brand-radius-md);
    text-decoration: none;
}
.contact-carte:hover,
.contact-carte:focus-visible { border-color: var(--brand-accent); }
.contact-carte-titre {
    font-family: var(--font-display);
    font-size: var(--fs-18);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--brand-ink);
}
.contact-carte-texte { font-size: var(--fs-md); line-height: 1.5; color: var(--brand-muted); }

/* La confirmation, à la place du formulaire. */
.contact-parti {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 720px;
    padding: 28px 32px;
    background: var(--brand-ink);
    border-radius: var(--brand-radius-lg);
}
.contact-parti p { margin: 0; font-size: var(--fs-17); line-height: 1.55; color: var(--brand-paper); }
.contact-parti strong { color: var(--brand-accent-light); }
.contact-parti-rappel { font-size: var(--fs-md) !important; color: var(--brand-accent-light) !important; }
.contact-suite { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.contact-suite-liens { display: flex; flex-wrap: wrap; gap: 12px; }
.contact-suite-liens .btn { min-height: 44px; padding: 0 18px; }

@media (max-width: 1024px) {
    .contact-grille { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .contact-avant { position: static; }
}
@media (max-width: 640px) {
    .contact-titre { font-size: var(--fs-36); }
    .contact-form { padding: 22px 18px; }
    .contact-envoyer { align-self: stretch; width: 100%; }
    .contact-suite-liens .btn { width: 100%; }
}

/* ---------- Menu déroulant (6 septembre 2026) ----------
   Un seul dessin pour tous les <select> du site public, et plus tard de
   l'application. Le menu reste un select natif : clavier, lecteur d'écran,
   première lettre, roue de sélection des téléphones — rien n'est réécrit.

   Deux couches. La première dessine le bouton fermé et vaut partout. La
   seconde, sous @supports, reprend aussi le panneau ouvert par le mécanisme
   des selects personnalisables (appearance: base-select) : Chrome et Edge
   depuis la version 135, Safari depuis la 27. Un navigateur qui l'ignore —
   Firefox, tant que la fonction n'y est pas activée par défaut — garde sa
   liste native derrière le même bouton : c'est le repli voulu. */
.menu {
    width: 100%;
    box-sizing: border-box;
    height: 48px;
    padding: 0 40px 0 14px;
    background: var(--color-white);
    border: 1.5px solid var(--brand-line);
    border-radius: var(--brand-radius-sm);
    font: inherit;
    font-size: var(--fs-xl);
    line-height: 1.5;
    color: var(--brand-ink);
    appearance: none;
    -webkit-appearance: none;
    /* Le chevron, à l'encre, 18 px, à 14 px du bord droit. */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="%23191924" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="5 8 10 13 15 8"/></svg>');
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    transition: border-color var(--dur-fast) var(--ease-soft),
                box-shadow var(--dur-fast) var(--ease-soft);
}
/* Tant que rien n'est choisi, « Choisir… » se lit en retrait. */
.menu:has(option[value=""]:checked) { color: var(--brand-muted); }
.menu:focus,
.menu:focus-visible {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: var(--ring-focus);
}

@supports (appearance: base-select) {
    .menu,
    .menu::picker(select) { appearance: base-select; }

    /* Le bouton fermé garde exactement les mêmes mesures ; seul le chevron
       change de mécanisme : un pseudo-élément à la place du fond. */
    .menu {
        display: flex;
        align-items: center;
        padding-right: 14px;
        background-image: none;
    }
    .menu::picker-icon {
        /* Le même dessin que le fond du repli, au pixel près : un SVG en
           contenu, qui porte son encre — un masque décalait le tracé. */
        content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="%23191924" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="5 8 10 13 15 8"/></svg>');
        width: 18px;
        height: 18px;
        margin-inline-start: auto;
        flex-shrink: 0;
        transition: rotate var(--dur-fast) var(--ease-soft);
    }
    .menu:open { border-color: var(--brand-accent); box-shadow: var(--ring-focus); }
    .menu:open::picker-icon { rotate: 180deg; }

    /* Le panneau : sous le bouton, à sa largeur, huit lignes au plus. */
    .menu::picker(select) {
        margin: 6px 0 0;
        padding: 6px;
        width: anchor-size(self-inline);
        max-height: 367px;               /* 8 × 44 px + marges + bords */
        overflow-y: auto;
        background: var(--color-white);
        border: 1.5px solid var(--brand-line);
        border-radius: var(--brand-radius-md);
        box-shadow: var(--brand-shadow-menu);
    }
    .menu option {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 44px;
        padding: 0 12px;
        border-radius: 6px;
        font-size: var(--fs-xl);
        font-weight: 400;
        color: var(--brand-ink);
    }
    .menu option[value=""] { color: var(--brand-muted); }
    .menu option:hover { background: var(--brand-surface); }
    .menu option:focus-visible {
        outline: none;
        background: var(--brand-surface);
        box-shadow: inset 0 0 0 2px var(--brand-accent);
    }
    .menu option:checked { color: var(--brand-accent-text); font-weight: 600; }
    /* « Choisir… » est l'absence de choix : jamais en indigo, jamais cochée,
       même quand c'est elle que le select porte. */
    .menu option[value=""]:checked { color: var(--brand-muted); font-weight: 400; }
    .menu option[value=""]::checkmark { visibility: hidden; }
    /* La coche, à droite du libellé et non devant. */
    .menu option::checkmark {
        content: "";
        order: 1;
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        background-color: var(--brand-accent-text);
        mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="black" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 10.5 8.5 15 16 6"/></svg>') center / contain no-repeat;
    }
    .menu option:not(:checked)::checkmark { visibility: hidden; }
}

/* ---------- Modules (13 septembre 2026) ----------
   La page publique du catalogue, d'après modules-bureau.html et
   modules-telephone.html. Les couleurs, les polices et l'échelle des titres
   viennent de :root ; deux titres suivent l'échelle de la charte (H1 54,
   H2 36) plutôt que les 48 et 38 des planches, pour que le site n'ait qu'une
   seule échelle. */
.modules { display: flex; flex-direction: column; gap: 88px; }

.modules-eyebrow {
    display: block;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand-accent-text);
}
.modules-titre-page,
.modules-titre,
.modules-appel-titre {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--brand-ink);
    text-wrap: pretty;
}
.modules-titre-page { font-size: var(--fs-54); line-height: 1.02; }
.modules-titre      { font-size: var(--fs-36); line-height: 1.08; }

/* ----- Entrée : le chapeau et les deux cartes ----- */
.modules-entree { display: flex; flex-direction: column; gap: 36px; }
.modules-entree-copy { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.modules-chapeau {
    margin: 0;
    font-size: var(--fs-18);
    line-height: 1.55;
    color: var(--brand-ink);
    text-wrap: pretty;
}

.modules-cartes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-12);
}
.modules-carte {
    display: flex;
    flex-direction: column;
    gap: var(--sp-7);
    padding: 26px 28px;
    background: var(--color-surface);
    border: 1px solid var(--brand-line);
    border-radius: var(--brand-radius-lg);
}
.modules-carte-tete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-6);
    flex-wrap: wrap;
}
.modules-carte-nom {
    font-family: var(--font-display);
    font-size: var(--fs-26);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--brand-ink);
}
.modules-carte-accroche {
    margin: 0;
    font-size: var(--fs-17);
    font-weight: 500;
    line-height: 1.55;
    color: var(--brand-ink);
    text-wrap: pretty;
}
.modules-carte .modules-lien { margin-top: auto; }

/* ----- Le nom d'un module, sa pastille et son état ----- */
.modules-nom { display: inline-flex; align-items: center; gap: var(--sp-5); }
.modules-pastille {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    border-radius: var(--radius-pill);
    background: var(--brand-muted);
}
.modules-pastille-lg { width: 14px; height: 14px; }
.ton-pharmaouss .modules-pastille,
.ton-pharmaouss .modules-puce { background: var(--module-pharmaouss); }
.ton-trod .modules-pastille,
.ton-trod .modules-puce { background: var(--module-trod); }

/* L'état ne s'affiche que sur un module fermé : marquer « Ouvert » sur
   l'autre serait du bruit. */
.modules-etat {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 var(--sp-5);
    border-radius: var(--radius-pill);
    background: var(--module-trod-tint);
    color: var(--module-trod-text);
    font-size: var(--fs-xs);
    font-weight: 600;
}

/* ----- Une section de module ----- */
.modules-section {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
    column-gap: 56px;
    row-gap: 18px;
    align-items: start;
}
.modules-corps { grid-column: 1; display: flex; flex-direction: column; gap: 18px; }
.modules-figure {
    grid-column: 2;
    grid-row: 1 / span 2;
    position: sticky;
    top: var(--sp-12);
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}
.modules-figure figcaption { font-size: var(--fs-xs); color: var(--brand-muted); }
.modules-encart { grid-column: 1; }

.modules-section-antigene { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.modules-section-antigene .modules-encart {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: var(--sp-12);
}

.modules-section-tete {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-6) var(--sp-8);
}
.modules-accroche {
    margin: 0;
    font-size: var(--fs-20);
    font-weight: 500;
    line-height: 1.55;
    color: var(--brand-ink);
    text-wrap: pretty;
}
.modules-resume {
    margin: 0;
    font-size: var(--fs-17);
    line-height: 1.55;
    color: var(--brand-ink);
    text-wrap: pretty;
}

/* Les quatre tests du périmètre : des étiquettes, pas des liens. */
.modules-tests {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
}
.modules-tests li {
    padding: var(--sp-3) var(--sp-6);
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    font-size: var(--fs-sm);
    color: var(--brand-ink);
}

.modules-bloc { display: flex; flex-direction: column; gap: var(--sp-6); }
.modules-surtitre {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-muted);
}

.modules-liste {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--sp-5);
}
.modules-liste li {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-6);
    font-size: var(--fs-xl);
    line-height: 1.5;
    color: var(--brand-ink);
}
.modules-puce {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    margin-top: var(--sp-4);
    border-radius: var(--radius-pill);
    background: var(--brand-accent);
}

/* Les deux paragraphes de franchise : celui de Pharmaouss sur le fond des
   encarts, celui d'Antigêne encadré, parce qu'il porte la responsabilité. */
.modules-encart {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    padding: 18px 20px;
    background: var(--brand-surface);
    border-radius: var(--brand-radius-md);
}
.modules-encart p {
    margin: 0;
    font-size: var(--fs-lg);
    line-height: 1.55;
    color: var(--brand-ink);
    text-wrap: pretty;
}
.modules-encart-cadre {
    gap: var(--sp-6);
    align-items: flex-start;
    padding: 24px 26px;
    background: var(--color-surface);
    border: 1px solid var(--brand-line);
    border-left: 4px solid var(--module-trod);
}
.modules-encart-cadre p { font-size: var(--fs-xl); }

/* ----- Les deux panneaux : l'abonnement, et ce qui vaut pour tous ----- */
.modules-duo {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-12);
    align-items: start;
}
.modules-panneau {
    display: flex;
    flex-direction: column;
    gap: var(--sp-7);
    padding: 28px 30px;
    background: var(--color-surface);
    border: 1px solid var(--brand-line);
    border-radius: var(--brand-radius-lg);
}

/* ----- Les liens de la page ----- */
.modules-lien {
    display: inline-block;
    padding-block: var(--sp-3);
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--brand-accent-text);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-soft);
}
.modules-lien:hover,
.modules-lien:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
.modules-lien-clair { align-self: center; color: var(--brand-accent-light); }
.modules-lien-clair:hover,
.modules-lien-clair:focus-visible { color: var(--brand-paper); }

/* ----- L'appel final ----- */
.modules-appel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 40px 44px;
    background: var(--brand-ink);
    border-radius: var(--brand-radius-lg);
}
.modules-appel-titre { font-size: var(--fs-32); line-height: 1.1; color: var(--brand-paper); }
.modules-appel-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-7) 22px;
}

/* Points de rupture : les cinq du système, pas un de plus. */
@media (max-width: 1024px) {
    .modules { gap: 64px; }
    .modules-section,
    .modules-section-antigene { column-gap: var(--sp-16); }
}
@media (max-width: 820px) {
    /* Les deux colonnes s'empilent : la capture se place après la liste et
       avant le paragraphe de franchise, comme sur la planche téléphone. */
    .modules-section,
    .modules-section-antigene { grid-template-columns: minmax(0, 1fr); row-gap: var(--sp-10); }
    .modules-corps,
    .modules-figure,
    .modules-encart,
    .modules-section-antigene .modules-encart {
        grid-column: 1;
        grid-row: auto;
        position: static;
    }
    .modules-cartes,
    .modules-duo { grid-template-columns: minmax(0, 1fr); gap: var(--sp-7); }
}
@media (max-width: 640px) {
    .modules { gap: 44px; }
    .modules-titre-page { font-size: var(--fs-36); }
    .modules-titre { font-size: var(--fs-26); }
    .modules-appel-titre { font-size: var(--fs-26); }
    .modules-entree { gap: var(--sp-12); }
    .modules-entree-copy { gap: var(--sp-6); }
    .modules-carte,
    .modules-panneau { padding: 22px 20px; }
    .modules-encart-cadre { padding: var(--sp-10); }
    .modules-appel { padding: 28px 20px; }
}
@media (max-width: 400px) {
    .modules-appel-cta { align-items: stretch; flex-direction: column; }
    .modules-appel-cta .btn { width: 100%; }
    .modules-lien-clair { align-self: flex-start; }
}
