/* ASECNA Santé — style simple, mobile d'abord, bon contraste.
   Même famille que la Bibliothèque ASECNA (police, structure, boutons, cartes),
   avec sa propre couleur d'accent : vert-teal sobre. */
:root {
  --accent: #0f766e;
  --accent-hover: #0b5c56;
  --accent-clair: #e6f4f2;
  --fond: #f4f8f7;
  --carte: #ffffff;
  --texte: #1e293b;
  --gris: #5b6779;
  --bordure: #d5e3e0;
  --vert: #e3f4e6;
  --orange: #fff1d6;
  --rouge: #fde4e1;
  --ombre: 0 1px 2px rgba(15, 42, 40, 0.05), 0 1px 3px rgba(15, 42, 40, 0.06);
  --ombre-haute: 0 6px 16px rgba(15, 42, 40, 0.10), 0 2px 4px rgba(15, 42, 40, 0.06);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.45;
  color: var(--texte);
  background: var(--fond);
}

a { color: var(--accent); }

/* ---------- en-tête ---------- */
.entete {
  background: var(--carte);
  border-bottom: 1px solid var(--bordure);
  box-shadow: var(--ombre);
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
}
.entete-interieur { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.entete-logo { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.entete .logo {
  display: block; color: var(--accent); font-size: 1.2rem; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase; text-decoration: none; line-height: 1.2;
}
.entete-titre { display: flex; align-items: center; gap: 8px; }
.entete .sous-titre { display: block; font-size: 0.875rem; color: var(--gris); }

.contenu { max-width: 720px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: 8px 0 12px; color: var(--texte); }
h2 { font-size: 1.15rem; margin: 0 0 4px; }

/* ---------- formulaires ---------- */
.formulaire { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.formulaire label { font-weight: 600; margin-top: 8px; }
.formulaire label.case { font-weight: 400; display: flex; align-items: center; gap: 10px; min-height: 44px; }
.formulaire label.case input { width: 24px; height: 24px; accent-color: var(--accent); }
/* tous les champs de saisie : même style que la recherche de l'accueil, pleine largeur */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="file"]),
select, textarea {
  display: block; width: 100%; min-height: 48px; padding: 8px 12px; margin: 0;
  font-family: inherit; font-size: 1rem; line-height: 1.3; color: var(--texte);
  border: 1.5px solid #b3c4c1; border-radius: 9px; background: #fff;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
textarea { min-height: 96px; resize: vertical; }
input[type="file"] {
  display: block; width: 100%; min-height: 48px; padding: 8px 12px; font-family: inherit; font-size: 0.95rem;
  color: var(--texte); border: 1.5px dashed #b3c4c1; border-radius: 9px; background: #fff;
}
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 6px 12px; font: inherit; font-weight: 600; color: var(--accent);
  background: var(--accent-clair); border: 0; border-radius: 7px; cursor: pointer;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.22);
}
input::placeholder, textarea::placeholder { color: #66727f; }

/* ---------- boutons ---------- */
.bouton {
  display: block; width: 100%; min-height: 52px; padding: 12px 16px; margin-top: 10px;
  font-size: 1.05rem; font-weight: 600; text-align: center; text-decoration: none;
  color: #fff; background: var(--accent); border: 2px solid var(--accent); border-radius: 9px; cursor: pointer;
  transition: transform 0.18s var(--ease), filter 0.18s var(--ease), background-color 0.18s var(--ease);
}
.bouton:hover { transform: translateY(-1px); filter: brightness(1.06); }
.bouton-secondaire { color: var(--accent); background: #fff; }
.bouton-secondaire:hover { background: var(--accent-clair); }
.categories { display: grid; gap: 0; }
.categories .bouton { display: flex; justify-content: space-between; align-items: center; }
.nombre { background: var(--accent-clair); color: var(--accent); border-radius: 12px; padding: 0 10px; }

/* ---------- cartes de résultats ---------- */
.carte {
  display: block; margin-bottom: 12px; padding: 14px; text-decoration: none; color: var(--texte);
  background: var(--carte); border: 1px solid var(--bordure); border-radius: 12px; box-shadow: var(--ombre);
  animation: apparition 0.35s ease backwards;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}
.carte:hover { transform: translateY(-2px); box-shadow: var(--ombre-haute); border-color: #a9c7c2; }
.carte p { margin: 4px 0; }
.meta { color: var(--gris); }
.total { font-weight: 600; }
.badge {
  display: inline-block; margin-right: 6px; padding: 2px 10px; font-size: 0.9rem; font-weight: 600;
  color: var(--accent); background: var(--accent-clair); border-radius: 12px;
}

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

/* ---------- statut et avertissements ---------- */
.bandeau {
  padding: 10px 12px; font-weight: 600; color: #6b2a00; background: var(--orange);
  border-left: 6px solid #b4610c; border-radius: 6px;
}
.statut { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--bordure); }
.statut-confirmee { background: var(--vert); }
.statut-en_attente, .statut-a_actualiser { background: var(--orange); }
.statut-suspendue, .statut-terminee { background: var(--rouge); }

/* ---------- fiche ---------- */
.infos dt { margin-top: 14px; font-weight: 700; color: var(--accent); }
.infos dd { margin: 2px 0 0; white-space: pre-line; }
.retour { display: inline-block; padding: 8px 0; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pagination .bouton { width: auto; flex: 1; }
.pagination span { flex: 1; text-align: center; }

/* ---------- pied de page ---------- */
.pied {
  max-width: 720px; margin: 24px auto 0; padding: 16px; padding-bottom: max(20px, env(safe-area-inset-bottom));
  font-size: 0.9rem; color: var(--gris); border-top: 1px solid var(--bordure);
}
.pied p { margin: 0; }

/* ---------- écran de démarrage (splash, page d'accueil seulement) ---------- */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  height: 100vh; height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; text-align: center; background: var(--fond);
  transition: opacity 0.4s ease;
}
.splash.sortie { opacity: 0; pointer-events: none; }
html.sans-splash .splash { display: none; }
html:has(.splash) { overflow: hidden; } /* pas de barre de défilement derrière le splash */
.splash-centre { display: flex; flex-direction: column; align-items: center; max-width: 100%; }

/* La croix bat comme un cœur. Cycle de 1,1 s : deux pulsations rapprochées (pics à 18 % et 38 %), puis une pause.
   La croix, les deux halos et la ligne de pouls partagent le même cycle et le même départ (0,5 s) :
   le pic de la ligne de pouls tombe sur la première pulsation. */
.coeur {
  --taille: 96px; --flou: 14px;
  position: relative; isolation: isolate; width: var(--taille); height: var(--taille);
  animation: splash-croix 0.7s var(--ease) both; /* apparition avec un très léger rebond */
}
@keyframes splash-croix {
  0%   { opacity: 0; transform: scale(0.8); }
  60%  { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
.coeur-icone {
  width: 100%; height: 100%; border-radius: 22.9%; background: var(--accent);
  box-shadow: 0 14px 32px rgba(15, 118, 110, 0.30), 0 4px 10px rgba(15, 118, 110, 0.18);
  animation: battement 1.1s infinite 0.5s;
}
.coeur-icone svg { display: block; width: 100%; height: 100%; }
@keyframes battement {
  0%, 10% { transform: scale(1);    animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1); }
  18%     { transform: scale(1.12); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  27%, 31% { transform: scale(1);   animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1); }
  38%     { transform: scale(1.08); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  47%, 100% { transform: scale(1); }
}

/* halos verts très doux : un par pulsation, ils s'élargissent puis disparaissent */
.coeur::before, .coeur::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 22.9%;
  background: var(--accent); filter: blur(var(--flou)); opacity: 0; will-change: transform, opacity;
  animation-duration: 1.1s; animation-iteration-count: infinite; animation-delay: 0.5s;
  animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1);
}
.coeur::before { animation-name: halo-1; }
.coeur::after  { animation-name: halo-2; }
@keyframes halo-1 {
  0%, 10% { opacity: 0;    transform: scale(1); }
  18%     { opacity: 0.30; transform: scale(1.08); }
  40%     { opacity: 0;    transform: scale(1.6); }
  41%, 100% { opacity: 0;  transform: scale(1); }
}
@keyframes halo-2 {
  0%, 30% { opacity: 0;    transform: scale(1); }
  38%     { opacity: 0.22; transform: scale(1.06); }
  58%     { opacity: 0;    transform: scale(1.45); }
  59%, 100% { opacity: 0;  transform: scale(1); }
}

/* ligne de pouls : se dessine de gauche à droite pendant la 1re moitié du cycle (vitesse constante), reste, puis s'estompe */
.coeur-pouls { display: block; margin: var(--marge-pouls, 22px 0 18px); max-width: 70vw; height: auto; overflow: visible; }
.pouls {
  stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0;
  animation: pouls-cycle 1.1s infinite 0.5s;
}
@keyframes pouls-cycle {
  0%   { stroke-dashoffset: 1; opacity: 1; animation-timing-function: linear; }
  50%  { stroke-dashoffset: 0; opacity: 1; }
  76%  { stroke-dashoffset: 0; opacity: 1; }
  94%, 100% { stroke-dashoffset: 0; opacity: 0; }
}

.splash-titre, .splash-sous, .splash-mali { margin: 0; opacity: 0; animation: splash-texte 0.6s var(--ease) forwards; }
.splash-titre {
  font-size: 1.7rem; font-weight: 700; letter-spacing: 0.22em; text-indent: 0.22em; /* centre malgré l'espacement */
  color: var(--accent); animation-delay: 0.55s;
}
.splash-sous {
  margin-top: 8px; max-width: 300px; font-size: 0.95rem; color: var(--gris);
  text-wrap: balance; animation-delay: 0.75s; /* deux lignes équilibrées, jamais un mot seul */
}
.splash-mali {
  margin-top: 6px; max-width: 280px; font-size: 0.8rem; line-height: 1.35; color: #66727f;
  letter-spacing: 0.02em; text-wrap: balance; animation-delay: 0.9s;
}
@keyframes splash-texte { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* petits écrans et paysage : tout reste visible et centré */
@media (max-width: 360px) { .splash-titre { font-size: 1.4rem; letter-spacing: 0.16em; text-indent: 0.16em; } }
@media (max-height: 430px) {
  .splash .coeur { --taille: 72px; }
  .splash .coeur-pouls { --marge-pouls: 12px 0 10px; }
  .splash-titre { font-size: 1.35rem; }
}

/* « moins d'animations » : la croix reste fixe, sans halo */
@media (prefers-reduced-motion: reduce) {
  .coeur, .coeur-icone, .splash-titre, .splash-sous, .splash-mali, .carte { animation: none; opacity: 1; transform: none; }
  .coeur::before, .coeur::after { display: none; }
  .pouls { animation: none; stroke-dashoffset: 0; opacity: 0.35; }
  .bouton, .carte, input, select { transition: none; }
  .bouton:hover, .carte:hover { transform: none; }
}

@media (min-width: 600px) {
  .categories { grid-template-columns: 1fr 1fr; column-gap: 10px; }
  .bouton { width: auto; }
  .categories .bouton, .formulaire .bouton { width: 100%; }
  .actions { display: flex; gap: 10px; }
  .actions .bouton { flex: 1; }
}

/* ---------- page d'accueil (mise en page de la connexion de la Bibliothèque) ---------- */
.accueil { max-width: 1200px; margin: 0 auto; padding: 24px 12px 0; }
.accueil-grille { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: center; }

/* à gauche : le cœur en grand + la devise */
.coeur-hero { display: flex; flex-direction: column; align-items: center; text-align: center; }
.coeur-hero .coeur { --taille: 64px; --flou: 10px; }
.coeur-hero .coeur-pouls { display: none; }
.devise { margin: 14px 0 0; font-style: italic; color: var(--gris); font-size: 0.95rem; }

/* à droite : carte blanche */
.carte-accueil {
  position: relative; overflow: hidden; background: var(--carte);
  border: 1px solid var(--bordure); border-radius: 16px;
  box-shadow: 0 18px 48px rgba(15, 42, 40, 0.16);
  padding: 24px 18px 20px;
}
.carte-entete { text-align: center; padding-top: 8px; margin-bottom: 18px; }
.carte-logo { width: 104px; height: 104px; border-radius: 50%; box-shadow: 0 4px 14px rgba(15, 118, 110, 0.20); }
.carte-entete h1 {
  margin: 14px 0 8px; font-size: 1.3rem; font-weight: 700; line-height: 1.25;
  letter-spacing: 0.03em; text-transform: uppercase; color: var(--accent);
}
.carte-org { margin: 0 0 4px; font-size: 1rem; font-weight: 600; line-height: 1.4; text-wrap: balance; }
.carte-sous { margin: 0; font-size: 0.95rem; font-style: italic; color: var(--gris); }
.formulaire { margin-bottom: 8px; }
.bouton-principal { margin-top: 14px; box-shadow: var(--ombre); }
.titre-categories { margin: 22px 0 6px; font-size: 1rem; color: var(--gris); font-weight: 600; }

/* bouton « À propos » en haut à droite */
.bouton-propos {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px;
  font-size: 0.95rem; font-weight: 600; text-decoration: none; color: var(--texte);
  background: #fff; border: 1.5px solid #b3c4c1; border-radius: 9px;
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease);
}
.bouton-propos:hover { transform: translateY(-1px); background: var(--accent-clair); }

.apropos-titre { margin: 22px 0 6px; color: var(--accent); }

/* téléphone : la carte prend toute la largeur, le cœur reste petit au-dessus */
@media (max-width: 991px) {
  .accueil { padding-top: 56px; } /* place pour « À propos » */
}

/* grand écran : cœur à gauche, carte à droite */
@media (min-width: 992px) {
  .accueil { padding: 64px 24px 24px; } /* la carte commence sous « À propos » */
  .accueil-grille { grid-template-columns: 5fr 7fr; gap: 48px; min-height: calc(100vh - 170px); }
  .coeur-hero .coeur { --taille: 200px; --flou: 28px; }
  .coeur-hero .coeur-pouls { display: block; width: 340px; --marge-pouls: 44px 0 30px; }
  .devise { font-size: 1.1rem; margin-top: 8px; }
  .carte-accueil { padding: 34px 40px 30px; }
  .carte-accueil .categories .bouton { min-height: 46px; margin-top: 8px; padding: 8px 16px; }
  .carte-entete h1 { font-size: 1.45rem; }
  .bouton-propos { top: 16px; right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .bouton-propos { transition: none; }
}

/* ---------- comptes : en-tête, connexion, messages ---------- */
.entete-interieur { flex-wrap: wrap; }
.entete-compte { margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-size: 0.85rem; }
.compte-nom { font-weight: 600; }
.compte-role { color: var(--gris); }
.entete-compte form { margin: 0; }
.bouton-lien {
  padding: 6px 2px; font: inherit; font-weight: 600; color: var(--accent); background: none; border: 0;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 40px;
}
.champ-mdp { position: relative; width: 100%; }
.champ-mdp input { padding-right: 88px; }
.bouton-oeil {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%); min-height: 44px; padding: 4px 12px;
  font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--accent); background: var(--accent-clair);
  border: 0; border-radius: 7px; cursor: pointer;
}
.alerte, .succes { padding: 10px 12px; border-radius: 8px; font-weight: 600; margin: 0 0 12px; }
.alerte { color: #7a1d12; background: var(--rouge); border-left: 5px solid #c0392b; }
.succes { color: #12512b; background: var(--vert); border-left: 5px solid #1e7d4f; }
.lien-carte { margin: 14px 0 0; text-align: center; font-weight: 600; }
.aide-carte { margin: 10px 0 0; text-align: center; font-size: 0.9rem; color: var(--gris); }
.aide { color: var(--gris); font-size: 0.9rem; }
.petit { font-size: 0.85rem; }

/* ---------- espace de gestion ---------- */
.entete-large { max-width: 1200px; margin: 0 auto; }
.nav-admin { display: flex; flex-wrap: wrap; gap: 4px 6px; padding-top: 8px; }
.nav-admin a {
  padding: 8px 12px; border-radius: 8px; font-size: 0.92rem; font-weight: 600; text-decoration: none; color: var(--texte);
}
.nav-admin a:hover { background: var(--accent-clair); }
.nav-admin a.actif { color: #fff; background: var(--accent); }
.contenu-admin { max-width: 1200px; font-size: 16px; }
.contenu-admin h2 { margin: 0 0 10px; }
.cadre {
  margin: 0 0 18px; padding: 16px; background: var(--carte); border: 1px solid var(--bordure);
  border-radius: 12px; box-shadow: var(--ombre);
}
.titre-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.bouton-auto { display: inline-block; width: auto; margin-top: 0; min-height: 44px; padding: 9px 18px; font-size: 0.95rem; }
.filtres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.filtres input[type="search"], .filtres select { width: auto; min-width: 180px; flex: 1 1 180px; }
.filtres input[type="file"] { width: auto; flex: 1 1 260px; }
.filtres input[type="date"] { width: auto; }
.tableau-defilant { overflow-x: auto; margin-bottom: 14px; }
.tableau { width: 100%; border-collapse: collapse; background: var(--carte); font-size: 0.92rem; }
.tableau th, .tableau td { padding: 9px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--bordure); }
.tableau th { font-size: 0.82rem; color: var(--gris); text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
.actions-ligne { display: flex; flex-wrap: wrap; gap: 6px; }
.actions-ligne form { margin: 0; }
.bouton-petit {
  min-height: 36px; padding: 5px 12px; font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer;
  color: var(--accent); background: #fff; border: 1.5px solid var(--accent); border-radius: 8px;
}
.bouton-petit:hover { background: var(--accent-clair); }
.bouton-ok { color: #fff; background: var(--accent); }
.bouton-ok:hover { background: var(--accent-hover); }
.bouton-danger { color: #a3271a; border-color: #c0392b; }
.bouton-danger:hover { background: var(--rouge); }
.badge-test { color: #6b2a00; background: var(--orange); }
.badge-alerte { color: #7a1d12; background: var(--rouge); }
.badge-en_attente { color: #6b2a00; background: var(--orange); }
.badge-actif { color: #12512b; background: var(--vert); }
.badge-refuse, .badge-desactive { color: #7a1d12; background: var(--rouge); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat {
  display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 10px; text-decoration: none;
  color: var(--texte); border: 1px solid var(--bordure);
}
.stat-nombre { font-size: 1.6rem; font-weight: 700; }
.liste-simple { margin: 0; padding-left: 20px; }
.liste-simple li { margin: 4px 0; }
.apercu { margin-top: 14px; padding: 14px; border: 1.5px dashed var(--accent); border-radius: 10px; background: var(--accent-clair); }
.apercu h3 { margin: 0 0 6px; }
.grille-form { display: grid; grid-template-columns: 1fr; gap: 8px 16px; }
.grille-form .pleine { grid-column: 1 / -1; }
.grille-form fieldset { border: 1px solid var(--bordure); border-radius: 9px; padding: 6px 12px; }
.mdp-temporaire {
  display: inline-block; padding: 10px 16px; font-family: Consolas, "Courier New", monospace; font-size: 1.4rem;
  letter-spacing: 0.08em; background: var(--accent-clair); border: 1.5px solid var(--accent); border-radius: 8px;
  user-select: all;
}
@media (min-width: 760px) { .grille-form { grid-template-columns: 1fr 1fr; } }

/* ---------- finitions (audit visuel) ---------- */
.retour { display: inline-flex; align-items: center; min-height: 44px; }
.lien-tactile { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.entete .logo { display: inline-flex; align-items: center; min-height: 44px; }
.bouton-lien { display: inline-flex; align-items: center; min-height: 44px; }
.badge { font-size: 0.9rem; }
body:has(.contenu-admin) .pied { max-width: 1200px; }  /* le pied de page suit la largeur de l'espace de gestion */

/* ---------- téléphone ---------- */
@media (max-width: 700px) {
  .entete-compte { width: 100%; margin-left: 0; justify-content: space-between; font-size: 1rem; }
  .compte-nom, .compte-role { font-size: 1rem; }
  .aide, .petit, .aide-carte, .meta { font-size: 1rem; }
  .total { font-size: 1rem; }

  /* menu de gestion : une seule ligne qui défile, onglets de 44 px */
  .nav-admin { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px 0; }
  .nav-admin::-webkit-scrollbar { display: none; }
  .nav-admin a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; font-size: 1rem; white-space: nowrap; }

  .bouton-petit { min-height: 44px; padding: 8px 14px; font-size: 1rem; }
  .bouton-auto { font-size: 1rem; }
  .actions-ligne { gap: 8px; }

  /* tableaux de gestion : une carte par ligne (les étiquettes viennent de data-label) */
  .tableau-defilant { overflow: visible; }
  .tableau, .tableau tbody, .tableau tr, .tableau td { display: block; width: 100%; }
  .tableau thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tableau { background: transparent; }
  .tableau tr {
    margin: 0 0 12px; padding: 4px 14px; background: var(--carte); border: 1px solid var(--bordure);
    border-radius: 12px; box-shadow: var(--ombre);
  }
  .tableau td { position: relative; padding: 9px 0; font-size: 1rem; border-bottom: 1px solid #edf2f1; overflow-wrap: anywhere; }
  .tableau td:last-child { border-bottom: 0; }
  .tableau td[data-label] { padding-left: 40%; min-height: 44px; }
  .tableau td[data-label]::before {
    content: attr(data-label); position: absolute; left: 0; top: 9px; width: 36%;
    font-size: 0.9rem; font-weight: 600; color: var(--gris); line-height: 1.5;
  }
  .tableau td:has(.actions-ligne) { padding-left: 0; }
  .tableau td:has(.actions-ligne)::before { display: none; }
  .tableau td[colspan] { padding-left: 0; text-align: center; border: 0; }
  .tableau td a { display: inline-block; padding: 10px 0; }
  .tableau tr:has(td[colspan]) { box-shadow: none; }

  .stats { grid-template-columns: 1fr 1fr; }
  .titre-actions .bouton-auto { width: 100%; }
  .filtres .bouton-auto { flex: 1 1 100%; }
  .filtres label.petit { font-size: 1rem; }
  .mdp-temporaire { font-size: 1.15rem; max-width: 100%; overflow-wrap: anywhere; }
}

/* ---------- audit : cibles tactiles et petits textes ---------- */
.bouton-propos { min-height: 44px; }
.apercu summary { display: flex; align-items: center; min-height: 44px; font-weight: 600; cursor: pointer; }
.lien-carte a { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 700px) {
  .devise, .carte-sous { font-size: 1rem; }
  .bouton-oeil { font-size: 0.9rem; }
  .tableau td a { padding: 11px 0; }
}

/* ---------- vie : croix qui bat dans l'en-tête, apparitions, survols (transform et opacity seulement) ---------- */
.entete-titre { gap: 8px; }
.coeur-mini { --taille: 24px; --flou: 5px; flex: none; display: block; animation: none; }
.coeur-mini .coeur-icone { display: block; }
.coeur-mini .coeur-icone { animation-duration: 2.5s; animation-delay: 0.4s; box-shadow: 0 2px 6px rgba(15, 118, 110, 0.28); }
.coeur-mini::before, .coeur-mini::after { animation-duration: 2.5s; animation-delay: 0.4s; }

/* apparition douce des cartes et des listes, décalée de quelques millisecondes */
:is(.carte, .cadre, .categories .bouton, .stats .stat, .tableau tbody tr) {
  animation: apparition 0.4s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}
:is(.carte, .cadre, .categories .bouton, .stats .stat, .tableau tbody tr):nth-child(2) { --i: 1; }
:is(.carte, .cadre, .categories .bouton, .stats .stat, .tableau tbody tr):nth-child(3) { --i: 2; }
:is(.carte, .cadre, .categories .bouton, .stats .stat, .tableau tbody tr):nth-child(4) { --i: 3; }
:is(.carte, .cadre, .categories .bouton, .stats .stat, .tableau tbody tr):nth-child(5) { --i: 4; }
:is(.carte, .cadre, .categories .bouton, .stats .stat, .tableau tbody tr):nth-child(6) { --i: 5; }
:is(.carte, .cadre, .categories .bouton, .stats .stat, .tableau tbody tr):nth-child(7) { --i: 6; }
:is(.carte, .cadre, .categories .bouton, .stats .stat, .tableau tbody tr):nth-child(n+8) { --i: 7; }

/* survol et appui : légère élévation et ombre, 0,2 s */
.bouton, .bouton-petit, .carte, .stat, .cadre, .bouton-propos, .nav-admin a {
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease),
              border-color 0.2s var(--ease), filter 0.2s var(--ease);
}
.bouton:hover, .bouton-petit:hover { transform: translateY(-1px); box-shadow: var(--ombre-haute); }
.stat:hover { transform: translateY(-2px); box-shadow: var(--ombre-haute); }
.cadre:hover { box-shadow: var(--ombre-haute); }
.bouton:active, .bouton-petit:active, .carte:active, .stat:active, .bouton-propos:active {
  transform: translateY(0) scale(0.985); box-shadow: var(--ombre); filter: brightness(0.97);
}

/* badges : petit point discret qui respire */
.badge-nouveau::before, .badge-24h::before, .badge-en_attente::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; vertical-align: 1px;
  border-radius: 50%; background: currentColor; animation: point 2.4s ease-in-out infinite;
}
@keyframes point { 0%, 100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }

/* champs : le libellé prend la couleur d'accent quand le champ est actif */
.formulaire label { transition: color 0.2s var(--ease); }
.formulaire label:has(+ input:focus, + select:focus, + textarea:focus, + .champ-mdp:focus-within) { color: var(--accent); }

/* transitions douces entre les pages */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 0.16s ease-out both fondu-sortie; }
::view-transition-new(root) { animation: 0.24s ease-in both fondu-entree; }
@keyframes fondu-sortie { to { opacity: 0; } }
@keyframes fondu-entree { from { opacity: 0; } }
main { animation: apparition 0.3s var(--ease) backwards; }

/* « moins d'animations » : tout reste fixe */
@media (prefers-reduced-motion: reduce) {
  :is(.carte, .cadre, .categories .bouton, .stats .stat, .tableau tbody tr), main { animation: none; }
  .coeur-mini, .coeur-mini .coeur-icone { animation: none; }
  .coeur-mini::before, .coeur-mini::after { display: none; }
  .badge-nouveau::before, .badge-24h::before, .badge-en_attente::before { animation: none; opacity: 1; }
  .bouton:hover, .bouton-petit:hover, .stat:hover, .bouton:active, .bouton-petit:active, .carte:active, .stat:active { transform: none; }
  @view-transition { navigation: none; }
}

/* ---------- onde tricolore de l'en-tête (remplace le drapeau) ---------- */
.onde-mini { flex: none; width: 48px; height: 16px; overflow: visible; }
.onde-mini path { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; animation: onde-cycle 2.5s infinite 0.4s; }
/* même cycle et même départ que la croix : le pic de l'onde arrive sur le premier battement */
@keyframes onde-cycle {
  0%   { stroke-dashoffset: 1; opacity: 1; animation-timing-function: linear; }
  50%  { stroke-dashoffset: 0; opacity: 1; }
  74%  { stroke-dashoffset: 0; opacity: 1; }
  92%, 100% { stroke-dashoffset: 0; opacity: 0; }
}
@media (max-width: 700px) { .onde-mini { width: 36px; height: 12px; } }
@media (prefers-reduced-motion: reduce) { .onde-mini path { animation: none; stroke-dashoffset: 0; opacity: 0.9; } }
/* badges d'un même statut : petit espace régulier */
.badge { margin-right: 4px; }
.badge:last-child { margin-right: 0; }
