/* =============================================================================
   finitions.css — Couches ajoutées à partir du 03/10/2026, prioritaires sur les précédentes : animations,
   refonte commune des boutons et listes, questionnaire (dialogues, barre d'onglets, tri), lecture d'un coup
   d'œil, onglet Contrôle, recherche Spotlight, Liquid Glass, fenêtre « Accès restreint », survol des courbes.
   Sections 41 à 49.
   Découpage du 07/10/2026 de l'ancien style.css (nettoyé : règles mortes et déclarations écrasées retirées,
   rendu vérifié identique). Chargés dans cet ordre par base.html et connexion.html : socle → ecrans →
   finitions. L'ordre compte : à sélecteur égal, la règle la plus loin l'emporte (une section plus loin
   peut volontairement en écraser une plus haute). Jetons (:root) : socle.css, section 1.
   ============================================================================= */

/* =============================================================================
   41. Animations (demande du 03/10/2026) — toutes coupées si « réduire les animations »
   Cascade et squelettes posés par Animations (app.js) ; graphiques : dessinerGraphique().
   ============================================================================= */

/* Apparition en cascade des blocs (fill-mode « backwards » : aucune transformation ne reste
   après l'animation, les fenêtres en position fixe à l'intérieur ne sont pas affectées) */
.entree { animation: entree-bloc 0.35s var(--ease-out) var(--delai-entree, 0ms) backwards; }   /* 0,8 s → 0,35 s (22/10/2026) */
@keyframes entree-bloc {
  from { opacity: 0; transform: translateY(8px); }
}

/* Squelettes de chargement : indicateurs encore vides, graphiques pas encore dessinés */
@keyframes squelette-reflet {
  from { background-position: 100% 0; }
  to   { background-position: -100% 0; }
}
.squelette,
.graphique:empty,
#contenuObjectif:empty {
  background: linear-gradient(90deg, var(--surface-2) 25%, #F7F9FC 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: squelette-reflet 1.3s ease-in-out infinite;
  border-radius: 8px;
}
.kpi-card__valeur.squelette { color: transparent !important; width: 62%; min-height: 1.1em; user-select: none; }
.graphique:empty { min-height: 240px; }
#contenuObjectif:empty { min-height: 150px; }

/* Barres proportionnelles et jauge d'objectif : remplissage depuis la gauche */
.barre-inline__remplissage,
.jauge__remplissage {
  animation: barre-remplir 0.6s var(--ease-out) backwards;                     /* 1,1 s + 0,2 s → 0,6 s (22/10/2026) */
}
@keyframes barre-remplir {
  from { clip-path: inset(0 100% 0 0 round 4px); }
  to   { clip-path: inset(0 0 0 0 round 4px); }
}

/* Graphiques : fondu avec très légère montée, à l'arrivée et au changement d'année (dessinerGraphique) */
   /* 0,9 s → 0,35 s (22/10/2026) */
@keyframes graphique-apparition {
  from { opacity: 0; transform: translateY(6px); }
}

/* Chiffres : largeur fixe pendant le défilement (pas de tremblement) et arrivée en fondu après le squelette */
.kpi-card__valeur { font-variant-numeric: tabular-nums; transition: color 0.4s ease; }

/* Changement d'année / rechargement : fondu doux au lieu d'un saut */
.dashboard,
#contenuRenouv { transition: opacity 0.35s ease; }

/* Micro-interactions */
.btn,
.fc-puce,
.btn-statut,
.selecteur-annee { transition: transform 0.12s ease, background 150ms ease, color 150ms ease,
                               border-color 150ms ease, box-shadow 150ms ease; }
.btn:active,
.fc-puce:active,
.btn-statut:active,
.selecteur-annee:active,
.sidebar__toggle:active { transform: scale(0.97); }
.table tr[data-depliable]:active,
.ligne-cliquable:active { background: var(--tableau-survol); }
@media (hover: hover) {
  .kpi-card,
  .carte,
  .table-conteneur { transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease; }
  .kpi-card:hover { transform: translateY(-4px); box-shadow: var(--ombre-survol); }
  .carte:hover,
  .table-conteneur:not(.table-conteneur--nu):hover { box-shadow: var(--ombre-survol-bloc); }
}

@media (prefers-reduced-motion: reduce) {
  .entree,
  .squelette,
  .graphique:empty,
  #contenuObjectif:empty,
  .barre-inline__remplissage,
  .jauge__remplissage,
  .graphique--apparition,
  .modal,
  .modal-fond { animation: none; }
  .kpi-card:hover,
  .btn:active,
  .fc-puce:active,
  .btn-statut:active,
  .selecteur-annee:active,
  .sidebar__toggle:active { transform: none; }
}

/* =============================================================================
   42. Boutons, listes déroulantes, onglets — refonte commune (demande du 03/10/2026 :
   « tous les boutons de tout type, sur toutes les pages, design sur toutes les plateformes »).
   Placé en fin de feuille : remplace les réglages de base des sections 9, 14, 17 et 29.
   ============================================================================= */

/* --- Boutons ------------------------------------------------------------------ */
.btn {
  min-height: 38px;

  font-family: inherit;

  letter-spacing: 0.1px;
  line-height: 1.2;
}
.btn svg { flex-shrink: 0; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(31,78,140,0.28); }

