/* ==========================================================================
   AGEMA — Gestion du stock · identité "rayonnage & étiquette"

   Sujet : le magasin de fournitures d'une administration — des étagères
   métalliques, des étiquettes de rayon, des cartons de toner.
   Couleur : vert pétrole des rayonnages pour la structure (menu, titres),
   orange "étiquette de rayon" pour les actions. Cyan / magenta / jaune du
   toner réservés au sceau et à l'état du stock (magenta = à commander).
   Deux thèmes : clair (par défaut) et sombre, choisis par poste.
   Type : Bricolage Grotesque pour les titres et les chiffres, Figtree pour
   l'interface. Chiffres tabulaires partout.
   Mouvement : un seul vrai "moment" au chargement du tableau de bord
   (indicateurs qui montent, compteurs, jauges qui se remplissent), plus des
   transitions courtes entre les pages et des retours au survol.
   ========================================================================== */

:root {
  /* ---- Thème clair ---- */
  --fond: #EDF1EF;
  --surface: #FFFFFF;
  --surface-2: #F4F7F5;
  --menu: #0F3B3A;
  --menu-2: #184B49;
  --menu-trait: #25605C;
  --texte-menu: #D2E6E2;
  --texte-menu-doux: #8DB1AC;

  --accent: #E8590C;            /* orange étiquette */
  --accent-2: #C94A06;
  --sur-accent: #FFFFFF;

  --titre: #0F3B3A;
  --texte: #16211F;
  --texte-doux: #5A6B68;
  --trait: #DCE3E0;
  --trait-vif: #BCC9C5;

  --cyan: #0091C9;
  --magenta: #C2185F;
  --sur-magenta: #FFFFFF;
  --jaune: #E8A600;
  --vert: #17825A;

  --fond-alerte: #FCEDF3;  --texte-alerte: #8C1046;
  --fond-ok: #E5F4EC;      --texte-ok: #0F5E3F;
  --fond-attente: #FFF4D6; --texte-attente: #765200;
  --fond-info: #E4F2F8;    --texte-info: #0B5577;

  --survol-ligne: #F0F5F3;
  --jauge-fond: #E0E7E4;
  --ombre: 0 1px 2px rgba(15,59,58,.06), 0 10px 28px -14px rgba(15,59,58,.28);
  --ombre-forte: 0 2px 4px rgba(15,59,58,.08), 0 18px 40px -16px rgba(15,59,58,.38);
  --anneau: rgba(232,89,12,.22);
  --voile: rgba(8,24,23,.55);

  /* Le bon imprimé reste une feuille blanche dans les deux thèmes */
  --doc-fond: #FFFFFF; --doc-texte: #16211F; --doc-doux: #5A6B68; --doc-trait: #DCE3E0; --doc-marque: #0F3B3A;

  /* Typographie */
  --titres: "Bricolage Grotesque", "Segoe UI", Roboto, Arial, sans-serif;
  --police: "Figtree", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Rayons par rôle */
  --rayon-champ: 10px;
  --rayon-cadre: 18px;
  --rayon-sm: var(--rayon-champ);   /* anciens noms encore utilisés dans les gabarits */
  --rayon: var(--rayon-cadre);

  --menu-l: 256px;
  --vite: .18s cubic-bezier(.2,.7,.2,1);
  color-scheme: light;
}

/* ---- Thème sombre : même structure, valeurs redéfinies ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0C1514; --surface: #142120; --surface-2: #1A2928;
    --menu: #08100F; --menu-2: #13201F; --menu-trait: #1F302E;
    --texte-menu: #C4D8D4; --texte-menu-doux: #6E8C87;
    --accent: #FF7A33; --accent-2: #FF955A; --sur-accent: #1E0D02;
    --titre: #EAF3F0; --texte: #DCE7E4; --texte-doux: #8FA4A0;
    --trait: #223230; --trait-vif: #344A47;
    --cyan: #3DB9E8; --magenta: #F0508F; --sur-magenta: #2B0515; --jaune: #F2BE3A; --vert: #3CC48A;
    --fond-alerte: #3A1526; --texte-alerte: #FFB4D0;
    --fond-ok: #11301F;     --texte-ok: #8FE0B8;
    --fond-attente: #352A0C; --texte-attente: #F5D27A;
    --fond-info: #0E2A36;   --texte-info: #9CD7EE;
    --survol-ligne: #1A2927; --jauge-fond: #22312F;
    --ombre: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.7);
    --ombre-forte: 0 2px 4px rgba(0,0,0,.45), 0 18px 40px -16px rgba(0,0,0,.8);
    --anneau: rgba(255,122,51,.28); --voile: rgba(0,0,0,.65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #0C1514; --surface: #142120; --surface-2: #1A2928;
  --menu: #08100F; --menu-2: #13201F; --menu-trait: #1F302E;
  --texte-menu: #C4D8D4; --texte-menu-doux: #6E8C87;
  --accent: #FF7A33; --accent-2: #FF955A; --sur-accent: #1E0D02;
  --titre: #EAF3F0; --texte: #DCE7E4; --texte-doux: #8FA4A0;
  --trait: #223230; --trait-vif: #344A47;
  --cyan: #3DB9E8; --magenta: #F0508F; --sur-magenta: #2B0515; --jaune: #F2BE3A; --vert: #3CC48A;
  --fond-alerte: #3A1526; --texte-alerte: #FFB4D0;
  --fond-ok: #11301F;     --texte-ok: #8FE0B8;
  --fond-attente: #352A0C; --texte-attente: #F5D27A;
  --fond-info: #0E2A36;   --texte-info: #9CD7EE;
  --survol-ligne: #1A2927; --jauge-fond: #22312F;
  --ombre: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.7);
  --ombre-forte: 0 2px 4px rgba(0,0,0,.45), 0 18px 40px -16px rgba(0,0,0,.8);
  --anneau: rgba(255,122,51,.28); --voile: rgba(0,0,0,.65);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  font-family: var(--police);
  background: var(--fond);
  color: var(--texte);
  font-size: 15px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  transition: background-color .3s ease, color .3s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--titres); text-wrap: balance; }
::selection { background: var(--anneau); }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }

/* ---------------- Transitions entre les pages ---------------- */
@view-transition { navigation: auto; }
.menu { view-transition-name: menu; }
::view-transition-old(root) { animation: .16s ease both page-sort; }
::view-transition-new(root) { animation: .28s cubic-bezier(.2,.7,.2,1) both page-entre; }
@keyframes page-sort { to { opacity: 0; } }
@keyframes page-entre { from { opacity: 0; transform: translateY(8px); } }

