/* L'AURORE VERTE (14/10/2026) — le style « liquide » de GesCom.
   Choix fait sur la proposition visuelle « GesCom en aurore verte » (palette B, présentation « 2 · Par phase ») :
   les boutons, les interrupteurs et les surlignages passent en vert liquide ; le contenu, les tableaux et les couleurs
   d'ALERTE (orange, rouge, le réveil en retard, la pastille ambre « Signaler un bug ») ne bougent pas.
   Trois traitements, rien d'autre :
     · plein liquide : taches de vert qui se mélangent et coulent lentement, reflet de verre, relief — ce qu'on touche
       pour agir (onglet ouvert du menu, bouton principal, +, réveil, filtre allumé) ;
     · verre : verre clair (ou sombre sur la barre de gauche) avec un liseré vert qui tourne — les boutons secondaires ;
     · surlignage : l'onglet ouvert, la tuile de l'onglet ouvert, les barres des étapes du tableau de bord.
   Chargé APRÈS la feuille de docs/index.html. Les feuilles posées par les modules (pose-mobile.js, chat.js, rappels.js,
   retour.js) arrivent plus tard dans la page : leurs sélecteurs sont repris ici précédés de `body`, pour l'emporter
   sans !important. Si le poste demande moins d'animations, tout s'arrête et les couleurs restent. */
@property --liq-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
:root {
  /* La palette : 5 couleurs + 2 teintes de halo (r, g, b). Plus de bleu (Yoann, 16/10/2026 : « on voit le bouton d'en dessous,
     le bleu qu'il y avait à l'époque ») : la tache et le halo bleus du bouton vert passent au vert. */
  --liq-c1: #2dd4bf; --liq-c2: #039342; --liq-c3: #16b55a; --liq-c4: #84cc16; --liq-c5: #22c55e;
  --liq-o1: 3, 147, 66; --liq-o2: 22, 181, 90;
  --liq-fond:
    radial-gradient(closest-side, var(--liq-c1), transparent),
    radial-gradient(closest-side, var(--liq-c3), transparent),
    radial-gradient(closest-side, var(--liq-c5), transparent),
    radial-gradient(closest-side, var(--liq-c4), transparent),
    linear-gradient(120deg, var(--liq-c2), var(--liq-c3) 55%, var(--liq-c4));
  --liq-tailles: 100% 100%, 120% 190%, 110% 180%, 90% 170%, 100% 170%, 100% 100%;
  --liq-depart: 0 0, -10% -40%, 110% -30%, 90% 140%, -20% 130%, 0 0;
  --liq-texte: linear-gradient(100deg, var(--liq-c2), var(--liq-c3) 50%, var(--liq-c1));
  --liq-barre: linear-gradient(90deg, var(--liq-c2), var(--liq-c3) 55%, var(--liq-c1));
  --liq-reflet: linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.14) 45%, rgba(255,255,255,0) 55%, rgba(0,0,0,.08) 100%);
  --liq-relief: inset 0 1.5px 1px rgba(255,255,255,.85), inset 0 -5px 12px rgba(0,40,20,.22);
  --liq-halo: 0 10px 26px -10px rgba(var(--liq-o1), .75), 0 4px 14px -6px rgba(var(--liq-o2), .5);
}
@keyframes liq-coule {
  0%   { background-position: 0 0, -10% -40%, 110% -30%, 90% 140%, -20% 130%, 0 0; }
  33%  { background-position: 0 0, 40% 120%, 0% -40%, 120% 40%, 80% 140%, 0 0; }
  66%  { background-position: 0 0, 110% 20%, 50% 140%, -10% -30%, 10% 0%, 0 0; }
  100% { background-position: 0 0, -10% -40%, 110% -30%, 90% 140%, -20% 130%, 0 0; }
}
@keyframes liq-tourne { to { --liq-a: 360deg; } }

/* ── 1. PLEIN LIQUIDE ─────────────────────────────────────────────────────────────────────────────── */
nav.menu a.active,
.btn-primary,
body .rp-fab:not(.rp-fab-retard),
body .chat-neuf,
body .chat-vide-b,
body .pm-op-sel.on,
#view-dashboard .kpi-ouvert-pastille {
  background: var(--liq-reflet), var(--liq-fond);
  background-size: var(--liq-tailles);
  background-repeat: no-repeat;
  background-position: var(--liq-depart);
  animation: liq-coule 9s ease-in-out infinite;
  color: #fff;
  border-color: transparent;
  box-shadow: var(--liq-relief), var(--liq-halo);
  text-shadow: 0 1px 3px rgba(0,40,20,.4);
}
nav.menu a.active { font-weight: 700; }
nav.menu a.active .count { background: rgba(255,255,255,.3); }
.btn-primary:hover { background: var(--liq-reflet), var(--liq-fond); background-size: var(--liq-tailles); background-repeat: no-repeat; filter: brightness(1.06) saturate(1.1); }
body .chat-vide-b:active, body .chat-neuf:hover { filter: brightness(1.06); }
body .pm-op-sel.on .pm-op-n { opacity: .8; }
/* Un bouton principal désactivé ne coule pas : il ne doit pas avoir l'air de pouvoir être pressé. */
.btn-primary:disabled, .btn-primary[disabled] { animation: none; filter: grayscale(.65); opacity: .6; cursor: not-allowed; box-shadow: none; }

