/* Box — mise en page inspirée de SaisieImageBox, couleurs de la charte commune. */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--kb-font); color: var(--kb-text); background: var(--kb-bg); font-size: 13px; }
button { font-family: inherit; }
.mono { font-family: var(--kb-mono); }
.muted { color: var(--kb-muted); }
.hidden { display: none !important; }

/* ── Bandeau supérieur (bleu, boutons à icône comme la Box Cegid) ── */
.bx-top { display: flex; align-items: stretch; gap: 4px; background: var(--kb-primary); color: #fff; padding: 0 14px; height: 62px; }
.bx-brand { display: flex; align-items: center; gap: 10px; margin-right: 14px; min-width: 0; }
.bx-brand .logo-img { width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; overflow: hidden; }
.bx-brand .logo-img.has-logo { width: auto; max-width: 90px; background: #fff; padding: 3px 6px; }
.bx-brand .logo-text { font-weight: 700; font-size: 14px; line-height: 1.1; white-space: nowrap; }
.bx-brand .logo-text small { display: block; font-weight: 500; font-size: 10px; opacity: .8; }
.bx-nav { display: flex; align-items: stretch; }
.bx-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0 14px; color: #fff; text-decoration: none; font-size: 12px; opacity: .85; border-bottom: 3px solid transparent; }
.bx-nav a svg { width: 22px; height: 22px; }
.bx-nav a:hover { opacity: 1; background: rgba(255,255,255,.08); }
.bx-nav a.active { opacity: 1; border-bottom-color: #fff; background: rgba(255,255,255,.12); }
.bx-nav a .bx-badge { position: absolute; }
.bx-top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 12px; }
.bx-top-right select { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 6px; padding: 5px 8px; font-size: 12px; }
.bx-top-right select option { color: var(--kb-text); }
.bx-top-right a { color: #fff; text-decoration: none; opacity: .9; }
.bx-top-right a:hover { opacity: 1; text-decoration: underline; }

.bx-more { background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff; cursor: pointer; border-radius: 6px; padding: 2px 10px; font-size: 18px; line-height: 1; }
.bx-more:hover, .bx-more.active { background: rgba(255,255,255,.18); }

.bx-main { padding: 14px 16px 30px; }
.bx-card { background: var(--kb-surface); border: 1px solid var(--kb-border); border-radius: var(--kb-radius); box-shadow: var(--shadow-sm); }

/* ── Barre d'onglets grise (Factures | Contrats | Autres documents | Banque) ── */
.bx-tabs { display: flex; align-items: center; background: #7a7a80; border-radius: var(--kb-radius) var(--kb-radius) 0 0; }
.bx-tabs a { color: #fff; text-decoration: none; padding: 11px 18px; font-size: 14px; opacity: .9; }
.bx-tabs a:hover { opacity: 1; }
.bx-tabs a.active { background: var(--kb-surface); color: var(--kb-text); font-weight: 700; opacity: 1; }
.bx-tabs .bx-tabs-right { margin-left: auto; display: flex; gap: 6px; padding-right: 10px; }
.bx-icon-btn { background: transparent; border: 0; color: #fff; cursor: pointer; padding: 6px; border-radius: 6px; }
.bx-icon-btn:hover { background: rgba(255,255,255,.15); }
.bx-icon-btn svg { width: 18px; height: 18px; display: block; }

/* ── Tuiles de compteurs ── */
.bx-tiles { display: flex; gap: 10px; padding: 14px; flex-wrap: wrap; }
.bx-tile { position: relative; width: 200px; height: 132px; border: 1px solid var(--kb-border); background: #f4f4f6; border-radius: 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: var(--kb-muted-strong); overflow: hidden; }
.bx-tile:hover { border-color: var(--kb-primary); }
.bx-tile .n { font-size: 52px; font-weight: 300; line-height: 1; color: #555; }
.bx-tile .l { font-size: 14px; margin-top: 6px; }
.bx-tile .bar { position: absolute; left: 4px; right: 4px; bottom: 4px; height: 15px; background: #9fc9ec; }
.bx-tile .bar i { display: block; height: 100%; background: var(--kb-primary); }
.bx-tile .bar b { position: absolute; left: 5px; top: 0; font-size: 10px; color: #fff; line-height: 15px; }
.bx-tile.active { background: var(--kb-primary-light); border-color: #9fc9ec; }
.bx-tile.active .l { font-weight: 700; color: var(--kb-text); }
.bx-tile.active::after { content: ''; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 38px 38px 0; border-color: transparent var(--kb-primary) transparent transparent; }
.bx-tile.active::before { content: '✓'; position: absolute; top: 2px; right: 5px; color: #fff; font-weight: 700; z-index: 1; font-size: 14px; }
.bx-tile.auto .l::after { content: ' ⚡'; }

/* ── Tableaux ── */
.bx-list-head { display: flex; align-items: center; gap: 12px; padding: 4px 16px 8px; color: var(--kb-muted); font-size: 15px; }
.bx-list-head input[type=search] { margin-left: auto; padding: 6px 10px; border: 1px solid var(--kb-border); border-radius: 6px; width: 260px; font-size: 12px; }
.bx-list-head label { font-size: 12px; color: var(--kb-muted-strong); }
.bx-table-wrap { max-height: calc(100vh - 380px); min-height: 220px; overflow: auto; border-top: 1px solid var(--kb-border); }
table.bx-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bx-table th { position: sticky; top: 0; background: #ececee; color: var(--kb-text); font-weight: 600; text-align: center; padding: 8px 6px; border-right: 1px solid #dcdce0; z-index: 1; }
.bx-table td { padding: 5px 8px; border-bottom: 1px solid var(--kb-border-light); white-space: nowrap; }
.bx-table tr:hover td { background: var(--kb-hover-row); }
.bx-table tr.sel td { background: #dce9f8; }
.bx-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.bx-table td.c { text-align: center; }
.bx-table .arrow { color: #b0b0b5; }
.bx-table tr.has .arrow { color: var(--kb-primary); }
.bx-table tr.clickable { cursor: pointer; }
.bx-chevron { background: none; border: 0; color: var(--kb-primary); cursor: pointer; font-size: 14px; padding: 0 6px; }

/* ── Menus déroulants ── */
.bx-menu { position: absolute; z-index: 50; background: #fff; border: 1px solid var(--kb-border); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 4px 0; min-width: 230px; }
.bx-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 7px 14px; font-size: 12px; cursor: pointer; color: var(--kb-text); }
.bx-menu button:hover { background: var(--kb-primary-light); }
.bx-menu button.danger { color: var(--kb-danger); }
.bx-menu hr { border: 0; border-top: 1px solid var(--kb-border-light); margin: 4px 0; }

/* ── Boutons ── */
.bx-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--kb-border); background: #fff; color: var(--kb-text); border-radius: 6px; padding: 6px 12px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.bx-btn:hover { border-color: var(--kb-primary); color: var(--kb-primary); }
.bx-btn.primary { background: var(--kb-primary); border-color: var(--kb-primary); color: #fff; }
.bx-btn.primary:hover { background: var(--kb-primary-dark); color: #fff; }
.bx-btn.ok { background: var(--kb-ok); border-color: var(--kb-ok); color: #fff; }
.bx-btn.danger { color: var(--kb-danger); }
.bx-btn:disabled { opacity: .45; cursor: not-allowed; }
.bx-btn svg { width: 14px; height: 14px; }
.bx-toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--kb-border); background: var(--kb-toolbar); flex-wrap: wrap; }
.bx-toolbar .sep { width: 1px; height: 22px; background: var(--kb-border); margin: 0 4px; }
.bx-toolbar .title { font-weight: 700; font-size: 13px; margin-right: 8px; }

/* ── Pastilles ── */
.bx-pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.bx-pill.ok { background: var(--kb-st-ok-bg); color: var(--kb-st-ok); }
.bx-pill.warn { background: var(--kb-st-warn-bg); color: var(--kb-st-warn); }
.bx-pill.danger { background: var(--kb-st-danger-bg); color: var(--kb-st-danger); }
.bx-pill.info { background: var(--kb-st-info-bg); color: var(--kb-st-info); }
.bx-pill.neutral { background: var(--kb-st-neutral-bg); color: var(--kb-st-neutral); }
.bx-pill.avoir { background: #f3e8ff; color: #7e22ce; }

/* ── Écran de saisie : écriture à gauche, image à droite ── */
.bx-split { display: grid; grid-template-columns: minmax(560px, 1.25fr) minmax(380px, 1fr); gap: 12px; height: calc(100vh - 132px); }
.bx-split.large { grid-template-columns: minmax(560px, 1.9fr) minmax(340px, 1fr); }
.bx-split > .bx-card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.bx-pieces { flex: 0 0 auto; max-height: 38%; overflow: auto; }
.bx-detail { flex: 1 1 auto; overflow: auto; border-top: 3px solid var(--kb-border); }
.bx-detail-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #4a4a50; color: #fff; font-size: 12px; }
.bx-detail-head .grow { flex: 1; }
.bx-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 14px; padding: 12px; }
.bx-form label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--kb-muted-strong); }
.bx-form input, .bx-form select { padding: 5px 8px; border: 1px solid var(--kb-border); border-radius: 5px; font-size: 12px; background: #fff; }
.bx-form .span2 { grid-column: span 2; }
.bx-form .with-btn { display: flex; gap: 4px; }
.bx-form .with-btn input { flex: 1; min-width: 0; }
.bx-mini-btn { border: 1px solid var(--kb-border); background: #fff; border-radius: 5px; cursor: pointer; padding: 0 7px; font-size: 12px; }
.bx-mini-btn.gold { background: #fde68a; border-color: #f59e0b; }
.bx-ventil td input { width: 100%; border: 1px solid transparent; background: transparent; padding: 3px 4px; font-size: 12px; text-align: inherit; }
.bx-ventil td input:focus { border-color: var(--kb-primary); background: #fff; outline: none; }
.bx-ventil td.num input { text-align: right; }
.bx-totals { display: flex; justify-content: flex-end; gap: 18px; padding: 8px 12px; font-size: 12px; }
.bx-totals b { font-variant-numeric: tabular-nums; }

/* Couleurs des contrôles (support de formation Cegid) */
.f-missing { background: #ffe4ec !important; }
.c-doublon-box { background: #fef9c3; }
.c-doublon-qc { background: #ffedd5; }
.c-tva { color: #1d4ed8; font-weight: 700; }
.c-date { color: var(--kb-danger); font-weight: 700; }
.bx-checks { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.bx-check { display: flex; gap: 8px; align-items: center; font-size: 12px; padding: 5px 9px; border-radius: 6px; }
.bx-check.ok { background: var(--kb-st-ok-bg); color: var(--kb-st-ok); }
.bx-check.ko { background: var(--kb-st-danger-bg); color: var(--kb-st-danger); }
.bx-check.warn { background: var(--kb-st-warn-bg); color: var(--kb-st-warn); }
.bx-score { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.bx-score .gauge { width: 60px; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.bx-score .gauge i { display: block; height: 100%; }

/* ── Visionneuse d'image ── */
.bx-viewer { flex: 1; overflow: auto; background: #6b6b70; padding: 18px; display: flex; justify-content: center; align-items: flex-start; }
.bx-paper { position: relative; background: #fff; width: 520px; min-height: 700px; padding: 34px 38px; box-shadow: 0 4px 18px rgba(0,0,0,.35); font-family: Georgia, 'Times New Roman', serif; font-size: 12px; color: #222; transform-origin: top center; }
.bx-paper h2 { font-family: Arial, sans-serif; margin: 0 0 4px; font-size: 22px; letter-spacing: 1px; }
.bx-paper .small { font-size: 10px; color: #555; font-family: Arial, sans-serif; }
.bx-paper table { width: 100%; border-collapse: collapse; margin-top: 16px; font-family: Arial, sans-serif; font-size: 11px; }
.bx-paper th, .bx-paper td { border-bottom: 1px solid #ddd; padding: 5px 4px; text-align: left; }
.bx-paper td.r, .bx-paper th.r { text-align: right; }
.bx-paper .tot { margin-left: auto; width: 220px; margin-top: 12px; font-family: Arial, sans-serif; }
.bx-paper .tot div { display: flex; justify-content: space-between; padding: 3px 0; }
.bx-paper .tot .ttc { font-weight: 700; border-top: 2px solid #222; margin-top: 4px; padding-top: 6px; }
.bx-paper .avoir-stamp { position: absolute; top: 120px; right: 40px; border: 3px solid #7e22ce; color: #7e22ce; padding: 4px 14px; font: 700 22px Arial, sans-serif; transform: rotate(-12deg); }
.bx-paper.real { padding: 0; width: auto; min-height: 0; background: transparent; box-shadow: none; }
.bx-paper.real img, .bx-paper.real embed { max-width: 100%; box-shadow: 0 4px 18px rgba(0,0,0,.35); background: #fff; }
.tag { position: relative; outline: 2px solid; outline-offset: 1px; }
.tag::before { content: attr(data-tag); position: absolute; top: -15px; left: -2px; font: 600 9px Arial, sans-serif; color: #fff; padding: 1px 4px; white-space: nowrap; }
.tag.t-blue { outline-color: #2563eb; } .tag.t-blue::before { background: #2563eb; }
.tag.t-violet { outline-color: #7c3aed; } .tag.t-violet::before { background: #7c3aed; }
.tag.t-red { outline-color: #dc2626; } .tag.t-red::before { background: #dc2626; }
.hide-tags .tag { outline: none; } .hide-tags .tag::before { display: none; }
.hl { background: #fde047; }

/* ── Tri / validation : mosaïque ── */
.bx-mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; padding: 12px; overflow: auto; align-content: start; }
.bx-thumb { border: 2px solid transparent; border-radius: 6px; background: #fff; cursor: pointer; padding: 6px; text-align: center; font-size: 10px; color: var(--kb-muted-strong); box-shadow: var(--shadow-md); }
.bx-thumb .page { height: 140px; background: repeating-linear-gradient(#fff 0 9px, #eee 9px 10px); border: 1px solid #ddd; margin-bottom: 5px; position: relative; overflow: hidden; }
.bx-thumb .page b { position: absolute; top: 8px; left: 8px; font: 700 10px Arial; color: #333; }
.bx-thumb.sel { border-color: var(--kb-primary); background: var(--kb-primary-light); }
.bx-thumb.excl { border-color: var(--kb-danger); background: var(--kb-st-danger-bg); opacity: .8; }
.bx-thumb.excl .page::after { content: 'EXCLU'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--kb-danger); font: 700 16px Arial; background: rgba(255,255,255,.6); }
.bx-group { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--kb-text); border-bottom: 1px solid var(--kb-border); padding-bottom: 4px; display: flex; align-items: center; gap: 8px; }

/* ── Dépôt ── */
.bx-drop { border: 2px dashed #9fc9ec; border-radius: var(--kb-radius); background: var(--kb-primary-light); padding: 40px; text-align: center; color: var(--kb-primary-dark); font-size: 14px; cursor: pointer; }
.bx-drop.over { background: #d4e6ff; border-color: var(--kb-primary); }
.bx-depot-zone { display: flex; gap: 12px; align-items: stretch; }
.bx-depot-zone .bx-drop { flex: 1; }
.bx-depot-nb { cursor: default; height: auto; min-height: 132px; flex: 0 0 200px; }
.bx-depot-nb:hover { border-color: var(--kb-border); }
.bx-depot-nb .n { font-size: 64px; color: var(--kb-primary-dark); }
.bx-depot-go { flex: 0 0 200px; min-height: 132px; font-size: 22px; font-weight: 600; border-radius: 4px; justify-content: center; text-align: center; }
.bx-depot-go:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 640px) { .bx-depot-zone { flex-direction: column; } .bx-depot-nb, .bx-depot-go { flex-basis: auto; } }
.bx-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bx-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--kb-muted-strong); margin-bottom: 12px; }
.bx-field input, .bx-field select { padding: 7px 10px; border: 1px solid var(--kb-border); border-radius: 6px; font-size: 13px; }
.bx-section-title { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.bx-p { padding: 16px; }

/* ── Fenêtre modale ── */
.bx-modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 100; }
.bx-modal { background: #fff; border-radius: var(--kb-radius); box-shadow: var(--shadow-window); width: min(560px, 94vw); max-height: 86vh; overflow: auto; }
.bx-modal h3 { margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--kb-border); font-size: 15px; }
.bx-modal .body { padding: 16px 18px; font-size: 13px; line-height: 1.5; }
.bx-modal .foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--kb-border); }

.bx-toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #1d1d1f; color: #fff; padding: 9px 18px; border-radius: 8px; font-size: 13px; z-index: 200; box-shadow: var(--shadow-lg); }
.bx-empty { padding: 40px; text-align: center; color: var(--kb-muted); }
.bx-login { max-width: 420px; margin: 80px auto; text-align: center; }

@media (max-width: 1100px) {
  .bx-split { grid-template-columns: 1fr; height: auto; }
  .bx-viewer { min-height: 600px; }
  .bx-grid2 { grid-template-columns: 1fr; }
  .bx-nav a span { display: none; }
}

/* Tri : aide clavier, tableau triable */
.bx-touches { font-size: 11px; color: var(--kb-muted-strong); padding: 4px 12px; border-bottom: 1px solid var(--kb-border-light); }
.bx-tri-liste th.tri { cursor: pointer; user-select: none; }
.bx-tri-liste th.tri:hover, .bx-tri-liste th.tri.on { color: var(--kb-primary); }
.bx-tri-dossier th.tri { cursor: pointer; user-select: none; }
.bx-tri-dossier th.tri:hover, .bx-tri-dossier th.tri.on { color: var(--kb-primary); }
/* Saisie : colonnes Cpte TVA (6) et Origine (7) masquées sans écart ; contrôles OK repliés */
.bx-ventil.compact th:nth-child(6), .bx-ventil.compact td:nth-child(6) { display: none; }
.bx-check-ok { cursor: pointer; }
.bx-tri-liste td, .bx-tri-liste th { white-space: nowrap; }
.bx-tri-liste td.motif { max-width: 260px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: var(--kb-warn); }
/* Avis « pièces lues » : remplace le rechargement automatique de la page */
.bx-lu { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--kb-border); border-left: 4px solid var(--kb-primary); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 13px; }
/* Barre d'actions sur la sélection (liste des pièces d'un dossier) */
.bx-selbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 12px; background: var(--kb-primary-light); border-top: 1px solid var(--kb-border); border-bottom: 1px solid var(--kb-border); position: sticky; top: 0; z-index: 5; }
.bx-selbar[hidden] { display: none; }
.bx-selbar b { font-size: 12px; margin-right: 6px; }
/* Avancement de la lecture : barre en arrière-plan du nom du fichier */
.bx-ficprog { background: linear-gradient(90deg, var(--kb-primary-light) var(--p), transparent var(--p)); transition: background .6s; }
.bx-ficprog.fini { background: var(--kb-st-ok-bg, #e7f6ec); }
.bx-ficprog .pct { font-size: 11px; font-weight: 600; color: var(--kb-primary); margin-left: 6px; }
.bx-ficprog.fini .pct { color: var(--kb-ok); }
/* Formulaire de saisie compact : zones à la taille de leur contenu (journal et devise 3 caractères) */
.bx-form.bx-form-c { display: flex; flex-wrap: wrap; align-items: flex-end; }
.bx-form-c .w-j { width: 62px; }
.bx-form-c .w-d { width: 128px; }
.bx-form-c .w-n { width: 150px; }
.bx-form-c .w-t { width: 86px; }
.bx-form-c .w-m { width: 104px; }
.bx-form-c .w-m input { text-align: right; }
.bx-form-c .w-f { flex: 1 1 340px; min-width: 300px; }
.bx-form-c .w-f .w-c { flex: 0 0 96px; }
.bx-form-c .w-s { width: 140px; }
.bx-form-c .w-l { flex: 1 1 240px; }
.bx-form-c select, .bx-form-c input { width: 100%; box-sizing: border-box; }
/* Liste des comptes du dossier sous la zone « compte » de la ventilation */
.bx-ac { position: absolute; z-index: 70; background: #fff; border: 1px solid var(--kb-border); border-radius: 6px; box-shadow: var(--shadow-lg); max-height: 260px; overflow: auto; min-width: 320px; font-size: 12px; }
.bx-ac-item { padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.bx-ac-item b { margin-right: 8px; }
.bx-ac-item.on, .bx-ac-item:hover { background: var(--kb-primary-light); }
.bx-ac-vide { padding: 8px 10px; color: var(--kb-muted-strong); }
/* Chargement : l'écran reste affiché, estompé, au lieu d'être vidé */
.bx-main.bx-charge { opacity: .55; transition: opacity .15s .1s; pointer-events: none; }
/* Zone active : couleur différente (saisie au clavier) */
.bx-form input:focus, .bx-form select:focus, .bx-ventil td input:focus { background: #fff8d6 !important; border-color: var(--kb-primary) !important; outline: none; box-shadow: 0 0 0 2px rgba(37, 99, 235, .15); }
/* Ventilation : ligne modifiée à la main en bleu ; taux sur 4 caractères */
.bx-ventil tr.modif td input { color: #1d4ed8; font-weight: 600; }
/* Ventilation : colonnes fixes — comptes et montants sur 10 caractères, taux sur 4, le libellé prend le reste */
.bx-ventil { table-layout: fixed; width: 100%; }
.bx-ventil col.c-cpt { width: calc(10ch + 26px); }
.bx-ventil col.c-mt { width: calc(10ch + 30px); }
.bx-ventil col.c-tx { width: calc(4ch + 26px); }
.bx-ventil col.c-ctva { width: calc(8ch + 26px); }
.bx-ventil col.c-x { width: 34px; }
.bx-ventil.compact col.c-ctva { width: 0; }
.bx-ventil th { white-space: normal; line-height: 1.2; }
.bx-ventil td input[data-l="compte"], .bx-ventil td input[data-l="ht"], .bx-ventil td input[data-l="tva"] { max-width: 100%; }
.bx-totals { align-items: center; }
.bx-totals #a-valider { margin-left: 8px; }
.bx-ventil tr.ret td { background: #fbf7ec; }
.bx-btn.warn { background: #e8a33d; border-color: #e8a33d; color: #fff; }

/* ── Silaé : tableau par année (27/10/2026) ── */
.bx-sg-vues { display: flex; gap: 6px; padding: 12px 14px 0; }
.bx-sg-vues a { padding: 5px 12px; border-radius: 6px; border: 1px solid var(--kb-border); color: var(--kb-text); text-decoration: none; font-size: 12px; }
.bx-sg-vues a.active { background: var(--kb-primary); border-color: var(--kb-primary); color: #fff; font-weight: 600; }
.bx-sg-barre { display: flex; align-items: center; gap: 14px; padding: 12px 14px; flex-wrap: wrap; font-size: 12px; }
.bx-sg-barre input[type=search] { padding: 6px 10px; border: 1px solid var(--kb-border); border-radius: 6px; width: 220px; font-size: 12px; }
.bx-sg-barre #sg-go { margin-left: auto; }
.bx-sg-annees { display: flex; align-items: center; gap: 10px; font-size: 15px; margin-right: 6px; }
.bx-sg-annees a { color: var(--kb-primary); text-decoration: none; font-size: 13px; }
.bx-sg-annees b { font-size: 18px; }
.bx-sg-compte { display: inline-flex; align-items: center; gap: 5px; }
.bx-sg-compte i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.bx-sg-compte.vert i, .bx-sg-legende .vert, table.bx-sg td.bx-sg-c.vert, table.bx-sg tr:hover td.bx-sg-c.vert { background: #1a9d54; }
.bx-sg-compte.orange i, .bx-sg-legende .orange, table.bx-sg td.bx-sg-c.orange, table.bx-sg tr:hover td.bx-sg-c.orange { background: #f08c00; }
.bx-sg-compte.bleu i, .bx-sg-legende .bleu, table.bx-sg td.bx-sg-c.bleu, table.bx-sg tr:hover td.bx-sg-c.bleu { background: #1c7ed6; }
.bx-sg-compte.rouge i, .bx-sg-legende .rouge, table.bx-sg td.bx-sg-c.rouge, table.bx-sg tr:hover td.bx-sg-c.rouge { background: #e03131; }
.bx-sg-legende .gris, table.bx-sg td.bx-sg-c.gris, table.bx-sg tr:hover td.bx-sg-c.gris { background: #dcdce0; }
.bx-sg-wrap { max-height: calc(100vh - 300px); }
table.bx-sg th.bx-sg-m { width: 44px; cursor: pointer; }
table.bx-sg th.bx-sg-m:hover { background: #dce9f8; }
table.bx-sg td.bx-sg-nom { cursor: pointer; }
table.bx-sg td.bx-sg-nom:hover { color: var(--kb-primary); text-decoration: underline; }
table.bx-sg td.bx-sg-c { border: 2px solid #fff; padding: 0; height: 24px; cursor: pointer; position: relative; }
table.bx-sg td.bx-sg-c.gris, table.bx-sg td.bx-sg-c.futur { cursor: default; }
table.bx-sg tr:hover td.bx-sg-c { filter: brightness(1.06); }
table.bx-sg tr:hover td.bx-sg-c.futur { background: var(--kb-hover-row); }
table.bx-sg td.bx-sg-c.vert::after { content: '✓'; color: #fff; font-size: 11px; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
table.bx-sg td.bx-sg-c.sel { outline: 3px solid #1d1d1f; outline-offset: -3px; }
table.bx-sg td.bx-sg-c.sel::after { content: '●'; color: #fff; font-size: 10px; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.bx-sg-legende { display: flex; align-items: center; gap: 6px; padding: 10px 14px; font-size: 11px; color: var(--kb-muted-strong); flex-wrap: wrap; }
.bx-sg-legende span { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.bx-sg-selection { margin-left: auto; font-size: 12px; color: var(--kb-text); }
/* Ligne active au clavier (flèches ↑ ↓, 02/11/2026) */
.bx-table tbody tr.bx-kb td { box-shadow: inset 0 1px 0 var(--kb-primary), inset 0 -1px 0 var(--kb-primary); }
.bx-table tbody tr.bx-kb td:first-child { box-shadow: inset 3px 0 0 var(--kb-primary), inset 0 1px 0 var(--kb-primary), inset 0 -1px 0 var(--kb-primary); }
