/* =====================================================================
   Lotissement Khouribga - feuille de style
   Pensee TELEPHONE d'abord (Younes et ses associes consultent sur mobile),
   elargie ensuite pour le PC. Toutes les zones tactiles font au moins 44 px,
   les champs font 16 px minimum (en dessous, iOS zoome tout seul).
   ===================================================================== */

:root {
  --marine:      #12315e;
  --marine-fonce:#0c2244;
  --marine-clair:#1d4a8a;
  --or:          #c8892f;
  --or-clair:    #e8b463;
  --vert:        #1d7a4c;
  --vert-clair:  #e6f4ec;
  --rouge:       #b3261e;
  --rouge-clair: #fdecea;
  --orange:      #b46b00;
  --orange-clair:#fdf3e3;

  --fond:        #f4f6fa;
  --carte:       #ffffff;
  --bord:        #dfe4ee;
  --bord-fort:   #c3cbdb;
  --texte:       #16203a;
  --texte-doux:  #5c6884;
  --texte-faible:#8a94ab;

  --r-s: 10px;
  --r-m: 14px;
  --r-l: 20px;
  --ombre:    0 1px 2px rgba(18, 49, 94, .06), 0 4px 14px rgba(18, 49, 94, .07);
  --ombre-h:  0 8px 30px rgba(18, 49, 94, .16);
  --haut: env(safe-area-inset-top, 0px);
  --bas:  env(safe-area-inset-bottom, 0px);
  --duree: .18s;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond:        #10141f;
    --carte:       #181e2c;
    --bord:        #2a3245;
    --bord-fort:   #3b455e;
    --texte:       #eef1f7;
    --texte-doux:  #a4aec4;
    --texte-faible:#7b869e;
    --marine:      #2c5fa8;
    --marine-fonce:#1a2438;
    --marine-clair:#4a86d8;
    --or:          #dda75a;
    --vert-clair:  #16342a;
    --rouge-clair: #3a1e1c;
    --orange-clair:#332816;
    --ombre:   0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.35);
    --ombre-h: 0 8px 30px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body { min-height: 100dvh; }
[hidden] { display: none !important; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; font-size: 16px; color: inherit; }

/* Chiffres alignes : indispensable pour comparer des montants d'un coup d'oeil */
.nb, .kpi-valeur, .montant, td.num, th.num, .pin-points {
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
}

/* ===================== CHARGEMENT ===================== */
.chargement {
  position: fixed; inset: 0; z-index: 900;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--fond); color: var(--texte-doux);
}
.chargement-rond {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--bord); border-top-color: var(--marine);
  animation: tourne .8s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }

