@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");
:root {
  --bs-green: #2e7d32;
  --bs-green-dark: #1b5e20;
  --bs-green-light: #e8f5e9;
  --bs-bg: #f4f7f2;
  --bs-card: #ffffff;
  --bs-text: #1f2a1f;
  --bs-text-muted: #6b7a6b;
  --bs-border: #e1e8df;
  --bs-danger: #c62828;
  --bs-warning: #f9a825;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bs-bg);
  color: var(--bs-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
}

.bs-boot {
  padding: 60px;
  text-align: center;
  color: var(--bs-text-muted);
}

/* ---------- Shell ---------- */
.bs-shell { display: flex; min-height: 100vh; }

.bs-sidebar {
  width: 262px;
  flex: 0 0 262px;
  background: #ffffff;
  border-right: 1px solid var(--bs-border);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  overflow-y: auto;
}

.bs-logo {
  padding: 0 20px 18px;
  border-bottom: 1px solid var(--bs-border);
  margin-bottom: 12px;
  text-align: center;
}
.bs-logo-img { display: block; max-width: 100%; max-height: 64px; margin: 0 auto 8px; }
.bs-logo-caption {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bs-text-muted);
}
.bs-logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--bs-green-dark);
  text-align: left;
}
.bs-logo-text span { color: var(--bs-green); }

.bs-nav { list-style: none; margin: 0; padding: 0; flex: 1; }
.bs-nav li { margin: 2px 10px; }
.bs-nav button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  color: var(--bs-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}
.bs-nav button:hover { background: var(--bs-green-light); }
.bs-nav button.active { background: var(--bs-green); color: #fff; font-weight: 600; }
.bs-nav .bs-icon { font-size: 16px; width: 18px; text-align: center; flex: 0 0 18px; }
.bs-icon-badge {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}

/* Sage-style collapsible module groups (Gestion des ventes / achats / articles) */
.bs-nav-group { margin: 2px 10px; }
.bs-nav-group-toggle {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--bs-green-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}
.bs-nav-group-toggle:hover { background: var(--bs-green-light); }
.bs-nav-group-toggle.active:not(:hover) { background: var(--bs-green-light); }
.bs-chevron {
  margin-left: auto;
  font-size: 11px;
  color: var(--bs-text-muted);
  transition: transform .15s ease;
  flex: 0 0 auto;
}
.bs-nav-group.open .bs-chevron { transform: rotate(90deg); color: var(--bs-green); }

.bs-nav-children {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height .18s ease;
}
.bs-nav-group.open .bs-nav-children { max-height: 320px; }
.bs-nav-children li { margin: 1px 0 1px 14px; }
.bs-nav-children button.bs-nav-child {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 2px solid var(--bs-border);
  padding: 8px 12px 8px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 13.5px;
  line-height: 1.3;
  color: var(--bs-text-muted);
  cursor: pointer;
}
.bs-nav-children button.bs-nav-child:hover { background: var(--bs-green-light); color: var(--bs-text); border-left-color: var(--bs-green); }
.bs-nav-children button.bs-nav-child.active {
  background: var(--bs-green-light);
  color: var(--bs-green-dark);
  font-weight: 600;
  border-left-color: var(--bs-green);
}

.bs-sidebar-footer {
  padding: 14px 20px 0;
  border-top: 1px solid var(--bs-border);
  font-size: 13px;
  color: var(--bs-text-muted);
}
.bs-sidebar-footer a { color: var(--bs-green); text-decoration: none; }
.bs-sidebar-footer a:hover { text-decoration: underline; }

.bs-main { flex: 1; min-width: 0; padding: 28px 32px; }

.bs-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.bs-topbar h1 { font-size: 22px; margin: 0; }
.bs-topbar .bs-user { font-size: 14px; color: var(--bs-text-muted); }
.bs-dash-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 20px 6px 6px;
  border: 1px solid var(--bs-border);
  border-radius: 999px;
  background: var(--bs-card);
}