/* ---------------- Menu latéral ---------------- */
.menu {
  position: fixed; inset: 0 auto 0 0; width: var(--menu-l); z-index: 40;
  background: var(--menu); color: var(--texte-menu);
  display: flex; flex-direction: column;
  padding: 24px 0 16px 14px;
  transition: background-color .3s ease;
}
body.avec-menu .zone { margin-left: var(--menu-l); }

.marque { display: flex; align-items: center; gap: 12px; padding: 0 16px 24px 8px; color: #fff; }
.marque:hover { text-decoration: none; }
.marque-sceau { position: relative; width: 38px; height: 36px; flex-shrink: 0; isolation: isolate; }
.marque-sceau i { position: absolute; width: 21px; height: 21px; border-radius: 50%; mix-blend-mode: screen; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.marque-sceau .c { background: var(--cyan); left: 1px; top: 1px; }
.marque-sceau .m { background: var(--magenta); left: 16px; top: 1px; }
.marque-sceau .j { background: var(--jaune); left: 8.5px; top: 14px; }
.marque:hover .marque-sceau .c { transform: translate(-3px, -2px); }
.marque:hover .marque-sceau .m { transform: translate(3px, -2px); }
.marque:hover .marque-sceau .j { transform: translate(0, 3px); }
.marque-texte { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.marque-texte .titre { font-family: var(--titres); font-size: 24px; font-weight: 800; letter-spacing: .01em; color: #fff; }
.marque-texte .sous-titre { font-size: 11.5px; color: var(--texte-menu-doux); margin-top: 4px; }

.menu-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.menu-groupe { font-size: 12px; font-weight: 600; color: var(--texte-menu-doux); padding: 18px 12px 6px; }
.menu-nav a {
  display: flex; align-items: center; gap: 11px;
  color: var(--texte-menu); font-size: 14.5px; font-weight: 500;
  padding: 10px 12px; border-radius: 12px 0 0 12px; position: relative;
  transition: background-color var(--vite), color var(--vite), padding var(--vite);
}
.menu-nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; transition: transform var(--vite); }
.menu-nav a:hover { background: var(--menu-2); color: #fff; text-decoration: none; padding-left: 16px; }
.menu-nav a:hover svg { transform: scale(1.12); }
/* Onglet actif : il prend la couleur de la page, comme un intercalaire */
.menu-nav a.actif { background: var(--fond); color: var(--titre); font-weight: 700; padding-left: 12px; }
.menu-nav a.actif svg { opacity: 1; color: var(--accent); transform: none; }
.menu-nav a.actif::before, .menu-nav a.actif::after { content: ""; position: absolute; right: 0; width: 16px; height: 16px; pointer-events: none; }
.menu-nav a.actif::before { top: -16px; background: radial-gradient(circle at 0 0, transparent 16px, var(--fond) 16.5px); }
.menu-nav a.actif::after  { bottom: -16px; background: radial-gradient(circle at 0 100%, transparent 16px, var(--fond) 16.5px); }

/* Bouton clair / sombre */
.bascule-theme {
  display: flex; align-items: center; gap: 10px; margin: 10px 14px 0 0; padding: 9px 12px;
  background: var(--menu-2); color: var(--texte-menu); border: 1px solid var(--menu-trait);
  border-radius: 12px; font: 500 13.5px var(--police); cursor: pointer; text-align: left;
  transition: background-color var(--vite), color var(--vite);
}
.bascule-theme:hover { color: #fff; border-color: var(--texte-menu-doux); }
.bascule-theme .piste {
  margin-left: auto; width: 38px; height: 22px; border-radius: 999px; background: var(--menu-trait);
  position: relative; flex-shrink: 0;
}
.bascule-theme .piste::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--jaune); transition: transform .3s cubic-bezier(.3,1.4,.5,1), background-color .3s ease;
}
.bascule-theme svg { width: 17px; height: 17px; }
.bascule-theme .lune { display: none; }
:root[data-theme="dark"] .bascule-theme .piste::after { transform: translateX(16px); background: var(--texte-menu); }
:root[data-theme="dark"] .bascule-theme .soleil { display: none; }
:root[data-theme="dark"] .bascule-theme .lune { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bascule-theme .piste::after { transform: translateX(16px); background: var(--texte-menu); }
  :root:not([data-theme="light"]) .bascule-theme .soleil { display: none; }
  :root:not([data-theme="light"]) .bascule-theme .lune { display: block; }
}

.menu-utilisateur {
  display: flex; align-items: center; gap: 10px; margin: 12px 14px 0 0;
  padding: 12px 10px 0; border-top: 1px solid var(--menu-trait); font-size: 13px;
}
.avatar-initiales {
  width: 36px; height: 36px; border-radius: 12px; background: var(--accent); color: var(--sur-accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--titres); font-size: 13px; font-weight: 800; flex-shrink: 0;
}
.menu-utilisateur .infos { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.menu-utilisateur .nom { font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-utilisateur .role { color: var(--texte-menu-doux); font-size: 11.5px; }
.btn-deconnexion {
  color: var(--texte-menu); border: 1px solid var(--menu-trait); border-radius: var(--rayon-champ);
  padding: 5px 10px; font-size: 12px; flex-shrink: 0; transition: background-color var(--vite), color var(--vite);
}
.btn-deconnexion:hover { background: var(--magenta); border-color: var(--magenta); color: var(--sur-magenta); text-decoration: none; }

/* ---------------- Zone de travail ---------------- */
.zone { min-height: 100vh; display: flex; flex-direction: column; }
.conteneur { width: 100%; max-width: 1180px; margin: 0 auto; padding: 40px 40px 56px; flex: 1; }
.conteneur.etroit { max-width: 560px; }
.conteneur.plein { max-width: none; padding: 0; }

h1.titre-page {
  font-size: 34px; font-weight: 800; color: var(--titre);
  margin: 0 0 26px; letter-spacing: -.02em; line-height: 1.1;
}

/* ---------------- Messages flash ---------------- */
.flash {
  padding: 13px 16px; border-radius: var(--rayon-champ); margin-bottom: 18px;
  font-size: 14px; font-weight: 500; animation: flash-entre .4s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes flash-entre { from { opacity: 0; transform: translateY(-8px); } }
.flash-success { background: var(--fond-ok); color: var(--texte-ok); }
.flash-danger  { background: var(--fond-alerte); color: var(--texte-alerte); }
.flash-warning { background: var(--fond-attente); color: var(--texte-attente); }
.flash-info    { background: var(--fond-info); color: var(--texte-info); }

/* ---------------- Tableau de bord ---------------- */
.cartes { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.carte {
  background: var(--surface); border-radius: var(--rayon-cadre); padding: 20px 22px 22px; min-width: 0;
  box-shadow: var(--ombre); transition: transform var(--vite), box-shadow var(--vite), background-color .3s ease;
}
.carte:hover { transform: translateY(-3px); box-shadow: var(--ombre-forte); }
.carte .carte-tete { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.carte .carte-tete svg { width: 17px; height: 17px; color: var(--texte-doux); }
.carte .titre { font-size: 13.5px; font-weight: 600; color: var(--texte-doux); }
.carte .valeur {
  font-family: var(--titres); font-size: 46px; font-weight: 800; color: var(--titre);
  line-height: .95; letter-spacing: -.03em;
}
.carte .valeur small { font-family: var(--police); font-size: 16px; font-weight: 700; color: var(--texte-doux); margin-left: 6px; letter-spacing: 0; }
.carte .note { font-size: 13px; color: var(--texte-doux); margin-top: 10px; }
.carte.alerte { background: var(--magenta); }
.carte.alerte .carte-tete svg, .carte.alerte .titre, .carte.alerte .note, .carte.alerte .valeur { color: var(--sur-magenta); }
.carte.alerte .carte-tete svg { animation: clignote 2.4s ease-in-out 1.2s 3; }
@keyframes clignote { 50% { opacity: .35; } }
.carte.ok .carte-tete svg, .carte.ok .valeur { color: var(--vert); }

/* Le moment du chargement : les blocs montent l'un après l'autre */
.cartes .carte, .actions-principales > *, .actions-secondaires, .zone .panneau {
  animation: monte .55s cubic-bezier(.2,.75,.2,1) both;
}
.cartes .carte:nth-child(2) { animation-delay: .06s; }
.cartes .carte:nth-child(3) { animation-delay: .12s; }
.actions-principales > :nth-child(1) { animation-delay: .16s; }
.actions-principales > :nth-child(2) { animation-delay: .22s; }
.actions-secondaires { animation-delay: .26s; }
.zone .panneau:nth-of-type(1) { animation-delay: .05s; }
.zone .panneau:nth-of-type(2) { animation-delay: .1s; }
.zone .panneau:nth-of-type(3) { animation-delay: .15s; }
@keyframes monte { from { opacity: 0; transform: translateY(14px); } }

/* ---------------- Boutons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--rayon-champ); font-size: 14px;
  font-weight: 600; border: 1.5px solid transparent; cursor: pointer; text-align: center;
  font-family: var(--police); line-height: 1.3;
  transition: background-color var(--vite), border-color var(--vite), color var(--vite), transform .1s ease, box-shadow var(--vite);
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-principal { background: var(--accent); color: var(--sur-accent); box-shadow: 0 6px 16px -8px var(--accent); }
.btn-principal:hover { background: var(--accent-2); color: var(--sur-accent); box-shadow: 0 10px 22px -10px var(--accent); }
.btn-secondaire { background: var(--surface); color: var(--titre); border-color: var(--trait-vif); }
.btn-secondaire:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--magenta); color: var(--sur-magenta); }
.btn-danger:hover { filter: brightness(.92); color: var(--sur-magenta); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; }

/* Les deux opérations du magasin */
.actions-principales { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.action-principale {
  display: flex; align-items: center; gap: 16px; position: relative; overflow: hidden;
  background: var(--accent); color: var(--sur-accent); border-radius: var(--rayon-cadre); padding: 24px 26px;
  box-shadow: var(--ombre); transition: transform var(--vite), box-shadow var(--vite), background-color .3s ease;
}
.action-principale:nth-child(2) { background: var(--surface); color: var(--titre); }
.action-principale:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--ombre-forte); color: var(--sur-accent); }
.action-principale:nth-child(2):hover { color: var(--titre); }
/* Flèche qui glisse au survol */
.action-principale::after {
  content: "→"; margin-left: auto; font-size: 22px; font-weight: 700; opacity: .5;
  transition: transform var(--vite), opacity var(--vite);
}
.action-principale:hover::after { transform: translateX(5px); opacity: 1; }
.action-principale .icone {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center;
  transition: transform .3s cubic-bezier(.3,1.5,.5,1);
}
.action-principale:hover .icone { transform: rotate(-8deg) scale(1.08); }
.action-principale:nth-child(2) .icone { background: var(--jaune); color: #2A1E00; }
.action-principale .icone svg { width: 23px; height: 23px; }
.action-principale .titre { font-family: var(--titres); font-size: 19px; font-weight: 800; }
.action-principale .desc { font-size: 13.5px; opacity: .8; margin-top: 2px; }

/* Raccourcis : une rangée de pastilles */
.actions-secondaires { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.action-secondaire {
  display: inline-flex; align-items: center; gap: 8px; color: var(--titre);
  background: var(--surface); padding: 8px 15px 8px 12px; border-radius: 999px; font-size: 13.5px;
  border: 1.5px solid var(--trait); transition: border-color var(--vite), transform var(--vite), background-color .3s ease;
}
.action-secondaire svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.action-secondaire:hover { border-color: var(--accent); text-decoration: none; color: var(--titre); transform: translateY(-2px); }
.action-secondaire .titre { font-weight: 600; }
.action-secondaire.desactive { opacity: .45; cursor: not-allowed; }

/* ---------------- Formulaires ---------------- */
.champ { margin-bottom: 16px; }
.champ label { display: block; font-size: 13px; font-weight: 600; color: var(--titre); margin-bottom: 6px; }
.champ input[type=text], .champ input[type=number], .champ input[type=date],
.champ input[type=password], .champ input[type=file], .champ select, .champ textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--trait-vif); border-radius: var(--rayon-champ);
  font-size: 14.5px; font-family: var(--police); background: var(--surface); color: var(--texte);
  transition: border-color var(--vite), box-shadow var(--vite), background-color .3s ease;
}
.champ input:hover, .champ select:hover, .champ textarea:hover { border-color: var(--texte-doux); }
.champ input:focus, .champ select:focus, .champ textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--anneau);
}
.ligne-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.case { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.case input { cursor: pointer; accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------------- Panneaux / sections ---------------- */
.panneau {
  background: var(--surface); border-radius: var(--rayon-cadre); box-shadow: var(--ombre);
  padding: 24px 26px; margin-bottom: 18px; min-width: 0; transition: background-color .3s ease;
}
.panneau h2 { font-size: 20px; font-weight: 800; margin: 0 0 16px; color: var(--titre); line-height: 1.25; letter-spacing: -.01em; }
.panneau h2.alerte { color: var(--magenta); }
.panneau .vide-ok { color: var(--vert); font-size: 14px; font-weight: 600; margin: 0; }
.panneau .note-bas { font-size: 13px; color: var(--texte-doux); margin: 14px 0 0; }
.bandeau-section {
  display: flex; align-items: center; gap: 10px; font-family: var(--titres); font-size: 16px; font-weight: 800;
  color: var(--titre); margin: -2px 0 18px;
}
.bandeau-section::before { content: ""; width: 12px; height: 12px; border-radius: 4px; background: var(--accent); flex-shrink: 0; }

/* ---------------- Tableaux ---------------- */
.panneau:has(> table.liste) { overflow-x: auto; }
table.liste { width: 100%; border-collapse: collapse; font-size: 14px; }
table.liste th {
  background: var(--surface-2); color: var(--texte-doux); text-align: left; padding: 12px 14px;
  font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--trait); white-space: nowrap;
}
table.liste th:first-child { border-top-left-radius: var(--rayon-cadre); }
table.liste th:last-child  { border-top-right-radius: var(--rayon-cadre); }
.panneau > table.liste:not(:first-child) th { border-radius: 0; }
table.liste td { padding: 12px 14px; border-bottom: 1px solid var(--trait); transition: background-color .12s ease; }
table.liste tbody tr:last-child td { border-bottom: none; }
table.liste tr.alerte td { background: var(--fond-alerte); }
table.liste tr.alerte td:first-child { box-shadow: inset 4px 0 0 var(--magenta); }
table.liste tbody tr:hover td { background: var(--survol-ligne); }
table.liste tbody tr.alerte:hover td { background: var(--fond-alerte); filter: brightness(.98); }

.statut-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.statut-ok { background: var(--fond-ok); color: var(--texte-ok); }
.statut-alerte { background: var(--magenta); color: var(--sur-magenta); }
.statut-alerte::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pouls 1.6s ease-in-out infinite; }
@keyframes pouls { 50% { opacity: .25; } }
.statut-attente { background: var(--fond-attente); color: var(--texte-attente); }

/* ---------------- Jauges : stock face au seuil ---------------- */
.jauges-legende { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--texte-doux); margin: -6px 0 16px; }
.jauges-legende span { display: inline-flex; align-items: center; gap: 6px; }
.jauges-legende .pastille { width: 16px; height: 8px; border-radius: 4px; background: var(--vert); }
.jauges-legende .pastille.alerte { background: var(--magenta); }
.jauges-legende .repere { width: 2px; height: 14px; background: var(--titre); }

.jauge-ligne {
  display: grid; grid-template-columns: minmax(0, 230px) minmax(0, 1fr) 54px;
  align-items: center; gap: 16px; padding: 7px 8px; margin: 0 -8px; font-size: 14px; border-radius: 10px;
  transition: background-color .12s ease;
}
.jauge-ligne:hover { background: var(--survol-ligne); }
.jauge-nom { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jauge-fond { background: var(--jauge-fond); border-radius: 6px; height: 12px; position: relative; }
.jauge-fond::after {
  content: ""; position: absolute; top: -4px; bottom: -4px; width: 2px;
  left: var(--seuil, 50%); background: var(--titre); transform: translateX(-1px); border-radius: 1px;
}
.jauge-remplissage {
  height: 100%; background: var(--vert); border-radius: 6px; max-width: 100%;
  transform-origin: left center; animation: remplit .9s cubic-bezier(.25,.8,.25,1) both;
}
.jauge-ligne:nth-of-type(2) .jauge-remplissage { animation-delay: .04s; }
.jauge-ligne:nth-of-type(3) .jauge-remplissage { animation-delay: .08s; }
.jauge-ligne:nth-of-type(4) .jauge-remplissage { animation-delay: .12s; }
.jauge-ligne:nth-of-type(5) .jauge-remplissage { animation-delay: .16s; }
.jauge-ligne:nth-of-type(n+6) .jauge-remplissage { animation-delay: .2s; }
@keyframes remplit { from { transform: scaleX(0); } }
.jauge-remplissage.alerte { background: var(--magenta); }
.jauge-valeur { text-align: right; font-family: var(--titres); font-weight: 800; }
.jauge-ligne.alerte .jauge-valeur, .jauge-ligne.alerte .jauge-nom { color: var(--magenta); font-weight: 700; }

/* ---------------- Barre d'outils ---------------- */
.barre-outils {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px;
  background: var(--surface); padding: 10px; border-radius: var(--rayon-cadre); box-shadow: var(--ombre);
}
.barre-outils input[type=text], .barre-outils input[type=date] {
  padding: 9px 12px; border: 1.5px solid var(--trait-vif); border-radius: var(--rayon-champ);
  font-size: 14px; font-family: var(--police); background: var(--surface); color: var(--texte);
  transition: border-color var(--vite), box-shadow var(--vite);
}
.barre-outils input[type=text] { flex: 1 1 240px; min-width: 0; }
.barre-outils input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--anneau); }

/* ---------------- Document imprimable (bon / fiche) : toujours une feuille blanche ---------------- */
.document {
  background: var(--doc-fond); color: var(--doc-texte); max-width: 760px; margin: 0 auto;
  padding: 50px 54px; border-radius: 6px; box-shadow: var(--ombre-forte);
  border-top: 8px solid var(--accent);
  animation: monte .5s cubic-bezier(.2,.75,.2,1) both;
}
.document a { color: var(--doc-marque); }
.document.large { max-width: 980px; }
.document .entete-officiel { text-align: center; font-size: 12.5px; color: var(--doc-doux); line-height: 1.7; }
.document .titre-document {
  text-align: center; font-family: var(--titres); font-size: 30px; font-weight: 800; color: var(--doc-marque);
  margin: 12px 0 24px; padding-bottom: 16px; border-bottom: 2px solid var(--doc-marque);
}
.document .infos-doc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 26px; margin-bottom: 24px; font-size: 14px; align-items: start; }
.document .infos-doc strong { color: var(--doc-doux); font-weight: 600; font-size: 12px; display: block; margin-bottom: 1px; }

.tampon {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 94px; height: 94px; border-radius: 50%; border: 2.5px solid #E8590C; color: #E8590C;
  box-shadow: inset 0 0 0 3px var(--doc-fond), inset 0 0 0 4.5px #E8590C;
  transform: rotate(-8deg); animation: tamponne .5s .35s cubic-bezier(.3,1.6,.5,1) both;
}
@keyframes tamponne { from { transform: rotate(-8deg) scale(1.6); opacity: 0; } }
.tampon .tampon-label { font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.tampon .tampon-num { font-family: var(--titres); font-size: 17px; font-weight: 800; }

.document table.doc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 22px; }
.document table.doc-table th { background: var(--doc-marque); color: #fff; padding: 9px 11px; text-align: left; font-size: 12px; font-weight: 600; }
.document table.doc-table td { padding: 9px 11px; border-bottom: 1px solid var(--doc-trait); }
.document .signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 54px; }
.document .signatures div { border-top: 1.5px solid var(--doc-marque); padding-top: 8px; text-align: center; font-size: 12.5px; color: var(--doc-doux); }
.barre-impression { max-width: 760px; margin: 0 auto 16px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.barre-impression.large { max-width: 980px; }

@media print {
  .menu, .barre-impression, .flash, .pied-page { display: none !important; }
  body { background: #fff; }
  body.avec-menu .zone { margin-left: 0; }
  .conteneur { padding: 0; }
  .document { border: none; box-shadow: none; max-width: 100%; padding: 0; animation: none; }
  .tampon { animation: none; }
  .document table.doc-table th { background: none; color: var(--doc-marque); border-bottom: 2px solid var(--doc-marque); }
}

/* ---------------- Panier (saisie du bon de sortie) ---------------- */
.panier-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 14px; }
.panier-table th { text-align: left; padding: 9px 10px; font-size: 12.5px; color: var(--texte-doux); font-weight: 600; background: var(--surface-2); }
.panier-table th:first-child { border-radius: var(--rayon-champ) 0 0 var(--rayon-champ); }
.panier-table th:last-child  { border-radius: 0 var(--rayon-champ) var(--rayon-champ) 0; }
.panier-table td { padding: 10px; border-bottom: 1px solid var(--trait); }
.panier-table tbody tr:not(#panierVideLigne) { animation: ligne-entre .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes ligne-entre { from { opacity: 0; transform: translateX(-10px); } }
.panier-vide { color: var(--texte-doux); padding: 18px 4px; font-size: 14px; text-align: center; }

.pied-page { text-align: center; color: var(--texte-doux); font-size: 12px; padding: 18px 16px 24px; }

/* ---------------- Page de connexion ---------------- */
/* À gauche, le rayonnage (étagères et cartons de toner) ; à droite, le formulaire */
.ecran-connexion {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  background: var(--surface);
}
.ecran-connexion::before {
  content: ""; background-color: var(--menu);
  background-image: repeating-linear-gradient(180deg, transparent 0 132px, var(--menu-trait) 132px 140px);
}
/* Cartons sur les étagères, dessinés par le gabarit */
.etageres { display: none; }
.ecran-connexion:has(.etageres)::before { display: none; }
.ecran-connexion .etageres {
  display: block; position: relative; overflow: hidden; background: var(--menu);
  background-image: repeating-linear-gradient(180deg, transparent 0 132px, var(--menu-trait) 132px 140px);
}
.etageres .carton {
  /* posé sur l'étagère n° --rang (la tablette commence à 132px puis tous les 140px) */
  position: absolute; top: calc(132px + var(--rang) * 140px - var(--h));
  left: var(--x); width: var(--l); height: var(--h); border-radius: 6px;
  background: var(--c); transform-origin: bottom center;
  animation: pose .7s cubic-bezier(.3,1.4,.5,1) both; animation-delay: var(--d);
}
.etageres .carton::after {
  content: ""; position: absolute; left: 22%; right: 22%; top: 30%; height: 18%; border-radius: 3px; background: rgba(255,255,255,.75);
}
@keyframes pose { from { transform: translateY(-60px); opacity: 0; } }
.etageres .slogan {
  position: absolute; left: 48px; right: 48px; bottom: 40px; color: #fff;
  font-family: var(--titres); font-size: clamp(22px, 2.6vw, 34px); font-weight: 800; line-height: 1.15; letter-spacing: -.01em;
  max-width: 16ch;
}

.encre-fond { display: none; }
.carte-connexion { align-self: center; justify-self: center; width: 100%; max-width: 380px; padding: 40px 24px; }
.sceau-cmj { position: relative; width: 62px; height: 58px; margin: 0 0 18px; isolation: isolate; }
.sceau-cmj span { position: absolute; width: 34px; height: 34px; border-radius: 50%; mix-blend-mode: multiply; }
:root[data-theme="dark"] .sceau-cmj span { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sceau-cmj span { mix-blend-mode: screen; } }
.sceau-cmj .c { background: var(--cyan);    left: 4px;  top: 2px;  animation: cale-c .9s .15s cubic-bezier(.2,.8,.2,1) both; }
.sceau-cmj .m { background: var(--magenta); left: 24px; top: 2px;  animation: cale-m .9s .15s cubic-bezier(.2,.8,.2,1) both; }
.sceau-cmj .j { background: var(--jaune);   left: 14px; top: 20px; animation: cale-j .9s .15s cubic-bezier(.2,.8,.2,1) both; }
@keyframes cale-c { from { transform: translate(-14px, -8px); } }
@keyframes cale-m { from { transform: translate(14px, -8px); } }
@keyframes cale-j { from { transform: translate(0, 14px); } }
@keyframes tourne { to { transform: rotate(360deg); } }

.carte-connexion .titre-appli { font-size: 44px; font-weight: 800; color: var(--titre); letter-spacing: -.01em; line-height: 1; margin: 0; }
.carte-connexion .sous-titre-appli { font-size: 14.5px; color: var(--texte-doux); margin: 8px 0 30px; }
.carte-connexion .btn { padding: 13px 18px; font-size: 15px; }
.carte-connexion .flash-danger { animation: secoue .45s; }
@keyframes secoue { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

.btn-chargement::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; opacity: .8;
  animation: tourne .7s linear infinite;
}

/* ---------------- Modale ---------------- */
.modale-fond {
  display: none; position: fixed; inset: 0; background: var(--voile); backdrop-filter: blur(3px);
  z-index: 100; align-items: flex-start; justify-content: center; padding: 60px 16px; overflow-y: auto;
}
.modale-fond.ouverte { display: flex; animation: apparition .16s ease; }
.modale-boite {
  background: var(--surface); border-radius: var(--rayon-cadre); padding: 28px 30px; width: 100%; max-width: 440px;
  box-shadow: var(--ombre-forte); animation: entree-modale .25s cubic-bezier(.3,1.3,.5,1);
}
.modale-boite h2 { font-size: 21px; font-weight: 800; margin: 0 0 6px; color: var(--titre); }
@keyframes apparition { from { opacity: 0; } }
@keyframes entree-modale { from { opacity: 0; transform: translateY(-10px) scale(.97); } }

/* ---------------- Mouvement réduit ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .carte .valeur { font-size: 38px; }
}
@media (max-width: 900px) {
  .menu {
    position: sticky; top: 0; inset: auto; width: auto; height: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 16px 0; gap: 4px 10px;
  }
  body.avec-menu .zone { margin-left: 0; }
  .marque { padding: 0 0 6px; }
  .marque-texte .sous-titre { display: none; }
  .bascule-theme { margin: 0 0 6px auto; padding: 7px 9px; }
  .bascule-theme .libelle { display: none; }
  .bascule-theme .piste { margin-left: 4px; }
  .menu-utilisateur { margin: 0 0 6px; padding: 0; border: none; }
  .menu-utilisateur .infos { display: none; }
  .menu-nav {
    order: 3; flex-basis: 100%; flex-direction: row; overflow-x: auto; gap: 2px;
    margin: 0 -16px; padding: 0 12px; -webkit-overflow-scrolling: touch;
  }
  .menu-groupe { display: none; }
  .menu-nav a { white-space: nowrap; border-radius: 12px 12px 0 0; padding: 10px 12px; }
  .menu-nav a:hover { padding-left: 12px; }
  .menu-nav a.actif::before, .menu-nav a.actif::after { display: none; }
  .conteneur { padding: 24px 16px 40px; }
  .cartes, .actions-principales { grid-template-columns: 1fr; }
  .ecran-connexion { grid-template-columns: 1fr; grid-template-rows: 180px auto; }
  .etageres .slogan { display: none; }
}
@media (max-width: 600px) {
  h1.titre-page { font-size: 26px; }
  .jauge-ligne { grid-template-columns: minmax(0, 1fr) 46px; row-gap: 6px; }
  .jauge-ligne .jauge-fond { grid-column: 1 / -1; grid-row: 2; }
  .panneau { padding: 18px 16px; }
  .document { padding: 28px 18px; }
  .document .infos-doc { grid-template-columns: 1fr; }
  .ligne-champs { grid-template-columns: 1fr; }
}

/* ==========================================================================
   AJOUTS : accueil, graphiques, recherche rapide, notifications, effets
   ========================================================================== */

/* ---------------- Accueil du tableau de bord ---------------- */
.accueil { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.accueil .titre-page { margin: 0; }
.accueil-salut { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--accent); }
.horloge { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.horloge-heure { font-family: var(--titres); font-size: 34px; font-weight: 800; color: var(--titre); letter-spacing: -.02em; }
.horloge-date { font-size: 13px; color: var(--texte-doux); margin-top: 4px; }

/* ---------------- Titres de page : soulignement qui se trace ---------------- */
h1.titre-page { position: relative; padding-bottom: 12px; }
h1.titre-page::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 5px; width: 64px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent) 0 60%, var(--jaune) 60% 80%, var(--cyan) 80%);
  transform-origin: left; animation: trace .7s .1s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes trace { from { transform: scaleX(0); } }

/* ---------------- Graphiques ---------------- */
.graphiques {
  display: grid; gap: 16px; margin-bottom: 18px;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}
.graphiques .panneau { margin: 0; }
.graphe-sous { margin: -10px 0 18px; font-size: 13px; color: var(--texte-doux); }
.panneau .vide { color: var(--texte-doux); font-size: 14px; margin: 0; }

/* Barres verticales par mois */
.barres { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; height: 210px; align-items: stretch; }
.barre-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.barre-valeur { font-family: var(--titres); font-weight: 800; font-size: 14px; color: var(--titre); }
.barre-piste { flex: 1; width: 100%; display: flex; align-items: flex-end; border-radius: 10px; background: var(--surface-2); }
.barre {
  width: 100%; min-height: 4px; border-radius: 10px; background: var(--jauge-fond);
  background: linear-gradient(180deg, var(--cyan), color-mix(in srgb, var(--cyan) 55%, var(--surface)));
  transform-origin: bottom; animation: monte-barre .8s cubic-bezier(.25,.8,.25,1) both;
  animation-delay: calc(var(--i) * .07s + .2s); transition: filter var(--vite);
}
.barre-col.courant .barre { background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--surface))); }
.barre-col:hover .barre { filter: brightness(1.12) saturate(1.1); }
.barre-libelle { font-size: 12.5px; color: var(--texte-doux); }
.barre-col.courant .barre-libelle { color: var(--accent); font-weight: 700; }
@keyframes monte-barre { from { transform: scaleY(0); } }