.btn--primaire {
  border-color: #1B467F;
}
@media (hover: hover) and (pointer: fine) { .btn--primaire:hover {
  background: linear-gradient(180deg, #3A76C6 0%, #2459A0 100%);
  border-color: #1F4E8C;
  box-shadow: 0 2px 4px rgba(16,24,40,0.14), 0 8px 18px rgba(31,78,140,0.28), inset 0 1px 0 rgba(255,255,255,0.18);
} }

.btn--secondaire {
  border-color: var(--bordure-forte);
}
@media (hover: hover) and (pointer: fine) { .btn--secondaire:hover {
  background: var(--surface-0);
  border-color: var(--couleur-bleu-clair);
  color: var(--couleur-bleu);
  box-shadow: 0 2px 8px rgba(31,78,140,0.12);
} }

.btn--fantome {  border-color: transparent;  }
@media (hover: hover) and (pointer: fine) { .btn--fantome:hover { background: rgba(31,78,140,0.07); color: var(--couleur-bleu); } }

.btn--danger {
  border-color: rgba(215,38,61,0.45);
}
@media (hover: hover) and (pointer: fine) { .btn--danger:hover { background: rgba(215,38,61,0.07); border-color: var(--couleur-rouge); } }

.btn--sm { min-height: 32px;  gap: 6px; border-radius: 8px;  }

/* Boutons-icônes (modifier, supprimer, fiche…) : carrés, discrets, colorés au survol */
.btn--icone {  min-height: 32px;    }
@media (hover: hover) and (pointer: fine) { .btn--icone:hover { background: rgba(31,78,140,0.08); color: var(--couleur-bleu); } }
@media (hover: hover) and (pointer: fine) { .btn--icone-danger:hover { background: rgba(215,38,61,0.08); color: var(--couleur-rouge); } }

/* Pagination : page en cours en bleu plein */
.btn--page {   font-variant-numeric: tabular-nums; }
.btn.actif { background: var(--couleur-bleu); border-color: var(--couleur-bleu); color: #fff; box-shadow: 0 2px 6px rgba(31,78,140,0.25); }

.btn:disabled,
.btn.desactive { opacity: 0.45; box-shadow: none; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) { .btn:disabled:hover,
.btn.desactive:hover { transform: none; } }

/* --- Listes déroulantes : même habillage que le sélecteur d'année du tableau de bord --- */
.select {
  -webkit-appearance: none;
  appearance: none;
  height: 38px;
  padding: 0 34px 0 12px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16,24,40,0.06);
  background-color: var(--surface-0);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%237A8699' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3,4.5 6,7.5 9,4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
}
@media (hover: hover) and (pointer: fine) { .select:hover { border-color: var(--couleur-bleu-clair); } }
.select:focus { border-color: var(--couleur-bleu); box-shadow: 0 0 0 3px rgba(31,78,140,0.16); }
.select--sm { height: 32px; padding: 0 30px 0 10px; border-radius: 8px; font-size: 13px; background-position: right 10px center; }

/* Champs de saisie : mêmes hauteurs et arrondis que les boutons */
.input { height: 38px; border-radius: 10px; }
.input--sm { height: 32px; border-radius: 8px; }

/* --- Fermeture des fenêtres : bouton rond --- */
.modal__fermer {
  flex-shrink: 0;

  transition: background 150ms ease, color 150ms ease, transform 0.12s ease;
}
@media (hover: hover) and (pointer: fine) {  }
.modal__fermer:active { transform: scale(0.94); }

/* --- Bouton œil des commissions (carte du tableau de bord) --- */
.kpi-card__bouton-masque { border-radius: 50%; }
@media (hover: hover) and (pointer: fine) { .kpi-card__bouton-masque:hover { border-color: var(--couleur-bleu-clair); color: var(--couleur-bleu); } }

/* --- Onglets (Explorer) : contrôle segmenté --- */
.onglets {
  max-width: 100%;
}
.onglet {
  margin: 0;
}
@media (hover: hover) and (pointer: fine) { .onglet:hover { color: var(--texte-principal); } }
.onglet.actif {
  background: var(--surface-0);
  color: var(--couleur-bleu);
  box-shadow: 0 1px 3px rgba(16,24,40,0.12);
}

/* --- Téléphone : cibles tactiles confortables (16 px dans les champs : pas de zoom iOS) --- */
@media (max-width: 640px) {
  .btn { min-height: 44px; }
  .btn--sm { min-height: 38px; }
  .btn--icone { width: 38px; min-height: 38px; }
  .btn--page { min-width: 38px; }
  .input,
  .select { height: 44px; font-size: 16px; }
  .fc .input,
  .fc .select { height: 42px; }
  .onglets { display: flex; }
  .onglet { flex: 1; padding: 10px 12px; }
}

/* =============================================================================
   43. Questionnaire du 03/10/2026 : fenêtres de dialogue, barre d'onglets mobile,
   transitions entre pages, plein écran, indicateurs 2 par ligne
   ============================================================================= */

/* --- Fenêtres de dialogue maison (showConfirm / demanderTexte, app.js) --- */
.dialogue-fond { z-index: 650; }
.dialogue-fond--sortie { opacity: 0; transition: opacity 0.18s ease; }
.dialogue {
  max-width: 400px;
  padding: 24px 22px 18px;
  text-align: center;
  border-radius: 20px;
}
.dialogue__icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: rgba(31,78,140,0.10);
  color: var(--couleur-bleu);
}
.dialogue__icone svg { width: 24px; height: 24px; }
.dialogue__icone--danger { background: rgba(215,38,61,0.10); color: var(--couleur-rouge); }
.dialogue__titre { margin: 0 0 6px; font-size: 18px; font-weight: 700; color: var(--texte-principal); }
.dialogue__message {
  margin: 0 0 4px;
  font-size: var(--taille-base);
  line-height: 1.5;
  color: var(--texte-secondaire);
  white-space: pre-line;
}
.dialogue__libelle { display: block; margin: 14px 0 6px; text-align: left; }
.dialogue__erreur { margin-top: 6px; text-align: left; }
.dialogue__actions { display: flex; gap: 10px; margin-top: 20px; }
.dialogue__actions .btn { flex: 1; }
.btn--danger-plein {
  background: linear-gradient(180deg, #E0384F 0%, var(--couleur-rouge) 100%);
  border-color: #B91F33;
  color: #fff;
  box-shadow: 0 1px 2px rgba(16,24,40,0.14), 0 4px 12px rgba(215,38,61,0.22), inset 0 1px 0 rgba(255,255,255,0.16);
}
@media (hover: hover) and (pointer: fine) { .btn--danger-plein:hover { background: linear-gradient(180deg, #E84A60 0%, #C42136 100%); } }

/* --- Barre d'onglets mobile : refonte.css (26/10/2026) --- */

/* --- Pas de fondu entre pages (@view-transition) : retiré le 18/11/2026, il retenait la page suivante ~800 ms sur
       ordinateur (mesuré) ; l'entrée animée de chaque écran suffit (cadre.js › Mouvement) --- */

@media (prefers-reduced-motion: reduce) {
  .dialogue-fond--sortie { transition: none; }
}

/* --- Indicateurs : 2 par ligne sur téléphone, partout (remplace l'ancienne règle « 1 par ligne ≤ 390 px ») --- */
@media (max-width: 640px) {
  .kpi-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-card { padding: 12px; }
  .kpi-card__valeur { font-size: 20px; }
  .kpi-card__note { font-size: 11px; }
}

/* --- Import sur écran tactile : un simple bouton, sans glisser-déposer (questionnaire du 03/10/2026) --- */
.drop-zone__texte-tactile { display: none; }
@media (pointer: coarse), (max-width: 640px) {
  .drop-zone__glisser,
  .drop-zone__texte-ordinateur { display: none; }
  .drop-zone__texte-tactile { display: inline; }
  .drop-zone { padding: 22px 16px; }
  .drop-zone__bouton {
    width: 100%;
    max-width: 320px;
    min-height: 46px !important;
    margin-top: 4px !important;
    font-size: 15px;
    background: linear-gradient(180deg, #3069B5 0%, var(--couleur-bleu) 100%);
    border-color: #1B467F;
    color: #fff;
    box-shadow: 0 4px 12px rgba(31,78,140,0.22);
  }
}

/* --- Onglets de page (Renouvellements) : contrôle segmenté pleine largeur sur téléphone --- */

/* --- Erreurs de saisie sous les champs (ErreursChamps, app.js) --- */
.input--erreur,
.select--erreur { border-color: var(--couleur-rouge) !important; box-shadow: 0 0 0 3px rgba(215,38,61,0.12) !important; }
.champ__erreur--message {
  margin: 4px 0 0;
  font-weight: 600;
  animation: erreur-apparition 0.25s ease backwards;
}
@keyframes erreur-apparition { from { opacity: 0; transform: translateY(-3px); } }

/* --- Recherche globale (Recherche, app.js) --- */

/* Recherche façon Spotlight (demande du 03/10/2026) : une barre flottante en verre dépoli ; les résultats
   se déploient dessous dès la première lettre (classe .recherche--resultats posée par app.js) */
.recherche-fond {
  align-items: flex-start;
  padding-top: 16vh;
  z-index: 640;
  background: rgba(11,31,58,0.22);
  -webkit-backdrop-filter: blur(5px);
          backdrop-filter: blur(5px);
}
.recherche {
  width: 100%;
  max-width: 660px;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(255,255,255,0.97);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
          backdrop-filter: blur(30px) saturate(180%);
  animation: recherche-entree 0.22s var(--ease-out);
}
@keyframes recherche-entree {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.recherche__saisie {
  display: flex;
  align-items: center;
}
.recherche--resultats .recherche__saisie { border-bottom: 1px solid rgba(11,31,58,0.08); }
.recherche__saisie > svg { flex-shrink: 0; }
.recherche__champ {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--texte-principal);
}
.recherche__champ::placeholder { color: var(--texte-tertiaire); opacity: 0.7; font-weight: 400; }
.recherche__champ::-webkit-search-cancel-button { display: none; }
.recherche__echap {
  flex-shrink: 0;
  padding: 3px 7px;
  border: 1px solid var(--bordure);
  border-radius: 6px;
  background: rgba(255,255,255,0.7);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--texte-tertiaire);
}
.recherche__fermer {                                       /* « Annuler » : téléphone uniquement */
  display: none;
  padding: 6px 4px;
  border: none;
  background: none;
  color: var(--couleur-bleu);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.recherche__corps { display: none; }
.recherche--resultats .recherche__corps { display: block; animation: recherche-resultats 0.2s ease; }
@keyframes recherche-resultats { from { opacity: 0; } to { opacity: 1; } }

/* Loupe de recherche (ordinateur) : dernier bouton de l'en-tête de page, même hauteur que les boutons (38 px) */

.recherche__titre {
  margin: 0;
}
.recherche__corps { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 10px; -webkit-overflow-scrolling: touch; }
.recherche__liste { margin: 0; list-style: none; }
.recherche__criteres { margin: 0; }
.recherche__pastille {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(31,78,140,0.10);
  color: var(--couleur-bleu);
  font-size: 12px;
  font-weight: 600;
}
.recherche__icone {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface-2);
  color: var(--texte-secondaire);
}
.recherche__icone svg { width: 17px; height: 17px; }
.recherche__icone--client { background: rgba(31,78,140,0.10); color: var(--couleur-bleu); }
.recherche__montant { flex-shrink: 0; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--texte-principal); }
.recherche__tout { display: flex; }
.recherche__aucun { margin: 0; color: var(--texte-tertiaire); font-size: 14px; list-style: none; }
.recherche__resultat {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.recherche__nom { flex: 1; min-width: 0; font-weight: 600; color: var(--texte-principal); }
.recherche__nom mark { background: rgba(45,107,196,0.18); color: inherit; border-radius: 3px; padding: 0 1px; }
.recherche__nom small { display: block; font-weight: 400; color: var(--texte-tertiaire); }
.recherche__actions { display: flex; gap: 6px; flex-shrink: 0; }

@media (max-width: 768px) {
                    /* sur mobile : loupe de la barre du haut */

          /* loupe dans la barre bleue du haut */
  .modal-fond.recherche-fond { padding: calc(74px + env(safe-area-inset-top)) 12px 12px; }   /* sous la barre bleue du haut */
  .recherche { max-height: calc(100dvh - 100px - env(safe-area-inset-top)); }
  .recherche__champ { font-size: 17px; }                  /* ≥ 16 px : pas de zoom iOS */
  .recherche__echap { display: none; }
  .recherche__fermer { display: block; }
  .recherche__resultat:has(.recherche__actions) { flex-wrap: wrap; }
  .recherche__actions { width: 100%; }
  .recherche__actions .btn { flex: 1; }
}

/* --- Plein écran iPhone (barre d'état transparente) : fenêtres hors de la barre d'état et de la barre d'accueil --- */
@media (max-width: 768px) {
  .modal-fond {
    padding-top: max(var(--espace-md), calc(env(safe-area-inset-top) + 8px));
    padding-bottom: max(var(--espace-md), calc(env(safe-area-inset-bottom) + 8px));
  }
  .modal-fond--commande {
    padding-top: calc(10px + env(safe-area-inset-top));
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
}

/* --- Tableaux sur téléphone : la ligne de total est peinte en entier (et non cellule par cellule,
       ce qui donnait l'impression d'un texte sélectionné) --- */
@media (max-width: 640px) {
  .table tr.ligne-total { background: var(--tableau-total); }
  .table tr.ligne-total td { background: transparent; border-top: none; }
}

/* --- App iPhone (écran d'accueil) : zone de l'heure uniforme (bug du 03/10/2026) ---
   iOS teinte et floute la zone de la barre d'état d'après le fond de la RACINE de la page :
   ce fond était gris clair → bandeau gris flou au-dessus de la barre bleue. La racine devient
   bleu nuit (comme la barre), le corps de page garde son gris ; plus de rebond, pour que ce bleu
   n'apparaisse jamais sous la barre d'onglets. */
@media (max-width: 768px) {
  html {
    background: var(--barre-haut);
    overscroll-behavior-y: none;
  }
  body { min-height: 100vh; min-height: 100dvh; }
}

/* -----------------------------------------------------------------------------
   44. Lecture « d'un coup d'œil » (demande du 03/10/2026)
   ----------------------------------------------------------------------------- */

/* % de marge en pastille : vert ≥ 13 %, orange 10–13 %, rouge < 10 % (app.js, pastilleMarge) */
.pastille-marge {
  min-width: 58px;

  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Répartition par type : une barre découpée + légende (dashboard.js, afficherRepartition) */
.repartition { margin-bottom: var(--espace-md); }
.repartition:empty { display: none; }
/* Même jauge que l'objectif de marge (.jauge, .jauge__seg, .jauge__repere) : seules les teintes changent */
.jauge.repartition__barre { margin-top: 6px; }

/* Camaïeu de bleus en dégradé horizontal, comme le « réalisé » de l'objectif */
/* Dégradé de bleus gardé à la demande de l'utilisateur (22/10/2026 : orange/vert essayés puis refusés) */

.repartition__legende strong {  font-variant-numeric: tabular-nums; }

/* Renouvellements, onglet Année : prochaines échéances en liste compacte (renouvellements.js, afficherProchaines) */

.prochaines__liste { list-style: none; margin: 0; padding: 0; }

.prochaine {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1.4fr) 112px 112px;
  align-items: center;

  border: 0;

  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
@media (hover: hover) and (pointer: fine) {  }

.prochaine__date {   white-space: nowrap; font-variant-numeric: tabular-nums; }
               /* client et dénomination : deux colonnes de la grille */
.prochaine__client { min-width: 0;   overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prochaine__denomination { min-width: 0;   overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prochaine__montant { justify-self: end;   white-space: nowrap; }
.prochaine__rebours {
  justify-self: end;

  white-space: nowrap;
}

/* Téléphone : client / dénomination sur deux lignes, montant au-dessus du compte à rebours */
@media (max-width: 640px) {
  .prochaine {
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }
  .prochaine__date { grid-area: date;  }
  .prochaine__texte { grid-area: texte; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  .prochaine__montant { grid-area: montant; justify-self: end; font-size: 13px; }
  .prochaine__rebours { grid-area: rebours;   }
}
@media (prefers-reduced-motion: reduce) {
  .repartition__barre { animation: none; }
}

/* Carte dont le tableau défilant remplit toute la hauteur de la rangée (ex. Renouvellements › Clients,
   à côté du graphique « Par mois ») : la hauteur est donnée par la carte voisine */

/* Tableau d'évolution mensuelle (tableau de bord) : colonne « Évol. marge » en pastille, mois sans données
   discrets (demande du 03/10/2026) */
.table-evolution td.evol-courante { font-weight: 600; color: var(--texte-principal); }
.table-evolution tr.evol-ligne-vide td:not(.evol-precedente) { color: var(--texte-tertiaire); }

.table-evolution tfoot .evol-precedente { color: var(--texte-secondaire); }
/* Téléphone : la comparaison est déjà dans le détail dépliable (pastilles « en 2026 ») */
@media (max-width: 640px) {
  .table-evolution .evol-ecart { display: none; }
}

/* Vérification des champs et boutons (demande du 03/10/2026) — téléphone : dans les barres de filtres,
   libellés de largeur fixe (les listes commencent toutes au même endroit) et petits boutons à la hauteur
   des champs (44 px) */
@media (max-width: 640px) {
  .filter-bar .btn--sm { min-height: 44px; }
}

/* Tri des tableaux par en-tête (app.js, TriTableaux ; demande du 03/10/2026) : en-têtes cliquables,
   petite flèche discrète au survol, flèche pleine sur la colonne triée. Colonnes de nombres (alignées à
   droite) : flèche avant le libellé, pour garder l'alignement avec les chiffres. */
.table thead th.th-triable { cursor: pointer; user-select: none; -webkit-user-select: none; white-space: nowrap; }
.table thead th.th-triable::after,
.table thead th.th-triable.num::before {
  content: "↕";
  display: inline-block;
  width: 10px;
  margin-left: 5px;
  font-size: 10px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.table thead th.th-triable.num::after { content: none; }
.table thead th.th-triable.num::before { margin: 0 5px 0 0; }
@media (hover: hover) and (pointer: fine) { .table thead th.th-triable:hover::after,
.table thead th.th-triable.num:hover::before { opacity: 0.55; } }
.table thead th.th-tri-asc::after,
.table thead th.th-tri-asc.num::before { content: "▲"; opacity: 1; font-size: 8px; }
.table thead th.th-tri-desc::after,
.table thead th.th-tri-desc.num::before { content: "▼"; opacity: 1; font-size: 8px; }
.table thead th.th-tri-asc.num::after,
.table thead th.th-tri-desc.num::after { content: none; }

@media (hover: hover) and (pointer: fine) {  }

/* Liste des commandes : largeurs de colonnes fixes (ordinateur et tablette). Le tri et la pagination chargent
   d'autres commandes ; sans cela les colonnes changeaient de largeur à chaque tri (demande du 03/10/2026).
   Textes trop longs : « … » (texte complet au survol) ; en dessous de 1080 px, le tableau défile. */
@media (min-width: 641px) {
  #tableCommandes { table-layout: fixed; min-width: 1040px; }
  #tableCommandes th:nth-child(1)  { width: 106px; }   /* Date */
  #tableCommandes th:nth-child(2)  { width: 14%; }     /* Client */
                                                        /* Dénomination : le reste */
  #tableCommandes th:nth-child(4)  { width: 86px; }    /* CA SRV */
  #tableCommandes th:nth-child(5)  { width: 90px; }    /* CA DIS */
  #tableCommandes th:nth-child(6)  { width: 98px; }    /* CA Total */
  #tableCommandes th:nth-child(7)  { width: 88px; }    /* Marge */
  #tableCommandes th:nth-child(8)  { width: 80px; }    /* % Marge */
  #tableCommandes th:nth-child(9)  { width: 100px; }   /* Commission */
  #tableCommandes th:nth-child(10) { width: 112px; }   /* Type */
  #tableCommandes th:nth-child(11) { width: 80px; }    /* Modifier / supprimer */
  #tableCommandes th,
  #tableCommandes td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #tableCommandes .cellule-nom { max-width: none; }
}

/* -----------------------------------------------------------------------------
   45. Renouvellements › Contrôle des données (04/10/2026) — controle_renouvellements.js
   ----------------------------------------------------------------------------- */

.controle__liste { display: grid; grid-template-columns: minmax(0, 1fr);   }
.controle__carte {  min-width: 0; }
.controle__haut { display: flex; align-items: center;  flex-wrap: wrap; margin-bottom: 8px; }

.controle__effet {
  margin-left: auto;

  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.controle__effet--nul   {        font-weight: 600; }

.controle__commandes { list-style: none;     overflow: hidden; }
.controle__commande {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 150px 110px 36px;
  align-items: center;
}

.controle__date {  font-variant-numeric: tabular-nums; }
.controle__denomination {   overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.controle__periodicite {  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.controle__montant {  text-align: right;  }
.controle__actions { display: flex; flex-wrap: wrap;  }
.controle__ignorer { margin-left: auto; }
@media (max-width: 640px) {
  .controle__effet { margin-left: 0; }
  .controle__commande {
    grid-template-columns: minmax(0, 1fr) auto 38px;
    grid-template-areas: "denom montant ouvrir" "date periode ouvrir";
    gap: 2px 10px;
  }
  .controle__denomination { grid-area: denom; }
  .controle__montant { grid-area: montant; }
  .controle__date { grid-area: date; font-size: 12px; }
  .controle__periodicite { grid-area: periode; font-size: 12px; text-align: right; }
  .controle__commande .btn { grid-area: ouvrir; }
  .controle__actions .btn { flex: 1 1 auto; }
  .controle__ignorer { margin-left: 0; }
}

/* -----------------------------------------------------------------------------
   46. Recherche façon Spotlight : finitions (04/10/2026) — barre seule plus « présente » (ombre profonde,
   halo bleu, loupe en pastille), résultats aérés et alignés (marges régulières, intitulés + compteur,
   lignes séparées)
   ----------------------------------------------------------------------------- */
.recherche {
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.8);
  box-shadow:
    0 0 0 5px rgba(45,107,196,0.10),          /* halo bleu discret */
    0 2px 6px rgba(11,31,58,0.08),
    0 28px 70px rgba(11,31,58,0.38);
}
.recherche__saisie { padding: 14px 18px 14px 14px; gap: 14px; }
.recherche__saisie > svg {
  box-sizing: content-box;
  width: 20px;
  height: 20px;
  padding: 9px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(45,107,196,0.16), rgba(31,78,140,0.08));
  color: var(--couleur-bleu);
}
.recherche--resultats .recherche__saisie { border-bottom-color: var(--tableau-trait); }

/* Résultats */
.recherche__corps { padding: 6px 12px 14px; background: var(--surface-1); }
.recherche__criteres { padding: 10px 8px 2px; }
.recherche__titre {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 8px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--texte-tertiaire);
}
.recherche__compte {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--texte-tertiaire);
  font-variant-numeric: tabular-nums;
}
.recherche__liste {
  padding: 0;
  border: 1px solid var(--bordure);
  border-radius: 14px;
  background: var(--surface-0);
  overflow: hidden;
}
.recherche__resultat { gap: 14px; padding: 11px 14px; border-radius: 0; }
.recherche__resultat + .recherche__resultat { border-top: 1px solid var(--tableau-trait); }
.recherche__resultat:hover,
.recherche__resultat.actif { background: var(--tableau-survol); }
.recherche__resultat.actif { box-shadow: inset 3px 0 0 var(--couleur-bleu-clair); }
.recherche__icone { width: 36px; height: 36px; border-radius: 11px; }
.recherche__nom { font-size: 14px; }
.recherche__nom small { margin-top: 3px; font-size: 12.5px; }
.recherche__montant { font-size: 14px; }
.recherche__tout { margin: 14px 0 2px; height: 42px; border-radius: 12px; justify-content: center; }
.recherche__aucun { padding: 22px 8px; text-align: center; }
@media (max-width: 768px) {
  .recherche { border-radius: 20px; }
  .recherche__saisie { padding: 10px 14px 10px 10px; gap: 10px; }
  .recherche__saisie > svg { width: 18px; height: 18px; padding: 8px; }
  .recherche__corps { padding: 4px 10px 12px; }
  .recherche__resultat { padding: 10px 12px; gap: 12px; }
  .recherche__actions { padding-left: 48px; }
}

/* Résultats de recherche : ligne principale « Client · Intitulé de la commande » (demande du 04/10/2026) */
.recherche__ligne1 { display: flex; align-items: baseline; min-width: 0; gap: 6px; }
.recherche__client { flex: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recherche__sep { flex: none; color: var(--texte-tertiaire); font-weight: 400; }
.recherche__intitule { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
                       font-weight: 500; color: var(--texte-secondaire); }
@media (max-width: 640px) {
  /* Téléphone : « Client · Intitulé » à la suite, comme sur ordinateur ; le texte passe à la ligne au besoin */
  .recherche__ligne1 { display: block; }
  .recherche__client, .recherche__intitule { display: inline; max-width: none; white-space: normal; }
  .recherche__client { white-space: nowrap; }      /* le nom du client ne se coupe pas */
  .recherche__sep { display: inline; margin: 0 5px; }
}

/* Tableau de bord : salutation au-dessus du titre (« Bonjour Thomas, ») */
.page__salut {    letter-spacing: -0.02em;
               line-height: 1.2;  }      /* en gras, comme un titre (04/10/2026) */

@media (max-width: 768px) {
  .page__salut { font-size: 22px; }
}
@media (max-width: 640px) {
  /* Clients récents sur une ligne qui défile au doigt (le titre « Récents » reste visible au début) */
  .fc-recents { flex-wrap: nowrap; overflow-x: auto; margin: 10px -12px 0; padding: 2px 12px; scrollbar-width: none; }
  .fc-recents::-webkit-scrollbar { display: none; }
  .fc-recent { flex: none; }
}

/* -----------------------------------------------------------------------------
   Page de connexion allégée (04/10/2026, « trop lourde ») — remplace l'aspect de la section 37 :
   fond bleu nuit uni (plus de halos ni de trame), une seule colonne centrée (logo, « Pilotage commercial »),
   carte sobre (ombre légère ; sur téléphone : plus de verre dépoli, simple panneau discret)
   ----------------------------------------------------------------------------- */
.page-connexion { background: linear-gradient(180deg, #0D2342 0%, #0B1F3A 100%); }
.page-connexion .connexion {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  max-width: 440px;
  text-align: center;
}
.page-connexion .connexion__marque { padding: 0; }
.page-connexion .connexion__logo-marque { width: 168px; margin: 0 auto 10px; }
.page-connexion .connexion__accroche {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.page-connexion .connexion__accroche span { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: inherit; }
.page-connexion .connexion__carte {
  justify-self: auto;
  max-width: 380px;
  padding: 26px 26px 24px;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
  text-align: left;
}
.page-connexion .connexion__titre { margin: 0 0 18px; font-size: 24px; }

@media (max-width: 560px) {
  /* Clavier fermé : ensemble descendu vers le milieu de l'écran (04/10/2026 : « trop compacté vers le haut ») ;
     clavier : aucune animation maison, l'iPhone gère seul (04/10/2026) */
  .page-connexion .connexion { justify-content: flex-start; padding: calc(13vh + env(safe-area-inset-top)) 18px 24px; }
  .page-connexion .connexion__carte {
    width: 100%;
    max-width: none;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    -webkit-backdrop-filter: none;
            backdrop-filter: none;
    box-shadow: none;
  }
  .page-connexion .connexion__titre { font-size: 22px; color: #fff; }
}

/* Page de connexion : entrée animée en douceur (04/10/2026, « la rendre un peu vivante »).
   Halo qui apparaît puis respire lentement derrière le logo, logo net depuis un léger flou, sous-titre qui se
   resserre, carte qui monte, contenu en cascade, reflet qui traverse le bouton une fois. ≈ 1,3 s au total. */
.page-connexion::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 40% at 50% 30%, rgba(45,107,196,0.28), transparent 70%);
  animation: cx-halo-entree 1.6s ease-out both, cx-halo-souffle 9s ease-in-out 1.6s infinite alternate;
}
.page-connexion .connexion__marque { animation: none; }
.page-connexion .connexion__logo-marque { animation: cx-logo 0.4s var(--ease-out) both; }   /* entrée raccourcie le 22/10/2026 */
.page-connexion .connexion__accroche { animation: cx-sous-titre 0.45s var(--ease-out) 0.05s both; }
.page-connexion .connexion__carte { animation: cx-carte 0.4s var(--ease-out) 0.08s both; }
.page-connexion .connexion__carte > * { animation: cx-element 0.3s var(--ease-out) both; }
.page-connexion .connexion__carte > :nth-child(1) { animation-delay: 0.14s; }
.page-connexion .connexion__carte > :nth-child(2) { animation-delay: 0.17s; }
.page-connexion .connexion__carte > :nth-child(3) { animation-delay: 0.2s; }
.page-connexion .connexion__carte > :nth-child(4) { animation-delay: 0.23s; }
.page-connexion .connexion__carte > :nth-child(5) { animation-delay: 0.26s; }
.page-connexion .connexion__carte > :nth-child(n+6) { animation-delay: 0.29s; }
/* Secousse (champ vide) : doit rester prioritaire sur l'animation d'entrée */
.page-connexion .connexion__carte.connexion__carte--secousse { animation: connexion-secousse 0.45s ease; }
/* Reflet qui traverse le bouton une fois, après l'apparition */
.page-connexion .connexion__bouton { overflow: hidden; }
.page-connexion .connexion__bouton::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
  animation: cx-reflet 0.9s ease-in-out 0.45s both;
}
@keyframes cx-halo-entree   { from { opacity: 0; } to { opacity: 1; } }
@keyframes cx-halo-souffle  { from { opacity: 1; transform: scale(1); } to { opacity: 0.65; transform: scale(1.08); } }
@keyframes cx-logo          { from { opacity: 0; transform: translateY(10px) scale(0.94); filter: blur(6px); }
                              to   { opacity: 1; transform: none; filter: none; } }
@keyframes cx-sous-titre    { from { opacity: 0; letter-spacing: 9px; } to { opacity: 1; letter-spacing: 3px; } }
@keyframes cx-carte         { from { opacity: 0; transform: translateY(26px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes cx-element       { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cx-reflet        { from { left: -60%; } to { left: 130%; } }
@media (prefers-reduced-motion: reduce) {
  .page-connexion::before,
  .page-connexion .connexion__logo-marque,
  .page-connexion .connexion__accroche,
  .page-connexion .connexion__carte,
  .page-connexion .connexion__carte > *,
  .page-connexion .connexion__bouton::before { animation: none; }
}

/* 47. Barre d'onglets mobile « Liquid Glass » : remplacée par la barre bleu nuit de refonte.css (26/10/2026). */

/* Connexion sur téléphone (04/10/2026) : à l'ouverture du clavier, iOS place toujours le champ au milieu de la
   zone visible, quoi qu'on fasse ; le haut du logo passait alors sous la zone de l'heure. On réduit donc la
   hauteur entre le haut du logo et le champ (logo un peu plus petit, espacements serrés, libellé masqué
   visuellement — le cadenas et le texte d'exemple suffisent, le libellé reste lu par l'accessibilité). */
@media (max-width: 560px) {
  .page-connexion .connexion { gap: 20px; padding-top: calc(15vh + env(safe-area-inset-top)); }
  .page-connexion .connexion__logo-marque { width: 148px; margin-bottom: 6px; }
  .page-connexion .connexion__carte { padding: 16px 16px 16px; }
  .page-connexion .connexion__titre { margin-bottom: 12px; }
  .page-connexion .connexion__label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .page-connexion .connexion__bouton { margin-top: 14px; }
}

/* =============================================================================
   48. Fenêtre « Accès restreint » des commissions (06/10/2026, demande : « plus simple, ne demande que le
       mot de passe, look espion ») — coins de viseur, empreinte balayée par un trait lumineux, titre à chasse
       fixe ; couleurs de l'app (retour : la 1re version vert terminal « dénotait » ; parmi 3 propositions,
       l'utilisateur a choisi la carte blanche). Thème = variables --e-*. États posés par app.js › Commissions : .espion--refuse
       (secousse, rouge), .espion--autorise (vert, puis fermeture). Polices système uniquement (hors ligne).
   ============================================================================= */
.espion-fond {
  background: rgba(11, 31, 58, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.espion {
  --e-fond: var(--surface-0);
  --e-bordure: var(--bordure);
  --e-texte: var(--texte-tertiaire);
  --e-accent: var(--couleur-bleu-clair);
  --e-halo: rgba(45, 107, 196, 0.16);
  --e-coin: rgba(31, 78, 140, 0.35);
  --e-champ: var(--surface-0);
  --e-champ-bordure: var(--bordure-forte);
  --e-champ-texte: var(--texte-principal);
  --e-indication: #8A96A8;
  --e-rouge: var(--couleur-rouge);
  --e-vert: var(--couleur-vert);
  --e-medaillon: radial-gradient(circle, #EAF1FB 0%, #EAF1FB 58%, rgba(234, 241, 251, 0) 72%);
  position: relative;
  width: min(340px, 100%);
  padding: 32px 28px 20px;
  border: 1px solid var(--e-bordure);
  border-radius: 20px;
  background: var(--e-fond);
  box-shadow: 0 24px 60px rgba(11, 31, 58, 0.22), 0 2px 8px rgba(11, 31, 58, 0.08);
  font-family: var(--fonte);
  text-align: center;
  animation: espion-entree 340ms cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
/* Coins de viseur */
.espion::before,
.espion::after {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  --c: var(--e-coin);
  background:
    linear-gradient(var(--c), var(--c)) top left / 14px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) top left / 1.5px 14px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 14px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 1.5px 14px no-repeat;
}
.espion::after {
  background:
    linear-gradient(var(--c), var(--c)) bottom left / 14px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 1.5px 14px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 14px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 1.5px 14px no-repeat;
}
.espion__fermer {
  position: absolute; top: 14px; right: 14px; z-index: 1;
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--e-texte); opacity: 0.7; cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .espion__fermer:hover { opacity: 1; background: var(--e-halo); } }
.espion__fermer svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Empreinte balayée */
.espion__scanner {
  position: relative;
  width: 72px; height: 72px; margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--e-medaillon);
  overflow: hidden;
}
.espion__empreinte {
  width: 42px; height: 42px;
  fill: none; stroke: var(--e-accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke 250ms ease;
}
.espion__balayage {
  position: absolute; left: 14%; right: 14%; top: 0; height: 2px;
  border-radius: 2px;
  background: var(--e-accent);
  box-shadow: 0 0 8px 1px var(--e-accent);
  animation: espion-balayage 2.4s ease-in-out infinite;
}
.espion__titre {
  margin: 0 0 18px;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--e-texte);
}

/* Champ du mot de passe + bouton flèche intégré (bouton principal de l'app) */
.espion__champ {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 4px 4px 14px;
  border: 1px solid var(--e-champ-bordure);
  border-radius: 12px;
  background: var(--e-champ);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.espion__champ:focus-within { border-color: var(--e-accent); box-shadow: 0 0 0 3px var(--e-halo); }
.espion__champ input {
  flex: 1; min-width: 0; height: 40px; padding: 0;
  border: 0; outline: none; background: transparent;
  color: var(--e-champ-texte); caret-color: var(--e-accent);
  font-family: inherit; font-size: 16px; letter-spacing: 0.25em;
}
.espion__champ input::placeholder { color: var(--e-indication); letter-spacing: 0; }
.espion__champ input::-webkit-credentials-auto-fill-button { visibility: hidden; pointer-events: none; position: absolute; right: 0; }
.espion__valider {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid #1B467F; border-radius: 9px; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, #3069B5 0%, var(--couleur-bleu) 100%);
  box-shadow: 0 2px 8px rgba(31, 78, 140, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition: transform 150ms ease, filter 150ms ease;
}
@media (hover: hover) and (pointer: fine) { .espion__valider:hover { filter: brightness(1.1); } }
.espion__valider:active { transform: scale(0.94); }
.espion__valider:disabled { filter: grayscale(0.5); cursor: wait; }
.espion__valider svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Ligne de statut : hauteur réservée (pas de saut) */
.espion__statut {
  min-height: 18px; margin: 12px 0 0;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; font-weight: 700; letter-spacing: 0.26em; text-transform: uppercase;
}
.espion__statut span::before { content: "■ "; }

/* États */
.espion--refuse { --e-accent: var(--e-rouge); animation: espion-secousse 420ms ease; }
.espion--refuse .espion__champ { border-color: var(--e-rouge); box-shadow: 0 0 0 3px color-mix(in srgb, var(--e-rouge) 16%, transparent); }
.espion--refuse .espion__statut { color: var(--e-rouge); }
.espion--refuse .espion__balayage { opacity: 0; }
.espion--autorise { --e-accent: var(--e-vert); }
.espion--autorise .espion__statut { color: var(--e-vert); }
.espion--autorise .espion__balayage { animation: espion-valide 600ms ease forwards; }
.espion--autorise .espion__scanner { animation: espion-pulsation 600ms ease; }

@keyframes espion-entree {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes espion-balayage {
  0%   { top: 14%; opacity: 0; }
  15%  { opacity: 1; }
  50%  { top: 84%; }
  85%  { opacity: 1; }
  100% { top: 14%; opacity: 0; }
}
@keyframes espion-valide {
  to { top: 0; height: 100%; left: 0; right: 0; opacity: 0.16; box-shadow: 0 0 26px 6px var(--e-accent); }
}
@keyframes espion-pulsation { 50% { transform: scale(1.08); } }
@keyframes espion-secousse {
  15%, 55% { transform: translateX(-7px); }
  35%, 75% { transform: translateX(7px); }
}
@media (prefers-reduced-motion: reduce) {
  .espion, .espion__balayage, .espion--refuse, .espion--autorise .espion__scanner { animation: none; }
  .espion__balayage { top: 50%; opacity: 0.5; }
}
/* Téléphone : carte dans le haut de l'écran, au-dessus du clavier */
@media (max-width: 768px) {
  .modal-fond.espion-fond {
    align-items: flex-start;
    padding: calc(env(safe-area-inset-top) + 72px) 16px 16px;
  }
}

/* =============================================================================
   49. Survol des courbes d'évolution (tableau de bord, 07/10/2026) — calque posé par dashboard.js
       (afficherSurvolCourbes) : point sur chaque courbe au mois survolé + infobulle « carte » de l'app.
   ============================================================================= */

/* =============================================================================
   50. CA et marge du tableau de bord à l'euro près (ordinateur, 07/10/2026) — dashboard.js › afficherKpis
       Le montant entier (« 1 742 345 € ») garde la taille habituelle tant qu'il tient ; sinon il se réduit juste
       assez pour tenir sur une ligne (unités de conteneur : 100cqi = largeur de la carte ; --caracteres = longueur
       du plus long des deux montants, ~0,58 em par caractère). Téléphone : montants abrégés, règle inactive.
   ============================================================================= */
@media (min-width: 641px) {
  #kpiGrille .kpi-card { container-type: inline-size; }   /* seulement les indicateurs du tableau de bord */
}

/* =============================================================================
   51. Connexion par clé d'accès (Face ID / Touch ID, 15/10/2026) — templates/connexion.html, static/js/cle_acces.js
   Bouton principal en haut de la carte (même style que « Se connecter »), puis « ou avec le mot de passe ».
   ============================================================================= */
.connexion__bouton[hidden], .connexion__ou[hidden], .connexion__cle-message[hidden], .connexion__erreur[hidden] { display: none; }
.connexion__bouton--cle { margin-top: 0; width: 100%; white-space: nowrap; }
/* Carte réduite (iPhone) : titre + « Se connecter » seulement ; le bouton dévoile Face ID et le mot de passe */
.connexion__bouton--devoiler { display: none; }
.connexion__carte--reduite > :not(.connexion__titre):not(.connexion__bouton--devoiler) { display: none !important; }
.connexion__carte--reduite .connexion__bouton--devoiler { display: flex; width: 100%; margin-top: 0; }
.connexion__visage { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.connexion__bouton--attente { opacity: 0.75; pointer-events: none; }
.connexion__ou { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; font-size: 12.5px; color: var(--texte-tertiaire); }
.connexion__ou::before, .connexion__ou::after { content: ""; flex: 1; height: 1px; background: var(--bordure); }
.connexion__cle-message { margin: 10px 0 0; font-size: 13px; color: var(--couleur-rouge); }
@media (max-width: 560px) {
  .connexion__ou { color: rgba(255,255,255,0.55); }
  .connexion__ou::before, .connexion__ou::after { background: rgba(255,255,255,0.14); }
  .connexion__cle-message { color: #FF9AA5; }
}

/* Page Import & sauvegarde : carte « Connexion par Face ID / Touch ID » */
.ca-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ca-liste li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px;
     font-size: 13.5px; }
.ca-liste small { display: block;  font-size: 12px; }

/* Page de connexion : champ « Identifiant » au-dessus du mot de passe (comptes, 19/10/2026) */
.connexion__champ--identifiant { margin-bottom: 14px; }

/* =============================================================================
   52. Comptes sans commissions (Phase 11, 19/10/2026) — <body data-commissions="non"> (templates/base.html)
   Le serveur ne renvoie aucune commission à ces comptes ; ici, on retire ce qui les affiche ou les saisit.
   ============================================================================= */
[data-commissions="non"] .col-commission,
[data-commissions="non"] .sidebar__commissions,
[data-commissions="non"] .fc-commission,
[data-commissions="non"] .cellule-commission { display: none !important; }
.kpi-card--verrou { background: var(--surface-1, #F4F6F9); box-shadow: none; border: 1px dashed var(--bordure-forte); }
.kpi-card__verrou { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--texte-secondaire); }
.kpi-card__verrou svg { width: 18px; height: 18px; flex: none; }

/* =============================================================================
   53. Invitation et « Face ID » obligatoire (Phase 11, 19/10/2026) — templates/invitation.html, face_id.html
   ============================================================================= */
.inv-etapes { display: flex; gap: 6px; margin-bottom: 16px; }
.inv-etapes span { flex: 1; height: 4px; border-radius: 2px; background: var(--bordure); }
.inv-etapes span.ok { background: var(--couleur-bleu-clair); }
.inv-texte { margin: -6px 0 16px; font-size: 14px; line-height: 1.5; color: var(--texte-secondaire); }
.inv-identifiant { margin-bottom: 14px; padding: 10px 14px; border-radius: 12px; background: var(--surface-1, #F4F6F9);
  font-size: 15px; font-weight: 600; color: var(--texte-principal); overflow-wrap: anywhere; }
.inv-gros-face { display: flex; justify-content: center; margin: 4px 0 14px; color: var(--couleur-bleu-clair); }
.inv-gros-face svg { width: 74px; height: 74px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.inv-petit { margin: 14px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--texte-tertiaire); text-align: center; }
.inv-petit a { color: inherit; text-decoration: underline; }
.page-connexion a.connexion__bouton { text-decoration: none; }
@media (max-width: 560px) {
  .inv-texte { color: rgba(255,255,255,0.7); }
  .inv-identifiant { background: rgba(255,255,255,0.08); color: #fff; }
  .inv-etapes span { background: rgba(255,255,255,0.15); }
  .inv-etapes span.ok, .inv-gros-face { color: #4FD6E8; }
  .inv-etapes span.ok { background: #4FD6E8; }
  .inv-petit { color: rgba(255,255,255,0.5); }
}

/* =============================================================================
   54. Administration › Comptes et bandeau « Voir comme » (Phase 11, 19/10/2026 ; maquettes n° 4 et 5)
   ============================================================================= */
.ac-personne { display: flex; align-items: center;  }
.ac-personne small, .ac-sous { display: block;    }
.ac-avatar {   border-radius: 50%; display: grid; place-items: center; flex: none;  font-weight: 700;  }
.ac-table td { vertical-align: middle; }
.ac-desactive td { opacity: 0.55; }
.pastille { display: inline-flex; align-items: center;      white-space: nowrap; }

.ac-actions { display: inline-flex;  position: relative; justify-content: flex-end; }
.ac-menu { position: fixed; z-index: 120; width: 270px;
    text-align: left; display: flex; flex-direction: column; }
.ac-menu button { font: 500 13.5px var(--fonte); text-align: left; padding: 9px 12px; border: 0; background: none;  cursor: pointer;  }
@media (hover: hover) and (pointer: fine) {  }
.ac-menu button[data-action-compte="desactiver"] { color: var(--couleur-rouge); }
.ac-menu hr { border: 0; border-top: 1px solid var(--bordure);  }
.ac-menu button[data-action-compte="supprimer"] { color: var(--couleur-rouge); }
.ac-lien {    flex-wrap: wrap;    }
.ac-lien__texte { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }

.ac-lien__adresse { flex: 1;
    overflow-wrap: anywhere; }
.ac-lien__actions {   align-items: center; }
.ac-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin-top: 14px; }
.ac-champs__large { grid-column: 1 / -1; }

.ac-journal__liste { list-style: none;  padding: 0; }

.ac-journal__liste li:last-child { border-bottom: 0; }
.ac-journal__quand {  flex: none;  font-size: 12.5px; font-variant-numeric: tabular-nums; }
.bandeau-vue {     margin-bottom: var(--espace-md);
       }

.bandeau-vue__retour { margin-left: auto; background: #fff; }
@media (max-width: 640px) {
  .ac-champs { grid-template-columns: 1fr; }
  .bandeau-vue__retour { margin-left: 0; width: 100%; }
}

/* =============================================================================
   55. Administration › Équipe, Pipe d'équipe, Activité (Phase 11, étape 4 ; maquettes n° 6 à 8)
   ============================================================================= */
.ae-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ae-barre { position: relative; display: inline-block; vertical-align: middle;     }
.ae-barre i { position: absolute; left: 0; top: 0; bottom: 0;   }

.ae-barre em { position: absolute;     }
.ae-pct {    font-variant-numeric: tabular-nums; }

.ape-etapes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));   }
.ape-etape small { display: block;    }
.ape-etape b { display: block;   }
.ape-etape span { font-size: 12.5px;  }
.aa-grille { display: grid;   align-items: start; }
.aa-liste { list-style: none; margin: 0; padding: 0; }

.aa-liste li:last-child { border-bottom: 0; }
.aa-liste small { display: block;  font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.aa-quand {  flex: none;   font-variant-numeric: tabular-nums; }
@media (max-width: 1024px) {
  .ae-kpis, .ape-etapes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aa-grille { grid-template-columns: 1fr; }
}

/* =============================================================================
   56. États vides : boutons qui passent à la ligne (20/10/2026 ; tableau de bord d'un compte neuf sur téléphone, les
       deux boutons débordaient de la carte)
   ============================================================================= */
.etat-vide > .flex { flex-wrap: wrap; justify-content: center; }
@media (max-width: 640px) {
  .etat-vide > .flex { flex-direction: column; align-items: stretch; width: 100%; max-width: 320px; }
  .etat-vide > .flex .btn { width: 100%; justify-content: center; }
}

/* =============================================================================
   57. Recherche ouverte au clavier (⌘K, « / ») : instantanée (revue de design du 22/10/2026 : une action au
       clavier ne s'anime jamais) ; ouverte au doigt ou à la souris, elle garde son apparition.
   ============================================================================= */
.recherche-fond--instant,
.recherche-fond--instant .recherche,
.recherche-fond--instant .recherche--resultats .recherche__corps { animation: none !important; }

/* =============================================================================
   58. Rendu « app » sur iPhone (revue mobile-native du 22/10/2026). Les effets de survol de toutes les feuilles sont
       réservés à la souris : @media (hover: hover) and (pointer: fine), sinon ils restaient « collés » après un toucher.
   ============================================================================= */
/* Pas de flash gris au toucher, pas de grossissement du texte en paysage */
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Toucher immédiat (pas d'attente du double-toucher) */
button, a, label, summary, [role="button"], .btn, .select, .onglet { touch-action: manipulation; }
/* Un appui long sur un contrôle ne sélectionne pas son libellé (le texte des pages reste sélectionnable) */
button, summary, [role="button"], .btn, .onglet, .barre-onglets__lien, .sidebar__item, .fc-puce, .pastille {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
/* Retour visuel au toucher, maintenant que le flash du navigateur est retiré */

.lien-discret:active, .pp-projet:active, .pm-carte__projet:active { opacity: 0.7; }
/* Champs à 16 px sur tout écran tactile (iPhone tenu en paysage compris) : sinon iOS zoome sur le champ */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px; }
}
/* Le défilement d'une fenêtre, de la recherche ou du menu ne fait pas bouger la page derrière */
.modal, .recherche__corps, .sidebar__nav { overscroll-behavior: contain; }
/* Hauteur réelle de l'écran (barre d'adresse comprise) pour la mise en page */
.layout, .contenu { min-height: 100dvh; }
/* Pipe : le bouton ⋯ n'apparaissait qu'au survol ; sur écran tactile, toujours visible */
@media (hover: none) { .pp-table .pp-fiche-btn { opacity: 1; } }

/* =============================================================================
   59. Pastilles de type de commande (22/10/2026) : mêmes bleus que la barre « Répartition par type » du tableau de bord
       (SRV foncé, DIS moyen, Mixte clair), partout (tableau de bord, Commandes, fiche client). Texte lisible : blanc sur
       le bleu foncé, bleu nuit / bleu sur les deux autres.
   ============================================================================= */
.badge--type-srv   { background: linear-gradient(90deg, #2D6BC4, #1F4E8C); color: #fff; }
.badge--type-dis   { background: linear-gradient(90deg, #7FB0EC, #4C8DE0); color: var(--couleur-bleu-nuit); }
.badge--type-mixte { background: linear-gradient(90deg, #C9DCF5, #A9C7EE); color: var(--couleur-bleu); }

