/*  ecran-bilan.css — SYS-01.

    Préfixe `.bl-`, celui de la maquette, vérifié libre avant d'être posé. Ce qui
    est commun au lot — panneau de contrôles, variation, panneau de détail de
    poste — vit dans etats-financiers.css, chargée avant : quatre écrans les
    montent, et le §6.3 fait remonter au gabarit ce qui sert deux écrans ou plus.

    La bande `.bl-fait` prend son dessin de easycompta-vignette.css, comme partout
    dans le module. */

/* 2 · Les largeurs de colonnes et de champs. Elles vivaient EN DUR dans le Razor
      (style="width:115px" sur chaque <th>, max-width sur chaque filtre) ; une largeur
      dans une page est ce que docs/conventions-responsive.md interdit, et c'est ici
      qu'un palier peut les relâcher. Les td suivent leur th. Celles des deux tableaux
      du bilan sont passées en section 4 avec la refonte du 2026-09-23. */
.bl-champ-arrete { max-width: 150px; }
.bl-champ-cumul { max-width: 175px; }

.bl-col-net { width: 115px; }

/* 3 · « D'où vient l'écart » — l'imputation des causes.

      La colonne des comptes porte des PASTILLES et non une liste à puces : une cause
      en aligne couramment dix ou quinze, et chacune doit rester cliquable jusqu'au
      grand livre, qui est toujours la question suivante. Une pastille porte son
      numéro, son solde, et son poids quand il n'est pas de 1 — « ×2 » dit à lui seul
      ce qu'aucune phrase ne disait avant : ce compte entre deux fois dans le total. */
.bl-col-comptes { width: auto; }

.bl-cause-comptes {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.bl-cause-compte {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 2px 7px;
    border: 1px solid var(--et-filet);
    border-radius: var(--et-r-btn);
    background: var(--et-surface-2);
    color: var(--et-ink);
    font-size: var(--et-fs-cell);
    text-decoration: none;
}

.bl-cause-compte:hover {
    background: var(--et-tint);
    border-color: var(--et-form-blue);
    color: var(--et-form-blue-d);
}

.bl-cause-compte .mnt { color: var(--et-faint); }

/* Le poids : la seule information de ce panneau qui ne se déduit d'aucun montant. */
.bl-cause-compte .poids {
    font-weight: 700;
    color: var(--et-avertissement-ink);
}

.bl-cause-vide { color: var(--et-faint); }

/* Un résidu non nul dit que le contrôle lui-même ne boucle plus : c'est plus grave
   que l'écart qu'il prétendait expliquer. */
.bl-cause-residu { color: var(--et-danger-ink); font-weight: 600; }

/* 4 · REFONTE ERGONOMIQUE (2026-09-23) — barre d'outils, tableaux repliables, volet
      latéral et pied collé. Aucune couleur écrite : tout est --et-*. Aucune largeur
      d'écran dans la page : les paliers sont ici, pris dans l'échelle retenue. */

/* 4.1 · La barre d'outils : vues, niveau de détail, recherche, critères. */
.bl-barre {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--et-surface-2);
    border: 1px solid var(--et-hairline);
}

.bl-seg { display: flex; }

.bl-seg button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 14px;
    background: var(--et-surface);
    border: 1px solid var(--et-form-border);
    font-size: 12px;
    font-weight: 600;
    color: var(--et-ink);
    white-space: nowrap;
    cursor: pointer;
}

.bl-seg button + button { border-left: 0; }

.bl-seg button.est-actif {
    background: var(--et-table-head);
    border-color: var(--et-table-head);
    color: var(--et-sur-aplat);
}

/* Le nombre de contrôles à revoir, sur l'onglet qui les montre. */
.bl-seg-compte {
    min-width: 18px;
    padding: 0 5px;
    background: var(--et-avertissement-bg);
    color: var(--et-avertissement-ink);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    border-radius: 999px;
}

.bl-recherche { position: relative; }

.bl-recherche .bi {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--et-muted);
    pointer-events: none;
}

