/* PrimoWeb · agence en ligne (28/11/2026). Direction : « Minimalism & Swiss » (ui-ux-pro-max, app/design-system/primoweb-app),
   clair, une seule couleur d'accent (le bleu PrimoWeb), beaucoup d'air, aucun effet décoratif.
   Repères 21st : tableau de suivi à colonnes gris clair et cartes blanches (uvain/kanban-board), table de contacts
   compacte à badges pointés (isaiahbjork/contacts-table-with-modal), traduits ici en CSS sans dépendance.
   Règle d'Alban : sur ordinateur, aucune page ne défile ; les listes défilent dans leur carte. */

@font-face { font-family: 'Manrope'; src: url('/polices/manrope-latin.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('/polices/space-grotesk-latin.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }

:root {
  --fond: #F7F8FA; --carte: #FFFFFF; --creux: #F1F3F6; --survol: #F4F6FA;
  --ligne: #E6E8EE; --ligne-forte: #D5D9E2;
  --texte: #0F172A; --texte-2: #475569; --texte-3: #7C8699;
  --bleu: #2C3EFF; --bleu-fonce: #1F2DD6; --bleu-doux: #EEF0FF; --bleu-clair: #6B7BFF;
  --vert: #059669; --vert-doux: #E7F6F0; --vert-fonce: #046C4E;
  --orange: #C2410C; --orange-doux: #FFF1E8;
  --jaune: #B45309; --jaune-doux: #FEF6E4;
  --rouge: #DC2626; --rouge-doux: #FDECEC;
  --violet: #6D28D9; --violet-doux: #F2ECFE;
  --gris: #94A3B8; --gris-doux: #F1F3F6;
  --rayon: 12px; --rayon-petit: 8px;
  --ombre: 0 1px 2px rgba(15, 23, 42, .04);
  --ombre-levee: 0 12px 32px -8px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .06);
  --police: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --chiffres: 'Space Grotesk', var(--police);
  --barre: 232px;
  --vite: 160ms cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 500 14px/1.45 var(--police); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; border-radius: 6px; }
svg.ic { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chiffre { font-family: var(--chiffres); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muet { color: var(--texte-3); }
.second { color: var(--texte-2); }
.hors-ecran { position: absolute; left: -9999px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ------------------------------------------------------------------ coquille */
.appli { display: grid; grid-template-columns: var(--barre) 1fr; height: 100dvh; }
.barre { display: flex; flex-direction: column; gap: 6px; padding: 18px 12px 14px; border-right: 1px solid var(--ligne); background: var(--carte); min-height: 0; }
.marque { display: block; padding: 4px 10px 14px; }
.marque img { height: 26px; width: auto; display: block; }
.cherche-bouton { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid var(--ligne); border-radius: var(--rayon-petit); background: var(--fond); color: var(--texte-3); cursor: pointer; transition: border-color var(--vite); margin-bottom: 8px; }
.cherche-bouton:hover { border-color: var(--ligne-forte); }
.cherche-bouton span:nth-child(2) { flex: 1; text-align: left; }
kbd { font: 600 10.5px var(--police); color: var(--texte-3); border: 1px solid var(--ligne); border-radius: 5px; padding: 1px 5px; background: var(--carte); }
#nav { display: flex; flex-direction: column; gap: 2px; }
.nav-titre { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-3); padding: 14px 10px 6px; }
.nav-lien { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--rayon-petit); color: var(--texte-2); font-weight: 600; transition: background var(--vite), color var(--vite); }
.nav-lien:hover { background: var(--survol); color: var(--texte); }
.nav-lien.actif { background: var(--bleu-doux); color: var(--bleu); }
.nav-lien .compte { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--rouge); color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.nav-lien.actif .compte { background: var(--bleu); }
.barre-pied { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px 4px 0; border-top: 1px solid var(--ligne); }
.etat-pc { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--texte-2); padding: 0 6px; }
.point { width: 8px; height: 8px; border-radius: 50%; background: var(--gris); flex: none; }
.etat-pc.ok .point { background: var(--vert); box-shadow: 0 0 0 3px var(--vert-doux); }
.etat-pc.pc-eteint .point { background: var(--vert); }
.moi { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-weight: 600; }
.moi #moiNom { flex: 1; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--bleu-doux); color: var(--bleu); flex: none; }
.avatar.mael { background: var(--violet-doux); color: var(--violet); }
.avatar.sans { background: var(--creux); color: var(--texte-3); }
.lien-discret { border: 0; background: none; color: var(--texte-3); cursor: pointer; font-size: 12.5px; padding: 2px 4px; }
.lien-discret:hover { color: var(--texte); }

