/*  ══ LE TABLEAU COMPARÉ (17/11/2026) : Shared/TableauComparaison.razor et Shared/ReglagesComparaison.razor ══════════════════════
    Un seul tableau, libellés et historique communs, A | B (| écart) par période ou par scénario. Servi par le panorama (zone
    Pilotage comparée) et par le pilotage complet (vue « Comparer » › Scénarios › A | B). Racine : .cmpt (.ip-cmp-arbre). */

.cmpt .ftt :is(th, td).is-cmp-a { background-image: linear-gradient(color-mix(in srgb, var(--brand) 7%, transparent), color-mix(in srgb, var(--brand) 7%, transparent)); }
.cmpt .ftt :is(th, td).is-cmp-b { background-image: linear-gradient(color-mix(in srgb, var(--ip-cmp-c, #D85A30) 9%, transparent), color-mix(in srgb, var(--ip-cmp-c, #D85A30) 9%, transparent)); }
.cmpt .ftt thead th.is-cmp-a { color: var(--brand); }
.cmpt .ftt thead th.is-cmp-b { color: var(--ip-cmp-c, #D85A30); }
.cmpt .ftt thead :is(th.is-cmp-a, th.is-cmp-b) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmpt.blocs { position: relative; }
.cmpt .ftt tr.ftt-band th { text-align: center !important; }
.cmpt .ftt tr.ftt-band th > .ftt-bandlbl { position: static !important; }
.cmpt.blocs div.ftt-wrap { overflow-x: hidden !important; }
.cmpt.blocs table.ftt { width: auto !important; min-width: 0 !important; }   /* largeur naturelle : la mesure de la fenêtre lit des colonnes non étirées */
.cmpt.blocs .ftt :is(th, td).is-cmp-b.cmp-deb { border-left: 2px solid var(--ip-cmp-c, #D85A30) !important; }
.cmpt.blocs .ftt :is(th, td).is-cmp-a.cmp-deb { border-left: 1px solid color-mix(in srgb, var(--tx1, #fff) 24%, transparent) !important; }
.ip-cmp-defil { position: absolute; left: 0; right: 0; bottom: 2px; height: 10px; pointer-events: none; z-index: 6; }
.ip-cmp-piste { position: absolute; top: 2px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--tx1, #fff) 8%, transparent); pointer-events: auto; cursor: pointer; }
.ip-cmp-piste.a { left: var(--cmp-xa, 50%); width: var(--cmp-w, 20%); }
.ip-cmp-piste.b { left: var(--cmp-xb, 75%); width: var(--cmp-w, 20%); }
.ip-cmp-piste.e { left: var(--cmp-xe, 90%); width: var(--cmp-w, 20%); }
.ip-cmp-piste.e i { background: color-mix(in srgb, var(--tx1, #fff) 35%, transparent); }
.cmpt .ftt :is(th, td).is-cmp-e { background-image: linear-gradient(color-mix(in srgb, var(--tx1, #fff) 4%, transparent), color-mix(in srgb, var(--tx1, #fff) 4%, transparent)); }
.cmpt .ftt thead th.is-cmp-e { color: var(--tx2); font-weight: 700; text-align: center !important; }
.cmpt:not(.blocs) .ftt :is(th, td).is-cmp-e { border-left: 1px dashed color-mix(in srgb, var(--tx1, #fff) 12%, transparent) !important; }
.cmpt.blocs .ftt :is(th, td).is-cmp-e.cmp-deb { border-left: 2px solid color-mix(in srgb, var(--tx1, #fff) 30%, transparent) !important; }
.cmp-ecart { font-variant-numeric: tabular-nums; color: var(--tx2); }
.cmp-ecart.pos { color: var(--ok, #22c55e); }
.cmp-ecart.neg { color: var(--danger, #ef4444); }
.ip-cmp-piste i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: color-mix(in srgb, var(--brand) 55%, transparent); transition: left .18s ease; }
.ip-cmp-piste.b i { background: color-mix(in srgb, var(--ip-cmp-c, #D85A30) 60%, transparent); }
.cmpt .ftt thead :is(th.is-cmp-a, th.is-cmp-b) { font-weight: 700; text-align: center !important; }   /* 17/11/2026 : centrés, comme l'étiquette de mois ou d'exercice au-dessus */
.cmpt:not(.blocs) .ftt :is(th, td).cmp-deb { border-left: 1px solid color-mix(in srgb, var(--tx1, #fff) 24%, transparent) !important; }
.cmpt:not(.blocs) .ftt :is(th, td).is-cmp-b { border-left: 1px solid color-mix(in srgb, var(--tx1, #fff) 9%, transparent) !important; }
.cmpt:not(.blocs) .ftt tr.ftt-band th.is-prev { border-left: 1px solid color-mix(in srgb, var(--tx1, #fff) 24%, transparent); }
.ip-cmp-hist { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--o12, rgba(255,255,255,.12));
    background: transparent; color: var(--tx2); font: inherit; font-size: 12px; cursor: pointer; }
.ip-cmp-hist i { width: 22px; height: 12px; border-radius: 6px; background: var(--o12, rgba(255,255,255,.18)); position: relative; transition: background .15s; }
.ip-cmp-hist i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--tx2); transition: transform .15s, background .15s; }
.ip-cmp-hist.on { color: var(--tx1); }
.ip-cmp-hist.on i { background: color-mix(in srgb, var(--brand) 55%, transparent); }
.ip-cmp-hist.on i::after { transform: translateX(10px); background: #fff; }
/*  Surfaces opaques de la grille (l'en-tête collant et la colonne figée laissent sinon défiler les chiffres au travers). */
.cmpt div.ftt-wrap { --ftt-frost: var(--ftt-frost-dense, var(--ftt-surface, #fff)) !important; }
/*  Réglages hors panorama (pilotage complet, vue « Comparer ») : une ligne qui passe à la ligne au besoin. */
.cmpt-regl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 2px 8px; }
.cmpt-regl .ip-cmp-seg { flex: none; }
.cmpt-regl .ip-cmp-seg .iku-seg-b { height: 24px; padding: 0 10px; font-size: 12px; }
/*  Pilotage complet (FinTreePopup, « Comparer » › Scénarios › A | B) : le tableau prend la hauteur restante et y défile. */
.ftp-cmpt { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ftp-cmpt > .cmpt { flex: 1 1 auto; min-height: 0; height: 100%; }
.diffbar-fixe { font-size: 12.5px; font-weight: 700; color: var(--tx1); padding: 0 4px; white-space: nowrap; }