.bl-recherche input { width: 220px; padding-left: 28px; }

.bl-champ { display: flex; align-items: center; gap: 6px; }

.bl-champ label {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--et-muted);
}

.bl-bascules {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    font-size: var(--et-fs-cell);
}

/* La case de Bootstrap flotte à -1.5em, calibrée pour une case de 1em ; la charte
   la porte à 24 px (`.appgrid input:where(…)`), elle déborde alors sur son libellé
   et le renvoie à la ligne — mesuré au banc. En flex, la case et son libellé
   restent sur une ligne quelle que soit la taille de la case. */
.bl-bascules .form-check {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 0;
    margin: 0;
    padding-left: 0;
    white-space: nowrap;
}

.bl-bascules .form-check-input { float: none; flex-shrink: 0; margin: 0; }
.bl-bascules .form-check-label { margin: 0; }

/* 4.3 · La ligne de contexte : exercice, cumul, unité. */
.bl-contexte {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin-bottom: 12px;
    font-size: var(--et-fs-cell);
    color: var(--et-muted);
}

.bl-contexte strong { color: var(--et-ink); }
.bl-contexte-alerte { font-weight: 600; color: var(--et-avertissement-ink); }
.bl-contexte-unite { margin-left: auto; }

/* 4.4 · Le corps : les deux tableaux, sur toute la largeur — le volet du poste
      retenu s'ouvre par-dessus (4.5) et ne leur prend rien. */
.bl-corps { min-width: 0; }

/* Actif et passif côte à côte dès qu'ils tiennent, l'un sous l'autre sinon — sans
   palier : c'est la largeur réelle de la zone qui décide, rail ouvert ou non. Avec
   le brut, l'actif demande toute la largeur.

   640 PX PAR SECTION, ET NON 440 : mesuré au banc (2026-09-23), une section de
   463 px ne laissait que 93 px au libellé une fois posées les trois colonnes de
   montants — les 47 libellés de la trame étaient tronqués en « Im… », « C… ».
   À 640 px, le libellé garde environ 250 px. C'est pour tenir ce seuil à 1600 px
   que le volet est passé en surimpression : en colonne, il ramenait chaque section
   sous 640 px. À 1280, les sections s'empilent : un bilan dont on ne lit pas les
   postes n'est pas « côte à côte », il est illisible. */
.bl-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 640px), 1fr));
    align-items: start;
    border: 1px solid var(--et-hairline);
    background: var(--et-surface);
}

.bl-tables.avec-brut { grid-template-columns: minmax(0, 1fr); }

.bl-section { min-width: 0; }
.bl-section + .bl-section { border-left: 1px solid var(--et-filet-fort); }
.bl-tables.avec-brut .bl-section + .bl-section { border-left: 0; border-top: 2px solid var(--et-filet-fort); }