#vue { min-width: 0; min-height: 0; overflow: auto; outline: none; }
.page { display: flex; flex-direction: column; gap: 18px; padding: 26px 32px 28px; height: 100%; min-height: 0; max-width: 1680px; margin: 0 auto; }
.page.libre { height: auto; }
.entete { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.entete h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.entete .phrase { color: var(--texte-2); margin-top: 3px; }
.entete .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fil { display: flex; align-items: center; gap: 6px; color: var(--texte-3); font-weight: 600; font-size: 12.5px; margin-bottom: 4px; }
.fil a:hover { color: var(--texte); }

/* ------------------------------------------------------------------ éléments */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: var(--rayon-petit); border: 1px solid transparent; background: var(--bleu); color: #fff; font-weight: 700; cursor: pointer; transition: background var(--vite), border-color var(--vite), opacity var(--vite); white-space: nowrap; }
.btn:hover { background: var(--bleu-fonce); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.sec { background: var(--carte); color: var(--texte); border-color: var(--ligne-forte); }
.btn.sec:hover { background: var(--survol); }
.btn.fantome { background: none; color: var(--texte-2); }
.btn.fantome:hover { background: var(--survol); color: var(--texte); }
.btn.danger { background: var(--carte); color: var(--rouge); border-color: #F3C7C7; }
.btn.danger:hover { background: var(--rouge-doux); }
.btn.petit { height: 28px; padding: 0 10px; font-size: 12.5px; }
.icone-bouton { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--rayon-petit); border: 0; background: none; color: var(--texte-3); cursor: pointer; }
.icone-bouton:hover { background: var(--survol); color: var(--texte); }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--ligne-forte); border-radius: var(--rayon-petit); background: var(--carte); transition: border-color var(--vite), box-shadow var(--vite); }
textarea { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px var(--bleu-doux); }
input::placeholder, textarea::placeholder { color: var(--texte-3); }
label.champ { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--texte-2); }
.grille-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.grille-champs .large { grid-column: 1 / -1; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--bleu); cursor: pointer; }

