/* ═══════════════════════════════════════════════════════════════════
   Arpentiq — Systeme de tableaux (handoff Margot "handoff-tables")
   Design respecte a 100% : typo, tailles, epaisseurs, marges, tokens,
   etats. Light + Noir.

   ⚠ TOUTES les classes sont prefixees `aqt-`.
   Le mockup utilise .row .cell .pill .score .act .badge .multi .step
   .h .tr .av .sub .nm ... — des noms ultra-generiques qui, injectes
   tels quels, repeindraient la moitie du CRM (lecon b1824/b1859).
   Le prefixe est la SEULE divergence avec le mockup ; toutes les
   valeurs sont identiques.
   ═══════════════════════════════════════════════════════════════════ */

.aqt-mn{ font-family: var(--mono, 'JetBrains Mono', monospace); font-variant-numeric: tabular-nums; }

/* ── Barre d'actions groupees ─────────────────────────────────────── */
/* [b2235] PILL FLOTTANTE (handoff Margot « handoff-bulkbar »), valeurs reprises
   telles quelles. Elle est en position:fixed : elle ne participe plus au flux,
   donc elle ne pousse plus le tableau vers le bas. */
.aqt-bulk{
  position:fixed; left:50%; bottom:24px;
  transform:translateX(-50%) translateY(12px);
  z-index:40;
  display:flex; align-items:center; gap:6px;
  background:var(--text); color:var(--bg);
  border-radius:13px; padding:7px 7px 7px 6px;
  box-shadow:0 12px 34px -8px rgba(20,22,31,.4), 0 2px 8px rgba(20,22,31,.25);
  /* [b2239] la pill s'etale sur une ligne et ne depasse jamais du viewport :
     elle defile horizontalement au besoin plutot que de passer a la ligne. */
  flex-wrap:nowrap; max-width:calc(100vw - 48px); overflow-x:auto;
  scrollbar-width:none;
  opacity:0; pointer-events:none;
  transition:opacity .2s, transform .24s cubic-bezier(.2,.8,.2,1);
}
.aqt-bulk.on{ opacity:1; transform:translateX(-50%); pointer-events:auto; }
.aqt-bulk::-webkit-scrollbar{ display:none; }
.aqt-bulk .aqt-cnt{
  display:inline-flex; align-items:center; gap:8px;
  font-size:12.5px; font-weight:600; padding:5px 11px;
  background:color-mix(in srgb, var(--bg) 16%, transparent);
  border-radius:9px; white-space:nowrap; flex:0 0 auto;
}
.aqt-bulk .aqt-cnt b{ font-family:var(--mono,'JetBrains Mono',monospace); font-weight:700; }
.aqt-bulk .aqt-x{ width:16px; height:16px; display:grid; place-items:center; border-radius:5px; cursor:pointer; opacity:.7; }
.aqt-bulk .aqt-x:hover{ opacity:1; }
.aqt-bulk .aqt-x svg{ width:12px; height:12px; display:block; }
.aqt-bulk .aqt-bsep{ flex:0 0 auto; width:1px; height:20px; background:color-mix(in srgb, var(--bg) 22%, transparent); margin:0 2px; }
.aqt-bulk .aqt-ba{
  display:inline-flex; align-items:center; gap:7px;
  font-size:12.5px; font-weight:600; padding:6px 11px;
  border-radius:9px; cursor:pointer; transition:background .12s;
  /* [b2239] un libelle ne se coupe JAMAIS en deux lignes dans la pill */
  white-space:nowrap; flex:0 0 auto;
}
.aqt-bulk .aqt-ba svg{ flex:0 0 auto; }
.aqt-bulk .aqt-ba:hover{ background:color-mix(in srgb, var(--bg) 16%, transparent); }
.aqt-bulk .aqt-ba svg{ width:14px; height:14px; }

/* ── Conteneur ────────────────────────────────────────────────────── */
/* [b2194] La FENETRE du tableau ne bouge jamais : elle occupe la largeur
   disponible et c'est SON contenu qui defile. Sans width:100% + min-width:0,
   une grille large (beaucoup de colonnes, ou une colonne elargie a la
   poignee) pousse le conteneur et deborde la page au lieu de scroller
   a l'interieur. */
.aqt-wrap{
  overflow-x:auto;
  width:100%;
  max-width:100%;
  min-width:0;
  scrollbar-width:thin;
}
.aqt-wrap::-webkit-scrollbar{ height:8px; }
.aqt-wrap::-webkit-scrollbar-thumb{ background:var(--border-hi); border-radius:99px; }
.aqt-wrap::-webkit-scrollbar-track{ background:transparent; }
.aqt-tbl{
  /* [b2198] LA cause du "pas de scroll horizontal" : la table faisait 100% de
     large avec overflow:hidden -> elle CLIPPAIT les lignes trop larges au lieu
     de deborder, donc .aqt-wrap ne voyait jamais rien a faire defiler.
     width:max-content la fait grandir avec la plus large de ses lignes ;
     min-width:100% garde le cadre pleine largeur quand il y a peu de colonnes. */
  width:max-content;
  min-width:100%;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:var(--shadow-sm, 0 1px 2px rgba(20,22,31,.05));
  overflow:hidden;
}
.aqt-tbl.aqt-compta{ min-width:1180px; width:max-content; }