.bl-sect {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 12px;
    background: var(--et-table-head);
    color: var(--et-sur-aplat);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.bl-sect-total {
    margin-left: auto;
    font-family: var(--et-font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

.bl-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: var(--et-fs-cell);
}

.bl-table thead th {
    padding: var(--et-cellule-tete-y) 8px;
    background: var(--et-surface-2);
    border-bottom: 1px solid var(--et-hairline);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--et-muted);
    white-space: nowrap;
}

.bl-table td {
    padding: 0 8px;
    height: 30px;
    border-bottom: 1px solid var(--et-rang);
    color: var(--et-ink);
}

.bl-table tbody tr { cursor: pointer; }
.bl-table tbody tr:hover { background: var(--et-survol); }

.bl-c-pli { width: 32px; padding-right: 0 !important; }
.bl-c-num { width: 118px; text-align: right; white-space: nowrap; }
.bl-c-var { width: 86px; text-align: right; white-space: nowrap; }

.bl-table td.bl-c-num {
    font-family: var(--et-font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
}

.bl-pale { color: var(--et-muted) !important; }

/* Le chevron plie ; le libellé retient. Deux boutons, deux gestes : cliquer un total
   pour voir ce qu'il somme ne doit pas, en plus, le replier. */
.bl-chev {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--et-muted);
    cursor: pointer;
}

.bl-chev:hover { background: var(--et-surface); color: var(--et-ink); }
.bl-chev .bi { font-size: 12px; transition: transform .12s ease; }
.bl-chev.est-ouvert .bi { transform: rotate(90deg); }

.bl-lib {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 0;
    background: transparent;
    border: 0;
    text-align: left;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.bl-lib-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bl-rep {
    flex-shrink: 0;
    display: inline-block;
    min-width: 30px;
    padding: 0 4px;
    background: var(--et-surface-3);
    border: 1px solid var(--et-form-border);
    font-family: var(--et-font-mono);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: var(--et-muted);
}

/* La profondeur se lit au retrait ET au poids : une masse ne se confond pas avec
   la rubrique qu'elle ouvre. */
.bl-niv-2 .bl-lib { padding-left: 12px; }
.bl-niv-3 .bl-lib { padding-left: 24px; }

.bl-table tr.est-total td { background: var(--et-surface-3); }
.bl-table tr.est-total .bl-lib,
.bl-table tr.est-total .bl-net { font-weight: 700; }
.bl-table tr.bl-niv-1.est-total td { background: var(--et-surface-2); border-top: 1px solid var(--et-filet-fort); }

.bl-table tr.est-general td {
    height: 36px;
    background: var(--et-info-bg);
    border-top: 2px solid var(--et-form-blue);
    font-weight: 700;
}

.bl-table tr.est-general .bl-lib { font-weight: 700; }

.bl-table tr.est-choisie td { background: var(--et-tint); }
.bl-table tr.est-choisie td:first-child { box-shadow: inset 3px 0 0 var(--et-form-blue); }

.bl-aucun { padding: 16px 12px !important; text-align: center; color: var(--et-muted) !important; }

/* 4.5 · Le volet du poste retenu, EN SURIMPRESSION à droite de la fenêtre.

      Sans voile : la page reste active dessous, on retient un autre poste sans
      refermer. Sous les fenêtres modales Bootstrap (1055) et les menus de la
      coquille (2000), au-dessus de sa barre (40) — 1045 est la couche du panneau
      latéral de Bootstrap (.offcanvas), le même objet. */
.bl-volet {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1045;
    width: 400px;
    max-width: 100%;
    overflow-y: auto;
    background: var(--et-surface);
    border-left: 1px solid var(--et-hairline);
    box-shadow: var(--et-ombre-flottant);
    animation: bl-volet-entree .16s ease-out;
}

@keyframes bl-volet-entree {
    from { transform: translateX(24px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .bl-volet { animation: none; }
}

.bl-volet-tete { padding: 14px 16px; border-bottom: 1px solid var(--et-hairline); }

.bl-volet-ref {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--et-table-head-encre);
}

.bl-volet-fermer {
    margin-left: auto;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--et-muted);
    cursor: pointer;
}

.bl-volet-fermer:hover { background: var(--et-surface-2); color: var(--et-ink); }

.bl-volet-tete h2 { margin: 8px 0 0; font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--et-ink); }

.bl-volet-montant {
    margin-top: 8px;
    font-family: var(--et-font-mono);
    font-size: 24px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--et-ink);
}

.bl-volet-prec { margin-top: 2px; font-family: var(--et-font-mono); font-size: 12px; color: var(--et-muted); }

/* La part du poste dans son total : une barre, pas un camembert — une seule grandeur. */
.bl-part { position: relative; height: 6px; margin-top: 12px; background: var(--et-rang); }

.bl-part-barre {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--part, 0%);
    background: var(--et-form-blue);
}

.bl-part-texte { margin-top: 4px; font-size: 12px; color: var(--et-muted); }

.bl-volet-brut {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.bl-volet-brut > div { padding: 6px 10px; background: var(--et-surface-2); }
.bl-volet-brut span { display: block; font-size: 12px; color: var(--et-muted); }
.bl-volet-brut strong { font-family: var(--et-font-mono); font-size: var(--et-fs-cell); font-variant-numeric: tabular-nums; }

.bl-volet-bloc { padding: 10px 12px; }

.bl-volet-cap {
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--et-table-head-encre);
}