/* ── 2. VERRE ─────────────────────────────────────────────────────────────────────────────────────── */
/* L'anneau est recalculé sur chaque élément qui le fait tourner (une variable composée héritée garderait l'angle de l'ancêtre). */
body #retour-fab .rt-rond-b,
body .chat-entete-b,
#view-dashboard h3.dash-h .fa,
#user-block .btn-logout,
#view-dashboard .kpis-volume .kpi.ouvert,
body .pm-op-sel:not(.on)::before {
  --liq-anneau: conic-gradient(from var(--liq-a), var(--liq-c1), var(--liq-c2), var(--liq-c3), var(--liq-c4), var(--liq-c5), var(--liq-c1));
}
body #retour-fab .rt-rond-b,
body .chat-entete-b,
#view-dashboard h3.dash-h .fa {
  border: 1.5px solid transparent;
  background: linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.72)) padding-box, var(--liq-anneau) border-box;
  box-shadow: inset 0 1px 0 #fff, 0 6px 18px -8px rgba(var(--liq-o1), .55);
  animation: liq-tourne 10s linear infinite;
}
#user-block .btn-logout {
  border: 1.4px solid transparent;
  background: linear-gradient(rgba(30,31,39,.92), rgba(30,31,39,.8)) padding-box, var(--liq-anneau) border-box;
  animation: liq-tourne 10s linear infinite;
}
#user-block .btn-logout:hover { background: linear-gradient(rgba(127,29,29,.9), rgba(127,29,29,.75)) padding-box, var(--liq-anneau) border-box; }
/* Un filtre éteint sur la barre verte du téléphone : verre clair, liseré en anneau (masque : le fond ne transparaît pas). */
body .pm-op-sel:not(.on) { position: relative; border-color: transparent; background: rgba(255,255,255,.16); box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
body .pm-op-sel:not(.on)::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: var(--liq-anneau);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: liq-tourne 10s linear infinite;
}