/* ---------- Cards / stats ---------- */
.bs-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.bs-stat {
  background: var(--bs-card);
  border: 1px solid var(--bs-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.bs-stat-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.bs-stat .n { font-size: 24px; font-weight: 800; color: var(--bs-green-dark); line-height: 1.15; }
.bs-stat .l { font-size: 12.5px; color: var(--bs-text-muted); margin-top: 3px; }
.bs-stats-sm .n { font-size: 17px; }
.text-danger { color: var(--bs-danger); font-weight: 600; }

/* ---------- Small horizontal bar charts (top produits, top impayés) ---------- */
.bs-hbar-title { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--bs-text-muted); margin-bottom: 10px; }
.bs-hbar-chart { display: flex; flex-direction: column; gap: 10px; }
.bs-hbar-row { display: grid; grid-template-columns: 150px 1fr 100px; align-items: center; gap: 10px; }
.bs-hbar-label { font-size: 13px; color: var(--bs-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-hbar-track { background: var(--bs-bg); border-radius: 4px; height: 10px; overflow: hidden; }
.bs-hbar-fill { height: 100%; border-radius: 4px; min-width: 4px; }
.bs-hbar-value { font-size: 13px; font-weight: 600; text-align: right; white-space: nowrap; }
@media (max-width: 780px) {
  .bs-hbar-row { grid-template-columns: 100px 1fr 80px; }
}

/* ---------- Tableau de bord: évolution du CA (bar chart) ---------- */
.bs-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 170px;
  padding-top: 22px;
  border-bottom: 1px solid var(--bs-border);
}
.bs-chart-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.bs-chart-value {
  font-size: 10.5px;
  color: var(--bs-text-muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.bs-chart-bar {
  width: 100%;
  max-width: 34px;
  background: var(--bs-green);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.bs-chart-label {
  font-size: 11.5px;
  color: var(--bs-text-muted);
  margin-top: 8px;
  text-align: center;
}

/* ---------- Tableau de bord: situation des règlements (mini status bar) ---------- */
.bs-status-bar {
  display: flex;
  width: 90px;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bs-border);
}
.bs-status-bar-paid { height: 100%; background: var(--bs-green); }
.bs-status-bar-due { height: 100%; background: var(--bs-danger); }

.bs-card {
  background: var(--bs-card);
  border: 1px solid var(--bs-border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}
.bs-card h2 { font-size: 17px; margin: 0 0 16px; }

/* ---------- Toolbar / search ---------- */
.bs-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.bs-toolbar input[type=text], .bs-toolbar input[type=date], .bs-toolbar select {
  padding: 9px 12px;
  border: 1px solid var(--bs-border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}
.bs-toolbar input[type=text] { flex: 1; min-width: 180px; }
.bs-spacer { flex: 1; }

.bs-btn {
  background: var(--bs-green);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.bs-btn:hover { background: var(--bs-green-dark); }
.bs-btn.secondary { background: #fff; color: var(--bs-text); border: 1px solid var(--bs-border); }
.bs-btn.secondary:hover { background: var(--bs-bg); }
.bs-btn.danger { background: var(--bs-danger); }
.bs-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Table ---------- */
table.bs-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.bs-table th {
  text-align: left;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--bs-text-muted);
  padding: 8px 10px;
  border-bottom: 2px solid var(--bs-border);
}
table.bs-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--bs-border);
  vertical-align: top;
}
table.bs-table tr:hover td { background: var(--bs-green-light); }
table.bs-table tr.bs-row-clickable { cursor: pointer; }
.bs-table .muted { color: var(--bs-text-muted); }
.bs-table .num { text-align: right; white-space: nowrap; }

.bs-empty { padding: 30px; text-align: center; color: var(--bs-text-muted); }
.bs-loading { padding: 30px; text-align: center; color: var(--bs-text-muted); }

.bs-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bs-green-light);
  color: var(--bs-green-dark);
}
.bs-badge-danger { background: #fdecea; color: var(--bs-danger); }
.bs-badge-warning { background: #fff8e1; color: #8d6e00; }
.bs-badge-green { background: var(--bs-green-light); color: var(--bs-green-dark); }

/* ---------- Modal / form ---------- */
.bs-modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,30,20,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 100; overflow-y: auto;
}
.bs-modal {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 560px;
  padding: 24px; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.bs-modal h3 { margin: 0 0 18px; font-size: 18px; }
.bs-field { margin-bottom: 14px; }
.bs-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--bs-text); }
.bs-field input[type=text], .bs-field input[type=email], .bs-field input[type=number], .bs-field select, .bs-field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--bs-border); border-radius: 8px; font-size: 14px; font-family: inherit;
}
.bs-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bs-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.bs-error { color: var(--bs-danger); font-size: 13px; margin-top: 10px; }
.bs-note { font-size: 12.5px; color: var(--bs-text-muted); margin-top: -6px; margin-bottom: 14px; }

/* ---------- Sub-tabs (documents, stock, inventaire, analyse) ---------- */
.bs-subtabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--bs-border); padding-bottom: 14px; }
.bs-subtab {
  background: none;
  border: 1px solid var(--bs-border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--bs-text-muted);
  cursor: pointer;
}
.bs-subtab:hover { background: var(--bs-green-light); color: var(--bs-text); }
.bs-subtab.active { background: var(--bs-green); border-color: var(--bs-green); color: #fff; }

.bs-transform-select {
  padding: 7px 8px;
  border: 1px solid var(--bs-border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: var(--bs-green-dark);
  font-weight: 600;
}

/* ---------- Document modal (dynamic line items) ---------- */
.bs-modal-wide { max-width: 800px; }
table.bs-lines-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 8px; }
table.bs-lines-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--bs-text-muted);
  padding: 6px 6px;
  border-bottom: 2px solid var(--bs-border);
}
table.bs-lines-table td { padding: 5px 6px; border-bottom: 1px solid var(--bs-border); vertical-align: middle; }
table.bs-lines-table select, table.bs-lines-table input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--bs-border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}
.bs-line-remove { background: none; border: none; color: var(--bs-danger); cursor: pointer; font-size: 15px; padding: 4px 8px; }
.bs-line-remove:hover { opacity: 0.7; }
.bs-doc-totals { text-align: right; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--bs-border); font-size: 14.5px; }

/* ---------- Detail panel ---------- */
.bs-detail dt { font-size: 12px; color: var(--bs-text-muted); text-transform: uppercase; margin-top: 12px; }
.bs-detail dd { margin: 2px 0 0; font-size: 14.5px; }

/* ---------- Document detail: Sage-100-i7-style action bar ---------- */
.bs-doc-actionbar { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 18px; margin-bottom: 4px; border-bottom: 1px solid var(--bs-border); }
.bs-doc-action-group { position: relative; }
.bs-doc-menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 50;
  background: #fff; border: 1px solid var(--bs-border); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12); min-width: 170px; overflow: hidden;
}
.bs-doc-menu button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 10px 14px; font-size: 13.5px; color: var(--bs-text); cursor: pointer;
}
.bs-doc-menu button:hover { background: var(--bs-green-light); }
.bs-doc-menu button[data-action="supprimer"] { color: var(--bs-danger); }