.bl-compo {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 32px;
    padding: 0 4px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--et-rang);
    text-align: left;
    color: var(--et-ink);
    font-size: var(--et-fs-cell);
    cursor: pointer;
}

.bl-compo:hover { background: var(--et-tint); }
.bl-compo .lib { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-compo .mnt { font-family: var(--et-font-mono); font-size: 12px; font-variant-numeric: tabular-nums; }

/* 4.5 bis · La lecture financière (canevas SYS-03, 2026-09-23) : six vignettes du
   dessin de la bande de faits, chacune avec sa formule en pied. Grille auto-fit : pas
   de palier à écrire, la largeur décide. */
.bl-lecture {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 10px;
}

.bl-formule {
    display: block;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--et-rang);
    font-family: var(--et-font-mono);
    font-size: 12px;
    color: var(--et-faint);
}

.bl-identite {
    margin-top: 12px;
    font-family: var(--et-font-mono);
    font-size: var(--et-fs-cell);
    color: var(--et-ink);
}

/* 4.6 · Le pied : les totaux qui ferment l'état.

   PAS DE `position: sticky` ICI. Mesuré au banc : `.et-scroll` porte bien
   `overflow: auto`, mais grandit avec son contenu — c'est le document qui défile.
   Le collage visait donc un conteneur qui ne défile jamais, et restait inerte. Le
   corriger touche la coquille, donc le noyau : hors de cet écran. Le volet (4.5),
   lui, est en `fixed` : il ne dépend d'aucun conteneur.
   CORRIGÉ DANS LA COQUILLE LE 2026-09-24 (easytime-shell.css, `.et-content`) : `.et-scroll`
   défile désormais. Coller ce pied est redevenu possible ; c'est une décision d'écran, pas
   prise ici. */
.bl-pied {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
    margin-top: 12px;
    padding: 8px 14px;
    background: var(--et-surface-2);
    border: 1px solid var(--et-hairline);
    border-top: 2px solid var(--et-filet-fort);
}

.bl-pied-total { display: inline-flex; align-items: baseline; gap: 8px; }
.bl-pied-total > span { font-size: 12px; color: var(--et-muted); }

.bl-pied-total strong {
    font-family: var(--et-font-mono);
    font-size: var(--et-fs-cell);
    font-variant-numeric: tabular-nums;
    color: var(--et-ink);
}

.bl-pied-total.est-ok strong { color: var(--et-succes-ink); }
.bl-pied-total.est-ecart strong { color: var(--et-danger-ink); }

/* Cibles tactiles : 44 px sous 1024 px, jamais moins (docs/cibles-tactiles.md). */
@media (max-width: 1024px) {
    .bl-seg button { height: 44px; }
    .bl-chev, .bl-volet-fermer { width: 44px; height: 44px; }
    .bl-c-pli { width: 48px; }
    .bl-table td { height: 44px; }
    .bl-compo { min-height: 44px; }
    /* Les comptes de « D'où vient l'écart » : des liens vers le grand livre, mesurés à
       19 px de haut au banc. */
    .bl-cause-compte { align-items: center; min-height: 44px; }
    .bl-lib { min-height: 44px; }
    .bl-barre .form-control-sm,
    .bl-barre .form-select-sm,
    .bl-pied .btn { min-height: 44px; }
}

@media (max-width: 720px) {
    .bl-recherche, .bl-recherche input { width: 100%; }
    .bl-contexte-unite { margin-left: 0; }
    .bl-c-num { width: 96px; }
    /* À 390 px la section fait 344 px : les colonnes de montants mangeaient le
       libellé jusqu'à 1 px. Le tableau garde sa largeur utile et défile dans sa
       section ; la page, elle, ne déborde pas. */
    .bl-section { overflow-x: auto; }
    .bl-table { min-width: 560px; }
}