/* ── 3. SURLIGNAGES ───────────────────────────────────────────────────────────────────────────────── */
/* L'onglet ouvert du bas, au téléphone : une goutte liquide derrière l'icône, le libellé en dégradé. */
body .pm-nav-b.on { position: relative; isolation: isolate; background: none; color: #027a37; }
body .pm-nav-b.on::before {
  content: ''; position: absolute; z-index: -1; left: 50%; top: 5px; width: 60px; height: 34px; margin-left: -30px; border-radius: 17px;
  background: var(--liq-reflet), var(--liq-fond); background-size: var(--liq-tailles); background-repeat: no-repeat; background-position: var(--liq-depart);
  animation: liq-coule 9s ease-in-out infinite; box-shadow: var(--liq-relief), var(--liq-halo);
}
body .pm-nav-b.on .pm-nav-ic { color: #fff; filter: drop-shadow(0 1px 1px rgba(0,40,20,.35)); }
body .pm-nav-b.on .pm-nav-l { background: var(--liq-texte); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ── 4. LE TABLEAU DE BORD : VOLUME, ACTIONS, ÉTAPES PAR PHASE ──────────────────────────────────────── */
/* Volume : une tuile par opération, toutes sur une rangée ; l'onglet ouvert a l'anneau vert qui tourne. */
#view-dashboard .kpis-volume { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; }
#view-dashboard .kpis-volume .kpi { padding: 12px 14px; border-radius: 14px; }
#view-dashboard .kpis-volume .kpi .top { margin-bottom: 4px; }
#view-dashboard .kpis-volume .kpi .label { font-size: 12.5px; font-weight: 600; }
#view-dashboard .kpis-volume .kpi .value { font-size: 26px; font-weight: 800; }
#view-dashboard .kpis-volume .kpi.ouvert {
  border: 2px solid transparent;
  background: linear-gradient(var(--card, #fff), var(--card, #fff)) padding-box, var(--liq-anneau) border-box;
  box-shadow: 0 10px 26px -16px rgba(var(--liq-o1), .8);
  animation: liq-tourne 10s linear infinite;
}
/* La pastille « OUVERT » se pose à cheval sur le bord haut : elle ne prend aucune place, le chiffre reste aligné avec les autres tuiles. */
#view-dashboard .kpis-volume .kpi { position: relative; }
#view-dashboard .kpi-ouvert-pastille { position: absolute; top: -9px; right: 12px; font-size: 9.5px; font-weight: 800; letter-spacing: .05em; line-height: 1.5; border-radius: 999px; padding: 1px 8px; }

/* Actions à mener : chaque bloc devient un bandeau (le chiffre à gauche, le reste à droite) ; sa couleur d'alerte reste. */
#view-dashboard .act-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
#view-dashboard .act-grid .act-card { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: center; border-radius: 14px; }
#view-dashboard .act-grid .act-card > * { grid-column: 2; min-width: 0; }
#view-dashboard .act-grid .act-card > .n { grid-column: 1; grid-row: 1 / span 8; align-self: center; font-size: 28px; }
#view-dashboard .act-grid .act-card > .lab { margin-top: 0; }
#view-dashboard .act-grid .act-card > .who { justify-self: start; margin-top: 6px; }

/* Où en sont les dossiers : les étapes rangées en phases (Vente, Financement, Pose, Après la pose). */
.ph-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.ph-grille.ph-n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ph-grille.ph-n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ph-grille.ph-n1 { grid-template-columns: minmax(0, 1fr); }
.ph-phase { background: #f7faf8; border: 1px solid var(--border, #d7e5db); border-radius: 14px; padding: 12px 10px 8px; display: grid; gap: 2px; align-content: start; min-width: 0; }
.ph-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted, #5f6f64); }
.ph-tete b { font-size: 24px; letter-spacing: 0; background: var(--liq-texte); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-variant-numeric: tabular-nums; }
.ph-part { height: 4px; border-radius: 2px; background: #e3ebe6; overflow: hidden; margin: 4px 6px 8px; }
.ph-part i, .ph-barre i { display: block; height: 100%; border-radius: inherit; background: var(--liq-barre); }
.ph-etape { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'top n' 'barre barre' 'sub sub'; align-items: center; gap: 4px 10px; padding: 8px 8px; border-radius: 10px; }
.ph-etape .top { grid-area: top; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ph-etape .ph-rang { flex: none; width: 16px; font-size: 11px; font-weight: 700; color: var(--muted, #5f6f64); text-align: center; }
.ph-etape .label { font-size: 13px; font-weight: 650; line-height: 1.25; color: var(--fg, #1e2a22); min-width: 0; }
.ph-etape .value { grid-area: n; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--fg, #1e2a22); }
.ph-etape .ph-barre { grid-area: barre; height: 6px; border-radius: 3px; background: #e3ebe6; overflow: hidden; margin-left: 24px; }
.ph-etape .sub { grid-area: sub; margin-left: 24px; font-size: 11px; line-height: 1.3; color: var(--muted2, #8a978f); }
.ph-etape.clic { cursor: pointer; }
.ph-etape.clic:hover, .ph-etape.clic:focus-visible { background: var(--card, #fff); box-shadow: 0 2px 10px -4px rgba(0,0,0,.18); }
.ph-etape.clic .value { background: var(--liq-texte); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ph-etape.vide { opacity: .5; }
@media (max-width: 1180px) { .ph-grille.ph-n4, .ph-grille.ph-n3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ph-grille.ph-n4, .ph-grille.ph-n3, .ph-grille.ph-n2 { grid-template-columns: minmax(0, 1fr); } }

/* DANS L'APPLI DU TÉLÉPHONE, RIEN NE TOURNE EN CONTINU (18/10/2026, audit des Discussions : « parfaitement fluide »). Les anneaux et
   coulées animées repeignaient l'écran sans arrêt — sur un iPhone, autant de calcul pris à la conversation. La même liste que
   « réduire les animations », ci-dessous. */
body.pm-on nav.menu a.active, body.pm-on .btn-primary, body.pm-on .rp-fab, body.pm-on .chat-neuf, body.pm-on .chat-vide-b, body.pm-on .pm-op-sel.on,
body.pm-on .pm-op-sel::before, body.pm-on #retour-fab .rt-rond-b, body.pm-on .chat-entete-b, body.pm-on .pm-nav-b.on::before { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  nav.menu a.active, .btn-primary, body .rp-fab, body .chat-neuf, body .chat-vide-b, body .pm-op-sel.on, body .pm-op-sel::before,
  body #retour-fab .rt-rond-b, body .chat-entete-b, #view-dashboard h3.dash-h .fa, #user-block .btn-logout,
  #view-dashboard .kpis-volume .kpi.ouvert, #view-dashboard .kpi-ouvert-pastille, body .pm-nav-b.on::before { animation: none; }
}