/* ===================== CONNEXION ===================== */
.connexion {
  position: fixed; inset: 0; z-index: 800; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(20px + var(--haut)) 18px calc(20px + var(--bas));
  background: linear-gradient(165deg, var(--marine-fonce) 0%, var(--marine) 55%, #17406f 100%);
}
.connexion-carte {
  width: 100%; max-width: 380px;
  background: var(--carte); border-radius: var(--r-l);
  padding: 24px 20px 20px; box-shadow: var(--ombre-h);
}
.marque { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.marque-logo { color: var(--marine); display: flex; }
.marque h1 { font-size: 19px; line-height: 1.2; }
.marque-sous { margin: 2px 0 0; font-size: 13px; color: var(--texte-faible); }

.connexion-bonjour { margin: 0 0 2px; font-size: 17px; }
.connexion-aide { margin: 0 0 16px; font-size: 14px; color: var(--texte-doux); }
.connexion-erreur { min-height: 20px; margin: 10px 0 4px; font-size: 14px; color: var(--rouge); text-align: center; }
.connexion-pied { margin: 18px 0 0; font-size: 13px; color: rgba(255,255,255,.6); }

.pin-points { display: flex; justify-content: center; gap: 13px; margin: 6px 0 2px; }
.pin-point {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--bord-fort); transition: all var(--duree);
}
.pin-point.plein { background: var(--marine); border-color: var(--marine); transform: scale(1.12); }
.pin-points.erreur { animation: secoue .4s; }
@keyframes secoue {
  10%, 90% { transform: translateX(-3px); } 30%, 70% { transform: translateX(5px); }
  50% { transform: translateX(-5px); }
}

.clavier { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.clavier button {
  height: 62px; border: 1px solid var(--bord); border-radius: var(--r-m);
  background: var(--fond); font-size: 25px; font-weight: 600;
  transition: transform .08s, background var(--duree);
}
.clavier button:active { transform: scale(.95); background: var(--bord); }
.clavier .clavier-vide { border: none; background: none; cursor: default; }
.clavier button[data-touche="effacer"] { font-size: 21px; color: var(--texte-doux); }

.lien-discret {
  display: block; width: 100%; margin-top: 16px; padding: 10px;
  background: none; border: none; color: var(--marine-clair);
  font-size: 14px; text-decoration: underline; text-underline-offset: 3px;
}

.champ { display: block; margin-bottom: 14px; }
.champ > span {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 600; color: var(--texte-doux);
}
.champ input, .champ select, .champ textarea {
  width: 100%; padding: 12px 13px; min-height: 46px;
  background: var(--fond); border: 1.5px solid var(--bord); border-radius: var(--r-s);
  transition: border-color var(--duree), box-shadow var(--duree);
}
.champ input:focus, .champ select:focus, .champ textarea:focus {
  outline: none; border-color: var(--marine-clair);
  box-shadow: 0 0 0 3px rgba(29, 74, 138, .15);
}
.champ textarea { min-height: 78px; resize: vertical; }
.champ-aide { margin: 5px 0 0; font-size: 12.5px; color: var(--texte-faible); }
.champ-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Champ montant : gros, lisible, clavier numerique */
.champ-montant input {
  font-size: 30px; font-weight: 700; text-align: right;
  padding: 14px 15px; min-height: 62px; letter-spacing: -.5px;
}

/* ===================== BOUTONS ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 10px 16px;
  border: 1.5px solid var(--bord-fort); border-radius: var(--r-s);
  background: var(--carte); font-size: 15px; font-weight: 600;
  transition: transform .08s, background var(--duree), border-color var(--duree);
}
.btn:active { transform: scale(.97); }
.btn-principal { background: var(--marine); border-color: var(--marine); color: #fff; }
.btn-danger    { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.btn-doux      { background: var(--fond); }
.btn-large     { width: 100%; min-height: 52px; font-size: 16.5px; }
.btn:disabled  { opacity: .5; cursor: not-allowed; }
.btn-mini      { min-height: 36px; padding: 6px 11px; font-size: 13.5px; }

/* ===================== EN-TETE ===================== */
.entete {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--haut)) 14px 10px;
  background: var(--marine); color: #fff;
  box-shadow: 0 1px 8px rgba(0,0,0,.18);
}
.entete-menu, .entete-profil {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: none;
  background: rgba(255,255,255,.14); border: none; border-radius: 50%; color: #fff;
}
.entete-profil { font-size: 13.5px; font-weight: 700; }
.entete-titre { flex: 1; min-width: 0; }
.entete-projet {
  display: block; font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.62);
}
.entete-vue {
  display: block; font-size: 17px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.entete-solde { text-align: right; font-size: 14.5px; font-weight: 700; white-space: nowrap; }
.entete-solde small {
  display: block; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: rgba(255,255,255,.62);
}
@media (max-width: 400px) { .entete-solde { display: none; } }

/* ===================== NAVIGATION ===================== */
.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; padding-bottom: var(--bas);
  background: var(--carte); border-top: 1px solid var(--bord);
}
.onglets button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 56px; padding: 8px 2px 6px;
  background: none; border: none; color: var(--texte-faible); font-size: 10.5px; font-weight: 600;
}
.onglets button.actif { color: var(--marine); }
.onglets button.actif svg { stroke-width: 2.3; }
.onglets svg { width: 22px; height: 22px; }
.rail { display: none; }

/* ===================== CONTENU ===================== */
main {
  padding: 14px 14px calc(84px + var(--bas));
  max-width: 1180px; margin: 0 auto; outline: none;
}
.section { margin-bottom: 22px; }
.section-titre {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin: 0 2px 10px;
}
.section-titre h2 { font-size: 15px; letter-spacing: .01em; }
.section-titre .lien {
  background: none; border: none; padding: 4px 2px;
  color: var(--marine-clair); font-size: 13.5px; font-weight: 600;
}
.sous-titre { margin: -6px 2px 12px; font-size: 13px; color: var(--texte-doux); }

.carte {
  background: var(--carte); border: 1px solid var(--bord);
  border-radius: var(--r-m); box-shadow: var(--ombre);
}
.carte-corps { padding: 14px; }