/* Anneau par service */
.anneau-zone { position: relative; width: 170px; max-width: 100%; aspect-ratio: 1; margin: 0 auto 16px; }
.anneau { width: 100%; height: 100%; transform: rotate(0deg); }
.anneau-part { animation: dessine 1s cubic-bezier(.3,.8,.3,1) both; animation-delay: calc(var(--i) * .12s + .25s); transition: stroke-width var(--vite); cursor: default; }
.anneau-part:hover { stroke-width: 7.5; }
@keyframes dessine { from { stroke-dasharray: 0 100; } }
.anneau-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.anneau-centre b { font-family: var(--titres); font-size: 34px; font-weight: 800; color: var(--titre); line-height: 1; }
.anneau-centre span { font-size: 12.5px; color: var(--texte-doux); }
.legende { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.legende li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.legende i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legende-nom { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legende b { font-family: var(--titres); }

/* Classement des articles */
.classement { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.classement li { display: flex; align-items: center; gap: 12px; animation: monte .5s cubic-bezier(.2,.75,.2,1) both; animation-delay: calc(var(--i) * .06s + .2s); }
.rang {
  width: 30px; height: 30px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--titres); font-weight: 800; font-size: 14px; background: var(--surface-2); color: var(--titre);
}
.classement li:first-child .rang { background: var(--jaune); color: #2A1E00; }
.classement-corps { flex: 1; min-width: 0; }
.classement-ligne { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 5px; }
.classement-nom { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.classement-ligne b { font-family: var(--titres); }
.classement-barre { height: 7px; border-radius: 4px; background: var(--jauge-fond); overflow: hidden; }
.classement-barre span { display: block; height: 100%; border-radius: 4px; background: var(--accent); transform-origin: left; animation: remplit .9s cubic-bezier(.25,.8,.25,1) both; animation-delay: calc(var(--i) * .08s + .3s); }

/* Fil des derniers bons */
.fil { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fil li { animation: glisse .45s cubic-bezier(.2,.75,.2,1) both; animation-delay: calc(var(--i) * .06s + .2s); }
@keyframes glisse { from { opacity: 0; transform: translateX(-12px); } }
.fil a {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 12px; color: var(--texte); transition: background-color var(--vite), transform var(--vite);
}
.fil a:hover { background: var(--surface-2); text-decoration: none; transform: translateX(4px); }
.fil-num { font-family: var(--titres); font-weight: 800; font-size: 13px; color: var(--accent); background: var(--fond); padding: 3px 9px; border-radius: 8px; }
.fil-service { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.fil-date { font-size: 13px; color: var(--texte-doux); }

/* ---------------- Lignes de tableau qui arrivent une par une ---------------- */
table.liste tbody tr { animation: glisse .4s cubic-bezier(.2,.75,.2,1) both; }
table.liste tbody tr:nth-child(2) { animation-delay: .03s; }
table.liste tbody tr:nth-child(3) { animation-delay: .06s; }
table.liste tbody tr:nth-child(4) { animation-delay: .09s; }
table.liste tbody tr:nth-child(5) { animation-delay: .12s; }
table.liste tbody tr:nth-child(6) { animation-delay: .15s; }
table.liste tbody tr:nth-child(7) { animation-delay: .18s; }
table.liste tbody tr:nth-child(8) { animation-delay: .21s; }
table.liste tbody tr:nth-child(n+9) { animation-delay: .24s; }

/* ---------------- Effet d'onde au clic ---------------- */
.btn, .action-principale, .action-secondaire { position: relative; overflow: hidden; }
.onde {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: currentColor; opacity: .22; transform: scale(0); animation: onde .65s ease-out forwards;
}
@keyframes onde { to { transform: scale(1); opacity: 0; } }

/* Reflet qui balaie le bloc "Nouveau bon de sortie" au survol */
.action-principale:first-child::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.28) 50%, transparent 65%);
  transform: translateX(-100%);
}
.action-principale:first-child:hover::before { animation: reflet .9s ease; }
@keyframes reflet { to { transform: translateX(100%); } }

/* ---------------- Bouton "Rechercher" du menu ---------------- */
.ouvrir-palette {
  display: flex; align-items: center; gap: 10px; margin: 0 14px 10px 0; padding: 9px 10px 9px 12px;
  background: var(--menu-2); color: var(--texte-menu-doux); border: 1px solid var(--menu-trait); border-radius: 12px;
  font: 500 13.5px var(--police); cursor: pointer; text-align: left; transition: color var(--vite), border-color var(--vite);
}
.ouvrir-palette:hover { color: #fff; border-color: var(--accent); }
.ouvrir-palette svg { width: 17px; height: 17px; flex-shrink: 0; }
.ouvrir-palette span { flex: 1; }
kbd {
  font: 600 11px var(--police); padding: 2px 6px; border-radius: 6px;
  background: rgba(127,127,127,.18); border: 1px solid rgba(127,127,127,.28); color: inherit; white-space: nowrap;
}

/* ---------------- Palette de recherche (Ctrl+K) ---------------- */
.palette-fond {
  position: fixed; inset: 0; z-index: 200; background: var(--voile); backdrop-filter: blur(4px);
  display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px;
  animation: apparition .15s ease;
}
.palette-fond[hidden] { display: none; }
.palette {
  width: 100%; max-width: 580px; background: var(--surface); border-radius: 20px; box-shadow: var(--ombre-forte);
  overflow: hidden; animation: entree-modale .25s cubic-bezier(.3,1.3,.5,1);
}
.palette-saisie { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--trait); color: var(--texte-doux); }
.palette-saisie svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent); }
.palette-saisie input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font: 500 17px var(--police); color: var(--texte); }
.palette-liste { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
.palette-liste li {
  display: flex; flex-direction: column; gap: 1px; padding: 10px 14px; border-radius: 12px; cursor: pointer;
  animation: glisse .25s cubic-bezier(.2,.75,.2,1) both; animation-delay: calc(var(--i) * .025s);
}
.palette-liste li b { font-weight: 600; color: var(--titre); }
.palette-liste li span { font-size: 13px; color: var(--texte-doux); }
.palette-liste li.actif { background: var(--accent); }
.palette-liste li.actif b, .palette-liste li.actif span { color: var(--sur-accent); }
.palette-liste li.recherche b::before { content: "⌕ "; }
.palette-pied { display: flex; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--trait); font-size: 12px; color: var(--texte-doux); }
.palette-pied kbd { margin-right: 3px; }