@media print {
  .bs-sidebar, .bs-topbar, .bs-doc-noprint { display: none !important; }
  .bs-main { padding: 0; }
  .bs-card { border: none; box-shadow: none; padding: 0; }
}

.bs-soon {
  padding: 60px 20px;
  text-align: center;
  color: var(--bs-text-muted);
}
.bs-soon .big { font-size: 40px; margin-bottom: 10px; }

@media (max-width: 780px) {
  .bs-shell { flex-direction: column; }
  .bs-sidebar { width: 100%; flex: none; flex-direction: column; max-height: 60vh; overflow-y: auto; padding: 10px; }
  .bs-logo, .bs-sidebar-footer { display: none; }
  .bs-main { padding: 18px; }
  .bs-field-row { grid-template-columns: 1fr; }
}

/* ---------- Global search bar (sidebar) ---------- */
.bs-search-wrap { padding: 0 16px 14px; }
.bs-search-wrap input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--bs-border);
  border-radius: 8px;
  font-size: 13.5px;
  background: var(--bs-bg);
  color: var(--bs-text);
}
.bs-search-wrap input:focus { outline: none; border-color: var(--bs-green); background: #fff; }
.bs-search-results {
  position: fixed;
  z-index: 1000;
  background: #fff;
  border: 1px solid var(--bs-border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.14);
  max-height: 420px;
  overflow-y: auto;
  padding: 6px;
}
.bs-search-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bs-text-muted);
  padding: 8px 10px 4px;
}
.bs-search-item {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bs-search-item:hover { background: var(--bs-green-light); }
.bs-search-item-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--bs-green-dark);
  background: var(--bs-green-light);
  border-radius: 5px;
  padding: 1px 6px;
  margin-right: 6px;
}
.bs-search-item-sub { font-size: 12px; color: var(--bs-text-muted); }
.bs-search-loading, .bs-search-empty { padding: 14px 10px; color: var(--bs-text-muted); font-size: 13px; text-align: center; }

/* ---------- Coin superieur droit (cloche + date/heure) ----------
   Un seul conteneur fixed en flex, plutot que deux elements positionnes
   fixed independamment avec des decalages "right" codes en dur : la
   largeur du texte de la date varie selon le jour de la semaine (ex.
   "mercredi" vs "dimanche"), donc deux positions fixes devinees a l'oeil
   finissaient par se chevaucher (la cloche recouvrait la date). Un flex
   avec gap les garde toujours cote a cote, quelle que soit la largeur. */
.bs-header-fixed {
  position: fixed;
  top: 14px;
  right: 24px;
  z-index: 401;
  display: flex;
  align-items: center;
  gap: 10px;
}
@media (max-width: 780px) { .bs-header-fixed { display: none; } }

/* ---------- Date/heure (coin superieur droit) ---------- */
.bs-clock {
  font-size: 12.5px;
  color: var(--bs-text-muted);
  background: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  white-space: nowrap;
}