/* ===================== KPI ===================== */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi {
  display: block; width: 100%; text-align: left;
  padding: 13px 14px; background: var(--carte);
  border: 1px solid var(--bord); border-left: 4px solid var(--marine);
  border-radius: var(--r-m); box-shadow: var(--ombre);
  transition: transform .08s, box-shadow var(--duree);
}
.kpi:active { transform: scale(.98); }
.kpi-libelle {
  display: block; font-size: 11.5px; font-weight: 600; color: var(--texte-doux);
  text-transform: uppercase; letter-spacing: .04em;
}
.kpi-valeur { display: block; margin-top: 5px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.kpi-note { display: block; margin-top: 3px; font-size: 12.5px; color: var(--texte-faible); }
.kpi.large { grid-column: 1 / -1; }
.kpi.vert   { border-left-color: var(--vert); }
.kpi.rouge  { border-left-color: var(--rouge); }
.kpi.orange { border-left-color: var(--orange); }
.kpi.or     { border-left-color: var(--or); }
.kpi-valeur.vert  { color: var(--vert); }
.kpi-valeur.rouge { color: var(--rouge); }

/* ===================== BARRES ET ANNEAUX ===================== */
.barre { height: 9px; margin-top: 9px; background: var(--bord); border-radius: 99px; overflow: hidden; }
.barre span { display: block; height: 100%; background: var(--marine); border-radius: 99px; transition: width .45s ease; }
.barre.vert span   { background: var(--vert); }
.barre.or span     { background: var(--or); }
.barre.rouge span  { background: var(--rouge); }

.avancement { display: flex; align-items: center; gap: 16px; padding: 16px 14px; }
.anneau { position: relative; flex: none; width: 78px; height: 78px; }
.anneau svg { transform: rotate(-90deg); }
.anneau-txt {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 19px; font-weight: 800; letter-spacing: -.03em;
}
.avancement-texte { min-width: 0; }
.avancement-texte h3 { font-size: 15.5px; }
.avancement-texte p { margin: 4px 0 0; font-size: 13.5px; color: var(--texte-doux); }

/* ===================== LISTES / LIGNES ===================== */
.liste { display: flex; flex-direction: column; gap: 9px; }
.ligne {
  display: block; width: 100%; text-align: left;
  padding: 13px 14px; background: var(--carte);
  border: 1px solid var(--bord); border-radius: var(--r-m); box-shadow: var(--ombre);
  transition: transform .08s;
}
.ligne:active { transform: scale(.99); }
.ligne-haut { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ligne-titre { font-size: 15px; font-weight: 650; line-height: 1.32; }
.ligne-sous { margin-top: 3px; font-size: 12.5px; color: var(--texte-faible); }
.ligne-montant { flex: none; font-size: 15.5px; font-weight: 700; white-space: nowrap; }
.ligne-montant.entree { color: var(--vert); }
.ligne-montant.sortie { color: var(--rouge); }
.ligne-bas {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 9px; font-size: 12.5px; color: var(--texte-doux);
}

.pastille {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.pastille::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pastille.gris   { background: var(--fond);         color: var(--texte-doux); }
.pastille.bleu   { background: rgba(29,74,138,.11); color: var(--marine-clair); }
.pastille.or     { background: var(--orange-clair); color: var(--orange); }
.pastille.vert   { background: var(--vert-clair);   color: var(--vert); }
.pastille.rouge  { background: var(--rouge-clair);  color: var(--rouge); }

.etiquette {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: var(--fond); border: 1px solid var(--bord);
  font-size: 11.5px; font-weight: 600; color: var(--texte-doux);
}

.vide {
  padding: 34px 20px; text-align: center; color: var(--texte-faible);
  background: var(--carte); border: 1px dashed var(--bord-fort); border-radius: var(--r-m);
}
.vide p { margin: 0 0 12px; font-size: 14.5px; }

/* ===================== FILTRES ===================== */
.filtres {
  display: flex; gap: 7px; margin-bottom: 12px;
  overflow-x: auto; padding-bottom: 3px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.filtres::-webkit-scrollbar { display: none; }
.filtres button {
  flex: none; min-height: 36px; padding: 7px 13px;
  background: var(--carte); border: 1.5px solid var(--bord); border-radius: 99px;
  font-size: 13.5px; font-weight: 600; color: var(--texte-doux); white-space: nowrap;
}
.filtres button.actif { background: var(--marine); border-color: var(--marine); color: #fff; }

.recherche { position: relative; margin-bottom: 12px; }
.recherche input {
  width: 100%; padding: 11px 13px 11px 40px; min-height: 46px;
  background: var(--carte); border: 1.5px solid var(--bord); border-radius: var(--r-s);
}
.recherche svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--texte-faible); pointer-events: none;
}

/* ===================== TABLEAU (PC) ===================== */
.tableau-boite { overflow-x: auto; border-radius: var(--r-m); }
table.tableau { width: 100%; border-collapse: collapse; background: var(--carte); font-size: 14px; }
table.tableau th, table.tableau td {
  padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--bord); white-space: nowrap;
}
table.tableau th {
  position: sticky; top: 0;
  background: var(--fond); font-size: 12px; font-weight: 700;
  color: var(--texte-doux); text-transform: uppercase; letter-spacing: .03em;
}
table.tableau td.num, table.tableau th.num { text-align: right; }
table.tableau tbody tr { cursor: pointer; }
table.tableau tbody tr:hover { background: var(--fond); }
table.tableau td.large { white-space: normal; min-width: 190px; }
.pc-seul { display: none; }

/* ===================== FEUILLE MODALE ===================== */
.voile {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 20, 40, .5); backdrop-filter: blur(2px);
  animation: apparait var(--duree) ease;
}
@keyframes apparait { from { opacity: 0; } }
.feuille {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 210;
  display: flex; flex-direction: column;
  max-height: 92dvh;
  background: var(--carte);
  border-radius: var(--r-l) var(--r-l) 0 0;
  box-shadow: var(--ombre-h);
  animation: monte .26s cubic-bezier(.22,.9,.3,1);
}
@keyframes monte { from { transform: translateY(100%); } }
.feuille-poignee {
  width: 40px; height: 4px; margin: 9px auto 0;
  background: var(--bord-fort); border-radius: 99px;
}
.feuille-entete {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px 10px; border-bottom: 1px solid var(--bord);
}
.feuille-entete h2 { font-size: 17px; }
.feuille-fermer {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: none;
  background: var(--fond); border: none; border-radius: 50%; color: var(--texte-doux);
}
.feuille-corps { flex: 1; overflow-y: auto; padding: 16px; -webkit-overflow-scrolling: touch; }
.feuille-pied {
  display: flex; gap: 10px;
  padding: 12px 16px calc(12px + var(--bas));
  border-top: 1px solid var(--bord); background: var(--carte);
}
.feuille-pied .btn { flex: 1; min-height: 50px; }
.feuille-pied:empty { display: none; }

/* Fiche detail : lignes libelle / valeur */
.detail { display: flex; flex-direction: column; gap: 1px; background: var(--bord); border-radius: var(--r-s); overflow: hidden; }
.detail-l {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 11px 13px; background: var(--carte);
}
.detail-l dt { font-size: 13.5px; color: var(--texte-doux); }
.detail-l dd { margin: 0; font-size: 14.5px; font-weight: 650; text-align: right; }
.detail-l dd.vert  { color: var(--vert); }
.detail-l dd.rouge { color: var(--rouge); }

/* ===================== BOUTON FLOTTANT ===================== */
.fab {
  position: fixed; right: 16px; z-index: 65;
  bottom: calc(74px + var(--bas));
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  background: var(--marine); border: none; border-radius: 50%; color: #fff;
  box-shadow: 0 6px 20px rgba(18, 49, 94, .4);
  transition: transform .1s;
}
.fab:active { transform: scale(.92); }

/* ===================== MESSAGES ===================== */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 400;
  bottom: calc(84px + var(--bas));
  display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px);
}
.toast {
  padding: 12px 15px; border-radius: var(--r-s);
  background: #1b2437; color: #fff; font-size: 14.5px;
  box-shadow: var(--ombre-h); animation: monteToast .22s ease;
}
@keyframes monteToast { from { transform: translateY(12px); opacity: 0; } }
.toast.ok    { background: var(--vert); }
.toast.err   { background: var(--rouge); }