/* ---------------- Notifications (toasts) ---------------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 150; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.flash.toast {
  position: relative; overflow: hidden; margin: 0; padding: 14px 40px 16px 16px;
  box-shadow: var(--ombre-forte); border-radius: 14px; backdrop-filter: blur(6px);
  animation: toast-entre .45s cubic-bezier(.3,1.3,.5,1) both;
}
@keyframes toast-entre { from { opacity: 0; transform: translateX(40px) scale(.96); } }
.flash.toast-sort { animation: toast-sort .3s ease forwards; }
@keyframes toast-sort { to { opacity: 0; transform: translateX(40px); } }
.toast-fermer {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: none; border-radius: 8px;
  background: transparent; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: .6;
}
.toast-fermer:hover { opacity: 1; background: rgba(127,127,127,.15); }
.toast-temps { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: currentColor; opacity: .35; transform-origin: left; animation: decompte 7s linear forwards; }
.toast-pause .toast-temps { animation-play-state: paused; }
@keyframes decompte { to { transform: scaleX(0); } }

/* ---------------- Ajouts responsive ---------------- */
@media (max-width: 1000px) {
  .graphiques { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .ouvrir-palette { order: 2; margin: 0 0 6px; padding: 7px 9px; }
  .ouvrir-palette span, .ouvrir-palette kbd { display: none; }
  .horloge { align-items: flex-start; }
}
@media (max-width: 600px) {
  .barres { gap: 6px; height: 170px; }
  .horloge-heure { font-size: 26px; }
}