/* ---------- Cloche de notification (echeances) ---------- */
.bs-bell-wrap { position: relative; }
.bs-bell-btn {
  position: relative;
  background: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.bs-bell-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #d32f2f;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 999px;
  min-width: 16px;
  text-align: center;
}
.bs-bell-panel {
  position: absolute;
  top: 42px;
  right: 0;
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.16);
  padding: 6px 0;
}
.bs-bell-title { padding: 10px 14px 6px; font-weight: 700; font-size: 13px; color: var(--bs-text-muted); }
.bs-bell-empty { padding: 18px 14px; color: var(--bs-text-muted); font-size: 13px; text-align: center; }
.bs-bell-row { padding: 9px 14px; cursor: pointer; border-top: 1px solid var(--bs-border); }
.bs-bell-row:hover { background: var(--bs-green-light, #eef6ec); }
.bs-bell-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bs-bell-row-bottom { font-size: 12px; color: var(--bs-text-muted); margin-top: 2px; }
.bs-bell-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.bs-bell-status.late { background: #fdecea; color: #c62828; }
.bs-bell-status.today { background: #fff3e0; color: #ef6c00; }
.bs-bell-status.soon { background: #fff8e1; color: #f9a825; }
/* ---------- Factures a regler (dans "Ajouter un reglement") ---------- */
.bs-lettrage-list { border: 1px solid var(--bs-border); border-radius: 8px; max-height: 220px; overflow-y: auto; }
/* Specificite ".bs-lettrage-list .bs-lettrage-row" (2 classes) - doit battre
   la regle generique ".bs-field label { display:block }" plus haut dans ce
   fichier, sinon chaque ligne (un <label>) retombe en display:block et le
   N° de facture + la date s'affichent colles l'un a l'autre sans espace. */
.bs-lettrage-list .bs-lettrage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--bs-border);
  font-size: 13px;
  cursor: pointer;
}
.bs-lettrage-row:last-child { border-bottom: none; }
.bs-lettrage-row:hover { background: var(--bs-green-light); }
.bs-lettrage-num { font-weight: 600; min-width: 100px; }
.bs-lettrage-remaining { margin-left: auto; color: var(--bs-text-muted); }
.bs-lettrage-amount { width: 90px; padding: 4px 6px; border: 1px solid var(--bs-border); border-radius: 6px; font-size: 12.5px; }
.bs-lettrage-total { font-size: 12.5px; color: var(--bs-text-muted); margin-top: 6px; }
.bs-lettrage-total.bs-lettrage-mismatch { color: #c62828; font-weight: 600; }
.bs-btn-sm { padding: 4px 10px; font-size: 12px; }
.bs-btn-link {
  background: none;
  border: none;
  color: var(--bs-green-dark, #2e7d32);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.bs-btn-link.bs-btn-danger {
  color: #c62828;
}

/* === DESIGN 2026 START (couche de style, supprimer ce bloc pour revenir a l'ancien look) === */
:root {
  --bs-green: #14634b;
  --bs-green-dark: #0e2a22;
  --bs-green-light: #e1f0e8;
  --bs-bg: #f3f5f1;
  --bs-card: #fcfcfb;
  --bs-text: #10201a;
  --bs-text-muted: #6f7a73;
  --bs-border: #e2e6e0;
  --bs-danger: #c13a3a;
  --bs-warning: #eda100;
  --radius: 14px;
  --bs-side: #0e2a22;
  --bs-side-ink: #d6e4dd;
  --bs-side-muted: #8fa89d;
  --bs-side-active: #1c4a3b;
  --bs-shadow: 0 1px 2px rgba(16,32,26,.05);
  --bs-s1: #2a78d6; --bs-s2: #eb6834; --bs-s3: #1baf7a; --bs-s4: #eda100;
}
html, body {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}
.bs-sidebar { background: var(--bs-side); border-right: 0; padding: 18px 0; width: 252px; flex: 0 0 252px; }
.bs-logo { margin: 0 14px 14px; padding: 10px 12px; border: 0; border-radius: 12px; background: #ffffff; }
.bs-logo-caption { color: #5d6b63; }
.bs-nav li { margin: 2px 12px; }
.bs-nav button { color: var(--bs-side-ink); border-radius: 10px; padding: 9px 12px; font-weight: 500; font-family: inherit; }
.bs-nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.bs-nav button.active { background: var(--bs-side-active); color: #fff; font-weight: 700; }
.bs-nav-group-toggle { color: var(--bs-side-ink); }
.bs-nav-group-toggle:hover { background: rgba(255,255,255,.07); color: #fff; }
.bs-nav-group-toggle.active:not(:hover) { background: var(--bs-side-active); color: #fff; }
.bs-nav-children button.bs-nav-child { color: var(--bs-side-muted); }
.bs-nav-children button.bs-nav-child:hover { background: rgba(255,255,255,.07); color: #fff; }
.bs-nav-children button.bs-nav-child.active { background: var(--bs-side-active); color: #fff; font-weight: 700; }
.bs-sidebar-footer { border-top: 1px solid rgba(255,255,255,.10); color: var(--bs-side-muted); }
.bs-sidebar-footer a { color: #8fd9bb; }
.bs-main { padding: 26px 32px 40px; }
.bs-topbar h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.bs-topbar .bs-user { font-weight: 600; }
.bs-card { background: var(--bs-card); border: 1px solid var(--bs-border); border-radius: var(--radius); box-shadow: var(--bs-shadow); padding: 18px 20px; }
.bs-card h2 { font-size: 15px; font-weight: 700; letter-spacing: -.005em; }
.bs-stats { gap: 16px; }
.bs-stat { border-radius: var(--radius); box-shadow: var(--bs-shadow); padding: 18px; background: var(--bs-card); }
.bs-stat .n { color: var(--bs-text); font-size: 25px; letter-spacing: -.02em; font-weight: 800; }
.bs-stat .l { font-weight: 600; color: var(--bs-text-muted); }
.bs-stat-icon { border-radius: 12px; box-shadow: none; }
table.bs-table th { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-text-muted); background: #f6f7f4; }
table.bs-table td { border-bottom-color: #ebeee9; }
table.bs-table tr:hover td { background: #f6f7f4; }
.bs-btn { border-radius: 10px; font-weight: 600; font-family: inherit; }
.bs-btn:hover { filter: brightness(1.08); }
.bs-toolbar input[type=text], .bs-toolbar input[type=date], .bs-toolbar select,
.bs-field input[type=text], .bs-field input[type=email], .bs-field input[type=number], .bs-field select, .bs-field textarea { border-radius: 10px; font-family: inherit; }
.bs-badge, .bs-badge-green, .bs-badge-warning, .bs-badge-danger { border-radius: 99px; font-weight: 700; }
.bs-subtab { border-radius: 8px; font-family: inherit; font-weight: 600; }
.bs-modal { border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.bs-modal h3 { font-weight: 800; letter-spacing: -.01em; }
.bs-chart-bar { background: var(--bs-s1); border-radius: 4px 4px 0 0; }
.bs-hbar-fill { border-radius: 0 4px 4px 0; }
/* -- tableau de bord : graphiques -- */
:root { --bs-q1:#86b6ef; --bs-q2:#3987e5; --bs-q3:#1c5cab; --bs-q4:#0d366b; --bs-grid:#e4e7e1; --bs-axis:#c6cbc3; }
.bsd { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 16px; margin: 0 0 20px; }
.bsd > .bs-card { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.bsd > .bs-card h2 { margin: 0; }
.bsd-c4 { grid-column: span 4; } .bsd-c5 { grid-column: span 5; } .bsd-c6 { grid-column: span 6; } .bsd-c7 { grid-column: span 7; } .bsd-c8 { grid-column: span 8; }
@media (max-width: 1280px) { .bsd-c4 { grid-column: span 6; } .bsd-c6, .bsd-c8 { grid-column: span 12; } }
@media (max-width: 800px) { .bsd > .bs-card { grid-column: span 12; } }
.bsd-sub { color: var(--bs-text-muted); font-size: 12.5px; margin-top: -6px; }
.bsd-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: #4b5851; }
.bsd-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bsd-legend i.ln { width: 14px; height: 3px; border-radius: 2px; vertical-align: 3px; }
.bsd-chart { width: 100%; position: relative; }
.bsd-chart svg { display: block; width: 100%; overflow: visible; }
.bsd-seg { display: flex; gap: 2px; height: 28px; }
.bsd-seg div { border-radius: 4px; color: #fff; font-size: 11.5px; font-weight: 700; display: flex; align-items: center; padding: 0 8px; min-width: 0; white-space: nowrap; }
.bsd-seg div.dk { color: #0b0b0b; }
.bsd-total { font-weight: 800; font-size: 18px; letter-spacing: -.01em; margin-top: auto; }
.bsd-row { display: grid; grid-template-columns: minmax(90px,150px) 1fr 64px; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }
.bsd-row .n { color: #4b5851; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsd-row .b { height: 12px; }
.bsd-row .b i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.bsd-row .v { text-align: right; font-weight: 700; }
.bsd-tip { position: fixed; z-index: 9999; pointer-events: none; background: #fff; color: #10201a; border: 1px solid #e2e6e0; border-radius: 10px; padding: 9px 12px; font-size: 12.5px; box-shadow: 0 8px 24px rgba(0,0,0,.18); min-width: 140px; opacity: 0; transition: opacity .08s; left: -999px; top: 0; }
.bsd-tip.on { opacity: 1; }
.bsd-tip .tt { color: #7d8780; font-size: 11.5px; font-weight: 600; margin-bottom: 5px; }
.bsd-tip .tr { display: flex; align-items: center; gap: 8px; padding: 1px 0; }
.bsd-tip .tr i { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.bsd-tip .tr em { font-style: normal; color: #4b5851; }
.bsd-tip .tr b { margin-left: auto; padding-left: 14px; }
/* -- tableau de bord v2 -- */
:root { --bs-good:#0ca30c; --bs-warn:#fab219; --bs-crit:#d03b3b; --bs-other:#a9afa8; }
.bsd-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.bsd-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.bsd-head p { color: #4b5851; margin: 2px 0 0; }
.bsd-segc { display: inline-flex; background: var(--bs-card); border: 1px solid var(--bs-border); border-radius: 10px; padding: 3px; gap: 2px; }
.bsd-segc button { border: 0; background: none; height: 30px; padding: 0 13px; border-radius: 7px; cursor: pointer; font-weight: 600; color: #4b5851; font-family: inherit; font-size: 14px; }
.bsd-segc button:hover { background: #f1f3ef; }
.bsd-segc button.on { background: var(--bs-green); color: #fff; }
.bsd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.bsd-kpi { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bsd-kpi .lab { color: #4b5851; font-weight: 600; font-size: 13px; }
.bsd-kpi .val { font-size: 25px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; word-break: break-word; }
.bsd-kpi .val small { font-size: 13px; font-weight: 600; color: #7d8780; margin-left: 4px; letter-spacing: 0; }
.bsd-delta { font-size: 12.5px; font-weight: 700; }
.bsd-delta span { font-weight: 500; color: #7d8780; }
.bsd-delta.good { color: #006300; } .bsd-delta.bad { color: #a62525; } .bsd-delta.none { color: #7d8780; font-weight: 500; }
.bsd-spark { height: 40px; }
.bsd-ch { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.bsd-ch .bsd-sub { margin-top: 1px; }
.bsd-stat { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.bsd-meter { height: 12px; border-radius: 99px; background: #cde2fb; overflow: hidden; }
.bsd-meter i { display: block; height: 100%; width: 0; background: var(--bs-s1); border-radius: 99px; }
.bsd-hr { border: 0; border-top: 1px solid var(--bs-border); width: 100%; margin: 4px 0; }
.bsd-seg.thin { height: 10px; margin-bottom: 4px; }
.bsd-seg.thin div { border-radius: 99px; padding: 0; }
.bsd-donutwrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.bsd-legend.bsd-col { flex-direction: column; gap: 9px; flex: 1; min-width: 150px; }
.bsd-legend .li { display: flex; align-items: center; gap: 8px; }
.bsd-legend .li b { margin-left: auto; color: #10201a; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.bsd-heat { display: grid; grid-template-columns: auto 1fr; gap: 6px 8px; align-items: stretch; font-size: 11px; color: #7d8780; }
.bsd-cells { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.bsd-cells i { display: block; aspect-ratio: 1; border-radius: 3px; min-width: 8px; }
.bsd-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; text-align: right; }
.bsd-days span { line-height: 1; align-self: center; }
.bsd-hl { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: #7d8780; justify-content: flex-end; }
.bsd-hl i { width: 12px; height: 12px; border-radius: 3px; display: block; }
.bsd-lines { display: flex; flex-direction: column; }
.bsd-line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #ebeee9; }
.bsd-line:last-child { border-bottom: 0; padding-bottom: 0; }
.bsd-line .t { flex: 1; min-width: 0; }
.bsd-line .t b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsd-line .t span { color: #7d8780; font-size: 12.5px; }
.bsd-line .amt { font-weight: 700; white-space: nowrap; }
.bsd-line .when { color: #7d8780; font-size: 12.5px; white-space: nowrap; }
.bsd-chip { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: #f6f7f4; border: 1px solid var(--bs-border); color: #4b5851; white-space: nowrap; }
.bsd-chip.warn { color: #8a5a00; } .bsd-chip.crit { color: #a62525; }
.bsd-chip.chipw { min-width: 54px; text-align: center; }
.bsd-bank { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-bottom: 1px solid #ebeee9; }
.bsd-bank:last-child { border-bottom: 0; padding-bottom: 0; }
.bsd-bank .r { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bsd-bank .r span { color: #4b5851; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.bsd-bank .r b { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
/* -- sidebar v2, onglets, entete -- */
.bs-nav > li:nth-child(1)::before { content: "PILOTAGE"; }
.bs-nav > li:nth-child(2)::before { content: "GESTION COMMERCIALE"; }
.bs-nav > li:nth-child(5)::before { content: "OUTILS"; }
.bs-nav > li:nth-child(6)::before { content: "COMPTABILITÉ"; }
.bs-nav > li:nth-child(1)::before, .bs-nav > li:nth-child(2)::before, .bs-nav > li:nth-child(5)::before, .bs-nav > li:nth-child(6)::before { display: block; margin: 14px 0 6px 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; color: var(--bs-side-muted); }
.bs-nav > li:nth-child(1)::before { margin-top: 4px; }
.bs-sidebar .bs-icon-badge { background: transparent !important; box-shadow: none; width: 20px; height: 20px; flex: 0 0 20px; font-size: 0; color: inherit; }
.bs-sidebar .bs-icon-badge svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; display: block; }
.bs-nav-group-toggle, .bs-nav button.bs-nav-top { font-weight: 500; font-size: 14.5px; }
.bs-nav button.bs-nav-top.active, .bs-nav-group-toggle.active { font-weight: 700; }
.bs-chevron { color: var(--bs-side-muted); }
.bs-nav-children li { margin: 1px 0 1px 20px; }
.bs-nav-children button.bs-nav-child { border-left: 1px solid rgba(255,255,255,.14); border-radius: 0 8px 8px 0; font-size: 13.5px; padding: 7px 12px; }
.bs-nav-children button.bs-nav-child.active { border-left-color: #3fb98c; }
.bs-search-wrap input { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #fff; border-radius: 10px; font-family: inherit; }
.bs-search-wrap input::placeholder { color: var(--bs-side-muted); }
.bs-search-wrap input:focus { background: rgba(255,255,255,.14); border-color: #3fb98c; }
.bs-subtabs { display: inline-flex !important; width: auto; max-width: 100%; gap: 2px; padding: 3px !important; border: 1px solid var(--bs-border); border-bottom: 1px solid var(--bs-border) !important; border-radius: 10px; background: var(--bs-card); }
.bs-subtab { border: 0; border-radius: 7px; padding: 0 14px; height: 30px; background: none; color: #4b5851; font-size: 13.5px; font-weight: 600; }
.bs-subtab:hover { background: #f1f3ef; color: var(--bs-text); }
.bs-subtab.active { background: var(--bs-green); color: #fff; }
.bs-header-fixed { position: absolute; top: 16px; right: 28px; }
.bs-main { position: relative; padding-top: 70px; }
.bs-clock, .bs-bell-btn { background: var(--bs-card); border: 1px solid var(--bs-border); border-radius: 10px; box-shadow: none; }
@media (max-width: 780px) { .bs-main { padding-top: 26px; } }
.bs-shell { align-items: flex-start; }
.bs-sidebar { position: sticky; top: 0; height: 100vh; align-self: flex-start; }
@media (max-width: 780px) { .bs-sidebar { position: static; height: auto; } }
/* -- logo sidebar v3 -- */
.bs-sidebar { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.bs-logo { display: grid; grid-template-columns: 46px 1fr; column-gap: 12px; align-items: center; margin: 0 8px 12px; padding: 4px 8px 14px; background: none; border: 0; border-bottom: 1px solid rgba(255,255,255,.10); border-radius: 0; text-align: left; }
.bs-logo::before { content: ""; grid-row: 1 / 3; width: 46px; height: 46px; border-radius: 13px; background: #ffffff url("logo-icon.png") center / 34px 34px no-repeat; }
.bs-logo-img { display: none !important; }
.bs-logo-text { display: block !important; grid-column: 2; font-size: 19px; font-weight: 800; letter-spacing: -.01em; color: #ffffff; align-self: end; line-height: 1.1; }
.bs-logo-text span { display: none; }
.bs-logo-caption { grid-column: 2; align-self: start; margin-top: 3px; color: var(--bs-side-muted); font-size: 10.5px; letter-spacing: .1em; }
/* -- logo sidebar v4 (sans fond blanc) -- */
.bs-logo::before { width: 46px; height: 46px; border-radius: 0; background: transparent url("logo-icon.png") center / contain no-repeat; filter: brightness(0) invert(1); }
/* -- logo sidebar v5 (couleurs, sans blanc) -- */
.bs-logo::before { filter: brightness(1.55) saturate(1.35) contrast(1.05); }
/* -- menu a plat v6 -- */
.bs-nav > li::before { content: none !important; }
.bs-nav > li.bs-nav-sec { margin: 16px 10px 6px !important; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--bs-side-muted); }
.bs-nav > li.bs-nav-sec:first-child { margin-top: 4px !important; }
/* === DESIGN 2026 END === */

/* COMMANDES EN INSTANCE (suivi) */
.bso-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.bso-kpi { display: flex; flex-direction: column; gap: 4px; }
.bso-kl { color: #4b5851; font-weight: 600; font-size: 13px; }
.bso-kv { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.bso-ks { color: var(--bs-text-muted, #7d8780); font-size: 12.5px; }
.bso-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.bso-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bso-col { background: #f3f5f1; border: 1px solid var(--bs-border, rgba(16,32,26,.10)); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 200px; }
.bso-col h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #7d8780; display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 2px 4px; }
.bso-col h3 b { background: #fff; border: 1px solid var(--bs-border, rgba(16,32,26,.10)); border-radius: 99px; padding: 1px 8px; color: #10201a; }
.bso-card { background: var(--bs-card, #fff); border: 1px solid var(--bs-border, rgba(16,32,26,.10)); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.bso-col .bso-card { box-shadow: none; }
.bso-t { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bso-t small, .bso-s, .bso-sub, .bso-prod small { color: #7d8780; font-size: 12px; }
.bso-it { color: #4b5851; font-size: 12.5px; }
.bso-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bso-chip { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: #f3f5f1; border: 1px solid var(--bs-border, rgba(16,32,26,.10)); color: #4b5851; }
.bso-chip.warn { color: #8a5a00; }
.bso-chip.crit { color: #a62525; }
.bso-act { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.bso-act .bs-btn { flex: 1; justify-content: center; }
.bso-pick { font-size: 12px; color: #4b5851; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.bso-none, .bso-empty { color: #7d8780; padding: 8px 4px; }
.bso-empty { text-align: center; padding: 28px; line-height: 1.7; }
.bso-side h2 { margin: 0; font-size: 15px; font-weight: 700; }
.bso-sub { margin: 2px 0 10px; }
.bso-prod { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--bs-grid, #e4e7e1); font-size: 13px; }
.bso-prod small { display: block; }
.bso-prod span { font-weight: 800; white-space: nowrap; }
@media (max-width: 1280px) { .bso-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .bso-board { grid-template-columns: 1fr; } .bso-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .bso-kpis { grid-template-columns: 1fr; } }
.bso { display: block; }
.bso-ks.bso-bad { color: #a62525; font-weight: 700; }
.bso-sidecol { display: flex; flex-direction: column; gap: 12px; }
.bso-grp { border: 1px dashed #c6cbc3; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #f6f7f4; }
.bso-grp h4 { margin: 0 0 6px; font-size: 13px; font-weight: 700; }
.bso-grp .bso-prod { padding: 4px 0; border-bottom: 0; color: #4b5851; }
.bso-grp .bso-prod.bso-tot { border-top: 1px solid #e4e7e1; margin-top: 4px; padding-top: 7px; color: #10201a; }
.bso-chip.good { color: #006300; }
.bso-tarifs { margin-bottom: 14px; }
.bso-tk { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.bso-tk-i { background: #f6f7f4; border: 1px solid var(--bs-border, rgba(16,32,26,.10)); border-radius: 12px; padding: 10px 12px; }
.bso-tk-v { font-size: 18px; font-weight: 800; letter-spacing: -.01em; margin: 2px 0; }
.bso-tk-h { margin: 14px 0 6px; font-size: 13px; font-weight: 700; }
.bso-tk-t { max-height: 190px; overflow: auto; border: 1px solid var(--bs-border, rgba(16,32,26,.10)); border-radius: 10px; }
@media (max-width: 900px) { .bso-tk { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.brl h2 { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.brl-aging { margin-bottom: 16px; }
.brl-bar { display: flex; gap: 2px; height: 28px; }
.brl-bar div { border-radius: 4px; color: #fff; font-size: 11.5px; font-weight: 700; display: flex; align-items: center; padding: 0 8px; min-width: 0; white-space: nowrap; overflow: hidden; }
.brl-leg { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12.5px; color: #4b5851; }
.brl-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.brl-row { cursor: pointer; }
.brl-row.sel td { background: #e1f0e8; }
.brl-inv { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; max-height: 190px; overflow: auto; }
.brl-i { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; padding: 6px 8px; border: 1px solid var(--bs-border, rgba(16,32,26,.10)); border-radius: 8px; cursor: pointer; }
.brl-i em { font-style: normal; font-weight: 700; white-space: nowrap; }
.brl-chan { margin-bottom: 10px; }
.brl-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.brl-contact label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #7d8780; }
.brl-contact input, #brl-msg { width: 100%; border: 1px solid var(--bs-border, rgba(16,32,26,.18)); border-radius: 8px; padding: 7px 9px; font: inherit; color: inherit; background: #fff; box-sizing: border-box; }
#brl-msg { resize: vertical; line-height: 1.5; }
.brl-opts { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; margin: 8px 0; color: #4b5851; }
.brl-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.brl-btns .bs-btn { justify-content: center; }
.bso-calc { margin-top: 14px; }
.bso-calc-f { background: #e8f2ec; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.5; margin: 8px 0; }
.bso-calc-k { margin: 10px 0; }
.bso-calc-t { overflow: auto; max-height: 260px; border: 1px solid var(--bs-border, rgba(16,32,26,.10)); border-radius: 10px; margin-bottom: 10px; }
.bso-calc-t tfoot td { background: #f2f6f3; position: sticky; bottom: 0; }
.bso-neg { color: #d03b3b; font-weight: 700; }
.bsp-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.bsp-tabs button { border: 1px solid var(--bs-border, rgba(16,32,26,.14)); background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; color: inherit; }
.bsp-tabs button.on { background: #0f6e47; color: #fff; border-color: #0f6e47; }
.bsp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.bsp-grid label, .bsp-doc label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: #5b665f; }
.bsp-grid input, .bsp-doc input, .bsp-doc textarea, .bsp-rows input[type=text], .bsp-list input[type=text] { border: 1px solid var(--bs-border, rgba(16,32,26,.18)); border-radius: 8px; padding: 7px 9px; font: inherit; color: #1c2a23; background: #fff; box-sizing: border-box; width: 100%; }
.bsp-doc { display: grid; gap: 12px; }
.bsp-list, .bsp-rows { display: flex; flex-direction: column; gap: 8px; }
.bsp-li { display: flex; gap: 8px; align-items: center; }
.bsp-row { display: grid; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--bs-border, rgba(16,32,26,.10)); border-radius: 10px; }
.bsp-x { border: none; background: transparent; color: #b13a3a; cursor: pointer; font-size: 18px; line-height: 1; padding: 4px 8px; }
.bsp-actions { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.bsp-msg { font-size: 12.5px; color: #0f6e47; }
.bsp-msg.err { color: #b13a3a; }
.bsp-hint { font-size: 12.5px; color: #6b766f; margin: 0 0 12px; }
@media (max-width: 760px) { .bsp-grid { grid-template-columns: 1fr; } }


/* ---- Saisie de document façon Sage ---- */
.bsx-backdrop { align-items: flex-start; padding: 16px; overflow-y: auto; }
.bsx-win { width: min(1180px, 98vw); background: #fff; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.3); overflow: hidden; margin: 0 auto; }
.bsx-titlebar { display: flex; align-items: center; justify-content: space-between; background: #3a4046; color: #fff; padding: 9px 14px; font-weight: 600; font-size: 14px; }
.bsx-x { background: transparent; border: 0; color: #fff; font-size: 16px; cursor: pointer; padding: 2px 8px; }
.bsx-toolbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--bs-border, #e1e8df); background: #f7f9f6; }
.bsx-tb { background: #fff; border: 1px solid #c5d0c3; border-radius: 6px; padding: 6px 14px; font-weight: 600; cursor: pointer; color: var(--bs-green-dark, #1b5e20); }
.bsx-tb:hover { background: var(--bs-green-light, #e8f5e9); }
.bsx-tb-hint { color: var(--bs-text-muted, #6b7a6b); font-size: 12.5px; }
.bsx-note { margin: 10px 14px 0; padding: 8px 12px; background: #fff8e1; border: 1px solid #f3e0a1; border-radius: 6px; font-size: 13px; }
.bsx-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 18px; padding: 14px; }
.bsx-f { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 8px; margin: 0; }
.bsx-f2 { grid-column: span 2; grid-template-columns: 120px 1fr; }
.bsx-l { text-align: right; font-size: 13px; color: #2c3a2c; }
.bsx-head input, .bsx-head select { width: 100%; padding: 7px 9px; border: 1px solid #ccd5ca; border-radius: 5px; background: #fff; font-size: 14px; }
.bsx-head input:disabled { background: #f1f3f0; color: #666; }
.bsx-entry { display: grid; grid-template-columns: 1.1fr 3fr 1fr .8fr 1fr .9fr 1.1fr; gap: 6px; padding: 8px 14px 4px; border-top: 1px solid var(--bs-border, #e1e8df); background: #fafbf9; }
.bsx-entry input { width: 100%; padding: 8px 9px; border: 1px solid #ccd5ca; border-radius: 4px; font-size: 14px; background: #fff; }
.bsx-entry input:disabled { background: #f1f3f0; }
.bsx-entry-bar { display: flex; align-items: center; gap: 8px; padding: 6px 14px 10px; background: #fafbf9; }
.bsx-hint { font-size: 12.5px; color: var(--bs-text-muted, #6b7a6b); }
.bsx-sp { flex: 1; }
.bsx-btn { background: #fff; border: 1px solid #b9c4b7; border-radius: 4px; padding: 6px 16px; font-size: 14px; cursor: pointer; }
.bsx-btn:hover:not(:disabled) { background: #f0f4ef; }
.bsx-btn:disabled { opacity: .45; cursor: default; }
.bsx-green { background: #2e9d3a; border-color: #2e9d3a; color: #fff; font-weight: 600; }
.bsx-green:hover:not(:disabled) { background: #26852f; }
.bsx-gridwrap { max-height: 38vh; overflow: auto; border-top: 1px solid #3a4046; border-bottom: 1px solid var(--bs-border, #e1e8df); }
.bsx-grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.bsx-grid thead th { position: sticky; top: 0; background: #4a5057; color: #fff; text-align: left; padding: 8px 10px; font-weight: 500; font-size: 13px; }
.bsx-grid td { padding: 7px 10px; border-bottom: 1px solid #eef1ec; }
.bsx-grid tbody tr:nth-child(even) { background: #f5f7f4; }
.bsx-grid tbody tr[data-i] { cursor: pointer; }
.bsx-grid tbody tr.sel { background: #cfe8d1 !important; }
.bsx-grid .n { text-align: right; white-space: nowrap; }
.bsx-empty { text-align: center; color: var(--bs-text-muted, #6b7a6b); padding: 18px !important; }
.bsx-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 12px 14px; }
.bsx-box { background: #d7ecd6; border: 1px solid #5fb560; border-radius: 4px; padding: 8px 12px; display: grid; gap: 4px; }
.bsx-box > div { display: flex; justify-content: space-between; gap: 12px; }
.bsx-box .tot { border-top: 1px solid #5fb560; padding-top: 4px; font-size: 15px; }
#bsx-error { padding: 0 14px; }
.bsx-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 10px 14px 14px; border-top: 1px solid var(--bs-border, #e1e8df); }
@media (max-width: 900px) {
  .bsx-head { grid-template-columns: 1fr; }
  .bsx-f2 { grid-column: auto; }
  .bsx-entry { grid-template-columns: 1fr 1fr; }
}