/* ── Grille de ligne ──────────────────────────────────────────────── */
.aqt-row{ display:grid; align-items:center; gap:14px; padding:0 14px; }

/* ── Entete ───────────────────────────────────────────────────────── */
.aqt-thead{ height:40px; background:var(--s2); border-bottom:1px solid var(--border); }
.aqt-h{
  position:relative;
  font-size:11px; font-weight:600; letter-spacing:.02em;
  color:var(--muted);
  display:inline-flex; align-items:center; gap:4px; min-width:0;
}
.aqt-h.aqt-r{ justify-content:flex-end; text-align:right; }
.aqt-h.aqt-sort{ cursor:pointer; }
.aqt-h.aqt-act{ color:var(--text); }
.aqt-h .aqt-sar{ display:inline-flex; flex-direction:column; line-height:.5; opacity:.35; }
.aqt-h.aqt-sort:hover .aqt-sar, .aqt-h.aqt-act .aqt-sar{ opacity:1; }
/* [b2236] colonne triee : on montre le SENS (la fleche inverse s'efface) */
.aqt-h.aqt-act{ color:var(--text); }
.aqt-h.aqt-act.aqt-asc  .aqt-sar svg:last-child{ opacity:.25; }
.aqt-h.aqt-act.aqt-desc .aqt-sar svg:first-child{ opacity:.25; }
.aqt-h .aqt-sar svg{ width:9px; height:7px; }
/* [b2236] Air entre les fleches de tri et la poignee de largeur. La poignee
   mordait 8px DANS la cellule : sur une colonne alignee a droite, elle
   recouvrait les fleches et bindSort ignore tout clic qui la touche -> le tri
   etait inerte sur Score / Budget / Prix. On decale les fleches ET la valeur
   des cellules du meme nombre de pixels : l'alignement colonne reste exact. */
.aqt-h.aqt-r .aqt-sar{ margin-right:8px; }
.aqt-row > .aqt-cell.aqt-r{ padding-right:8px; }
/* poignee de redimensionnement */
.aqt-h .aqt-rz{ position:absolute; top:0; bottom:0; right:-9px; width:14px; cursor:col-resize; z-index:5; display:flex; justify-content:center; }
.aqt-h .aqt-rz::after{ content:""; width:2px; background:transparent; transition:background .12s; }
.aqt-h .aqt-rz:hover::after, .aqt-h .aqt-rz.aqt-drag::after{ background:var(--accent); }

/* ── Ligne ────────────────────────────────────────────────────────── */
.aqt-tr{
  min-height:56px;
  border-bottom:1px solid var(--border);
  transition:background .1s;
  cursor:pointer;
  position:relative;
}
.aqt-tr:last-child{ border-bottom:0; }
.aqt-tr:hover{ background:var(--s2); }
.aqt-tr::before{
  content:""; position:absolute; left:0; top:0; bottom:0; width:2.5px;
  background:var(--_ac, var(--accent)); opacity:0; transition:opacity .12s; z-index:2;
}
.aqt-tr:hover::before{ opacity:1; }
.aqt-tr.aqt-sel{ background:var(--accent-dim); }
.aqt-cell{ min-width:0; }
.aqt-cell.aqt-r{ text-align:right; justify-self:end; }