/* ===================== ALERTES ===================== */
.alerte {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 13px; margin-bottom: 9px;
  border: 1px solid; border-radius: var(--r-m); font-size: 14px;
}
.alerte svg { flex: none; margin-top: 1px; }
.alerte.rouge  { background: var(--rouge-clair);  border-color: rgba(179,38,30,.28);  color: var(--rouge); }
.alerte.orange { background: var(--orange-clair); border-color: rgba(180,107,0,.28);  color: var(--orange); }
.alerte.bleu   { background: rgba(29,74,138,.08); border-color: rgba(29,74,138,.22); color: var(--marine-clair); }
.alerte b { font-weight: 700; }
.alerte-txt { min-width: 0; }

/* ===================== SIMULATEUR ===================== */
.curseur { margin-bottom: 18px; }
.curseur-tete {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px;
}
.curseur-tete label { font-size: 13.5px; font-weight: 600; color: var(--texte-doux); }
.curseur-val { font-size: 16px; font-weight: 800; }
.curseur input[type=range] {
  width: 100%; height: 34px; margin: 0; background: none; -webkit-appearance: none; appearance: none;
}
.curseur input[type=range]::-webkit-slider-runnable-track {
  height: 6px; background: var(--bord); border-radius: 99px;
}
.curseur input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; margin-top: -11px;
  background: var(--marine); border: 3px solid var(--carte); border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.28);
}
.curseur input[type=range]::-moz-range-track { height: 6px; background: var(--bord); border-radius: 99px; }
.curseur input[type=range]::-moz-range-thumb {
  width: 22px; height: 22px; background: var(--marine);
  border: 3px solid var(--carte); border-radius: 50%;
}
.curseur-bornes {
  display: flex; justify-content: space-between;
  margin-top: -2px; font-size: 11.5px; color: var(--texte-faible);
}