.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); box-shadow: var(--ombre); min-height: 0; display: flex; flex-direction: column; }
.carte-tete { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.carte-tete h2 { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.carte-tete .plus { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.carte-corps { padding: 0 16px 16px; min-height: 0; }
.defile { overflow: auto; min-height: 0; flex: 1; }
.vide { padding: 28px 16px; text-align: center; color: var(--texte-3); }
.vide b { display: block; color: var(--texte-2); margin-bottom: 2px; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--gris-doux); color: var(--texte-2); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.nu::before { display: none; }
.badge.gris { color: #64748B; background: var(--gris-doux); }
.badge.bleu-clair { color: #4453E8; background: #F0F2FF; }
.badge.bleu { color: var(--bleu); background: var(--bleu-doux); }
.badge.violet { color: var(--violet); background: var(--violet-doux); }
.badge.orange { color: var(--orange); background: var(--orange-doux); }
.badge.vert { color: var(--vert); background: var(--vert-doux); }
.badge.vert-fonce { color: var(--vert-fonce); background: #DDF1E9; }
.badge.rouge { color: var(--rouge); background: var(--rouge-doux); }
.badge.jaune { color: var(--jaune); background: var(--jaune-doux); }
.pastille { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pastille.gris { background: #94A3B8; } .pastille.bleu-clair { background: var(--bleu-clair); } .pastille.bleu { background: var(--bleu); }
.pastille.violet { background: var(--violet); } .pastille.orange { background: #EA580C; } .pastille.vert { background: var(--vert); } .pastille.vert-fonce { background: var(--vert-fonce); } .pastille.rouge { background: var(--rouge); }

.onglets { display: flex; gap: 2px; padding: 3px; background: var(--creux); border-radius: 10px; width: max-content; max-width: 100%; overflow-x: auto; }
.onglets button, .onglets a { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font-weight: 700; color: var(--texte-2); cursor: pointer; white-space: nowrap; font-size: 13px; }
.onglets .actif { background: var(--carte); color: var(--texte); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.onglets .n { color: var(--texte-3); font-weight: 600; margin-left: 4px; }

.barre-outils { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.barre-outils .recherche { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.barre-outils .recherche svg { position: absolute; left: 10px; top: 10px; color: var(--texte-3); }
.barre-outils .recherche input { padding-left: 32px !important; }
.barre-outils select { width: auto; min-width: 140px; }

/* ------------------------------------------------------------------ tableau */
.tableau { width: 100%; border-collapse: separate; border-spacing: 0; }
.tableau th { position: sticky; top: 0; z-index: 1; background: var(--carte); text-align: left; font-size: 12px; font-weight: 700; color: var(--texte-3); padding: 9px 12px; border-bottom: 1px solid var(--ligne); white-space: nowrap; }
.tableau th button { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.tableau th button:hover, .tableau th.trie button { color: var(--texte); }
.tableau td { padding: 10px 12px; border-bottom: 1px solid var(--ligne); vertical-align: middle; }
.tableau tbody tr { cursor: pointer; transition: background var(--vite); }
.tableau tbody tr:hover { background: var(--survol); }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau .nom { font-weight: 700; }
.tableau .sous { color: var(--texte-3); font-size: 12.5px; }
.tableau .droite { text-align: right; }
.retard { color: var(--rouge); font-weight: 700; }
.bientot { color: var(--jaune); font-weight: 700; }

/* ------------------------------------------------------------------ chiffres clés */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { padding: 14px 16px; }
.kpi .libelle { font-size: 12.5px; font-weight: 700; color: var(--texte-3); }
.kpi .valeur { font: 600 26px/1.15 var(--chiffres); letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .detail { font-size: 12.5px; color: var(--texte-2); margin-top: 2px; }

/* ------------------------------------------------------------------ accueil */
.accueil { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 16px; flex: 1; min-height: 0; }
.accueil .kpis { grid-column: 1 / -1; }
.colonne { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.ligne-tache { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ligne); }
.ligne-tache:last-child { border-bottom: 0; }
.ligne-tache .quoi { flex: 1; min-width: 0; }
.ligne-tache .quoi b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-tache .quoi a:hover { color: var(--bleu); }
.ligne-tache .quand { font-size: 12.5px; white-space: nowrap; }
.ligne-tache.faite .quoi b { text-decoration: line-through; color: var(--texte-3); }
.mini-pipeline { display: flex; flex-direction: column; gap: 8px; }
.mini-etape { display: grid; grid-template-columns: 110px 1fr 40px 76px; gap: 10px; align-items: center; font-size: 13px; }
.mini-etape .nom-e { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--texte-2); }
.jauge { height: 8px; border-radius: 4px; background: var(--creux); overflow: hidden; }
.jauge > span { display: block; height: 100%; border-radius: 4px; background: var(--bleu); min-width: 2px; transition: width 400ms ease; }
.mini-etape .n { text-align: right; font-weight: 700; }
.mini-etape .e { text-align: right; color: var(--texte-3); font-size: 12.5px; }
.agence-lignes { display: flex; flex-direction: column; }
.agence-ligne { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--ligne); }
.agence-ligne:last-child { border-bottom: 0; }
.agence-ligne .quoi { flex: 1; min-width: 0; }
.agence-ligne small { display: block; color: var(--texte-3); }

/* ------------------------------------------------------------------ pipeline */
.pipeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(196px, 1fr); gap: 10px; flex: 1; min-height: 0; overflow-x: auto; padding-bottom: 4px; }
.colonne-p { display: flex; flex-direction: column; min-height: 0; background: var(--creux); border-radius: 14px; padding: 10px 8px 8px; transition: background var(--vite), box-shadow var(--vite); }
.colonne-p.cible { background: var(--bleu-doux); box-shadow: inset 0 0 0 2px var(--bleu-clair); }
.colonne-p .tete { display: flex; align-items: center; gap: 8px; padding: 2px 6px 4px; font-weight: 700; }
.colonne-p .tete .n { font-size: 12px; color: var(--texte-3); background: var(--carte); border-radius: 6px; padding: 0 6px; }
.colonne-p .total { padding: 0 6px 8px; font-size: 12.5px; color: var(--texte-3); }
.colonne-p .cartes { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 60px; flex: 1; padding: 2px; }
.carte-p { background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px; padding: 10px 11px; cursor: grab; user-select: none; touch-action: none; transition: box-shadow var(--vite), transform var(--vite), border-color var(--vite); }
.carte-p:hover { border-color: var(--ligne-forte); box-shadow: 0 2px 8px -2px rgba(15, 23, 42, .1); }
.carte-p b { display: block; font-weight: 700; line-height: 1.3; }
.carte-p .ou { color: var(--texte-3); font-size: 12.5px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-p .pied { display: flex; align-items: center; gap: 8px; margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--ligne); font-size: 12.5px; }
.carte-p .pied .euros { font-weight: 700; font-family: var(--chiffres); white-space: nowrap; }
.carte-p .pied .quand { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; color: var(--texte-3); white-space: nowrap; overflow: hidden; }
.carte-p .pied .avatar { width: 22px; height: 22px; font-size: 10px; }
.carte-p.fantome { opacity: .35; }
.carte-p.vole { position: fixed; z-index: 50; pointer-events: none; box-shadow: var(--ombre-levee); transform: rotate(1.5deg); cursor: grabbing; }
.zone-perdu { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border: 1.5px dashed var(--ligne-forte); border-radius: 12px; color: var(--texte-3); font-weight: 700; transition: all var(--vite); flex: none; }
.zone-perdu.cible { border-color: var(--rouge); color: var(--rouge); background: var(--rouge-doux); }

/* ------------------------------------------------------------------ fiche */
.fiche { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 16px; flex: 1; min-height: 0; }
.fiche .colonne { overflow: auto; }
.etapes-fiche { display: flex; gap: 4px; flex-wrap: wrap; }
.etapes-fiche button { flex: 1; min-width: 0; border: 0; padding: 7px 4px 8px; border-radius: 7px; background: var(--creux); color: var(--texte-3); font-size: 11.5px; font-weight: 700; cursor: pointer; transition: background var(--vite), color var(--vite); position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etapes-fiche button:hover { color: var(--texte); background: var(--survol); }
.etapes-fiche button.passee { background: var(--bleu-doux); color: var(--bleu); }
.etapes-fiche button.actuelle { background: var(--bleu); color: #fff; }
.etapes-fiche.perdu button.actuelle { background: var(--rouge); }
.coord { display: flex; flex-direction: column; gap: 2px; }
.coord a, .coord span.l { display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 7px; color: var(--texte-2); overflow: hidden; }
.coord a:hover { background: var(--survol); color: var(--texte); }
.coord a span, .coord span.l span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paires { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; }
.paires dt { color: var(--texte-3); font-weight: 600; }
.paires dd { margin: 0; font-weight: 700; text-align: right; }
.fil-act { display: flex; flex-direction: column; }
.act { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 0 0 16px; position: relative; }
.act::before { content: ''; position: absolute; left: 13.5px; top: 30px; bottom: 2px; width: 1px; background: var(--ligne); }
.act:last-child::before { display: none; }
.act .rond { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--creux); color: var(--texte-2); }
.act .rond svg { width: 14px; height: 14px; }
.act.etape .rond { background: var(--bleu-doux); color: var(--bleu); }
.act.note .rond { background: var(--jaune-doux); color: var(--jaune); }
.act.email-recu .rond, .act.email-envoye .rond { background: var(--violet-doux); color: var(--violet); }
.act.devis .rond { background: var(--vert-doux); color: var(--vert); }
.act.depuis-carte .rond { background: #F0F2FF; color: #4453E8; }
.act .tete-act { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding-top: 4px; }
.act .tete-act b { font-weight: 700; }
.act .tete-act small { color: var(--texte-3); font-size: 12px; }
.act .texte { margin-top: 4px; color: var(--texte-2); white-space: pre-wrap; word-break: break-word; }
.act.note .texte { background: var(--jaune-doux); border-radius: 8px; padding: 8px 10px; color: var(--texte); }
.saisie-note { display: flex; gap: 8px; align-items: flex-end; padding: 12px 16px; border-top: 1px solid var(--ligne); }
.saisie-note textarea { min-height: 38px; max-height: 160px; }
.parcours { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; }
.parcours span { height: 6px; border-radius: 3px; background: var(--creux); }
.parcours span.ok { background: var(--vert); } .parcours span.agence { background: var(--bleu); } .parcours span.toi { background: #EA580C; } .parcours span.client { background: var(--violet); }

/* ------------------------------------------------------------------ chiffres */
.chiffres { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; flex: 1; min-height: 0; }
.entonnoir { display: flex; flex-direction: column; gap: 6px; }
.marche { display: grid; grid-template-columns: 120px 1fr 56px; gap: 12px; align-items: center; }
.marche .barre-e { height: 30px; border-radius: 7px; background: var(--creux); position: relative; overflow: hidden; }
.marche .barre-e span { position: absolute; inset: 0 auto 0 0; background: var(--bleu-doux); border-right: 2px solid var(--bleu); border-radius: 7px; }
.marche .barre-e em { position: absolute; left: 10px; top: 0; line-height: 30px; font-style: normal; font-weight: 700; font-family: var(--chiffres); }
.marche .taux { text-align: right; font-weight: 700; font-size: 12.5px; color: var(--texte-2); }
.passage { margin-left: 132px; font-size: 11.5px; color: var(--texte-3); display: flex; align-items: center; gap: 4px; padding-left: 4px; }

/* ------------------------------------------------------------------ clients et agence */
.grille-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-content: start; }
.client-carte { padding: 14px 16px; gap: 10px; }
.client-carte .haut { display: flex; align-items: flex-start; gap: 10px; }
.client-carte .haut div { flex: 1; min-width: 0; }
.client-carte b { font-weight: 700; }
.client-carte .actions-c { display: flex; gap: 6px; flex-wrap: wrap; }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; flex: 1; min-height: 0; }

/* ------------------------------------------------------------------ fenêtres, palette, notifications */
dialog { border: 0; padding: 0; border-radius: 14px; box-shadow: var(--ombre-levee); background: var(--carte); color: var(--texte); max-width: min(560px, calc(100vw - 24px)); width: 100%; }
dialog::backdrop { background: rgba(15, 23, 42, .32); backdrop-filter: blur(2px); }
.fenetre-tete { display: flex; align-items: center; gap: 10px; padding: 16px 18px 6px; }
.fenetre-tete h2 { font-size: 16px; font-weight: 700; flex: 1; }
#fenetreCorps { padding: 8px 18px 18px; max-height: calc(100dvh - 120px); overflow: auto; }
.pied-fenetre { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
#palette { max-width: 560px; margin-top: 12vh; overflow: hidden; }
#paletteChamp { border: 0 !important; border-bottom: 1px solid var(--ligne) !important; border-radius: 0 !important; height: 52px !important; padding: 0 18px !important; font-size: 15px; box-shadow: none !important; }
#paletteResultats { max-height: 50vh; overflow: auto; padding: 6px; }
#paletteResultats a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; }
#paletteResultats a small { color: var(--texte-3); margin-left: auto; }
#paletteResultats a.sel, #paletteResultats a:hover { background: var(--bleu-doux); }
#paletteResultats .groupe { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-3); padding: 8px 12px 4px; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: var(--texte); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--ombre-levee); font-weight: 600; animation: monte 200ms ease; }
.toast.erreur { background: var(--rouge); }
.toast.ok { background: var(--vert-fonce); }
.toast button { margin-left: 10px; border: 0; background: rgba(255, 255, 255, .18); color: #fff; border-radius: 6px; padding: 2px 8px; font-weight: 700; cursor: pointer; }
@keyframes monte { from { opacity: 0; transform: translateY(6px); } }
.chargement { display: grid; place-items: center; height: 100%; color: var(--texte-3); }
.squelette { background: linear-gradient(90deg, var(--creux), var(--survol), var(--creux)); background-size: 200% 100%; animation: luit 1.2s infinite; border-radius: 8px; }
@keyframes luit { to { background-position: -200% 0; } }

/* ------------------------------------------------------------------ connexion */
.connexion { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.connexion form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; background: var(--carte); border: 1px solid var(--ligne); border-radius: 16px; padding: 28px; box-shadow: var(--ombre); }
.connexion img { height: 30px; width: auto; align-self: flex-start; margin-bottom: 6px; }
.connexion h1 { font-size: 18px; font-weight: 700; }
.choix-compte { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choix-compte button { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--ligne-forte); border-radius: 10px; background: var(--carte); cursor: pointer; font-weight: 700; }
.choix-compte button.actif { border-color: var(--bleu); box-shadow: 0 0 0 3px var(--bleu-doux); }
.connexion .erreur { color: var(--rouge); font-weight: 600; font-size: 13px; }

/* ------------------------------------------------------------------ écran moyen et téléphone */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accueil { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .page { height: auto; }
  .fiche, .chiffres, .deux-colonnes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  :root { --barre: 0px; }
  .appli { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .barre { order: 2; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--ligne); gap: 0; }
  .marque, .cherche-bouton, .barre-pied, .nav-titre { display: none; }
  #nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav-lien { flex-direction: column; gap: 3px; font-size: 10.5px; padding: 6px 4px; flex: 1; position: relative; }
  .nav-lien.secondaire { display: none; }
  .nav-lien svg { width: 20px; height: 20px; }
  .nav-lien .compte { position: absolute; top: 2px; right: calc(50% - 20px); margin: 0; }
  .page { padding: 18px 14px 24px; gap: 14px; }
  .entete h1 { font-size: 19px; }
  .kpis { gap: 10px; }
  .kpi .valeur { font-size: 21px; }
  .pipeline { grid-auto-columns: 82vw; scroll-snap-type: x mandatory; }
  .colonne-p { scroll-snap-align: start; }
  .tableau .cacher-tel { display: none; }
  .grille-champs { grid-template-columns: 1fr; }
  .mini-etape { grid-template-columns: 92px 1fr 30px 64px; }
  .marche { grid-template-columns: 92px 1fr 48px; }
  .passage { margin-left: 104px; }
}