/* ── Case a cocher ────────────────────────────────────────────────── */
.aqt-cbx{
  width:16px; height:16px; border-radius:5px;
  border:1.6px solid var(--border-hi);
  flex-shrink:0; display:grid; place-items:center;
  cursor:pointer; transition:.12s;
}
.aqt-thead .aqt-cbx, .aqt-tr:hover .aqt-cbx{ border-color:var(--muted); }
.aqt-cbx.aqt-ck{ background:var(--accent); border-color:var(--accent); }
.aqt-cbx svg{ width:11px; height:11px; color:#fff; opacity:0; }
.aqt-cbx.aqt-ck svg{ opacity:1; }

/* ── 1re colonne collante (Compta) ────────────────────────────────── */
.aqt-tbl.aqt-compta .aqt-row > .aqt-cell:first-of-type,
.aqt-tbl.aqt-compta .aqt-thead > .aqt-h:first-of-type{
  position:sticky; left:14px; z-index:3; background:inherit;
}
.aqt-tbl.aqt-compta .aqt-tr > .aqt-cell:first-of-type{ background:var(--surface); }
.aqt-tbl.aqt-compta .aqt-tr:hover > .aqt-cell:first-of-type{ background:var(--s2); }
.aqt-tbl.aqt-compta .aqt-thead > .aqt-h:first-of-type{ background:var(--s2); }
.aqt-wrap.aqt-scrolled .aqt-tr > .aqt-cell:first-of-type,
.aqt-wrap.aqt-scrolled .aqt-thead > .aqt-h:first-of-type{
  box-shadow:12px 0 12px -10px rgba(0,0,0,.12);
}

/* ══ T1 · Identite ════════════════════════════════════════════════ */
.aqt-ent{ display:flex; align-items:center; gap:11px; min-width:0; }
.aqt-av{
  width:32px; height:32px; border-radius:9px;
  display:grid; place-items:center;
  color:#fff; font-size:12px; font-weight:700;
  flex-shrink:0; letter-spacing:-.02em;
}
.aqt-av.aqt-addr{ background:var(--s3); color:var(--text-dim); }
.aqt-av.aqt-addr svg{ width:16px; height:16px; }
.aqt-ent > div{ min-width:0; }
.aqt-ent .aqt-nm{
  font-size:14px; font-weight:600; letter-spacing:-.01em;
  display:flex; align-items:center; gap:6px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.aqt-ent .aqt-nm .aqt-go{ width:12px; height:12px; color:var(--muted); opacity:0; flex-shrink:0; transition:.12s; }
.aqt-tr:hover .aqt-ent .aqt-nm .aqt-go{ opacity:1; }
.aqt-ent .aqt-sub{ font-size:11.5px; color:var(--muted); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ══ T2 · Statut ══════════════════════════════════════════════════ */
/* [b2189] Anthony : « que les badges soient identiques partout, plus rectangle »
   -> les pastilles de statut adoptent la geometrie des badges (radius 6px,
   meme padding) tout en gardant leur code couleur et leur point. */
.aqt-pill{
  display:inline-flex; align-items:center; gap:6px;
  font-size:12px; font-weight:600; border-radius:6px;
  padding:4px 9px; border:1px solid transparent;
  white-space:nowrap; max-width:100%;
}
.aqt-pill span:not(.aqt-d){ overflow:hidden; text-overflow:ellipsis; }
.aqt-pill .aqt-d{ width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.aqt-pill.aqt-chaud{ color:var(--chaud); background:color-mix(in srgb,var(--chaud) 11%,transparent); border-color:color-mix(in srgb,var(--chaud) 22%,transparent); }
.aqt-pill.aqt-chaud .aqt-d{ background:var(--chaud); }
.aqt-pill.aqt-tiede{ color:var(--tiede); background:color-mix(in srgb,var(--tiede) 13%,transparent); border-color:color-mix(in srgb,var(--tiede) 24%,transparent); }
.aqt-pill.aqt-tiede .aqt-d{ background:var(--tiede); }
.aqt-pill.aqt-froid{ color:var(--froid); background:color-mix(in srgb,var(--froid) 12%,transparent); border-color:color-mix(in srgb,var(--froid) 24%,transparent); }
.aqt-pill.aqt-froid .aqt-d{ background:var(--froid); }
.aqt-pill.aqt-accent{ color:var(--accent); background:var(--accent-dim); border-color:color-mix(in srgb,var(--accent) 26%,transparent); }
.aqt-pill.aqt-accent .aqt-d{ background:var(--accent); }
.aqt-pill.aqt-green{ color:var(--green); background:color-mix(in srgb,var(--green) 12%,transparent); border-color:color-mix(in srgb,var(--green) 24%,transparent); }
.aqt-pill.aqt-green .aqt-d{ background:var(--green); }
.aqt-pill.aqt-muted{ color:var(--text-dim); background:var(--s3); border-color:var(--border); }
.aqt-pill.aqt-muted .aqt-d{ background:var(--muted); }

/* ══ T2b · Signal ═════════════════════════════════════════════════ */
.aqt-sig{
  display:inline-flex; align-items:center; gap:6px;
  font-size:11.5px; font-weight:500;
  color:var(--chaud);
  background:color-mix(in srgb,var(--chaud) 8%,transparent);
  border:1px solid color-mix(in srgb,var(--chaud) 20%,transparent);
  border-radius:7px; padding:4px 9px; max-width:100%;
}
.aqt-sig span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.aqt-sig svg{ width:12px; height:12px; flex-shrink:0; }

/* ══ T3 · Score ═══════════════════════════════════════════════════ */
.aqt-score{ display:inline-flex; align-items:center; gap:9px; }
.aqt-ring{
  width:26px; height:26px; flex-shrink:0; border-radius:50%;
  background:conic-gradient(var(--_c) calc(var(--_v)*1%), var(--s3) 0);
  display:grid; place-items:center;
}
.aqt-ring::after{ content:""; width:19px; height:19px; border-radius:50%; background:var(--surface); }
.aqt-tr:hover .aqt-ring::after{ background:var(--s2); }
.aqt-score .aqt-v{ font-size:13.5px; font-weight:700; }

/* ══ T4 · Montant ═════════════════════════════════════════════════ */
.aqt-mt{ font-size:14px; font-weight:700; color:var(--text); }
.aqt-mt.aqt-sec{ font-size:12.5px; font-weight:600; color:var(--green); }
.aqt-mt.aqt-long{ font-size:13.5px; }

/* ══ T5 · Mesure ══════════════════════════════════════════════════ */
.aqt-ms{ font-size:13.5px; font-weight:500; color:var(--text-dim); }
.aqt-ms u{ text-decoration:none; color:var(--muted); font-size:11.5px; }

/* ══ T6 · Date / anciennete ═══════════════════════════════════════ */
.aqt-dt{ font-size:13px; color:var(--text-dim); }
.aqt-age{ display:inline-flex; align-items:center; gap:7px; font-size:12.5px; color:var(--text-dim); }
.aqt-age .aqt-d{ width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.aqt-age .aqt-d.aqt-g{ background:var(--froid); }
.aqt-age .aqt-d.aqt-o{ background:var(--tiede); }
.aqt-age .aqt-d.aqt-rd{ background:var(--chaud); }

/* ══ T7 · Badge ═══════════════════════════════════════════════════ */
/* [b2268] badges resserres : ils prenaient trop de place en colonne */
.aqt-bdg{
  display:inline-flex; align-items:center;
  font-family:var(--mono, 'JetBrains Mono', monospace);
  font-size:9px; font-weight:700; letter-spacing:.03em; text-transform:uppercase;
  border-radius:5px; padding:2px 6px; border:1px solid transparent;
  white-space:nowrap;
}
.aqt-bdg.aqt-excl{ color:var(--accent); background:var(--accent-dim); border-color:color-mix(in srgb,var(--accent) 24%,transparent); }
.aqt-bdg.aqt-simple{ color:var(--text-dim); background:var(--s3); }
.aqt-dpe{
  display:inline-grid; place-items:center; width:22px; height:22px; border-radius:6px;
  font-family:var(--mono, 'JetBrains Mono', monospace);
  font-size:11px; font-weight:700; color:#fff;
}
.aqt-dpe.aqt-A{ background:#2e9e5b; }
.aqt-dpe.aqt-B{ background:#5cae4a; }
.aqt-dpe.aqt-C{ background:#a6c34c; }
.aqt-dpe.aqt-D{ background:#f0c93a; color:#3a2e00; }
.aqt-dpe.aqt-E{ background:#eea23a; color:#3a2400; }
.aqt-dpe.aqt-F{ background:#e56f36; }
.aqt-dpe.aqt-G{ background:#d64560; }

/* ══ T8 · Multi-valeurs ═══════════════════════════════════════════ */
.aqt-multi{ display:flex; align-items:center; gap:5px; max-width:100%; min-width:0; overflow:hidden; }
.aqt-mv{
  font-size:11.5px; font-weight:600; color:var(--text-dim);
  background:var(--s2); border:1px solid var(--border);
  border-radius:6px; padding:2px 7px; white-space:nowrap; flex-shrink:0;
}
.aqt-mv.aqt-more{ color:var(--muted); background:transparent; border:0; padding:2px 2px; flex-shrink:0;
  cursor:default; }
.aqt-mv.aqt-more:hover{ color:var(--text); }

/* [b2242] Infobulle maison (le title natif ne s'affichait pas). Montee dans
   <body> : aucun conteneur a overflow ne peut la rogner. */
.aqt-tip{
  position:fixed; z-index:9998;
  max-width:340px; padding:8px 11px;
  white-space:pre-line;   /* [b2256] les infobulles multi-lignes (graphe compta) */
  background:var(--text); color:var(--bg);
  font-size:12px; font-weight:500; line-height:1.45;
  border-radius:8px; box-shadow:0 8px 24px -6px rgba(20,22,31,.45);
  opacity:0; pointer-events:none; transition:opacity .12s;
}
.aqt-tip.on{ opacity:1; }

/* ══ T9 · Action ══════════════════════════════════════════════════ */
.aqt-actt{
  display:inline-flex; align-items:center; gap:6px;
  font-size:11.5px; font-weight:600;
  color:var(--chaud);
  background:color-mix(in srgb,var(--chaud) 10%,transparent);
  border:1px solid color-mix(in srgb,var(--chaud) 22%,transparent);
  border-radius:7px; padding:4px 10px; cursor:pointer;
}
.aqt-actt .aqt-d{ width:5px; height:5px; border-radius:50%; background:currentColor; }
.aqt-actt.aqt-accent{ color:var(--accent); background:var(--accent-dim); border-color:color-mix(in srgb,var(--accent) 24%,transparent); }

/* cellule vide */
.aqt-dim{ color:var(--muted); font-size:13px; }

/* ══ Stepper (Dossiers) ═══════════════════════════════════════════ */
.aqt-step{ display:inline-flex; align-items:center; gap:0; }
.aqt-step i{ width:15px; height:4px; background:var(--s3); position:relative; }
.aqt-step i:first-child{ border-radius:99px 0 0 99px; }
.aqt-step i:last-child{ border-radius:0 99px 99px 0; }
.aqt-step i.aqt-on, .aqt-step i.aqt-cur{ background:var(--accent); }
.aqt-step .aqt-lb{ font-size:12px; font-weight:600; margin-left:9px; color:var(--text); }

/* ══ Etat vide ════════════════════════════════════════════════════ */
.aqt-empty{ padding:64px 20px; text-align:center; }
.aqt-empty .aqt-ei{
  width:46px; height:46px; border-radius:13px;
  background:var(--s2); border:1px solid var(--border);
  display:grid; place-items:center; margin:0 auto 14px; color:var(--muted);
}
.aqt-empty .aqt-ei svg{ width:22px; height:22px; }
.aqt-empty h3{ font-size:15px; font-weight:700; }
.aqt-empty p{ font-size:13px; color:var(--muted); margin:5px 0 16px; }
.aqt-empty .aqt-cta{
  display:inline-flex; align-items:center; gap:7px;
  font-size:13px; font-weight:600; color:var(--bg); background:var(--text);
  border-radius:9px; padding:8px 14px; cursor:pointer;
}
.aqt-empty .aqt-cta svg{ width:14px; height:14px; }


/* ── [b2189] Code couleur des sources ─────────────────────────────────────
   Valeurs par defaut, en attendant le panneau de personnalisation prevu.
   Meme geometrie que .aqt-bdg : seule la couleur distingue la source. */
.aqt-bdg.aqt-src-pige{
  color:var(--accent); background:var(--accent-dim);
  border-color:color-mix(in srgb,var(--accent) 24%,transparent);
}
.aqt-bdg.aqt-src-manuel{
  color:var(--text-dim); background:var(--s3); border-color:var(--border);
}
.aqt-bdg.aqt-src-reference{
  color:var(--froid); background:color-mix(in srgb,var(--froid) 12%,transparent);
  border-color:color-mix(in srgb,var(--froid) 24%,transparent);
}
.aqt-bdg.aqt-src-prospection{
  color:var(--green); background:color-mix(in srgb,var(--green) 12%,transparent);
  border-color:color-mix(in srgb,var(--green) 24%,transparent);
}
/* [b2268] une couleur par modele de scoring */
.aqt-bdg.aqt-src-sismo{
  color:var(--accent); background:var(--accent-dim);
  border-color:color-mix(in srgb,var(--accent) 26%,transparent);
}
.aqt-bdg.aqt-src-meridian{
  color:var(--froid); background:color-mix(in srgb,var(--froid) 12%,transparent);
  border-color:color-mix(in srgb,var(--froid) 24%,transparent);
}
.aqt-bdg.aqt-src-domo{
  color:var(--tiede); background:color-mix(in srgb,var(--tiede) 13%,transparent);
  border-color:color-mix(in srgb,var(--tiede) 26%,transparent);
}
.aqt-bdg.aqt-src-import{
  color:var(--tiede); background:color-mix(in srgb,var(--tiede) 13%,transparent);
  border-color:color-mix(in srgb,var(--tiede) 24%,transparent);
}


/* ── [b2190] Biens : la <table> historique est neutralisee en CSS ──────────
   Elle reste dans le DOM (repli possible) mais ne doit JAMAIS s'afficher :
   le selecteur de vue (Tableau/Vignettes/Carte) repose display:'' sur
   #biens-table-view a chaque bascule, ce qui ecrasait un display:none pose
   en JS -> l'ancien entete reapparaissait sous le nouveau tableau. */
#biens-table-view > div > table{ display:none !important; }
#biens-table-view{ border:0 !important; background:transparent !important; box-shadow:none !important; }

/* ── [b2190] Pied de tableau (compteur), identique sur toutes les vues ──── */
.aqt-foot{
  /* [b2232] aligne sur l'inset des lignes (.aqt-row padding:0 14px) : le
     compteur etait colle au bord gauche alors que la 1re colonne est a 14px. */
  padding:12px var(--aqp-pad, 14px) 0;
  font-size:12.5px;
  color:var(--muted);
}
.aqt-foot b{ color:var(--text); font-weight:700; }




/* ═══════════════════════════════════════════════════════════════════
   [b2196] COMPTA / DOSSIERS — harmonisation VISUELLE de la table
   existante (.cs-tbl), sans toucher au DOM.

   POURQUOI PAS UNE MIGRATION COMME LES 4 AUTRES : cette table porte le
   chiffre d'affaires. Elle a 21 colonnes configurables (caCols.visible),
   un menu contextuel au clic droit, les badges d'urgence J-X, la barre
   mandatProgress, et une semantique financiere verrouillee apres
   plusieurs builds de stabilisation (Facture TTC = com_brut, HT = /1.20,
   Net = HT - URSSAF). La convertir en grille reecrirait renderCell() et
   ses 21 cas -> risque disproportionne.

   Ici on ne change QUE l'apparence : entete, lignes, typo des montants,
   colonne collante. Zero ligne de logique touchee, aucun handler perdu.
   ═══════════════════════════════════════════════════════════════════ */

/* conteneur : meme carte que les autres tableaux */
body.shell-v2-on .cs-tbl-wrap{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:var(--shadow-sm, 0 1px 2px rgba(20,22,31,.05));
  overflow:auto;
  width:100%; max-width:100%; min-width:0;
}

/* entete : hauteur, fond et typo du systeme */
body.shell-v2-on .cs-tbl thead th,
body.shell-v2-on table.cs-tbl thead th,
body.shell-v2-on #page-mandats .cs-tbl thead th{
  height:40px !important;
  background:var(--s2) !important;
  border-bottom:1px solid var(--border);
  font-size:11px !important;
  font-weight:600 !important;
  letter-spacing:.02em !important;
  color:var(--muted) !important;
  text-transform:uppercase;
  white-space:nowrap;
  padding:0 12px;
}
body.shell-v2-on .cs-tbl thead th:hover{ color:var(--text) !important; }

/* lignes : hauteur, separateur, survol et liseré accent */
body.shell-v2-on .cs-tbl tbody tr,
body.shell-v2-on table.cs-tbl tbody tr{
  height:56px !important;
  border-bottom:1px solid var(--border);
  transition:background .1s;
  cursor:pointer;
  position:relative;
}
body.shell-v2-on .cs-tbl tbody tr:last-child{ border-bottom:0; }
body.shell-v2-on .cs-tbl tbody tr:hover{ background:var(--s2); }
body.shell-v2-on .cs-tbl tbody td{
  padding:0 12px;
  font-size:13px;
  color:var(--text-dim);
  border-bottom:0;
}

/* montants : mono tabulaire, alignes a droite comme le systeme */
body.shell-v2-on .cs-tbl tbody td.num,
body.shell-v2-on .cs-tbl tbody td[data-num],
body.shell-v2-on .cs-tbl .money-cell,
body.shell-v2-on .cs-tbl .euro-cell{
  font-family:var(--mono, 'JetBrains Mono', monospace);
  font-variant-numeric:tabular-nums;
  text-align:right;
  font-weight:700;
  color:var(--text);
}
/* dates en mono, comme le renderer `date` */
body.shell-v2-on .cs-tbl .date-cell{
  font-family:var(--mono, 'JetBrains Mono', monospace);
  font-variant-numeric:tabular-nums;
  font-size:13px;
  color:var(--text-dim);
}

/* colonne « Vente » collante : ombre au scroll, comme .aqt-compta */
body.shell-v2-on .cs-tbl .vente-cell{
  background:var(--surface) !important;
}
body.shell-v2-on .cs-tbl tbody tr:hover .vente-cell{ background:var(--s2) !important; }
body.shell-v2-on .cs-tbl-wrap.aqt-scrolled .vente-cell,
body.shell-v2-on .cs-tbl-wrap.aqt-scrolled thead th:first-child{
  box-shadow:12px 0 12px -10px rgba(0,0,0,.12);
}

/* pied compteur, identique aux autres vues */
body.shell-v2-on .cs-tbl-wrap + .aqt-foot{ padding-top:12px; }

/* ═══════════════════════════════════════════════════════════════════
   [b2202] APERCU INLINE (peek row) — handoff Margot "handoff-fiche-inline"
   Au clic sur une ligne, elle se deplie en accordeon et revele une box
   resume DANS le tableau. Une seule ligne ouverte a la fois.
   Classes prefixees aqt- (cf regle du fichier).
   ═══════════════════════════════════════════════════════════════════ */
.aqt-peekwrap{
  overflow:hidden; max-height:0;
  transition:max-height .32s cubic-bezier(.4,.7,.2,1);
  border-bottom:1px solid transparent;
}
.aqt-peekwrap.aqt-open{ max-height:340px; border-bottom-color:var(--border); }
.aqt-peek{
  background:linear-gradient(180deg,var(--s2),var(--surface));
  padding:0 14px 12px; position:relative;
}
.aqt-peek::before{
  content:""; position:absolute; left:0; top:0; bottom:0;
  width:2.5px; background:var(--_ac, var(--accent));
}
.aqt-pk-in{ opacity:0; transform:translateY(-6px); transition:opacity .3s .05s, transform .3s .05s; }
/* [b2203] Le tableau peut etre plus large que la fenetre : on ancre le contenu
   du peek a gauche pour qu'il reste lisible pendant le scroll horizontal,
   au lieu de partir hors ecran avec les colonnes. */
.aqt-pk-in{ position:sticky; left:0; }
.aqt-peekwrap.aqt-open .aqt-pk-in{ opacity:1; transform:none; }

/* [b2203] condense (retour Anthony) : moins de hauteur, meme largeur que le tableau */
.aqt-pk-grid{ display:grid; grid-template-columns:1.4fr 1fr 1.1fr; gap:10px; padding:12px 0 4px; }
@media(max-width:860px){ .aqt-pk-grid{ grid-template-columns:1fr; } }

.aqt-pk-card{
  background:var(--surface); border:1px solid var(--border);
  border-radius:11px; padding:10px 12px;
  display:flex; flex-direction:column;
}
.aqt-pk-lbl{
  font-family:var(--mono,'JetBrains Mono',monospace);
  font-size:9.5px; font-weight:600; letter-spacing:.07em;
  text-transform:uppercase; color:var(--muted);
  margin-bottom:6px; display:flex; align-items:center; gap:7px;
}
.aqt-pk-lbl svg{ width:12px; height:12px; }

.aqt-kv{ display:flex; justify-content:space-between; gap:10px; padding:3px 0; font-size:12px; }
.aqt-kv + .aqt-kv{ border-top:1px solid var(--border); }
.aqt-kv .aqt-k{ color:var(--muted); }
.aqt-kv .aqt-v{ font-weight:600; color:var(--text); text-align:right; }

.aqt-crit{ display:flex; flex-wrap:wrap; gap:6px; }
.aqt-crit span{
  font-size:11px; font-weight:600; color:var(--text-dim);
  background:var(--s2); border:1px solid var(--border);
  border-radius:7px; padding:3px 8px;
}

.aqt-pk-txt{ font-size:12px; line-height:1.5; color:var(--text-dim); flex:1; }
.aqt-pk-txt b{ color:var(--text); font-weight:600; }
.aqt-pk-btn{
  display:inline-flex; align-items:center; gap:7px;
  font-size:12.5px; font-weight:600; border-radius:9px;
  padding:7px 12px; cursor:pointer; margin-top:9px;
  border:1px solid var(--border); background:var(--surface); color:var(--text);
  align-self:flex-start;
}
.aqt-pk-btn svg{ width:14px; height:14px; }
.aqt-pk-btn:hover{ background:var(--s2); }
.aqt-pk-btn.aqt-pri{ background:var(--text); color:var(--bg); border-color:var(--text); }

/* chevron dans la cellule identite */
.aqt-chev{ width:13px; height:13px; flex-shrink:0; transition:transform .2s; color:var(--muted); }
.aqt-tr.aqt-open .aqt-chev{ transform:rotate(90deg); color:var(--text); }

/* [b2205] La ligne ouverte reste visuellement active meme quand la souris
   part : sans ca elle redevenait blanche et on perdait le lien entre
   l'apercu deplie et la ligne qui l'a ouvert. */
.aqt-tr.aqt-open{ background:var(--s2); }
.aqt-tr.aqt-open::before{ opacity:1; }
.aqt-tr.aqt-open .aqt-ring::after{ background:var(--s2); }
.aqt-tbl.aqt-compta .aqt-tr.aqt-open > .aqt-cell:first-of-type{ background:var(--s2) !important; }

/* [b2206] Jusqu'a 3 actions dans la carte Avis Arpe, sur UNE seule ligne. */
.aqt-pk-acts{ display:flex; align-items:center; gap:7px; margin-top:9px; flex-wrap:nowrap; }
.aqt-pk-acts .aqt-pk-btn{ margin-top:0; white-space:nowrap; flex:0 0 auto; padding:7px 11px; }

/* [b2235] Avatars seuls (colonne Consultant des Dossiers) : compacts, neutres,
   chevauches quand le dossier est partage. Le noir & blanc est obtenu par un
   FOND neutre (--text-dim) et non par filter:grayscale — deterministe, et le
   contraste du texte reste garanti sur les 4 themes. */
.aqt-avs{ display:inline-flex; align-items:center; }
.aqt-avs .aqt-avn{
  width:22px; height:22px; border-radius:7px;
  font-size:9.5px; font-weight:700;
  background:var(--text-dim); color:var(--bg);
  border:1.5px solid var(--surface);
}
.aqt-avs .aqt-avn + .aqt-avn{ margin-left:-7px; }

/* [b2208] Bouton « Tout replier » injecte en tete de la bande de filtres */
/* [b2235] MEME UI que les autres controles de la bande de filtres : depuis
   b2047 les .df-pill sont PLATS / TRANSPARENTS (hauteur 26px, padding 0 10px,
   radius --radius, hover --s2) — le bouton restait sur l'ancien gabarit blanc
   borde, seul relief de la bande. Geometrie recopiee a l'identique. */
.aqt-collapse-all{
  display:inline-flex; align-items:center; flex-shrink:0; box-sizing:border-box;
  height:26px; padding:0 10px;
  font:inherit; font-size:12px; font-weight:600;
  color:var(--text-dim);
  background:transparent; border:1px solid transparent; border-radius:var(--radius);
  margin-right:10px; cursor:pointer; white-space:nowrap;
  transition:background .15s, border-color .15s, color .15s;
}
.aqt-collapse-all:hover{ background:var(--s2); border-color:transparent; color:var(--text); }


/* ── [b2209] S4 : TOUS les badges a la meme taille que le gris (.aqt-bdg) ──
   Les pastilles de statut etaient plus grandes que les badges de source :
   meme typo, meme padding, meme radius -> une seule geometrie de badge. */
.aqt-pill, .aqt-bdg{
  font-size:11px !important;
  font-weight:600 !important;
  border-radius:6px !important;
  padding:4px 8px !important;
  line-height:1.25 !important;
}
.aqt-pill .aqt-d{ width:5px; height:5px; }

/* ── [b2209] S3a : la poignee de redimensionnement devient VISIBLE ────────
   Un trait fin apparait au survol de l'entete pour signaler ou saisir. */
.aqt-thead:hover .aqt-h .aqt-rz::after{ background:var(--border-hi); }
.aqt-h .aqt-rz:hover::after, .aqt-h .aqt-rz.aqt-drag::after{ background:var(--accent) !important; width:2px; }
.aqt-h .aqt-rz::after{ height:60%; align-self:center; border-radius:2px; }

/* ══════════════════════════════════════════════════════════════════════
   [b2267] DRAG DES COLONNES — handoff « handoff-colonnes », valeurs reprises
   ══════════════════════════════════════════════════════════════════════
   Ce n est PAS l entete seule qui bouge : c est la COLONNE ENTIERE qui est
   saisie (entete + toutes ses cellules), et tout le reste s estompe a .32.
   C est ce qui rend le geste comprehensible — mon b2266 n eclairait que
   l entete, on ne voyait pas ce qu on deplaçait. */

.aqt-h{ user-select:none; position:relative; }
.aqt-h.aqt-sort{ cursor:pointer; }

/* Poignee : points visibles au survol, curseur grab */
.aqt-h.aqt-movable::before{
  content:"⠿"; position:absolute; left:3px; top:50%; transform:translateY(-50%);
  font-size:11px; line-height:1; color:var(--border-hi);
  opacity:0; transition:opacity .15s; pointer-events:none;
}
.aqt-h.aqt-movable:hover::before{ opacity:1; }
.aqt-h.aqt-movable:hover{ cursor:grab; }
/* [b2269] pendant le drag, PLUS AUCUNE selection nulle part */
body.aqt-dragging, body.aqt-dragging *{
  cursor:grabbing !important;
  user-select:none !important; -webkit-user-select:none !important;
}

/* Etat drag : TOUT s estompe... */
.aqt-dragging .aqt-cell,
.aqt-dragging .aqt-h{ opacity:.32; transition:opacity .12s; }
/* ...sauf la colonne saisie, qui reste pleine et surlignee sur toute sa hauteur */
.aqt-dragging .aqt-cell.aqt-colgrab,
.aqt-dragging .aqt-h.aqt-colgrab{ opacity:1; }
.aqt-cell.aqt-colgrab{ background:var(--accent-dim) !important; }
.aqt-h.aqt-colgrab{ background:color-mix(in srgb, var(--accent) 16%, var(--s2)); color:var(--accent); }
.aqt-h.aqt-colgrab::before{ opacity:1; color:var(--accent); }
.aqt-cell.aqt-colgrab, .aqt-h.aqt-colgrab{
  box-shadow: inset 1px 0 0 var(--accent), inset -1px 0 0 var(--accent);
}

/* Repere d insertion : barre accent 2px, pleine hauteur de la colonne */
.aqt-cell, .aqt-h{ position:relative; }
/* [b2269] LA BARRE NE SE VOYAIT PAS SUR L'ENTETE. La poignee `⠿` et la barre
   d'insertion partagent le MEME pseudo-element ::before sur .aqt-h — un element
   n'en a qu'un. Le `transform:translateY(-50%)` de la poignee survivait a la
   regle de la barre et la decalait hors du cadre, et sa couleur/typo restaient.
   On reinitialise donc TOUT ce que la poignee avait pose. */
/* [b2271] Les barres par cellule sont SUPPRIMEES : comme les lignes ont des
   bordures et du padding, les cellules ne se touchent pas verticalement — on
   obtenait un pointille a cote de chaque texte au lieu d'un trait continu.
   Un SEUL element .aqt-dropline est desormais dessine par le JS, sur la
   frontiere de colonne et haut de tout le tableau. */
.aqt-dropline{
  /* [b2272] TROP EPAISSE (Anthony) : 3px + un anneau de 1px de chaque cote +
     un halo de 12px = un trait percu a ~7px. Un repere d'insertion doit se
     voir sans peser : 2px pleins, halo resserre, plus d'anneau. */
  position:absolute; top:0; left:0; width:2px; margin-left:-1px;
  background:var(--accent); border-radius:1px;
  box-shadow:0 0 5px color-mix(in srgb, var(--accent) 38%, transparent);
  z-index:40; pointer-events:none;
  opacity:0; transition:opacity .1s, left .08s;
}
.aqt-dropline.on{ opacity:1; }
.aqt-wrap{ position:relative; }
/* la poignee s'efface des qu'un repere est pose sur le meme entete */
.aqt-dragging .aqt-h.aqt-movable::before{ font-size:0; }
/* [b2269] une cellule qui rognerait son debordement masquerait la barre :
   pendant le drag uniquement, on la laisse deborder. */
.aqt-dragging .aqt-cell.aqt-dropL, .aqt-dragging .aqt-cell.aqt-dropR,
.aqt-dragging .aqt-h.aqt-dropL,    .aqt-dragging .aqt-h.aqt-dropR{ overflow:visible !important; }

/* Etiquette flottante */
.aqt-ghost{
  position:fixed; z-index:99999; pointer-events:none;
  background:var(--surface); border:1px solid var(--accent);
  border-radius:9px; box-shadow:0 16px 40px -10px rgba(20,22,31,.45), 0 2px 8px rgba(20,22,31,.18);
  padding:9px 13px;
  font-size:10px; font-weight:700; letter-spacing:.05em; text-transform:uppercase;
  color:var(--accent); font-family:'JetBrains Mono', monospace;
  white-space:nowrap;
  opacity:0; transform:translate(-50%,-140%);
  transition:opacity .12s;
}
.aqt-ghost.on{ opacity:1; }