.resultat { padding: 16px 15px; background: var(--marine); color: #fff; border-radius: var(--r-m); }
.resultat h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: rgba(255,255,255,.7); }
.resultat-val { margin-top: 5px; font-size: 30px; font-weight: 800; letter-spacing: -.025em; }
.resultat-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 15px; }
.resultat-grille > div > span {
  display: block; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .04em; color: rgba(255,255,255,.62);
}
.resultat-grille > div > b { font-size: 17px; font-weight: 700; }

/* ===================== SEGMENTS (choix rapides) ===================== */
.segments {
  display: flex; gap: 4px; padding: 4px;
  background: var(--fond); border: 1px solid var(--bord); border-radius: var(--r-s);
}
.segments button {
  flex: 1; min-height: 40px; padding: 8px 6px;
  background: none; border: none; border-radius: 7px;
  font-size: 14px; font-weight: 600; color: var(--texte-doux);
}
.segments button.actif { background: var(--carte); color: var(--texte); box-shadow: var(--ombre); }

/* Encart code PIN a communiquer */
.code-pin {
  padding: 18px; margin: 4px 0 14px; text-align: center;
  background: var(--vert-clair); border: 1.5px dashed var(--vert); border-radius: var(--r-m);
}
.code-pin-val {
  font-size: 38px; font-weight: 800; letter-spacing: .18em;
  color: var(--vert); font-variant-numeric: tabular-nums;
}
.code-pin p { margin: 8px 0 0; font-size: 13px; color: var(--texte-doux); }
.lien-copiable {
  display: block; width: 100%; padding: 11px 12px; margin-top: 10px;
  background: var(--fond); border: 1px solid var(--bord); border-radius: var(--r-s);
  font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all; text-align: left; color: var(--texte-doux);
}

/* ===================== GRAND ECRAN ===================== */
@media (min-width: 900px) {
  .onglets { display: none; }
  .entete { padding-left: 18px; padding-right: 18px; }
  .rail {
    display: flex; flex-direction: column; gap: 3px;
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
    width: 232px; padding: calc(74px + var(--haut)) 12px 16px;
    background: var(--carte); border-right: 1px solid var(--bord); overflow-y: auto;
  }
  .rail button {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 13px; min-height: 44px;
    background: none; border: none; border-radius: var(--r-s);
    font-size: 14.5px; font-weight: 600; color: var(--texte-doux); text-align: left;
  }
  .rail button:hover { background: var(--fond); }
  .rail button.actif { background: rgba(29,74,138,.11); color: var(--marine-clair); }
  .rail svg { width: 20px; height: 20px; flex: none; }
  .rail-separateur { height: 1px; margin: 9px 4px; background: var(--bord); }

  main { padding: 22px 26px 40px 258px; max-width: 1440px; }
  .entete { padding-left: 244px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .kpi.large { grid-column: span 2; }
  .fab { display: none; }
  .pc-seul { display: block; }
  .mobile-seul { display: none; }

  .feuille {
    left: 50%; top: 50%; right: auto; bottom: auto;
    width: min(620px, 94vw); max-height: 86dvh;
    transform: translate(-50%, -50%); border-radius: var(--r-l);
    animation: apparaitCentre .2s ease;
  }
  @keyframes apparaitCentre { from { opacity: 0; transform: translate(-50%, -46%); } }
  .feuille-poignee { display: none; }
  .feuille-pied { padding-bottom: 14px; }
  .toasts { bottom: 24px; }
  .avancement { padding: 20px; }
}

@media (min-width: 1250px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .colonnes-2 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; align-items: start; }
}

/* Impression : on ne veut que le contenu */
@media print {
  .entete, .onglets, .rail, .fab, .toasts, .filtres, .recherche { display: none !important; }
  main { padding: 0; }
  .carte, .ligne, .kpi { box-shadow: none; break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
