/* ==========================================================
   ACL — espace d'administration (tableau de bord moderne)
   Menu latéral encre et or, cartes arrondies sur fond pierre.
   ========================================================== */
body.admin {
  --app-fond: #f5f1ec;
  --app-carte: #ffffff;
  --app-bord: rgba(35, 32, 31, .08);
  --app-ombre: 0 1px 2px rgba(35, 32, 31, .04), 0 12px 32px -18px rgba(60, 45, 30, .28);
  --app-rayon: 18px;
  --app-rayon-petit: 11px;
  --app-nav: 264px;
  --ok: #2f7a56;
  --ok-fond: #e5f3ec;
  --attente: #9a6510;
  --attente-fond: #fcf1dc;
  --non: #a3324a;
  --non-fond: #f8e5e9;
  background: var(--app-fond); padding-bottom: 0; font-size: 1rem; line-height: 1.6;
}
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.ico--grand { width: 2.4rem; height: 2.4rem; }

/* Boutons de l'administration : plus compacts et arrondis */
.admin .bouton { border-radius: 999px; letter-spacing: .04em; text-transform: none; font-size: .86rem; font-weight: 500; padding: .85em 1.5em; gap: .5em; }
.admin .bouton::before { display: none; }
.admin .bouton--petit { padding: .65em 1.15em; font-size: .82rem; }
.admin .bouton--clair { background: var(--app-carte); border-color: var(--app-bord); box-shadow: 0 1px 2px rgba(35, 32, 31, .06); }
.admin .bouton--clair:hover { border-color: var(--dore); background: var(--app-carte); }
.admin .bouton--dore { background: var(--dore); border-color: var(--dore); color: var(--encre); }
.admin .bouton--dore:hover { color: var(--encre); background: #d2b88c; }
.admin .bouton--fantome { background: transparent; border-color: rgba(255, 255, 255, .25); color: #fff; }
.admin .bouton--fantome:hover { border-color: var(--dore); color: #fff; }
.admin .actions { margin-top: 0; gap: .6rem; }

/* ---------- Coque : menu latéral + contenu ---------- */
.app { display: grid; grid-template-columns: var(--app-nav) minmax(0, 1fr); min-height: 100vh; }
.app-nav {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 1.2rem;
  background: var(--encre); color: rgba(255, 255, 255, .78); padding: 1.4rem 1rem 1rem;
  background-image: radial-gradient(120% 50% at 0% 0%, rgba(194, 164, 115, .16), transparent 60%);
}
.app-nav__logo { display: grid; gap: .5rem; padding: .3rem .7rem 1.1rem; border-bottom: 1px solid rgba(194, 164, 115, .22); text-decoration: none; }
.app-nav__logo img { width: 118px; }
.app-nav__logo span { font: 500 .62rem/1 var(--corps); letter-spacing: .26em; text-transform: uppercase; color: var(--dore); }
.app-nav__liens { flex: 1; }
.app-nav__groupe { margin: 1rem .8rem .45rem; font: 700 .62rem/1 var(--corps); letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 255, 255, .45); }
.app-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.app-nav ul a, .app-nav__pied > a {
  display: flex; align-items: center; gap: .8rem; padding: .62rem .8rem; border-radius: var(--app-rayon-petit);
  color: rgba(255, 255, 255, .76); text-decoration: none; font: 500 .9rem/1.2 var(--corps); position: relative;
  transition: background .25s, color .25s;
}
.app-nav ul a:hover, .app-nav__pied > a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.app-nav ul a[aria-current="page"] { background: rgba(194, 164, 115, .16); color: #fff; }
.app-nav ul a[aria-current="page"]::before { content: ""; position: absolute; left: -1rem; top: 22%; bottom: 22%; width: 3px; border-radius: 0 3px 3px 0; background: var(--dore); }
.app-nav ul a[aria-current="page"] .ico { color: var(--dore); }
.app-nav ul a > span:not(.pastille):not(.visuellement-cache) { flex: 1; }
.app-nav__pied { display: grid; gap: .5rem; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: .9rem; }
.app-nav__moi { display: flex; align-items: center; gap: .7rem; padding: .6rem .5rem .2rem .7rem; }
.app-nav__qui { flex: 1; display: grid; line-height: 1.25; min-width: 0; }
.app-nav__qui strong { color: #fff; font-size: .88rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.app-nav__qui span { font-size: .72rem; color: rgba(255, 255, 255, .5); }
.app-nav__sortie { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; color: rgba(255, 255, 255, .65); }
.app-nav__sortie:hover { background: rgba(163, 50, 74, .35); color: #fff; }
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 2.3rem; height: 2.3rem; border-radius: 50%;
  background: linear-gradient(135deg, var(--dore), #9c7f4f); color: var(--encre); font: 700 .8rem/1 var(--corps);
}
.avatar--clair { background: var(--pierre); color: var(--dore-texte); border: 1px solid var(--pierre-fonce); }

.app-corps { min-width: 0; display: flex; flex-direction: column; }
.app-haut {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 1rem;
  padding: .8rem clamp(1rem, 3vw, 2.2rem); background: rgba(245, 241, 236, .88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--app-bord);
}
.app-haut__menu { display: none; }
.app-haut__logo { display: none; }
.app-haut__logo img { width: 92px; }
.app-haut__date { margin: 0 auto 0 0; display: flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--texte-doux); }
.app-haut__date .ico { color: var(--dore-texte); }

.admin-contenu { padding: clamp(1.2rem, 3vw, 2.2rem) clamp(1rem, 3vw, 2.2rem) 4rem; width: 100%; max-width: 1480px; margin: 0 auto; }
.admin-contenu > .flash { margin-bottom: 1.5rem; border-radius: var(--app-rayon-petit); }
.admin-contenu h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); margin-bottom: .2em; }
.admin-contenu h2 { font-size: 1.4rem; }
.admin-barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.admin-barre h1 { margin: 0; }
.admin-barre .actions { margin: 0; }

/* En-tête simple de la page de connexion */
.admin-entete { background: var(--encre); color: var(--ivoire); }
.admin-entete__inner { display: flex; align-items: center; padding: .9rem clamp(1rem, 3vw, 2rem); }
.admin-logo { display: flex; align-items: center; gap: .9rem; color: var(--ivoire); text-decoration: none; }
.admin-logo img { width: 92px; }
.admin-logo span { font: 500 .66rem/1 var(--corps); letter-spacing: .24em; text-transform: uppercase; color: var(--dore); }
.admin-connexion { min-height: 70vh; display: grid; place-items: center; }
.admin-connexion .carte-compte { border-radius: var(--app-rayon); background: var(--app-carte); box-shadow: var(--app-ombre); }

/* ---------- Cartes ---------- */
.panneau, .carte {
  background: var(--app-carte); border: 1px solid var(--app-bord); border-radius: var(--app-rayon);
  box-shadow: var(--app-ombre); padding: clamp(1.1rem, 2.4vw, 1.6rem); margin-bottom: 1.4rem;
}
.panneau > h2:first-child { margin-top: 0; }
.carte__tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-bottom: 1.1rem; }
.carte__tete h2 { display: flex; align-items: center; gap: .55rem; margin: 0; font: 700 1rem/1.3 var(--corps); letter-spacing: 0; color: var(--encre); }
.carte__tete h2 .ico { color: var(--dore-texte); }
.carte__lien { display: inline-flex; align-items: center; gap: .35rem; font-size: .84rem; font-weight: 500; color: var(--dore-texte); text-decoration: none; padding: .35rem .7rem; border-radius: 999px; }
.carte__lien:hover { background: var(--pierre); color: var(--encre); }
.carte__note { font-size: .78rem; color: var(--texte-doux); background: var(--pierre); padding: .2rem .6rem; border-radius: 999px; }
.carte__vide { margin: 0; color: var(--texte-doux); font-size: .92rem; }
.compteur { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 .45rem; border-radius: 999px; background: var(--attente-fond); color: var(--attente); font-size: .78rem; }
.grille-admin { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.4rem; align-items: start; }

/* ---------- Tableau de bord ---------- */
.tb-accueil { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.6rem; }
.tb-accueil h1 { margin: 0; }
.tb-surtitre { margin: 0 0 .35rem; font: 700 .7rem/1 var(--corps); letter-spacing: .2em; text-transform: uppercase; color: var(--dore-texte); }
.tb-resume { margin: .4rem 0 0; color: var(--texte-doux); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.kpi {
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "ico lib" "val val" "note note";
  align-items: center; gap: .35rem .7rem; padding: 1.15rem 1.25rem; background: var(--app-carte); border: 1px solid var(--app-bord);
  border-radius: var(--app-rayon); box-shadow: var(--app-ombre); color: var(--texte); text-decoration: none; overflow: hidden;
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s;
}
.kpi:hover { transform: translateY(-3px); color: var(--texte); box-shadow: 0 1px 2px rgba(35, 32, 31, .05), 0 20px 40px -20px rgba(60, 45, 30, .35); }
.kpi__ico { grid-area: ico; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 12px; background: var(--pierre); color: var(--dore-texte); }
.kpi__lib { grid-area: lib; font-size: .84rem; font-weight: 500; color: var(--texte-doux); }
.kpi__val { grid-area: val; font: 400 2.6rem/1.05 var(--titre); color: var(--encre); margin-top: .35rem; font-variant-numeric: lining-nums tabular-nums; }
.kpi__note { grid-area: note; font-size: .8rem; color: var(--texte-doux); }
.kpi__anneau { position: absolute; right: 1.1rem; bottom: 1rem; }
.kpi--alerte .kpi__ico { background: var(--attente-fond); color: var(--attente); }
.kpi--alerte::after { content: ""; position: absolute; top: 1.15rem; right: 1.15rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--attente); box-shadow: 0 0 0 0 rgba(176, 118, 20, .5); animation: pouls 2s infinite; }
@keyframes pouls { 70% { box-shadow: 0 0 0 9px rgba(176, 118, 20, 0); } 100% { box-shadow: 0 0 0 0 rgba(176, 118, 20, 0); } }
.anneau__fond { stroke: var(--pierre-fonce); }
.anneau__val { stroke: var(--dore); }

.tb-grille { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; margin-bottom: 1.4rem; }
.tb-col { display: grid; gap: 1.4rem; min-width: 0; }
.tb-col > .carte { margin: 0; }

/* Demandes à confirmer */
.demandes { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.demande { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: .9rem; border-radius: 14px; background: var(--craie); border: 1px solid var(--app-bord); }
.demande__date { display: grid; justify-items: center; width: 4.2rem; padding: .5rem 0; border-radius: 12px; background: var(--app-carte); border: 1px solid var(--pierre-fonce); text-decoration: none; color: var(--encre); line-height: 1.1; }
.demande__date span { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--texte-doux); }
.demande__date strong { font: 400 1.6rem/1.1 var(--titre); }
.demande__date span:last-child { color: var(--attente); font-weight: 700; letter-spacing: 0; font-size: .78rem; }
.demande__infos { min-width: 0; }
.demande__infos p { margin: 0; }
.demande__nom { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }
.demande__nom a { color: var(--encre); font-weight: 700; text-decoration: none; }
.demande__nom a:hover { color: var(--rose-texte); }
.demande__delai { font-size: .74rem; color: var(--attente); background: var(--attente-fond); padding: .1rem .55rem; border-radius: 999px; }
.demande__soin { font-size: .88rem; color: var(--texte); }
.demande__tel a { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--texte-doux); text-decoration: none; }
.demande__note { font-size: .84rem; font-style: italic; color: var(--texte-doux); margin-top: .2rem !important; }
.demande__actions { display: flex; gap: .45rem; }
.demande__actions form { margin: 0; }
.btn-statut {
  display: inline-flex; align-items: center; gap: .4rem; padding: .6rem .95rem; border-radius: 999px; border: 1px solid transparent;
  font: 500 .82rem/1 var(--corps); cursor: pointer; transition: background .25s, color .25s, transform .2s;
}
.btn-statut:active { transform: scale(.96); }
.btn-statut--ok { background: var(--ok); color: #fff; }
.btn-statut--ok:hover { background: #24603f; }
.btn-statut--non { background: var(--app-carte); color: var(--non); border-color: rgba(163, 50, 74, .25); }
.btn-statut--non:hover { background: var(--non-fond); }

/* Frise de la journée */
.frise { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.frise__item { display: grid; grid-template-columns: 4.2rem 1fr; gap: .9rem; position: relative; }
.frise__item::before { content: ""; position: absolute; left: 5.4rem; top: 0; bottom: -.65rem; width: 2px; background: var(--pierre-fonce); }
.frise__item:first-child::before { top: 1.3rem; }
.frise__item:last-child::before { bottom: calc(100% - 1.3rem); }
.frise__heure { margin: 0; padding-top: .7rem; text-align: right; line-height: 1.2; }
.frise__heure strong { display: block; font-size: .95rem; color: var(--encre); font-variant-numeric: tabular-nums; }
.frise__heure span { font-size: .74rem; color: var(--texte-doux); }
.frise__carte {
  display: grid; gap: .15rem; margin-left: 1.3rem; padding: .75rem 1rem; border-radius: 14px; border-left: 3px solid var(--ok);
  background: var(--craie); color: var(--texte); text-decoration: none; position: relative; transition: background .25s, transform .25s;
}
.frise__carte::before { content: ""; position: absolute; left: calc(-1.3rem - 4px); top: .95rem; width: .75rem; height: .75rem; border-radius: 50%; background: var(--app-carte); border: 2px solid var(--dore); }
.frise__carte:hover { background: var(--pierre); color: var(--texte); transform: translateX(3px); }
.frise__carte.evt--en_attente { border-left-color: var(--attente); }
.frise__carte.evt--honoree { border-left-color: #7d8c86; }
.frise__carte.evt--absente { border-left-color: var(--non); }
.frise__nom { font-weight: 700; color: var(--encre); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.frise__soin { font-size: .88rem; }
.frise__meta { display: flex; align-items: center; gap: .6rem; font-size: .78rem; color: var(--texte-doux); margin-top: .2rem; }
.frise__item--passe .frise__carte { opacity: .55; }
.frise__item--encours .frise__carte { background: #fff8ea; box-shadow: 0 0 0 1px rgba(194, 164, 115, .5); }
.frise__item--encours .frise__carte::before { background: var(--dore); box-shadow: 0 0 0 4px rgba(194, 164, 115, .25); }
.etiquette-direct { font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; background: var(--ok); padding: .2rem .5rem; border-radius: 999px; }
.vide-tb { display: flex; align-items: center; gap: 1.1rem; padding: 1.3rem; border-radius: 14px; background: var(--craie); border: 1px dashed var(--pierre-fonce); color: var(--texte-doux); }
.vide-tb .ico { color: var(--dore); }
.vide-tb p { margin: 0; }
.vide-tb strong { color: var(--encre); }

/* Carte sombre : prochain rendez-vous */
.carte--sombre {
  background: var(--encre); color: rgba(255, 255, 255, .8); border-color: transparent; position: relative; overflow: hidden;
  background-image: radial-gradient(90% 80% at 100% 0%, rgba(194, 164, 115, .32), transparent 60%);
}
.carte--sombre::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 160px; height: 160px; border-radius: 50%; border: 1px solid rgba(194, 164, 115, .25); box-shadow: 0 0 0 22px rgba(194, 164, 115, .05); pointer-events: none; }
.carte--sombre p { margin: 0; position: relative; z-index: 1; }
.carte__surtitre { margin: 0 0 1rem !important; font: 700 .68rem/1 var(--corps) !important; letter-spacing: .2em; text-transform: uppercase; color: var(--dore) !important; }
.prochain__delai { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--encre); background: var(--dore); padding: .25rem .7rem; border-radius: 999px; margin-bottom: .8rem !important; }
.prochain__nom { font: 400 1.75rem/1.15 var(--titre); color: #fff; }
.prochain__soin { margin-top: .3rem !important; font-size: .92rem; }
.prochain__quand { margin-top: .8rem !important; display: flex; align-items: center; gap: .45rem; font-size: .86rem; color: rgba(255, 255, 255, .65); }
.prochain__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.2rem !important; }

/* Histogramme des 7 prochains jours */
.histo { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; height: 170px; }
.histo__col { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; justify-items: center; height: 100%; min-height: 0; gap: .3rem; }
.histo__nb { font-size: .78rem; font-weight: 700; color: var(--encre); min-height: 1.2em; line-height: 1.2; }
.histo__barre { width: 100%; max-width: 30px; height: 100%; min-height: 0; }
.histo__barre rect { fill: var(--pierre-fonce); transition: fill .3s; }
.histo__col:hover .histo__barre rect { fill: var(--dore); }
.histo__col--auj .histo__barre rect { fill: var(--dore); }
.histo__jour { display: grid; justify-items: center; font-size: .7rem; color: var(--texte-doux); line-height: 1.2; }
.histo__jour b { font-size: .82rem; color: var(--encre); }
.histo__col--auj .histo__jour b { color: var(--dore-texte); }

/* Classement des soins */
.classement { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.classement p { display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 .3rem; font-size: .86rem; }
.classement p span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.classement p strong { color: var(--encre); }
.classement__barre { display: block; width: 100%; height: 6px; }
.classement__barre rect { fill: var(--dore); }
.classement__barre .classement__fond { fill: var(--pierre); }

/* Dernières conversations */
.convs-tb { list-style: none; margin: 0 -.5rem; padding: 0; }
.convs-tb a { display: flex; align-items: center; gap: .8rem; padding: .6rem .5rem; border-radius: 12px; color: var(--texte); text-decoration: none; }
.convs-tb a:hover { background: var(--craie); color: var(--texte); }
.convs-tb__txt { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.convs-tb__txt strong { font-size: .9rem; font-weight: 500; color: var(--encre); }
.convs-tb__txt span { font-size: .8rem; color: var(--texte-doux); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convs-tb a.non-lu strong { font-weight: 700; }
.convs-tb a.non-lu .convs-tb__txt span { color: var(--texte); }

/* Commutateur semaine précédente / suivante */
.segment { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--pierre); }
.segment a { display: inline-flex; align-items: center; padding: .45rem .85rem; border-radius: 999px; color: var(--encre); text-decoration: none; font-size: .82rem; font-weight: 500; }
.segment a:hover { background: var(--app-carte); box-shadow: 0 1px 3px rgba(35, 32, 31, .1); color: var(--encre); }

/* ---------- Tableaux ---------- */
.tableau-defile { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
.tableau { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; }
.tableau th, .tableau td { text-align: left; padding: .75rem .85rem; border-bottom: 1px solid var(--app-bord); vertical-align: middle; }
.tableau th { font: 700 .68rem/1.2 var(--corps); letter-spacing: .12em; text-transform: uppercase; color: var(--texte-doux); background: var(--craie); }
.tableau tr:hover td { background: #fdfbf8; }
.tableau input, .tableau select { padding: .5em .6em; font-size: .88rem; }
.tableau .etroit { width: 7rem; }

/* ---------- Agenda de la semaine ---------- */
.agenda { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 920px; table-layout: fixed; background: #fff; font-size: .8rem; }
.agenda th { background: var(--app-carte); padding: .5rem .3rem .7rem; border-bottom: 1px solid var(--app-bord); font-weight: 500; }
.agenda__jsem { display: block; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--texte-doux); }
.agenda__num { display: inline-grid; place-items: center; width: 2rem; height: 2rem; margin-top: .2rem; border-radius: 50%; font: 400 1.1rem/1 var(--titre); color: var(--encre); }
.agenda th.aujourdhui .agenda__jsem { color: var(--dore-texte); font-weight: 700; }
.agenda th.aujourdhui .agenda__num { background: var(--encre); color: #fff; }
.agenda .col-heure { width: 3.6rem; }
.agenda td { height: 2.1rem; border-left: 1px solid var(--app-bord); border-bottom: 1px solid rgba(29, 24, 27, .04); padding: 2px 3px; vertical-align: top; }
.agenda tr.heure-pleine td { border-top: 1px solid rgba(29, 24, 27, .09); }
.agenda td.heure { border-left: 0; text-align: right; padding-right: .6rem; color: var(--texte-doux); font-size: .72rem; }
.agenda td.ferme { background: repeating-linear-gradient(-45deg, #f7f4f1, #f7f4f1 4px, #efeae5 4px, #efeae5 8px); }
.agenda td.passe { background: #fbf9f7; }
.agenda a.libre { display: block; height: 100%; min-height: 1.9rem; border-radius: 8px; color: transparent; text-decoration: none; text-align: center; line-height: 1.9rem; font-size: 1rem; transition: background .2s, color .2s; }
.agenda a.libre:hover, .agenda a.libre:focus-visible { color: var(--dore-texte); background: var(--pierre); }
.evt {
  display: block; height: 100%; padding: .35rem .5rem; border-radius: 9px; border-left: 3px solid var(--rose-texte); background: #f6ecee;
  color: var(--encre); text-decoration: none; line-height: 1.3; overflow: hidden; transition: filter .2s, transform .2s;
}
.evt:hover { filter: brightness(.97); color: var(--encre); transform: translateY(-1px); }
.evt strong { display: block; font-size: .76rem; }
.evt span { display: block; color: var(--texte); font-size: .74rem; }
.evt--confirmee { border-color: var(--ok); background: var(--ok-fond); }
.evt--en_attente { border-color: var(--attente); background: var(--attente-fond); }
.evt--honoree { border-color: #7d8c86; background: #edf1ef; }
.evt--absente { border-color: var(--non); background: var(--non-fond); }
.evt--bloque { border-color: #6b5d63; background: #ebe6e3; color: var(--texte-doux); }
.legende-admin { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; font-size: .78rem; color: var(--texte-doux); margin: 1rem 0 0; }
.legende-admin span { display: inline-flex; align-items: center; gap: .4rem; }
.legende-admin i { width: .85rem; height: .85rem; display: inline-block; border-radius: 4px; border-left: 3px solid var(--ok); background: var(--ok-fond); }
.legende-admin .leg--en_attente { border-color: var(--attente); background: var(--attente-fond); }
.legende-admin .leg--honoree { border-color: #7d8c86; background: #edf1ef; }
.legende-admin .leg--absente { border-color: var(--non); background: var(--non-fond); }
.legende-admin .leg--bloque { border-color: #6b5d63; background: #ebe6e3; }
.legende-admin__astuce { margin-left: auto; font-style: italic; }

/* ---------- Formulaires admin ---------- */
.admin .formulaire label { margin-top: 1rem; }
.admin .formulaire input, .admin .formulaire textarea, .admin .formulaire select { border-radius: 10px; }
.champs-ligne { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0 1rem; }
.boutons-statut { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.boutons-statut form { margin: 0; }
.fiche dl { display: grid; grid-template-columns: 8rem 1fr; gap: .5rem 1rem; margin: 0; }
.fiche dt { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--texte-doux); }
.fiche dd { margin: 0; }
.mdp-temporaire { font: 500 1.3rem/1 ui-monospace, Consolas, monospace; background: var(--porcelaine); padding: .8rem 1rem; display: inline-block; border: 1px dashed var(--rose); border-radius: 10px; user-select: all; }
.horaires-jour { display: grid; grid-template-columns: 7rem 1fr 1fr; gap: .8rem 1.2rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--app-bord); }
.horaires-jour fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.horaires-jour legend { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--texte-doux); padding: 0; margin-right: .4rem; float: left; }
.horaires-jour select { width: auto; padding: .45em .5em; }
.horaires-jour strong { font: 400 1.1rem/1 var(--titre); }
.admin .statut { border-radius: 999px; border: 0; padding: .35em .75em; }
.admin .statut--confirmee { background: var(--ok-fond); color: var(--ok); }
.admin .statut--en_attente { background: var(--attente-fond); color: var(--attente); }
.admin .statut--annulee, .admin .statut--absente { background: var(--non-fond); color: var(--non); }
.admin .statut--honoree { background: #edf1ef; color: #55635d; }

/* E-mails */
.journal-court { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.journal-court li { padding: .45rem 0; border-bottom: 1px solid var(--app-bord); }
.ok { color: #2f6b4f; font-weight: 700; }
.ko { color: #9b1c2e; font-weight: 700; }
.apercu-mail { width: 100%; height: 75vh; border: 1px solid var(--app-bord); border-radius: 12px; background: #f8f2ec; }
.alerte-transport { border-left: 3px solid var(--attente); background: var(--attente-fond); padding: 1rem 1.2rem; margin-bottom: 1.5rem; font-size: .92rem; border-radius: var(--app-rayon-petit); }

/* Diagnostic e-mails */
.diagnostic { list-style: none; padding: 0; margin: 0 0 1rem; }
.diagnostic li { display: grid; grid-template-columns: minmax(12rem, 18rem) 1fr; gap: .3rem 1.2rem; padding: .7rem 0; border-bottom: 1px solid var(--app-bord); font-size: .9rem; }
.diagnostic span { color: var(--texte-doux); overflow-wrap: anywhere; }
.diagnostic__ok strong { color: #2f6b4f; }
.diagnostic__attention strong { color: #8a5a12; }
.diagnostic__erreur strong { color: #9b1c2e; }
@media (max-width: 640px) { .diagnostic li { grid-template-columns: 1fr; } }

/* Messagerie admin */
.messagerie-admin { display: grid; grid-template-columns: minmax(16rem, 22rem) 1fr; gap: 1.4rem; align-items: start; }
.liste-conv { padding: 0; overflow: hidden; }
.liste-conv ul { list-style: none; margin: 0; padding: 0; max-height: 75vh; overflow-y: auto; }
.conv { display: grid; gap: .2rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--app-bord); color: var(--texte); text-decoration: none; }
.conv:hover, .conv[aria-current="page"] { background: var(--craie); color: var(--encre); }
.conv[aria-current="page"] { box-shadow: inset 3px 0 0 var(--dore); }
.conv__nom { font-weight: 500; color: var(--encre); display: flex; align-items: center; gap: .5rem; }
.conv--non-lue .conv__nom { font-weight: 700; }
.conv__extrait { font-size: .85rem; color: var(--texte-doux); }
.conv__date { font-size: .72rem; color: var(--texte-doux); }
.nouvelle-conv { display: flex; gap: .5rem; align-items: center; }
.nouvelle-conv select { width: auto; min-width: 14rem; }
.admin .fil-messages, .admin .ecrire-message { border-radius: 14px; }
.admin .bulle { border-radius: 14px; }
.app-nav .pastille { margin-left: auto; }
@media (max-width: 900px) { .messagerie-admin { grid-template-columns: 1fr; } }

/* ---------- Écrans moyens et mobiles ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .tb-grille { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .app-nav {
    position: fixed; z-index: 70; left: 0; top: 0; bottom: 0; width: min(84vw, 300px); height: auto;
    transform: translateX(-102%); visibility: hidden; transition: transform .35s cubic-bezier(.2, .7, .2, 1), visibility .35s;
    box-shadow: 30px 0 60px -30px rgba(0, 0, 0, .5);
  }
  .app-nav.ouvert { transform: none; visibility: visible; box-shadow: 0 0 0 100vmax rgba(35, 32, 31, .45); }
  .app-haut__menu {
    display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; padding: 0; border-radius: 12px;
    border: 1px solid var(--app-bord); background: var(--app-carte); color: var(--encre); cursor: pointer;
  }
  .app-haut__logo { display: block; }
  .app-haut__date { display: none; }
  .app-haut__action { margin-left: auto; }
}
@media (max-width: 640px) {
  .kpis { gap: .7rem; }
  .kpi { padding: 1rem; }
  .kpi__val { font-size: 2.1rem; }
  .kpi__anneau { display: none; }
  .app-haut__action span { display: none; }
  .app-haut__action { width: 2.6rem; height: 2.6rem; padding: 0 !important; }
  .demande { grid-template-columns: auto 1fr; }
  .demande__actions { grid-column: 1 / -1; }
  .demande__actions form, .demande__actions .btn-statut { flex: 1; justify-content: center; }
  .legende-admin__astuce { margin-left: 0; }
  .horaires-jour { grid-template-columns: 1fr; }
  .fiche dl { grid-template-columns: 1fr; gap: 0; }
  .fiche dd { margin-bottom: .6rem; }
  .tb-accueil .actions { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .kpi, .frise__carte, .evt, .app-nav { transition: none; }
  .kpi--alerte::after { animation: none; }
}
