/* =====================================================================
   VK Gestion — feuille de style unique
   Outil interne : sobre, dense, lisible. Aucune animation décorative.
   ===================================================================== */

/* ---------------------------------------------------------------
   SOURCE UNIQUE DE VÉRITÉ POUR LES COULEURS
   Aucune valeur hexadécimale ne doit apparaître ailleurs dans ce fichier.
   --------------------------------------------------------------- */
:root {
  /* Marque Vanden Borre Kitchen */
  --vbk-red:        #FF3640;   /* rouge de marque officiel (identité + actions primaires) */
  --vbk-red-dark:   #D92630;   /* survol / état actif */
  --vbk-black:      #1A1A1A;   /* bandeau, texte fort */
  --vbk-graphite:   #2E2E2E;
  --vbk-white:      #FFFFFF;

  /* Neutres d'interface */
  --bg:             #F5F6F7;
  --surface:        #FFFFFF;
  --border:         #E4E7EA;
  --text:           #1A1A1A;
  --text-muted:     #6B7280;

  /* Statuts fonctionnels — jamais le rouge de marque */
  --ok:             #127A45;   /* payé, fait */
  --ok-soft:        #E7F5EC;
  --warn:           #B26A00;   /* à payer, échéance proche */
  --warn-soft:      #FDF3E2;
  --danger:         #9B1C1C;   /* en retard, litige, erreur */
  --danger-soft:    #FCE9E9;

  /* Dérivés (teintes de bordure, survols, fonds) */
  --border-strong:  #CBD1D8;
  --border-ok:      #BFE3D0;
  --border-warn:    #EBCB94;
  /* Hauteur de la barre d'onglets du bas : le panneau « Plus » et la
     calculette s'y posent, ils doivent parler de la même valeur. */
  --tabbar-h:       60px;
  --border-danger:  #F0C9C9;
  --border-dashed:  #C7CDD6;
  --line-soft:      #F0F2F5;
  --surface-alt:    #FAFBFC;
  --surface-hover:  #F1F3F5;
  --surface-sunken: #EEF0F3;
  --row-hover:      #FAFBFC;
  --row-danger:     #FDF4F4;
  --row-danger-hover: #FBECEC;
  --row-select:     #F0F3F8;
  --row-select-hover: #E9EEF6;
  --row-flash:      #DFF3E7;
  --ok-soft-hover:  #DAEEE3;
  --ok-dark:        #0F6A3B;
  --skeleton-a:     #EDEFF2;
  --skeleton-b:     #F6F7F9;
  --art:            #C8D0DB;
  --print-line:     #999999;
  --print-rule:     #DDDDDD;
  --print-zebra:    #F5F5F5;
  --toast-bg:       #21272F;
  --toast-link:     #FFB3B7;
  --row-highlight:  #FFF5CC;
  --info:           #1F5FBF;   /* planifié : une date est posée, rien d'inquiétant */
  --info-soft:      #E8F0FC;
  --border-info:    #BBD0F2;

  /* Transparences sur fond foncé */
  --on-dark:        rgba(255, 255, 255, .92);
  --on-dark-soft:   rgba(255, 255, 255, .60);
  --on-dark-fill:   rgba(255, 255, 255, .10);
  --on-dark-fill-2: rgba(255, 255, 255, .20);
  --on-dark-line:   rgba(255, 255, 255, .18);
  --overlay:        rgba(26, 26, 26, .45);

  /* Alias hérités : une seule définition, pas de couleur en dur */
  --muted:     var(--text-muted);
  --primary:   var(--vbk-black);
  --accent:    var(--vbk-red);
  --green:     var(--ok);
  --green-bg:  var(--ok-soft);
  --red:       var(--danger);
  --red-bg:    var(--danger-soft);
  --orange:    var(--warn);
  --orange-bg: var(--warn-soft);
  --grey:      var(--text-muted);
  --grey-bg:   var(--surface-hover);

  --radius: 8px;
  --radius-card: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-pop: 0 8px 24px rgba(16, 24, 40, .16);
  --shadow-modal: 0 12px 40px rgba(16, 24, 40, .22);
  --appbar-h: 64px;   /* laisse respirer le logo VBK (120px de large) */
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

h1 { font-size: 20px; margin: 0; font-weight: 600; }
h2 { font-size: 15px; margin: 0; font-weight: 600; }
a { color: var(--accent); }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.txt-red { color: var(--red); }
.spacer { flex: 1; }
.sep { color: var(--border); }
.print-only { display: none; }

/* ---------------------------------------------------------------
   Boutons & champs
   --------------------------------------------------------------- */
.btn {
  font: inherit;
  font-weight: 500;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  min-height: 36px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); }
.btn:disabled { opacity: .55; cursor: default; }
/* Bouton primaire = rouge de marque (identité), jamais le rouge d'alerte */
.btn-primary { background: var(--vbk-red); border-color: var(--vbk-red); color: var(--vbk-white); }
.btn-primary:hover { background: var(--vbk-red-dark); border-color: var(--vbk-red-dark); }
/* Variante contour : utilisée quand un bouton de marque côtoie une zone d'alerte */
.btn-outline { background: var(--surface); border-color: var(--vbk-red); color: var(--vbk-red); }
.btn-outline:hover { background: var(--surface-hover); border-color: var(--vbk-red-dark); color: var(--vbk-red-dark); }
.btn-danger { background: var(--red); border-color: var(--red); color: var(--vbk-white); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--grey-bg); border-color: transparent; color: var(--text); }
.btn-sm { padding: 5px 9px; min-height: 30px; font-size: 13px; }
.btn-icon { padding: 4px 10px; min-height: 32px; font-size: 16px; line-height: 1; }
.btn-block { width: 100%; }

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 9px;
  min-height: 36px;
  max-width: 100%;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
textarea { min-height: 54px; resize: vertical; }
label { font-size: 12px; color: var(--muted); font-weight: 500; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.check input { min-height: 0; width: 16px; height: 16px; }

.link-btn {
  background: none; border: none; padding: 0; font: inherit; font-weight: 500;
  color: var(--accent); cursor: pointer; text-align: left;
}
.link-btn:hover { text-decoration: underline; }

.icon-btn {
  background: none; border: 1px solid transparent; border-radius: 6px;
  cursor: pointer; font-size: 14px; padding: 6px 8px; color: var(--muted); min-height: 32px;
}
.icon-btn:hover { background: var(--grey-bg); color: var(--text); }
.icon-btn.danger:hover { background: var(--red-bg); color: var(--red); }

/* ---------------------------------------------------------------
   Écran de connexion
   --------------------------------------------------------------- */
.login-screen {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 20px;
}
.login-card {
  width: 100%; max-width: 360px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
}
.login-logo { display: block; width: 180px; max-width: 100%; height: auto; margin: 0 auto 4px; }
.login-sub { margin: 0 0 14px; color: var(--muted); font-size: 13px; text-align: center; }
.login-card label { margin-top: 10px; }
.login-card .btn { margin-top: 18px; }
.login-error {
  margin: 12px 0 0; padding: 8px 10px; font-size: 13px;
  background: var(--red-bg); color: var(--red); border-radius: var(--radius);
}

/* ---------------------------------------------------------------
   Structure de l'application
   --------------------------------------------------------------- */
.app { min-height: 100vh; }

/* Bandeau supérieur — logo VBK blanc + liseré rouge de marque : la signature visuelle */
.appbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--appbar-h); z-index: 30;
  background: var(--vbk-black); color: var(--vbk-white);
  border-bottom: 3px solid var(--vbk-red);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; gap: 12px;
}
.appbar-logo {
  display: flex; align-items: center; background: none; border: none;
  padding: 0; cursor: pointer; flex: 0 0 auto;
}
.appbar-logo img { width: 120px; height: auto; display: block; }
.appbar-center { display: flex; justify-content: center; flex: 1 1 auto; min-width: 0; }
.appbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 0 auto; }
.appbar .user { display: flex; align-items: baseline; gap: 7px; min-width: 0; padding: 0; }
.appbar .user-name { font-weight: 600; font-size: 13px; color: var(--vbk-white); }
.appbar .user-role { font-size: 12px; color: var(--on-dark-soft); }
.appbar-btn {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--on-dark);
  background: var(--on-dark-fill); border: 1px solid var(--on-dark-line);
  border-radius: var(--radius); padding: 6px 10px; min-height: 32px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.appbar-btn:hover { background: var(--on-dark-fill-2); color: var(--vbk-white); }
.appbar-btn.round { width: 32px; padding: 0; text-align: center; font-weight: 700; }

/* Sélecteur de mois dans le bandeau */
.appbar .month-picker .btn-icon,
.appbar .month-picker .btn {
  background: var(--on-dark-fill); border-color: var(--on-dark-line); color: var(--on-dark);
}
.appbar .month-picker .btn:hover { background: var(--on-dark-fill-2); color: var(--vbk-white); }
.appbar .month-label { color: var(--vbk-white); }

.sidebar {
  position: fixed; top: var(--appbar-h); left: 0; bottom: 0; width: 220px;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 12px; z-index: 20;
  overflow-y: auto; overscroll-behavior: contain;
}
.sidebar .nav { flex-shrink: 0; }
.sidebar-foot { flex-shrink: 0; }
.side-note { font-size: 11px; color: var(--muted); line-height: 1.4; margin: 0; padding: 0 8px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  font: inherit; font-weight: 500; text-align: left;
  background: none; border: none; border-radius: var(--radius);
  padding: 9px 10px; color: var(--text); cursor: pointer;
}
.nav-item .ico { color: var(--muted); font-size: 13px; }
.nav-item:hover { background: var(--grey-bg); }
/* Onglet actif : souligné rouge de marque, 2px */
.nav-item.active {
  background: var(--surface-hover); color: var(--text); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--vbk-red);
}
.nav-item.active .ico { color: var(--vbk-red); }

.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }
.user { padding: 4px 8px 10px; }
.user-name { font-weight: 600; }
.user-role { font-size: 12px; color: var(--muted); }

.main { margin-left: 220px; padding: calc(var(--appbar-h) + 18px) 22px 40px; max-width: 1500px; }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.head-left { display: flex; align-items: center; gap: 10px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Sélecteur de mois */
.month-picker { display: flex; align-items: center; gap: 6px; }
.month-label { font-weight: 600; min-width: 130px; text-align: center; }
.month-picker.compact .month-label { min-width: 110px; font-size: 13px; }

/* Barre d'outils de filtres */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar select, .toolbar input { min-height: 34px; font-size: 13px; }
.search { flex: 1 1 260px; min-width: 180px; }

/* ---------------------------------------------------------------
   Cartes
   --------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.card.pad { padding: 12px 14px; }
.card-head { padding: 12px 14px; border-bottom: 1px solid var(--border); }

.kpi-grid {
  display: grid; gap: 10px; margin-bottom: 14px;
  grid-template-columns: repeat(4, 1fr);
}
.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }
.kpi { padding: 12px 14px; margin: 0; min-width: 0; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi-value {
  font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums;
  margin-top: 2px; letter-spacing: -.4px; line-height: 1.2;
}
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
/* La variation reste neutre : l'orange et le vert sont réservés aux statuts fonctionnels */
.kpi-sub.up, .kpi-sub.down { color: var(--text-muted); }

/* « Reste à payer » : carte plus large, liseré d'alerte dès qu'il reste quelque chose */
.kpi-hero { grid-column: span 2; background: var(--surface-alt); border-color: var(--border-strong); }
.kpi-hero .kpi-value { font-size: 32px; font-weight: 700; }
.kpi-hero.is-alert { border-left: 4px solid var(--danger); }
#card-late { grid-column: span 2; }
.kpi.clickable { cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.kpi.clickable:hover { border-color: var(--border-strong); }
.kpi.is-alert .kpi-value { color: var(--red); }

/* Avancement du mois */
.progress-card { display: flex; flex-direction: column; gap: 10px; }
.progress-row { display: flex; align-items: center; gap: 14px; }
.progress-text { font-size: 13px; color: var(--muted); flex: 0 0 auto; min-width: 250px; }
.progress-track { flex: 1; height: 6px; background: var(--grey-bg); border-radius: 3px; overflow: hidden; }
/* Barre d'avancement neutre : le rouge de marque ne doit pas voisiner le rouge d'alerte */
.progress-bar { height: 100%; width: 0; background: var(--vbk-graphite); border-radius: 3px; transition: width .2s ease; }
.progress-bar.full { background: var(--ok); }

/* Blocs d'alerte */
.alerts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.alert {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font: inherit; text-align: left; cursor: pointer;
  background: var(--orange-bg); color: var(--warn);
  border: 1px solid var(--border-warn); border-radius: 10px; padding: 12px 14px; min-height: 52px;
}
.alert:hover { border-color: var(--border-warn); }
.alert.ok { background: var(--green-bg); color: var(--ok); border-color: var(--border-ok); }
.alert-text { font-weight: 500; }
.alert-go { font-size: 12px; opacity: .75; white-space: nowrap; }

/* ---------------------------------------------------------------
   Tableaux
   --------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--muted);
  padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--surface); position: sticky; top: 0; z-index: 1;
}
.table th[data-sort] { cursor: pointer; user-select: none; }
.table th[data-sort]:hover { color: var(--text); }
/* En-tête trié : neutre et gras. Le rouge de marque n'entre pas dans le tableau,
   qui contient déjà le rouge d'alerte des retards. */
.table th.sorted { color: var(--text); font-weight: 700; }
.table th.sorted[data-dir="asc"]::after  { content: " ▲"; font-size: 9px; }
.table th.sorted[data-dir="desc"]::after { content: " ▼"; font-size: 9px; }
.table td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:hover { background: var(--row-hover); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Le tableau des factures porte 13 colonnes : on resserre l'espacement
   horizontal pour qu'il tienne sans défilement sur un écran de 1440. */
.table-invoices th, .table-invoices td { padding-left: 8px; padding-right: 8px; }

.cell-supplier, .td-supplier { font-weight: 500; }
.td-number, .td-smartref { font-variant-numeric: tabular-nums; }
.td-smartref { font-size: 12px; }
.ref-chip {
  display: inline-block; font-size: 11px; padding: 1px 6px; margin: 1px 3px 1px 0;
  background: var(--surface-hover); border: 1px solid var(--border); border-radius: 10px;
}
.iban-alert .iban-body { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.iban-compare { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; }
.iban-compare code { background: var(--surface); padding: 1px 6px; border-radius: 4px; }
.iban-warn { margin: 0; font-size: 12px; line-height: 1.5; }
.iban-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 2px; }
.pill.locked { cursor: default; opacity: 1; }
.mob-meta { display: none; }
.txt-orange { color: var(--orange); }

/* Repères de ligne : barre verticale rouge (en retard) ou orange (échéance ≤ 5 jours).
   Les trois sélecteurs ont la même spécificité, l'ordre suffit à les départager. */
.table-invoices tbody tr td:first-child { box-shadow: inset 3px 0 0 transparent; }
.table-invoices tbody tr.row-late td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.table-invoices tbody tr.row-soon td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.row-late  { background: var(--row-danger); }
.row-late:hover { background: var(--row-danger-hover); }
.row-checked { background: var(--row-select); }
.row-checked:hover { background: var(--row-select-hover); }
.row-paid-flash { animation: paidflash .6s ease-out; }
@keyframes paidflash { from { background: var(--row-flash); } to { background: transparent; } }

/* Case à cocher + coche « facture complète » */
.th-check, .td-check { width: 46px; white-space: nowrap; }
.row-check { width: 16px; height: 16px; vertical-align: middle; cursor: pointer; accent-color: var(--accent); }
.done-mark { color: var(--green); margin-left: 2px; vertical-align: middle; }
.done-mark .ico-svg { width: 14px; height: 14px; }

/* Boutons d'action : discrets, révélés au survol de la ligne */
.td-actions { text-align: right; white-space: nowrap; }
.td-actions .icon-btn { opacity: 0; transition: opacity .15s ease, background .15s ease; }
.table-invoices tbody tr:hover .td-actions .icon-btn,
.td-actions .icon-btn:focus-visible { opacity: 1; }
.icon-btn .ico-svg { width: 16px; height: 16px; display: block; }

.row-flash { animation: flash 2.2s ease-out; }
@keyframes flash { from { background: var(--row-highlight); } to { background: transparent; } }
.actions { white-space: nowrap; text-align: right; }
.tag {
  display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 10px;
  background: var(--grey-bg); color: var(--muted); margin-left: 6px;
}

.table-foot {
  position: sticky; bottom: 0; z-index: 3;
  display: flex; justify-content: flex-end; gap: 22px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted);
  background: var(--surface); border-radius: 0 0 var(--radius-card) var(--radius-card);
}
.table-foot strong { color: var(--text); font-variant-numeric: tabular-nums; }
.table-foot .big { font-size: 15px; }

/* Pastilles Smart / WinAuditor / Stock (zone tactile 44px de large) */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 44px; min-height: 34px; padding: 0 8px;
  border-radius: 6px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 12px; cursor: pointer; line-height: 1;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.pill .ico-svg { width: 15px; height: 15px; flex: none; }
.pill.wide { min-width: 74px; }
.pill.on  { background: var(--green-bg); color: var(--green); border-color: var(--border-ok); }
.pill.off { background: var(--skeleton-b); color: var(--grey); border: 1px dashed var(--border-dashed); }
.pill.on:hover  { background: var(--ok-soft-hover); }
.pill.off:hover { background: var(--surface-hover); border-color: var(--green); color: var(--green); }
.pill-txt { font-variant-numeric: tabular-nums; }

/* Bouton « Marquer payé » — le geste principal du gérant */
.btn-pay {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--orange-bg); color: var(--orange);
  border: 1px solid var(--border-warn); border-radius: var(--radius);
  padding: 0 10px; min-height: 34px; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn-pay .ico-svg { width: 15px; height: 15px; transition: transform .15s ease; }
.btn-pay:hover { background: var(--green-bg); border-color: var(--border-ok); color: var(--green); }
.btn-pay:hover .ico-svg { transform: scale(1.18); }
.btn-pay:disabled { opacity: .6; cursor: default; }

/* Pastille verte « Payé le … » */
.paid-badge {
  display: inline-flex; align-items: stretch;
  background: var(--green-bg); color: var(--green);
  border: 1px solid var(--border-ok); border-radius: var(--radius); overflow: hidden;
  font-size: 12px; font-weight: 600;
}
.paid-badge .ico-svg { width: 15px; height: 15px; }
.paid-badge.static { padding: 0 10px; min-height: 34px; align-items: center; gap: 6px; }
.paid-main, .paid-date {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-weight: 600; color: inherit; background: none;
  border: none; cursor: pointer; padding: 0 8px; min-height: 34px;
  transition: background .15s ease;
}
.paid-date { border-left: 1px solid var(--border-ok); font-variant-numeric: tabular-nums; }
.paid-main:hover, .paid-date:hover { background: var(--ok-soft-hover); }

/* Statut secondaire (litige, acompte) */
.status-select { display: none; }
.st-green  { background: var(--green-bg);  color: var(--green);  border-color: var(--border-ok); }
.st-orange { background: var(--orange-bg); color: var(--orange); border-color: var(--border-warn); }
.st-red    { background: var(--red-bg);    color: var(--red);    border-color: var(--border-danger); }
.st-grey   { background: var(--grey-bg);   color: var(--muted);  border-color: var(--border); }
.st-blue   { background: var(--info-soft); color: var(--info);   border-color: var(--border-info); }

.badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 3px 8px; border-radius: 10px; border: 1px solid transparent;
}

/* États vide / chargement */
.empty {
  padding: 34px 10px; text-align: center; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty p { margin: 0; font-size: 14px; }
.empty-art { width: 110px; height: 74px; color: var(--art); }
.skeleton {
  display: block; height: 12px; border-radius: 4px;
  background: linear-gradient(90deg, var(--skeleton-a) 25%, var(--skeleton-b) 50%, var(--skeleton-a) 75%);
  background-size: 300% 100%; animation: sk 1.2s infinite linear;
}
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------------------------------------------------------------
   Fiche fournisseur
   --------------------------------------------------------------- */
.contact-line { font-size: 13px; }
.notes-line { font-size: 13px; margin-top: 6px; white-space: pre-wrap; }
.sd-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.segmented button {
  font: inherit; font-size: 13px; background: var(--surface); border: none;
  padding: 7px 12px; cursor: pointer; color: var(--muted); min-height: 34px;
}
.segmented button.active { background: var(--primary); color: var(--vbk-white); }

/* ---------------------------------------------------------------
   Menu déroulant (export)
   --------------------------------------------------------------- */
.dropdown { position: relative; }
.dd-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 6px 20px rgba(26,31,38,.12);
  min-width: 240px; padding: 4px; display: flex; flex-direction: column;
}
.dd-menu button {
  font: inherit; font-size: 13px; text-align: left; background: none; border: none;
  padding: 9px 10px; border-radius: 6px; cursor: pointer; color: var(--text);
}
.dd-menu button:hover { background: var(--grey-bg); }

/* ---------------------------------------------------------------
   Modales
   --------------------------------------------------------------- */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px; overflow-y: auto; }
.modal-top { z-index: 80; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(17, 22, 29, .42); }
.modal-box {
  position: relative; width: 100%; max-width: 760px;
  background: var(--surface); border-radius: 12px; box-shadow: 0 12px 40px rgba(17,22,29,.22);
  margin: auto 0;
}
.modal-box.narrow { max-width: 520px; }
/* La fenêtre d'aide (et toute .modal-card) : un vrai fond, sinon le texte
   se superpose à l'écran du dessous (constaté sur iPhone, 23/11/2026). */
.modal-card {
  position: relative; z-index: 1; width: 100%; max-width: 760px;
  background: var(--surface); color: var(--text); border-radius: 12px;
  box-shadow: var(--shadow-modal); margin: auto 0;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.modal-body { padding: 16px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.col-2 { grid-column: 1 / -1; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline.wrap { flex-wrap: wrap; }
.inline > input { flex: 1; min-width: 0; }
.sub { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.preview {
  background: var(--grey-bg); border-radius: var(--radius); padding: 8px 10px;
  font-weight: 600; font-variant-numeric: tabular-nums; min-height: 36px;
}
.hint { font-size: 12px; margin: 2px 0 0; }
.hint.warn { color: var(--orange); }
.payment-block { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 0; }
.payment-block legend { font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 4px; }
.dup-warning {
  background: var(--orange-bg); color: var(--warn); border: 1px solid var(--border-warn);
  border-radius: var(--radius); padding: 10px 12px; margin: 0; font-size: 13px;
}
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 4px; }

/* ---------------------------------------------------------------
   Toasts
   --------------------------------------------------------------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
.toast {
  background: var(--toast-bg); color: var(--vbk-white); border-radius: var(--radius);
  padding: 10px 13px; font-size: 13px; box-shadow: 0 6px 20px rgba(17,22,29,.24);
}
.toast { display: flex; align-items: center; gap: 12px; }
.toast-msg { flex: 1; }
.toast-error { background: var(--red); }
.toast-action {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--toast-link);
  background: none; border: none; cursor: pointer; padding: 2px 0; white-space: nowrap;
}
.toast-action:hover { color: var(--vbk-white); text-decoration: underline; }

/* ---------------------------------------------------------------
   Popover (confirmation de paiement, date, menu ⋯)
   --------------------------------------------------------------- */
.popover {
  position: absolute; z-index: 85; min-width: 190px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(16,24,40,.16); padding: 10px;
}
.popover.pop-right { min-width: 210px; padding: 4px; }
.pop-msg { margin: 0 0 8px; font-size: 13px; color: var(--text); font-weight: 500; }
.popover input[type="date"] { width: 100%; }
.pop-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.pop-menu { display: flex; flex-direction: column; }
.pop-menu hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.pop-menu button {
  display: flex; align-items: center; gap: 9px;
  font: inherit; font-size: 13px; text-align: left; color: var(--text);
  background: none; border: none; border-radius: 6px; padding: 8px 9px; cursor: pointer;
  transition: background .15s ease;
}
.pop-menu button:hover { background: var(--grey-bg); }
.pop-menu button.danger { color: var(--red); }
.pop-menu button.danger:hover { background: var(--red-bg); }
.pop-menu .ico-svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.pop-menu button.danger .ico-svg { color: var(--red); }

/* ---------------------------------------------------------------
   File « À contrôler » — document à gauche, champs à droite
   --------------------------------------------------------------- */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px;
  font-size: 11px; font-weight: 700; line-height: 1;
  background: var(--danger); color: var(--vbk-white); border-radius: 10px;
}

/* Mémoire fournisseur : champs de nature stable */
.memo-block { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 0;
  display: flex; flex-direction: column; gap: 10px; }
.memo-block legend { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.memo-row { display: flex; flex-direction: column; gap: 3px; }
.memo-row.is-diff input { border-color: var(--warn); background: var(--warn-soft); }
.memo-read { font-size: 11px; color: var(--muted); }
.memo-read code { background: var(--surface-hover); padding: 1px 5px; border-radius: 4px; }
.memo-check { font-size: 12px; color: var(--vbk-red); font-weight: 500; }
.memo-hint { margin: 4px 0 0; font-size: 11px; color: var(--muted); }

.memo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 16px; }
@media (max-width: 900px) { .memo-grid { grid-template-columns: 1fr; } }

/* Escompte */
.discount-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--ok-soft); border: 1px solid var(--border-ok); color: var(--ok);
  border-radius: var(--radius); padding: 9px 12px; font-size: 13px; margin-bottom: 12px;
}
.discount-banner strong { font-variant-numeric: tabular-nums; }
.pill-discount {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px;
  background: var(--ok-soft); color: var(--ok); border: 1px solid var(--border-ok);
}
.pay-choice { display: flex; flex-direction: column; gap: 8px; }
.pay-choice .pop-msg { margin-bottom: 2px; }
.pay-option { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pay-option strong { font-variant-numeric: tabular-nums; }

/* Validation d'une fiche fournisseur pré-remplie */
.validate-fiche { border-left: 3px solid var(--warn); display: flex; flex-direction: column; gap: 12px; }
.vf-head { display: flex; flex-direction: column; gap: 2px; }
.vf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.vf-row { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vf-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.vf-read { font-size: 11px; color: var(--muted); }
.vf-read code { background: var(--surface-hover); padding: 1px 5px; border-radius: 4px; }
.vf-manual-title { margin: 4px 0 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.vf-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Administration */
.role-select { font-size: 12px; min-height: 30px; max-width: 130px; }
.adm-nom { font-weight: 600; min-width: 0; width: 100%; max-width: 240px; }
.adm-mdp { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.adm-mdp input { width: 170px; max-width: 100%; }
.admin-link {
  margin-top: 12px; padding: 12px; border-radius: var(--radius);
  background: var(--warn-soft); border: 1px solid var(--border-warn);
  display: flex; flex-direction: column; gap: 6px;
}
.admin-link input { font-family: inherit; font-size: 12px; }
.admin-link p { margin: 0; }

/* Recherche globale */
.search-box { max-width: 620px; padding: 0; overflow: hidden; }
.search-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.search-icon { font-size: 18px; color: var(--muted); }
.search-bar input { flex: 1; border: none; font-size: 16px; padding: 6px 0; }
.search-bar input:focus { outline: none; }
.search-results { max-height: 60vh; overflow-y: auto; }
.search-hint { padding: 18px 16px; color: var(--muted); font-size: 13px; }
.search-hint p { margin: 0 0 6px; }
.search-group { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.search-group:last-child { border-bottom: none; }
.search-group h3 {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 4px 14px 6px; margin: 0;
}
.search-hit {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  text-align: left; font: inherit; background: none; border: none;
  padding: 8px 14px; cursor: pointer; transition: background .15s ease;
}
.search-hit:hover, .search-hit:focus-visible { background: var(--surface-hover); }
.hit-main { font-weight: 600; font-size: 14px; }
.hit-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

/* Réglages : quarantaine et liste blanche */
.q-list { display: flex; flex-direction: column; }
.q-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
}
.q-row:last-child { border-bottom: none; }
.q-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.q-email { font-weight: 600; font-size: 14px; word-break: break-all; }
.q-meta { font-size: 12px; color: var(--muted); }
.q-subject { font-size: 12px; color: var(--muted); font-style: italic;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.q-actions .check { font-size: 12px; color: var(--muted); white-space: nowrap; }
.purge-preview { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.purge-preview.danger { color: var(--danger); font-weight: 600; }

.catchup { display: flex; flex-direction: column; gap: 8px; }
.catchup-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.catchup-detail { font-size: 12px; color: var(--muted); }
.smart-field input { font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.smart-field { border-left: 3px solid var(--vbk-red); padding-left: 10px; }
.field-hint.danger { color: var(--danger); font-weight: 600; }

.review-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.review-list {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow);
  overflow: hidden; max-height: calc(100vh - var(--appbar-h) - 120px); overflow-y: auto;
}
.review-item {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px;
  align-items: center;
  width: 100%; text-align: left; font: inherit; cursor: pointer;
  background: none; border: none; border-bottom: 1px solid var(--line-soft);
  padding: 10px 12px; transition: background .15s ease;
}
.review-item:hover { background: var(--surface-hover); }
.review-item.active { background: var(--row-select); box-shadow: inset 3px 0 0 var(--vbk-red); }
.ri-supplier { font-weight: 600; font-size: 13px; }
.ri-amount { grid-row: 1 / 3; grid-column: 2; align-self: center; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ri-num { grid-column: 1; font-size: 12px; color: var(--muted); }
.ri-flag {
  grid-column: 1 / -1; font-size: 11px; font-weight: 600; color: var(--warn);
  background: var(--warn-soft); border-radius: 4px; padding: 1px 6px; justify-self: start;
}

.review-detail {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 14px; min-width: 0;
}
.review-banner {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  background: var(--warn-soft); color: var(--warn); border: 1px solid var(--border-warn);
  border-radius: var(--radius); padding: 9px 12px; font-size: 13px;
}
.review-banner.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--border-danger); }
/* Avertissement, pas alerte : il demande une vérification, pas un arrêt.
   Le rouge est réservé à ce qui bloque — l'IBAN, la TVA incohérente. */
.review-banner.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--border-warn); }
.review-banner .ico-svg { width: 16px; height: 16px; flex: none; }

.review-split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
.review-doc { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.review-doc-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-bottom: 1px solid var(--border); background: var(--surface-alt);
}
.review-viewer { height: 620px; background: var(--surface-sunken); }
.review-viewer iframe, .review-viewer object { width: 100%; height: 100%; border: none; display: block; }
.review-viewer object .empty { height: 100%; justify-content: center; }
.xml-view { margin: 0; padding: 12px; font-size: 11px; line-height: 1.5; height: 100%; overflow: auto; white-space: pre-wrap; }

.review-fields { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.review-fields .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-hint.warn { color: var(--warn); }

/* Le taux de TVA : champ visible, jamais déduit en silence */
.vat-block {
  border: 1px solid var(--border); border-left: 3px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; margin: 0;
}
.vat-block legend { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.vat-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vat-row select { min-width: 96px; }
.vat-row input { width: 88px; }
.vat-computed { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); margin-left: auto; }
.vat-computed strong { color: var(--text); font-variant-numeric: tabular-nums; }
.vat-read { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.vat-read strong { color: var(--text); font-variant-numeric: tabular-nums; }
.vat-verdict { font-size: 12px; margin: 6px 0 0; line-height: 1.45; }

.vat-block.is-ok     { border-left-color: var(--ok); }
.vat-block.is-ok     .vat-verdict { color: var(--ok); }
.vat-block.is-warn   { border-left-color: var(--warn); background: var(--warn-soft); }
.vat-block.is-warn   .vat-verdict { color: var(--warn); font-weight: 500; }
.vat-block.is-danger { border-left-color: var(--danger); background: var(--danger-soft); }
.vat-block.is-danger .vat-verdict { color: var(--danger); font-weight: 600; }
.vat-block.is-danger select, .vat-block.is-danger input { border-color: var(--danger); }

.uncertain-box {
  background: var(--warn-soft); border: 1px solid var(--border-warn);
  border-radius: var(--radius); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.uncertain-box p { margin: 0 0 2px; font-size: 12px; color: var(--warn); font-weight: 500; }

.review-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.block-reason { margin: 0; font-size: 12px; color: var(--danger); font-weight: 500; }

@media (max-width: 1180px) {
  .review-split { grid-template-columns: 1fr; }
  .review-viewer { height: 420px; }
}
@media (max-width: 900px) {
  .review-layout { grid-template-columns: 1fr; }
  .review-list { max-height: 240px; }
  .review-fields .grid2 { grid-template-columns: 1fr; }
  .vf-grid { grid-template-columns: 1fr; }
  .review-viewer { height: 320px; }
  .nav-badge { margin-left: 6px; }
}

/* ---------------------------------------------------------------
   Visite guidée (premier lancement)
   --------------------------------------------------------------- */
.tour-overlay { position: fixed; inset: 0; z-index: 95; }
.tour-hole {
  position: fixed; border-radius: var(--radius-card); pointer-events: none;
  box-shadow: 0 0 0 9999px var(--overlay);
  outline: 2px solid var(--vbk-red); outline-offset: 0;
  transition: top .2s ease, left .2s ease, width .2s ease, height .2s ease;
}
.tour-bubble {
  position: fixed; width: 300px; max-width: calc(100vw - 20px);
  background: var(--surface); border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal); padding: 14px; z-index: 96;
}
.tour-step { font-size: 11px; font-weight: 600; color: var(--vbk-red); text-transform: uppercase; letter-spacing: .04em; }
.tour-title { font-size: 15px; font-weight: 600; margin: 3px 0 6px; }
.tour-text { font-size: 13px; color: var(--text); margin: 0 0 14px; line-height: 1.5; }
.tour-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---------------------------------------------------------------
   Barre d'actions en lot (fin de mois)
   --------------------------------------------------------------- */
.bulk-bar {
  position: fixed; left: 220px; right: 0; bottom: 0; z-index: 45;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: var(--toast-bg); color: var(--vbk-white); padding: 10px 18px;
  box-shadow: 0 -2px 12px rgba(16,24,40,.18);
}
.bulk-summary { font-weight: 600; font-variant-numeric: tabular-nums; }
.bulk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bulk-actions .btn { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.2); color: var(--vbk-white); }
.bulk-actions .btn:hover { background: rgba(255,255,255,.2); }
.bulk-actions .btn-primary { background: var(--green); border-color: var(--green); }
.bulk-actions .btn-primary:hover { background: var(--ok-dark); }
.bulk-actions .btn-ghost { background: none; border-color: transparent; color: rgba(255,255,255,.7); }

/* ---------------------------------------------------------------
   Bouton flottant (mobile) + aide clavier
   --------------------------------------------------------------- */
.fab { display: none; }
.shortcuts { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.shortcuts li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.shortcuts span { color: var(--muted); }
kbd {
  display: inline-block; min-width: 24px; text-align: center;
  font-family: inherit; font-size: 12px; font-weight: 600;
  background: var(--grey-bg); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; padding: 2px 6px;
}

/* Infobulles d'aide contextuelle (« ? » à côté des libellés) */
.help-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 5px; vertical-align: middle;
  font-size: 11px; font-weight: 700; line-height: 1;
  color: var(--muted); background: var(--surface-hover);
  border: 1px solid var(--border); border-radius: 50%;
  cursor: help; padding: 0;
}
.help-dot:hover { color: var(--vbk-red); border-color: var(--vbk-red); }
.field-hint { font-size: 11px; color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------
   Mode d'emploi (guide.html)
   --------------------------------------------------------------- */
.guide-appbar-title { font-size: 14px; font-weight: 500; color: var(--on-dark); }
.guide {
  display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 40px;
  max-width: 1080px; margin: 0 auto;
  padding: calc(var(--appbar-h) + 30px) 20px 70px;
}
.guide-toc { position: sticky; top: calc(var(--appbar-h) + 24px); align-self: start; }
.guide-toc-title {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px; padding-left: 10px;
}
.guide-toc a {
  display: block; padding: 6px 10px; font-size: 13px; line-height: 1.35;
  color: var(--muted); text-decoration: none; border-left: 2px solid var(--border);
  transition: color .15s ease, border-color .15s ease;
}
.guide-toc a:hover { color: var(--vbk-red); border-left-color: var(--vbk-red); }

.guide-content { max-width: 720px; }
.guide-title { font-size: 26px; font-weight: 700; margin: 0 0 6px; letter-spacing: -.4px; }
.guide-lead { font-size: 15px; color: var(--muted); margin: 0 0 34px; }
.guide-content section {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 18px;
}
.guide-content h2 {
  font-size: 19px; font-weight: 600; margin: 0 0 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.guide-content p { font-size: 14px; line-height: 1.65; margin: 0 0 12px; }
.guide-content ul, .guide-content ol { font-size: 14px; line-height: 1.65; padding-left: 20px; margin: 0 0 12px; }
.guide-content li { margin-bottom: 6px; }
.guide-content code {
  font-size: 13px; background: var(--surface-hover); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px;
}
.guide-note {
  background: var(--surface-hover); border-left: 3px solid var(--vbk-red);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 10px 14px; font-size: 13px !important;
}
.faq-q { font-weight: 600; margin-bottom: 4px !important; }
.guide-highlight { border-color: var(--border-strong); border-left: 4px solid var(--vbk-red); }

.guide-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0 0 14px; }
.guide-table th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--muted);
  border-bottom: 1px solid var(--border); padding: 8px 10px; vertical-align: top;
}
.guide-table td { border-bottom: 1px solid var(--line-soft); padding: 9px 10px; vertical-align: top; line-height: 1.55; }
.guide-table tr:last-child td { border-bottom: none; }
.guide-colors td:first-child { white-space: nowrap; font-weight: 600; }
.swatch {
  display: inline-block; width: 13px; height: 13px; border-radius: 3px;
  margin-right: 6px; vertical-align: -1px; border: 1px solid var(--border);
}
.sw-ok { background: var(--ok); border-color: var(--ok); }
.sw-warn { background: var(--warn); border-color: var(--warn); }
.sw-danger { background: var(--danger); border-color: var(--danger); }
.sw-todo { background: var(--surface-hover); border: 1px dashed var(--border-dashed); }

.guide-foot { display: flex; gap: 10px; align-items: center; margin-top: 24px; }
.guide-foot .btn { text-decoration: none; display: inline-flex; align-items: center; }
.guide-print-head { display: none; }

@media (max-width: 900px) {
  .guide { grid-template-columns: 1fr; gap: 18px; padding: calc(var(--appbar-h) + 16px) 12px 40px; }
  .guide-toc { position: static; }
  .guide-appbar-title { display: none; }
  .guide-content section { padding: 16px; }
}

/* ---------------------------------------------------------------
   Barre d'onglets mobile
   --------------------------------------------------------------- */
.tabbar { display: none; }

/* ---------------------------------------------------------------
   Responsive — tablette
   --------------------------------------------------------------- */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .progress-text { min-width: 0; }
  .progress-row { flex-wrap: wrap; }
}

@media (max-width: 900px) {
  .q-row { flex-wrap: wrap; }
  .q-row .btn { width: 100%; }

  /* Le bandeau passe sur deux rangées : logo + compte, puis le sélecteur de mois */
  :root { --appbar-h: 100px; }

  .sidebar { display: none; }
  .main { margin-left: 0; padding: calc(var(--appbar-h) + 12px) 12px 96px; }

  .appbar { padding: 8px 12px; flex-wrap: wrap; align-content: center; row-gap: 6px; }
  .appbar-logo img { width: 96px; }
  .appbar-center { order: 3; flex: 0 0 100%; }
  .appbar .month-picker { width: 100%; justify-content: center; }
  .appbar .user-role { display: none; }
  .appbar-btn { font-size: 0; padding: 6px 9px; }
  .appbar-btn#btn-help { font-size: 13px; }
  .appbar-btn#btn-logout::after { content: "Quitter"; font-size: 13px; }

  .bulk-bar { left: 0; bottom: 56px; padding: 10px 12px; }
  .bulk-summary { font-size: 13px; }
  .bulk-actions { width: 100%; }
  .bulk-actions .btn { flex: 1 1 auto; min-height: 40px; }

  /* Bouton flottant « + » */
  .fab {
    display: flex; align-items: center; justify-content: center;
    position: fixed; right: 16px; bottom: 70px; z-index: 46;
    width: 52px; height: 52px; border-radius: 26px;
    background: var(--vbk-red); color: var(--vbk-white); border: none;
    font-size: 28px; line-height: 1; cursor: pointer;
    box-shadow: 0 4px 14px rgba(16,24,40,.24);
  }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font: inherit; font-size: 11px; font-weight: 500; background: none; border: none;
    padding: 9px 4px; color: var(--muted); cursor: pointer; min-height: 52px;
  }
  .tabbar-item .ico { font-size: 15px; }
  .tabbar-item.active { color: var(--text); font-weight: 600; box-shadow: inset 0 2px 0 var(--vbk-red); }
  .tabbar-item.active .ico { color: var(--vbk-red); }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .kpi-value { font-size: 22px; }
  .kpi-hero .kpi-value { font-size: 26px; }
  .alerts { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .month-label { min-width: 0; flex: 1; }
  .search { flex: 1 1 100%; }
  .toolbar select { flex: 1 1 46%; min-width: 0; }
  .page-head h1 { font-size: 18px; }
  .table-wrap { overflow-x: visible; }

  /* --- Tableaux génériques : une carte par ligne, libellés à gauche --- */
  .table { font-size: 14px; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    border: 1px solid var(--border); border-radius: var(--radius-card);
    margin: 0 0 10px; padding: 6px 12px; background: var(--surface);
  }
  .table tbody tr:hover { background: var(--surface); }
  .table td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    border: none; border-bottom: 1px solid var(--line-soft); padding: 7px 0; min-height: 40px;
  }
  .table tr td:last-child { border-bottom: none; }
  .table td::before {
    content: attr(data-label);
    font-size: 12px; font-weight: 600; color: var(--muted); flex: 0 0 auto;
  }
  .table td.num { text-align: right; }
  .table .empty-row td, .table .skeleton-row td { display: block; }
  .table .empty-row td::before, .table .skeleton-row td::before { content: ""; }
  .row-overdue { background: var(--row-danger); border-color: var(--border-danger); }

  /* --- Factures : carte dédiée (fournisseur, méta, montant, pastilles, paiement) --- */
  .table-invoices tbody tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
    padding: 12px; position: relative;
  }
  /* width:auto est indispensable : la règle générique met les td à 100 %,
     ce qui empilerait verticalement tous les éléments de la carte. */
  .table-invoices tbody tr td { border: none; padding: 0; min-height: 0; width: auto; }
  .table-invoices tbody tr td::before { content: none; }
  .table-invoices tbody tr td:first-child { box-shadow: none; }
  .row-late  { border-left: 3px solid var(--red); }
  .row-soon  { border-left: 3px solid var(--orange); }
  .row-checked { border-color: var(--accent); }

  .table-invoices .td-check { order: 0; width: auto; flex: 0 0 auto; }
  .table-invoices .td-supplier { order: 1; flex: 1 1 auto; font-size: 16px; font-weight: 600; }
  .table-invoices .td-amount { order: 2; flex: 0 0 auto; margin-left: auto; font-size: 18px; font-weight: 700; }
  .table-invoices .td-number { order: 3; flex: 0 0 100%; font-size: 12px; color: var(--muted); font-weight: 500; }
  .table-invoices .mob-meta { display: inline; }
  .table-invoices .mob-meta::before { content: " · "; }
  .table-invoices .td-date, .table-invoices .td-due { display: none; }

  .table-invoices .td-smart, .table-invoices .td-win, .table-invoices .td-stock {
    order: 4; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 3px;
  }
  .table-invoices .td-smart::before, .table-invoices .td-win::before, .table-invoices .td-stock::before {
    content: attr(data-label); display: block; font-size: 11px; font-weight: 600; color: var(--muted);
  }
  .table-invoices .td-actions { order: 5; flex: 1 1 auto; text-align: right; }
  .table-invoices .td-actions .icon-btn { opacity: 1; min-height: 44px; min-width: 44px; }
  .table-invoices .td-status { order: 6; flex: 0 0 100%; }
  .table-invoices .td-status .btn-pay,
  .table-invoices .td-status .paid-badge { width: 100%; justify-content: center; font-size: 14px; }
  /* la zone tactile utile est celle des boutons, pas du conteneur */
  .table-invoices .td-status .btn-pay,
  .table-invoices .td-status .paid-main,
  .table-invoices .td-status .paid-date { min-height: 44px; }
  .table-invoices .td-status .paid-main { flex: 1; justify-content: center; }
  .table-invoices .empty-row { display: block; padding: 0; border: none; background: none; }

  /* Zone tactile confortable sur mobile */
  .pill { min-width: 56px; min-height: 44px; font-size: 13px; }
  .row-check { width: 20px; height: 20px; }
  .table-foot { justify-content: space-between; position: static; }
  .modal { padding: 0; }
  .modal-box { border-radius: 0; min-height: 100vh; }
}

@media (pointer: coarse) {
  .pill { min-height: 44px; }
}

/* ---------------------------------------------------------------
   Tablette en paysage (900–1180 px) : on conserve le tableau dense,
   mais les grilles à plusieurs colonnes se desserrent.
   --------------------------------------------------------------- */
@media (min-width: 901px) and (max-width: 1180px) {
  .sidebar { width: 190px; }
  .main { margin-left: 190px; padding-left: 16px; padding-right: 16px; }
  .bulk-bar { left: 190px; }
  .review-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .review-viewer { height: 480px; }
  .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .toolbar select { flex: 1 1 30%; }
  .guide { grid-template-columns: 190px minmax(0, 1fr); gap: 24px; }

  /* Le tableau des factures doit tenir sans défilement latéral sur un iPad :
     on resserre plutôt que de laisser l'utilisateur pousser le tableau. */
  .table-invoices { font-size: 12px; }
  .table-invoices th, .table-invoices td { padding-left: 6px; padding-right: 6px; }
  .table-invoices .pill { min-width: 36px; padding: 0 5px; gap: 3px; }
  .table-invoices .pill.wide { min-width: 62px; }
  .table-invoices .btn-pay { padding: 0 7px; font-size: 11px; gap: 4px; }
  .table-invoices .paid-main, .table-invoices .paid-date { padding: 0 6px; }
  .table-invoices .td-date, .table-invoices .td-due { white-space: nowrap; }
  .th-check, .td-check { width: 34px; }
  /* Sur tablette, l'usage est la consultation, pas l'encodage : la colonne
     Stock passe à la trappe pour que le tableau tienne sans défilement.
     Elle reste accessible dans la fiche facture et sur le tableau de bord. */
  /* Ciblage par classe et non par rang : ajouter une colonne ne doit pas
     décaler silencieusement la règle. */
  .table-invoices .td-stock, .table-invoices .th-stock,
  .table-invoices .td-smartref, .table-invoices .th-smartref,
  .table-invoices .td-refs, .table-invoices .th-refs { display: none; }
  .table-invoices .help-dot { display: none; }
  .table-invoices .td-actions .icon-btn { padding: 4px 5px; }
}

/* Le message de confirmation est écrit en textContent : sans cela ses
   retours à la ligne seraient avalés, et deux lignes qui se ressemblent
   deviendraient indistinguables au moment de supprimer. */
#confirm-message { white-space: pre-line; }

/* Validation en série, en tête de la file à contrôler */
.review-bulk {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  padding: 10px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-alt);
}

/* Boutons de rattrapage sous la barre d'avancement */
.catchup-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px;
}

/* ---------------------------------------------------------------
   Mémoire — ce qui doit rester
   --------------------------------------------------------------- */
.memo-barre { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.memo-barre .search { flex: 1 1 200px; min-width: 0; }

.memo {
  display: block; margin-bottom: 10px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.memo.epinglee { border-color: var(--border-warn); background: var(--warn-soft); }
.memo.en-edition { border-color: var(--primary); }
.memo-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.memo-titre { font-size: 15px; margin: 0; }
.memo-theme {
  padding: 1px 8px; border-radius: 999px; background: var(--surface-sunken);
  color: var(--text-muted); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .02em;
}
/* Le texte est rendu tel qu'il a été tapé : c'est une note, pas un document */
.memo-corps { font-size: 13.5px; line-height: 1.55; white-space: normal; }
.memo-pied { margin: 8px 0 0; font-size: 11.5px; color: var(--text-muted); }

.memo-form { display: flex; flex-direction: column; gap: 8px; }
.memo-form textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 13.5px; line-height: 1.55;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); resize: vertical;
}
.memo-form textarea:focus, .memo-form .search:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--row-select);
}
.memo-form-bas { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.memo-form-bas select {
  padding: 7px 9px; font-size: 13px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--text);
}

@media (max-width: 900px) { .memo-form-bas .btn { flex: 1 1 auto; } }

/* ---------------------------------------------------------------
   À faire — la liste partagée
   --------------------------------------------------------------- */
.tache-ajout { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.tache-ajout .search { width: 100%; font-size: 15px; padding: 11px 12px; }
.tache-ajout-bas { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tache-ajout-bas select, .tache-ajout-bas input[type="date"] {
  flex: 1 1 130px; min-width: 0; padding: 8px 9px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
}
.tache-ajout-bas .btn { flex: 0 0 auto; }

.taches-resume { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.taches-titre {
  margin: 16px 0 6px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted);
}
.taches { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.tache {
  border: 1px solid var(--border); border-left-width: 4px; border-radius: 10px;
  background: var(--surface); overflow: hidden;
}
.tache.haute { border-left-color: var(--warn); }
.tache.normale { border-left-color: var(--border-strong); }
.tache.basse { border-left-color: var(--border); }
.tache.retard { border-left-color: var(--danger); background: var(--row-danger); }
/* Terminée : présente, mais qui ne réclame plus rien */
.tache.close { opacity: .6; }
.tache.close .tache-titre { text-decoration: line-through; }

.tache-haut { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; }
.tache-coche {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-muted); cursor: pointer; font-size: 15px; line-height: 1;
}
.tache-coche:hover { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.tache-corps { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.tache-titre { font-size: 14px; font-weight: 600; }
.tache-detail { font-size: 12.5px; color: var(--text-muted); }
.tache-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-muted); }
.tache-prio {
  padding: 1px 7px; border-radius: 999px; background: var(--warn-soft);
  color: var(--warn); border: 1px solid var(--border-warn); font-weight: 700;
}
.tache-reports { color: var(--warn); }
.tache-annulee, .tache-faite {
  padding: 1px 7px; border-radius: 999px; background: var(--surface-sunken); font-weight: 600;
}
.tache-fil {
  flex: 0 0 auto; border: 0; background: transparent; cursor: pointer;
  font-size: 15px; padding: 2px 4px; position: relative; color: var(--text-muted);
}
.tache-n {
  position: absolute; top: -2px; right: -4px; min-width: 15px; padding: 0 3px;
  border-radius: 999px; background: var(--primary); color: var(--on-dark);
  font-size: 10px; font-weight: 700; line-height: 15px;
}

.tache-echange { padding: 0 12px 12px 52px; border-top: 1px solid var(--line-soft); }
.tache-mot { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0; font-size: 12.5px; }
.tache-mot + .tache-mot { border-top: 1px solid var(--line-soft); }
.tache-mot.auto { color: var(--text-muted); font-style: italic; }
.tache-qui { font-weight: 600; }
.tache-quand { color: var(--text-muted); font-size: 11px; }
.tache-texte { flex: 1 1 100%; }
.tache-repondre { display: flex; gap: 6px; margin: 8px 0; }
.tache-repondre .search { flex: 1 1 auto; min-width: 0; }
.tache-actions { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 900px) {
  /* Sur téléphone, l'échange reprend toute la largeur : 52px d'alinéa
     sur un écran de 375 ne laisseraient rien pour le texte. */
  .tache-echange { padding: 0 12px 12px; }
  .tache-actions .btn, .tache-ajout-bas .btn { flex: 1 1 auto; }
}

/* ---------------------------------------------------------------
   Planning — le mois en calendrier
   --------------------------------------------------------------- */
.pl-resume { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.pl-chiffre {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface);
}
.pl-chiffre strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.pl-chiffre-lbl { font-size: 12px; color: var(--text-muted); }
.pl-chiffre.alerte { border-color: var(--border-danger); background: var(--danger-soft); }
.pl-chiffre.alerte strong { color: var(--danger); }
.pl-chiffre.gain { border-color: var(--border-ok); background: var(--ok-soft); }
.pl-chiffre.gain strong { color: var(--ok); }

.pl-entetes {
  /* Une colonne étroite en tête pour le numéro de semaine, puis les sept jours */
  display: grid; grid-template-columns: 38px repeat(7, 1fr); gap: 6px;
  margin-bottom: 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
}
.pl-entetes span { padding-left: 4px; }

.pl-grille { display: grid; grid-template-columns: 38px repeat(7, 1fr); gap: 6px; }

/* Le numéro de semaine : présent, jamais concurrent des chiffres du mois */
.pl-sem {
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--surface-sunken);
  color: var(--text-muted); font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pl-sem-tete { text-align: center; }
.pl-case {
  min-height: 96px; padding: 6px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); overflow: hidden;
}
.pl-case.vide { background: transparent; border-color: transparent; }
.pl-case.charge { cursor: pointer; }
.pl-case.charge:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.pl-case.retard { border-color: var(--border-danger); background: var(--row-danger); }
.pl-case.aujourdhui { border-color: var(--primary); box-shadow: 0 0 0 2px var(--row-select); }

.pl-num { font-size: 12px; font-weight: 700; color: var(--text-muted); display: flex; gap: 5px; align-items: baseline; }
.pl-today { font-size: 10px; font-weight: 600; color: var(--vbk-red); text-transform: uppercase; }

.pl-items { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pl-item {
  display: flex; justify-content: space-between; gap: 4px;
  font-size: 11px; line-height: 1.3; padding-left: 6px;
  border-left: 2px solid var(--warn);
}
.pl-item.escompte { border-left-color: var(--ok); }
.pl-item.en-retard { border-left-color: var(--danger); }
.pl-lib { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-mt { flex: 0 0 auto; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.pl-item.escompte .pl-mt { color: var(--ok); }
.pl-plus { font-size: 10.5px; color: var(--text-muted); padding-left: 8px; }
/* Rendez-vous clients : en bleu, à part des montants */
.pl-rdv { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pl-rdv-btn {
  font: inherit; font-size: 11px; line-height: 1.3; width: 100%; text-align: left; cursor: pointer;
  background: var(--info-soft); color: var(--text); border: none; border-left: 2px solid var(--info);
  border-radius: 3px; padding: 2px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pl-rdv-btn:hover { background: var(--border-info); }
.pl-rdv-btn.finie { opacity: .6; text-decoration: line-through; }
.pl-rdv-quoi { font-weight: 700; color: var(--info); }
.pl-pastille.rdv { background: var(--info); }
.pl-total {
  margin-top: 4px; padding-top: 3px; border-top: 1px solid var(--line-soft);
  font-size: 11.5px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums;
}

.pl-legende { margin: 12px 0 0; font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pl-pastille { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.pl-pastille.echeance { background: var(--warn); }
.pl-pastille.escompte { background: var(--ok); }
.pl-pastille.en-retard { background: var(--danger); }

@media (max-width: 900px) {
  .pl-resume { grid-template-columns: 1fr; }
  /* Sur téléphone le mois se lit en liste : une colonne de numéros de
     semaine n'aurait plus de lignes à numéroter. */
  .pl-sem, .pl-sem-tete { display: none; }
  /* Sept colonnes sur un téléphone donneraient des cases illisibles :
     le mois se lit alors comme une liste de jours. */
  .pl-entetes { display: none; }
  .pl-grille { grid-template-columns: 1fr; }
  .pl-case { min-height: 0; }
  .pl-case.vide { display: none; }
  .pl-case:not(.charge) { display: none; }
  /* Un jour sans facture mais avec un rendez-vous client reste visible */
  .pl-case.agenda { display: block; }
  .pl-rdv-btn { white-space: normal; font-size: 13px; padding: 6px 8px; }
}

/* ---------------------------------------------------------------
   Aperçu du courrier
   --------------------------------------------------------------- */
.courrier[hidden] { display: none; }
.courrier-titre {
  margin: 10px 0 6px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted);
}
.courrier-liste { list-style: none; margin: 0; padding: 0; }
.courrier-item {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  padding: 9px 10px; border-left: 3px solid var(--border);
  border-bottom: 1px solid var(--line-soft); background: var(--surface);
}
.courrier-item:last-child { border-bottom: 0; }
.courrier-item.urgent { border-left-color: var(--danger); background: var(--row-danger); }
/* Déjà vu : présent, mais qui ne réclame plus l'attention */
.courrier-item.vu { opacity: .62; }
.courrier-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.courrier-de { font-weight: 600; font-size: 13px; }
.courrier-objet { font-size: 13px; color: var(--text); }
.courrier-resume { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.courrier-cote {
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
  flex: 0 0 auto; text-align: right;
}
.courrier-cat {
  padding: 1px 8px; border-radius: 999px; background: var(--surface-sunken);
  color: var(--text-muted); font-size: 11px; font-weight: 600;
}
.courrier-action {
  padding: 1px 8px; border-radius: 999px; background: var(--warn-soft);
  color: var(--warn); border: 1px solid var(--border-warn);
  font-size: 11px; font-weight: 700;
}
.courrier-rien { color: var(--text-muted); font-size: 13px; margin: 4px 0; }
.courrier-negligeable {
  margin: 10px 0 0; padding: 8px 10px; border-radius: 8px;
  background: var(--surface-alt); color: var(--text-muted);
  font-size: 12.5px; line-height: 1.45;
}

@media (max-width: 900px) {
  .courrier-item { flex-direction: column; gap: 4px; }
  .courrier-cote { flex-direction: row; align-items: center; text-align: left; flex-wrap: wrap; }
}

/* ---------------------------------------------------------------
   Aide dans l'application
   --------------------------------------------------------------- */
/* L'aide contient désormais le mode d'emploi entier, pas seulement un
   extrait : elle a besoin de la place d'une page, pas d'une bulle. */
.help-card { width: min(96vw, 900px); max-height: 92vh; display: flex; flex-direction: column; }
.help-body { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; }
.help-body .search { width: 100%; }

.help-list { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.help-item {
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); cursor: pointer; font: inherit; color: var(--text);
}
.help-item:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.help-item-title { font-weight: 600; font-size: 14px; }
.help-item-snippet { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }

/* Le contenu vient du guide. On lui rend sa taille de lecture : ce texte
   se lit vraiment, parfois debout dans un magasin, et 13,5 px sur un
   téléphone ne se lit pas — c'était le reproche. */
.help-article { overflow-y: auto; padding: 0 6px 4px 2px; max-width: 68ch; }
.help-article h2 { display: none; }          /* le titre est déjà dans l'en-tête */
.help-article h3 {
  font-size: 17px; font-weight: 700; margin: 22px 0 8px;
  padding-top: 14px; border-top: 1px solid var(--line-soft); color: var(--text);
}
.help-article h3:first-child { border-top: none; padding-top: 0; margin-top: 4px; }
.help-article p, .help-article li { font-size: 15.5px; line-height: 1.65; color: var(--text); }
.help-article p { margin: 0 0 12px; }
.help-article ul, .help-article ol { margin: 8px 0 16px; padding-left: 22px; }
.help-article li { margin-bottom: 7px; }
.help-article strong { font-weight: 700; }
.help-article code {
  font-size: 14px; padding: 1px 5px; border-radius: 4px;
  background: var(--surface-sunken);
}
/* Les encarts du guide gardent leur relief dans l'aide */
.help-article .guide-note {
  margin: 14px 0; padding: 12px 14px; border-radius: 8px;
  background: var(--surface-alt); border-left: 3px solid var(--border-strong);
  font-size: 15px;
}
.help-article .guide-note.warn {
  background: var(--warn-soft); border-left-color: var(--warn);
}
.help-article .guide-note p:last-child { margin-bottom: 0; }
.help-article .guide-steps li { margin-bottom: 10px; }
.help-article .tag {
  font-size: 12px; padding: 2px 7px; border-radius: 999px;
  background: var(--surface-sunken); color: var(--text-muted); font-weight: 600;
}

.help-item-title { font-size: 15px; }
.help-list { gap: 6px; }

.help-foot { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

@media (max-width: 900px) {
  /* Sur téléphone, l'aide prend tout l'écran : c'est un document qu'on
     lit, pas une info-bulle qu'on consulte du coin de l'œil. */
  .help-card { width: 100%; max-width: 100%; max-height: 100vh; height: 100vh; border-radius: 0; }
  .help-foot .btn { flex: 1 1 auto; }
  .help-article { max-width: none; }
  .help-article p, .help-article li { font-size: 16px; }
  .help-article h3 { font-size: 18px; }
}

/* ---------------------------------------------------------------
   Calculette à bande
   --------------------------------------------------------------- */
.calc {
  /* Au-dessus des fenêtres de saisie (.modal 70, .modal-top 80) : c'est
     précisément en remplissant un montant qu'on a besoin de calculer.
     Sous les toasts (90), qui doivent rester lisibles. */
  position: fixed; right: 18px; bottom: 18px; z-index: 88;
  width: min(94vw, 320px);
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px; border: 1px solid var(--border-strong); border-radius: 14px;
  background: var(--surface); box-shadow: 0 16px 40px var(--overlay);
}
.calc[hidden] { display: none; }
.calc-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }

/* La bande : ce qui a été saisi reste sous les yeux */
.calc-tape {
  list-style: none; margin: 0; padding: 6px; max-height: 190px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-alt);
  font-variant-numeric: tabular-nums;
}
.calc-tape li {
  display: grid; grid-template-columns: 20px 1fr auto 20px;
  align-items: center; gap: 6px; padding: 3px 2px; font-size: 13px;
}
.calc-tape li + li { border-top: 1px solid var(--line-soft); }
.calc-vide { display: block !important; color: var(--text-muted); font-size: 12.5px; padding: 6px 2px; }
.calc-op  { color: var(--text-muted); font-weight: 700; }
.calc-val { color: var(--text); }
.calc-run { color: var(--text-muted); font-size: 12px; }
.calc-del {
  border: 0; background: transparent; color: var(--text-muted);
  cursor: pointer; line-height: 1; padding: 0 2px;
}
.calc-del:hover { color: var(--danger); }

.calc-total-row { display: flex; align-items: baseline; justify-content: space-between; }
.calc-total { font-size: 20px; font-variant-numeric: tabular-nums; }

.calc-entry { display: grid; grid-template-columns: 1fr auto auto auto auto; gap: 5px; }
.calc-entry input {
  padding: 8px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit;
  font-variant-numeric: tabular-nums; min-width: 0;
}
.calc-entry input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--row-select); }
.calc-vat, .calc-foot { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.calc-vat .btn { flex: 1 1 auto; font-size: 11.5px; padding: 5px 6px; }
.calc-remise { border-top: 1px solid var(--line-soft); padding-top: 6px; }
.calc-lbl { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }

@media (max-width: 900px) {
  .calc { right: 10px; left: 10px; bottom: calc(var(--tabbar-h, 60px) + 12px); width: auto; }
}

/* Petit « = » accolé à un champ de montant : le chemin le plus court
   vers la calculette, là où le besoin naît. */
.field-with-calc { display: flex; gap: 6px; align-items: stretch; }
.field-with-calc input { flex: 1 1 auto; min-width: 0; }
.btn-calc-inline {
  flex: 0 0 auto; padding: 0 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface-alt); color: var(--text-muted);
  cursor: pointer; font-weight: 700;
}
.btn-calc-inline:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-strong); }

/* ---------------------------------------------------------------
   Filtres de la file à contrôler
   --------------------------------------------------------------- */
.review-filters { display: flex; gap: 6px; margin-bottom: 8px; }
.review-filters select {
  flex: 1 1 auto; min-width: 0; padding: 6px 8px; font-size: 12.5px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
}

/* ---------------------------------------------------------------
   Bandeau de nouvelle version
   --------------------------------------------------------------- */
.update-banner {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 60; display: flex; align-items: center; gap: 10px;
  max-width: min(92vw, 620px); padding: 10px 14px;
  border: 1px solid var(--on-dark-line); border-radius: 12px;
  background: var(--toast-bg); color: var(--on-dark);
  font-size: 13.5px; box-shadow: 0 10px 30px var(--overlay);
}
.update-banner[hidden] { display: none; }
.update-banner .btn-ghost { color: var(--on-dark-soft); }

/* ---------------------------------------------------------------
   Sauvegardes
   --------------------------------------------------------------- */
.bk-state {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--border); border-left-width: 4px; border-radius: 8px;
  background: var(--surface-alt);
}
.bk-state strong { font-size: 13px; }
.bk-state span { font-size: 12.5px; color: var(--text-muted); }
.bk-state.is-ok  { border-left-color: var(--ok); }
.bk-state.is-bad { border-left-color: var(--danger); background: var(--danger-soft); }
.bk-state.is-bad span { color: var(--danger); }

/* ---------------------------------------------------------------
   Contrôle de sécurité
   --------------------------------------------------------------- */
.sec-list { list-style: none; margin: 0; padding: 4px 12px 14px; }
.sec-list li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 0; border-bottom: 1px solid var(--line-soft);
}
.sec-list li:last-child { border-bottom: 0; }
.sec-mark {
  flex: 0 0 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; line-height: 1;
}
.sec-ok   .sec-mark { background: var(--ok-soft);     color: var(--ok); }
.sec-warn .sec-mark { background: var(--warn-soft);   color: var(--warn); }
.sec-bad  .sec-mark { background: var(--danger-soft); color: var(--danger); }
.sec-text { display: flex; flex-direction: column; gap: 2px; }
.sec-text strong { font-size: 13px; }
.sec-text span { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.sec-bad .sec-text span { color: var(--danger); }

/* ---------------------------------------------------------------
   Fiches fournisseur en double
   --------------------------------------------------------------- */
.sup-dup { border-left: 4px solid var(--warn); }
.dup-sup { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.dup-sup:first-of-type { border-top: 0; }
.dup-sup-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.dup-sup-list { list-style: none; margin: 0; padding: 0; }
.dup-sup-list li {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 5px 0 5px 12px; border-left: 2px solid var(--border);
}
.dup-sup-name { font-weight: 600; font-size: 13.5px; }

/* ---------------------------------------------------------------
   Doublons
   --------------------------------------------------------------- */
.dup-head td {
  padding: 10px 10px 6px;
  background: var(--surface-alt);
  border-top: 2px solid var(--border-strong);
}
.dup-level {
  display: inline-block; margin-right: 8px; padding: 2px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .02em;
}
.dup-certain  { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--border-danger); }
.dup-probable { background: var(--warn-soft);   color: var(--warn);   border: 1px solid var(--border-warn); }
.dup-verifier { background: var(--surface-sunken); color: var(--text-muted); border: 1px solid var(--border); }
.dup-reason { font-size: 12.5px; color: var(--text-muted); }

/* ---------------------------------------------------------------
   Période affichée : mois · trimestre · année · dates au choix
   --------------------------------------------------------------- */
.range-fields { display: inline-flex; align-items: center; gap: 6px; }
.range-fields input[type="date"] {
  padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px;
}
.range-fields input[type="date"]:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--row-select);
}
.range-fields[hidden], select[hidden] { display: none; }

/* Libellé réservé aux lecteurs d'écran : présent, jamais visible */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Séparateur dans le menu d'export : les deux formats du dessus sont
   ceux qu'on donne au comptable, ceux du dessous restent du dépannage. */
.dd-sep { height: 1px; margin: 5px 0; background: var(--border); }

/* ---------------------------------------------------------------
   Vues du tableau : factures · à contrôler · documents
   --------------------------------------------------------------- */
.view-chips { display: flex; gap: 6px; margin: 0 0 10px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip:hover { background: var(--surface-hover); color: var(--text); }
.chip.active {
  background: var(--primary); border-color: var(--primary); color: var(--on-dark);
}
.chip-count {
  min-width: 20px; padding: 1px 6px; border-radius: 999px;
  background: var(--surface-sunken); color: var(--text);
  font-size: 11px; font-variant-numeric: tabular-nums; text-align: center;
}
.chip.active .chip-count { background: var(--on-dark-fill-2); color: var(--on-dark); }
.chip-count[hidden] { display: none; }

/* ---------------------------------------------------------------
   Référence Smart saisie dans le tableau
   --------------------------------------------------------------- */
/* Un champ transparent ressemble à du texte mort : personne ne devine
   qu'on peut y taper. Vide, il se montre donc comme un champ — pointillés
   et fond léger. Rempli, il s'efface pour ne pas alourdir le tableau. */
.smartref-input {
  width: 100%; min-width: 90px; max-width: 140px;
  padding: 4px 6px; border: 1px dashed var(--border-dashed); border-radius: 6px;
  background: var(--surface-alt); color: var(--text);
  font: inherit; font-size: 13px; font-variant-numeric: tabular-nums;
  cursor: text;
}
.smartref-input:not(:placeholder-shown) {
  border-color: transparent; background: transparent; font-weight: 600;
}
.smartref-input::placeholder { color: var(--text-muted); font-style: italic; }
.smartref-input:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.smartref-input:focus {
  outline: none; border-color: var(--primary); background: var(--surface);
  box-shadow: 0 0 0 3px var(--row-select);
}
.smartref-input.saving { opacity: .55; }
.smartref-input.saved { border-color: var(--border-ok); background: var(--ok-soft); }

/* ---------------------------------------------------------------
   Pièces qui ne sont pas des factures
   --------------------------------------------------------------- */
.table-invoices tbody tr.row-document { cursor: pointer; }
.row-document .td-doc { padding: 8px 10px; }
.doc-kind {
  display: inline-block; margin-right: 8px; padding: 2px 8px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-sunken); color: var(--text-muted);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
}
.doc-file { font-size: 13px; color: var(--text); word-break: break-all; }
.doc-summary {
  display: block; margin-top: 3px; max-width: 80ch;
  font-size: 12px; line-height: 1.45; color: var(--text-muted);
}

/* Une ligne de facture s'ouvre au clic : on l'annonce au curseur */
.table-invoices tbody tr[data-id] { cursor: pointer; }
.table-invoices tbody tr[data-id] .td-check,
.table-invoices tbody tr[data-id] .td-smartref,
.table-invoices tbody tr[data-id] .td-actions { cursor: auto; }

/* ---------------------------------------------------------------
   Pièce ouverte en pleine page depuis le tableau
   --------------------------------------------------------------- */
.review-back { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.review-layout.solo .review-list { display: none; }
.review-layout.solo { grid-template-columns: 1fr; }

/* ---------------------------------------------------------------
   Impression / PDF
   --------------------------------------------------------------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: var(--vbk-white); font-size: 11px; }
  /* Le mode d'emploi s'imprime en portrait */
  body.guide-body { font-size: 12px; }
  @page :first { margin: 12mm; }
  .sidebar, .appbar, .tabbar, .toolbar, .page-actions, .no-print, .fab, .bulk-bar,
  .modal, .toasts, .popover, .month-picker, .alerts, .segmented, .sd-toolbar,
  .progress-card, .td-check, .th-check, .td-actions { display: none !important; }
  .main { margin: 0; padding: 0; max-width: none; }
  .table-foot { position: static; }
  .print-only { display: block; margin-bottom: 10px; font-size: 13px; }
  #print-header { display: flex; align-items: center; gap: 14px; }
  #print-header img { width: 150px; height: auto; }

  /* Mode d'emploi : une section ne doit jamais être coupée en deux */
  .guide { display: block; padding: 0; max-width: none; }
  .guide-content { max-width: none; }
  .guide-print-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
  .guide-title { font-size: 20px; }
  .guide-content section {
    border: none; box-shadow: none; padding: 0; margin: 0 0 18px;
    break-inside: avoid; page-break-inside: avoid;
  }
  .guide-content section + section { break-before: page; page-break-before: always; }
  .guide-content h2 { font-size: 15px; }
  .guide-table { font-size: 11px; }
  .card { border: none; box-shadow: none; margin: 0 0 10px; }
  .card-head { padding: 0 0 6px; border: none; }
  .table-wrap { overflow: visible; }
  .table { font-size: 10px; }
  .table th { border-bottom: 1px solid var(--print-line); color: var(--vbk-black); position: static; }
  .table td { border-bottom: 1px solid var(--print-rule); }
  .row-late, .row-soon, .row-overdue { background: var(--print-zebra) !important; }
  .pill, .btn-pay, .paid-badge {
    border: 1px solid var(--print-line); background: none !important; color: var(--vbk-black) !important;
    min-width: 0; min-height: 0; padding: 0 4px;
  }
  .kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
  .kpi-hero, #card-late { grid-column: span 1; }
  .kpi { border: 1px solid var(--print-rule); }
}

/* =====================================================================
   Forcer l'acceptation
   La couleur dit ce que c'est : un geste permis, mais qui n'est pas la
   marche normale. Ni rouge — ce n'est pas une erreur — ni neutre.
   ===================================================================== */
.btn-warn {
  background: var(--warn); color: var(--vbk-white); border-color: var(--warn);
}
.btn-warn:hover { filter: brightness(.94); }

.force-zone {
  margin-top: 10px; padding: 14px; border-radius: 10px;
  background: var(--warn-soft); border: 1px solid var(--border-warn);
}
.force-zone label { display: block; font-weight: 600; margin-bottom: 6px; }
.force-zone textarea {
  width: 100%; font: inherit; padding: 9px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  resize: vertical;
}
.force-quoi { margin: 0 0 10px; font-size: 13px; color: var(--warn); }
.force-avertissement { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.force-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* TVA saisie à la main : le champ euro prend la place du champ pourcent */
#rv-vat-amount { width: 120px; }
.vat-mixte { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* Marque « forcée » dans les listes */
.st-forcee {
  background: var(--warn-soft); color: var(--warn); border-color: var(--border-warn);
}

/* =====================================================================
   Téléphone : le panneau « Plus »
   Cinq onglets en bas ne peuvent pas porter neuf écrans. Le reste vient
   d'ici — sinon il n'existe tout simplement pas sur un téléphone.
   ===================================================================== */
.sheet-backdrop, .plus-sheet { display: none; }

@media (max-width: 900px) {
  .sheet-backdrop {
    display: block; position: fixed; inset: 0; z-index: 48;
    background: rgba(16, 24, 40, .38);
  }
  .sheet-backdrop[hidden] { display: none; }

  .plus-sheet {
    display: block; position: fixed; left: 0; right: 0; z-index: 49;
    bottom: calc(var(--tabbar-h, 60px) + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border);
    border-radius: 14px 14px 0 0; padding: 14px 12px 18px;
    box-shadow: 0 -8px 26px rgba(16, 24, 40, .18);
    max-height: 70vh; overflow-y: auto;
  }
  .plus-sheet[hidden] { display: none; }

  .plus-titre {
    margin: 0 0 10px; font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  }
  .plus-item {
    display: flex; align-items: center; gap: 12px; width: 100%;
    font: inherit; text-align: left; background: none; border: none;
    border-bottom: 1px solid var(--border); padding: 12px 4px;
    color: var(--text); cursor: pointer; min-height: 56px;
  }
  .plus-item[hidden] { display: none; }
  .plus-item .ico {
    flex: none; width: 34px; height: 34px; border-radius: 9px;
    display: grid; place-items: center; font-size: 16px;
    background: var(--surface-hover); color: var(--vbk-red);
  }
  .plus-item strong { display: block; font-size: 15px; font-weight: 600; }
  .plus-item small { display: block; font-size: 12px; color: var(--muted); }
  .plus-fermer { width: 100%; margin-top: 14px; min-height: 44px; }
}

/* Aide-mémoire attaché à une demande */
.tache-aide {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: 12px; font-weight: 600;
  background: none; border: none; padding: 2px 0;
  color: var(--vbk-red); cursor: pointer; text-decoration: underline;
}
.tache-details {
  margin: 6px 0 0; font-size: 13px; color: var(--text);
  white-space: pre-wrap; line-height: 1.5;
}

/* =====================================================================
   D'où vient la demande
   Le rouge de la marque, réservé à ce que le gérant demande en son nom.
   Il ne sert nulle part ailleurs dans la liste : là où il apparaît, la
   demande vient de quelqu'un, pas du travail de fond.
   ===================================================================== */
.tache-gerant {
  padding: 1px 7px; border-radius: 999px;
  background: var(--vbk-red); color: var(--vbk-white);
  border: 1px solid var(--vbk-red); font-weight: 700; white-space: nowrap;
}
.taches-titre-gerant { color: var(--vbk-red); }
.taches-titre-gerant .muted { color: var(--text-muted); }

/* La ligne elle-même se distingue sans crier : un filet rouge à gauche
   suffit, une couleur de fond rendrait la liste illisible dès trois
   demandes. */
.tache.origine-gerant { box-shadow: inset 3px 0 0 var(--vbk-red); }

/* =====================================================================
   Documents attachés à une fiche mémoire
   Visibles hors édition : un mode d'emploi qu'il faut d'abord « modifier »
   pour apercevoir ne serait jamais ouvert.
   ===================================================================== */
.memo-fichiers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.memo-fichier {
  display: inline-flex; align-items: stretch; border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; background: var(--surface-hover);
  max-width: 100%;
}
.memo-fichier-ouvrir {
  display: inline-flex; align-items: center; gap: 7px; min-width: 0;
  font: inherit; font-size: 13px; background: none; border: none;
  padding: 7px 10px; color: var(--text); cursor: pointer; text-align: left;
  min-height: 38px;
}
.memo-fichier-ouvrir:hover { background: var(--surface-sunken); }
.memo-fichier-ouvrir small { color: var(--text-muted); white-space: nowrap; }
.memo-fichier-oter {
  flex: none; font: inherit; font-size: 16px; line-height: 1;
  background: none; border: none; border-left: 1px solid var(--border);
  padding: 0 10px; color: var(--text-muted); cursor: pointer;
}
.memo-fichier-oter:hover { background: var(--danger-soft); color: var(--danger); }

.memo-joindre {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border);
}
/* Le label fait bouton : le champ « fichier » natif ne se met pas à la
   charte, et sur téléphone son libellé anglais dépasse. */
.memo-joindre label.btn { cursor: pointer; }
.memo-attente { margin: 8px 0 0; font-size: 12.5px; color: var(--warn); }

/* =====================================================================
   Arrivées — ce qui vient d'entrer dans l'application
   Une ligne d'en-tête par journée, pour répondre d'un coup d'œil à
   « qu'est-ce qui est arrivé depuis hier ? ».
   ===================================================================== */
.table-invoices tr.jour-head td {
  background: var(--surface-sunken); padding: 9px 14px;
  border-top: 1px solid var(--border-strong);
}
.jour-label { font-weight: 700; font-size: 13px; }
.jour-detail { margin-left: 10px; font-size: 12.5px; color: var(--text-muted); }
.jour-total { float: right; font-weight: 600; font-size: 13px; }

/* Le bloc du tableau de bord : il annonce une nouveauté, pas un manquement.
   Les trois autres alertes disent ce qui reste à faire ; celle-ci dit ce
   qui vient d'arriver, et se tait quand rien n'est arrivé. */
.alert-arrivees {
  grid-column: 1 / -1; margin-top: 10px;
  background: var(--ok-soft); border-color: var(--border-ok); color: var(--ok);
}
.alert-arrivees[hidden] { display: none; }

/* =====================================================================
   Suivi d'une facture — ce que Marie signale
   Rien à signaler, rien à voir : la colonne ne doit attirer l'œil que là
   où il y a quelque chose. Une colonne pleine de « RAS » masquerait les
   trois lignes qui posent vraiment problème.
   ===================================================================== */
.td-suivi { white-space: nowrap; }
.suivi-vide {
  font: inherit; font-size: 15px; line-height: 1; cursor: pointer;
  width: 26px; height: 26px; border-radius: 7px;
  background: none; border: 1px dashed var(--border-dashed); color: var(--text-muted);
}
.suivi-vide:hover { border-style: solid; border-color: var(--vbk-red); color: var(--vbk-red); }

.suivi-chip { cursor: pointer; border-width: 1px; border-style: solid; }
.suivi-mot { margin-left: 4px; opacity: .7; }
.suivi-rouge  { background: var(--danger-soft); color: var(--danger); border-color: var(--border-danger); }
.suivi-orange { background: var(--warn-soft);   color: var(--warn);   border-color: var(--border-warn); }
.suivi-vert   { background: var(--ok-soft);     color: var(--ok);     border-color: var(--border-ok); }
.suivi-bleu   { background: var(--surface-sunken); color: var(--text); border-color: var(--border-strong); }

.pop-suivi { min-width: 290px; max-width: 340px; }
.pop-titre { margin: 0 0 8px; font-weight: 700; font-size: 13px; }
.suivi-choix { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.suivi-choix .badge { cursor: pointer; border: 1px solid transparent; }
.suivi-choix .badge.choisi { outline: 2px solid var(--vbk-red); outline-offset: 1px; }
.pop-suivi textarea {
  width: 100%; font: inherit; font-size: 13px; padding: 8px 9px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); resize: vertical;
}
.pop-signe { margin: 6px 0 0; font-size: 11.5px; color: var(--text-muted); }

/* Une facture pas encore regardée, repérée dans la liste normale. Elle
   n'est pas bloquée pour autant : on la paie, on l'exporte, on l'encode.
   La mention dit « personne ne l'a vérifiée », pas « interdit d'y toucher ». */
/* Un point d'exclamation, pas une phrase : la colonne du numéro de
   facture n'a pas la place d'accueillir « à contrôler », et le repère
   doit se voir sans se lire. */
.marque-verif {
  display: inline-grid; place-items: center; margin-left: 6px;
  width: 17px; height: 17px; border-radius: 50%;
  font-size: 11px; font-weight: 800; line-height: 1; cursor: help;
  background: var(--warn-soft); color: var(--warn); border: 1px solid var(--border-warn);
}

/* Réf. Smart absente mais encodage réputé fait par l'ancien franchisé */
.ref-ancien {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 3px 8px; border-radius: 6px;
  background: var(--warn-soft); color: var(--warn); border: 1px dashed var(--border-warn);
}

/* =====================================================================
   Réunir deux fiches fournisseur
   Ce qui va se passer est dit avant d'agir : combien de factures bougent,
   lesquelles se heurtent, et si les numéros de TVA diffèrent.
   ===================================================================== */
.fusion-intro { margin: 0 0 12px; font-size: 15px; }
#modal-fusion label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
#modal-fusion select { width: 100%; }
.fusion-apercu {
  margin-top: 12px; padding: 12px; border-radius: 8px;
  background: var(--surface-alt); border: 1px solid var(--border);
}
.fusion-apercu p { margin: 0 0 6px; }
.fusion-apercu p:last-child { margin-bottom: 0; }
.fusion-alerte { color: var(--warn); font-weight: 600; }
.fusion-collisions { margin: 4px 0 8px; padding-left: 20px; font-size: 12.5px; }

/* =====================================================================
   Choix de la période, depuis le bandeau supérieur
   Elle commande tous les écrans. Le libellé est cliquable : c'est lui
   qu'on regarde, c'est donc par lui qu'on doit pouvoir la changer.
   ===================================================================== */
.month-label {
  font: inherit; font-weight: 600; cursor: pointer;
  background: none; border: 1px solid transparent; border-radius: 8px;
  padding: 5px 10px; color: inherit; min-width: 120px; text-align: center;
}
.month-label:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); }
.month-picker .btn-icon:disabled { opacity: .35; cursor: default; }

.periode-choix { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 12px; }
.periode-choix .chip { cursor: pointer; }
.periode-reglage { margin-bottom: 10px; }
.periode-reglage select, .periode-reglage input { width: 100%; }
.periode-dates { display: flex; align-items: center; gap: 8px; }
.periode-dates label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.periode-dates input { flex: 1 1 auto; }
.periode-apercu {
  margin: 0; padding: 9px 11px; border-radius: 8px; font-size: 13px;
  background: var(--surface-alt); border: 1px solid var(--border); color: var(--text-muted);
}

@media (max-width: 900px) {
  /* Sur téléphone le bandeau est étroit : le libellé prend ce qu'il
     reste, les flèches gardent leur cible au doigt. */
  .month-label { min-width: 0; font-size: 13px; padding: 5px 6px; }
}

/* =====================================================================
   Quarantaine : voir avant de décider
   On demandait de trancher « est-ce un fournisseur ? » en cachant ce qui
   permet de répondre. Les messages et leurs pièces s'ouvrent maintenant
   sur place.
   ===================================================================== */
.q-row.deplie { background: var(--surface-alt); }
.q-detail {
  grid-column: 1 / -1; margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--border-dashed);
}
.q-msg { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.q-msg:last-child { border-bottom: none; }
.q-msg-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.q-msg-head strong { font-size: 13.5px; }
.q-fichiers { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.q-fichier {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 12.5px; cursor: pointer; min-height: 34px;
  padding: 5px 10px; border-radius: 7px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.q-fichier:hover { border-color: var(--vbk-red); color: var(--vbk-red); }
.q-fichier small { color: var(--text-muted); }

/* Retrouver un courrier */
.trace-resultats { padding: 10px 12px 14px; }
.trace-resume { margin: 0 0 10px; font-size: 13.5px; }
.trace-table { font-size: 13px; }
.trace-pj { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.trace-err { margin-left: 6px; font-size: 11.5px; color: var(--danger); cursor: help; text-decoration: underline dotted; }
.trace-vide {
  padding: 14px; border-radius: 8px;
  background: var(--warn-soft); border: 1px solid var(--border-warn);
}
.trace-vide p { margin: 0 0 6px; }
.trace-vide p:last-child { margin-bottom: 0; }
.st-grey { background: var(--surface-sunken); color: var(--text-muted); border-color: var(--border); }

/* Menu d'une pièce classée « document » : la nature, puis la suppression.
   Le coche marque la nature actuelle — sans quoi on ne sait pas ce qu'on
   est en train de changer. */
.pop-menu .pop-titre {
  margin: 2px 8px 6px; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
}
.pop-menu button.choisi { font-weight: 700; color: var(--text); }
.pop-menu .pop-note { margin: 6px 8px 2px; font-size: 11.5px; color: var(--text-muted); }

/* Activité jour par jour : ce que chaque journée a produit. L'avertissement
   sur les gestes non datés est en orange — c'est une réserve sur la
   lecture du tableau, pas une alerte. */
.activite-note {
  margin: 0 14px 12px; padding: 10px 12px; border-radius: 8px; font-size: 12.5px;
  background: var(--warn-soft); border: 1px solid var(--border-warn); color: var(--warn);
}

/* Une remarque écrite sur une facture, visible dans la liste.
   Discrète mais présente : elle dit « quelqu'un s'est occupé de ça »,
   ce qu'un champ caché au fond du formulaire ne disait pas. */
.suivi-note {
  display: inline-grid; place-items: center; cursor: help;
  width: 26px; height: 26px; border-radius: 7px; font-size: 13px;
  background: var(--surface-sunken); border: 1px solid var(--border-strong);
  color: var(--text); font: inherit; line-height: 1;
}
.suivi-note:hover { border-color: var(--vbk-red); color: var(--vbk-red); }

/* La case « ne plus bloquer pour ce fournisseur », dans la zone de forçage */
#rv-force-memo-wrap { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 13px; }

/* Remarques et suivi, depuis l'écran de contrôle.
   La remarque s'enregistrait uniquement en validant la facture — or on
   écrit « voir avec Bob » précisément parce qu'on ne valide pas. */
.rv-suivi-bloc { border-top: 1px solid var(--line-soft); padding-top: 12px; margin-top: 4px; }
.rv-suivi-etats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rv-suivi-etats .badge { cursor: pointer; border: 1px solid transparent; }
.rv-suivi-etats .badge.choisi { outline: 2px solid var(--vbk-red); outline-offset: 1px; }
.rv-notes-bas {
  display: flex; align-items: center; gap: 10px; margin-top: 7px; flex-wrap: wrap;
}
.rv-notes-bas .muted { flex: 1 1 auto; }

/* =====================================================================
   Cocher soi-même les fournisseurs
   Le nombre de factures de la période accompagne chaque nom : cocher une
   fiche qui n'a rien sur le trimestre ne produit rien, et s'en apercevoir
   après le téléchargement fait perdre le double du temps.
   ===================================================================== */
.fo-liste { max-height: 52vh; overflow-y: auto; margin-bottom: 12px; }
.fo-groupe { margin-bottom: 14px; }
.fo-groupe-tete {
  display: flex; align-items: baseline; gap: 10px; padding: 4px 2px 6px;
  border-bottom: 1px solid var(--border); margin-bottom: 4px;
  position: sticky; top: 0; background: var(--surface);
}
.fo-groupe-tete strong {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
}
.fo-ligne {
  display: flex; align-items: center; gap: 10px; padding: 7px 4px;
  border-radius: 7px; cursor: pointer; min-height: 38px;
}
.fo-ligne:hover { background: var(--surface-hover); }
.fo-nom { flex: 1 1 auto; font-size: 13.5px; }
.fo-compte {
  flex: 0 0 auto; font-size: 12px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; background: var(--surface-sunken);
}
/* Une fiche sans facture sur la période : visible, mais en retrait. */
.fo-ligne.vide .fo-nom { color: var(--text-muted); }

/* ---------------------------------------------------------------
   Clients — dossiers, poses, SAV
   --------------------------------------------------------------- */
.cl-ajout { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cl-ajout-ligne { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cl-ajout-ligne input { padding: 10px 12px; font-size: 15px; }
.cl-ajout-ligne input[type="tel"] { flex: 0 1 200px; min-width: 0; }
.cl-ajout-ligne .btn { flex: 0 0 auto; }
.cl-recherche { width: 100%; margin-bottom: 10px; padding: 9px 12px; }

/* Choix unique en boutons : un doigt, pas une liste déroulante */
.cl-choix { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cl-choix button {
  font: inherit; font-size: 13px; background: var(--surface); border: none;
  border-right: 1px solid var(--border); padding: 7px 12px; min-height: 36px; cursor: pointer; color: var(--muted);
}
.cl-choix button:last-child { border-right: none; }
.cl-choix button.active { background: var(--primary); color: var(--vbk-white); }

.cl-filtres { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.cl-filtre {
  font: inherit; font-size: 13px; padding: 6px 10px; min-height: 34px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
  display: inline-flex; gap: 6px; align-items: center;
}
.cl-filtre.active { background: var(--primary); border-color: var(--primary); color: var(--vbk-white); }
.cl-n { font-size: 11px; font-weight: 700; opacity: .75; font-variant-numeric: tabular-nums; }

.cl-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cl-carte {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px;
}
.cl-carte:hover, .cl-carte:focus-visible { border-color: var(--border-strong); background: var(--surface-hover); }
.cl-carte-haut { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.cl-nom { font-size: 15px; }
.cl-date { font-size: 12px; font-weight: 600; color: var(--info); }
.cl-fiches { display: flex; gap: 6px; flex-wrap: wrap; }
.cl-todo { margin: 0; font-size: 13px; white-space: pre-wrap; }
.cl-dernier { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Le relais Jordan → Marie */
.cl-filtre.relais:not(.active) { border-color: var(--border-warn); background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.cl-consigne { margin: 0; font-size: 14px; font-weight: 600; white-space: pre-wrap; }
.cl-carte .cl-consigne { font-size: 13px; color: var(--warn); }
.cl-relais { display: flex; flex-direction: column; gap: 8px; }
.cl-relais textarea { width: 100%; }
.cl-relais-titre { margin: 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cl-relais.attente { border-color: var(--border-warn); background: var(--warn-soft); }
.cl-relais.fait { border-color: var(--border-ok); background: var(--green-bg); }
.cl-relais.pas-fait { border-color: var(--border-danger); background: var(--red-bg); }
.cl-lot {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px;
  padding: 8px 12px; border: 1px dashed var(--border-warn); border-radius: var(--radius-card); background: var(--warn-soft);
}

.cl-retour { margin-bottom: 10px; }
.cl-bloc { margin-bottom: 10px; }
.cl-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.cl-grille input, .cl-grille textarea, .cl-bloc textarea { width: 100%; }
.cl-nom-champ { font-size: 17px; font-weight: 700; }
.cl-adresse { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.cl-contact { margin: 0 0 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.cl-contact .btn { text-decoration: none; }
.cl-section-tete { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0 8px; }
.cl-section-tete h2 { margin: 0; font-size: 15px; }

.cl-fiche {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--info);
  border-radius: var(--radius-card); padding: 10px 12px; margin-bottom: 8px;
  display: flex; flex-direction: column; gap: 10px;
}
.cl-fiche.sav { border-left-color: var(--warn); }
.cl-fiche.mesure { border-left-color: var(--info); }
.cl-fiche.demande { border-left-color: var(--border-strong); }
.cl-qui { margin: 0; font-size: 11px; }
.cl-urgent { font-weight: 800; letter-spacing: .04em; }
.cl-relais.urgent { border-color: var(--border-danger); background: var(--red-bg); }
.cl-case-urgent { align-items: center; min-height: 34px; }
.cl-case-urgent input { margin: 0; }
.cl-alerte-urgent {
  display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px;
  margin-bottom: 10px; padding: 10px 12px; font: inherit; font-size: 14px; cursor: pointer; text-align: left;
  border: 1px solid var(--border-danger); border-left: 4px solid var(--red); border-radius: var(--radius-card);
  background: var(--red-bg); color: var(--red);
}
.cl-alerte-urgent span { font-weight: 600; text-decoration: underline; }
.cl-fiche.finie { border-left-color: var(--border-strong); background: var(--surface-alt); }
.cl-fiche-haut { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cl-type { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }

/* Les étapes du SAV : on voit d'un coup d'œil où on en est */
.cl-etapes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.cl-etapes button {
  font: inherit; font-size: 13px; min-height: 38px; cursor: pointer; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.cl-etapes button.passee { background: var(--ok-soft); border-color: var(--border-ok); color: var(--ok); }
.cl-etapes button.active { background: var(--primary); border-color: var(--primary); color: var(--vbk-white); font-weight: 600; }

/* Le suivi d'un dossier : Smart, Cubehic, Nobilia, sur une seule fiche */
.sv-points { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.sv-point { display: flex; gap: 8px; align-items: baseline; font-size: 13px; line-height: 1.4; }
.sv-point .badge { flex: none; }
.sv-ok { color: var(--ok); margin: 0 0 12px; }
.sv-titre { margin: 4px 0 6px; }
.sv-ligne { list-style: none; margin: 0 0 6px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.sv-ligne button {
  width: 100%; font: inherit; font-size: 12px; line-height: 1.25; min-height: 40px; padding: 4px 6px;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer;
}
.sv-ligne button:disabled { cursor: default; }
.sv-ligne li.faite button { background: var(--ok-soft); border-color: var(--border-ok); color: var(--ok); }
.sv-ligne li.actuelle button { background: var(--ok); border-color: var(--ok); color: var(--vbk-white); font-weight: 600; }
.sv-ligne li.suivante button { background: var(--warn-soft); border-color: var(--border-warn); color: var(--warn); font-weight: 600; }
.sv-grille { margin-top: 12px; }
.sv-cases { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0 6px; }
.sv-confirme { margin-top: 4px; font-size: 12px; }

.cl-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cl-ok { border-color: var(--border-ok); color: var(--ok); }
.cl-ok:hover { background: var(--ok-soft); border-color: var(--ok); }
.cl-sav { border-color: var(--border-warn); color: var(--warn); }
.cl-sav:hover { background: var(--warn-soft); border-color: var(--warn); }
.cl-suite {
  border: 1px dashed var(--border-warn); background: var(--warn-soft); border-radius: var(--radius);
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
}
.cl-suite p { margin: 0; }
.cl-mail { border-color: var(--border-info); background: var(--info-soft); }
.cl-mail textarea { width: 100%; font: inherit; font-size: 13px; line-height: 1.45; }
.cl-mail .cl-choix { align-self: flex-start; flex-wrap: wrap; }
.cl-mail-cases {
  margin: 0; padding: 8px 10px; border: 1px solid var(--border-info); border-radius: var(--radius);
  background: var(--surface); display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.cl-mail-cases legend { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.cl-case { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; font-weight: 400; color: var(--text); cursor: pointer; min-height: 28px; }
.cl-case input { margin: 2px 0 0; padding: 0; flex: none; width: 16px; height: 16px; min-height: 0; }
.cl-case span { min-width: 0; overflow-wrap: anywhere; }
.cl-aide { display: block; font-size: 11px; font-style: normal; color: var(--warn); }
.cl-phrases { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-phrase {
  font: inherit; font-size: 12px; text-align: left; padding: 5px 9px; min-height: 30px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
}
.cl-prevenir { border-color: var(--info); color: var(--info); background: var(--info-soft); font-weight: 600; }
.cl-mail-changes { border-color: var(--info); }
.cl-phrase.active { background: var(--info); border-color: var(--info); color: var(--vbk-white); }
.cl-suite .search { width: 100%; padding: 9px 11px; }
.cl-finies-btn { margin-bottom: 8px; }

.cl-note-ajout { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 10px; }
.cl-note-ajout textarea { flex: 1; min-width: 0; }
.cl-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cl-note { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.cl-note-meta { font-size: 11.5px; color: var(--text-muted); }
.cl-note-texte { white-space: pre-wrap; }
.cl-note.auto .cl-note-texte { color: var(--text-muted); font-style: italic; }
.cl-danger { margin-top: 16px; text-align: right; }

@media (max-width: 900px) {
  .sv-ligne { grid-template-columns: repeat(2, 1fr); }
  .cl-grille { grid-template-columns: 1fr; }
  .cl-ajout-ligne input[type="tel"] { flex: 1 1 100%; }
  .cl-ajout-ligne .btn { flex: 1 1 100%; }
  .cl-etapes { grid-template-columns: 1fr 1fr; }
  .cl-note-ajout { flex-direction: column; align-items: stretch; }
  .cl-contact .btn { flex: 1 1 100%; justify-content: center; min-height: 42px; font-size: 15px; }
}

/* ---------------------------------------------------------------
   Dépôt de factures à la main, mails sans facture
   --------------------------------------------------------------- */
.depot-survol { outline: 3px dashed var(--info); outline-offset: -6px; background: var(--info-soft); }
#mails-sans-facture { margin-bottom: 12px; }
.msf summary { cursor: pointer; display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.msf > p { margin: 8px 0; }
.msf-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.msf-ligne {
  display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 8px 0; border-top: 1px solid var(--border);
}
.msf-texte { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.msf-texte strong { overflow-wrap: anywhere; }
.msf-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Le reste à faire daté, le travail fait, les documents */
.cl-echeance { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; }
.cl-echeance .field { max-width: 200px; }
.cl-en-retard { border-color: var(--border-danger); }
.cl-travail { display: flex; flex-direction: column; gap: 8px; }
.cl-travail-ligne { display: flex; gap: 10px; flex-wrap: wrap; }
.cl-travail-ligne .field { min-width: 0; }
.cl-travail-texte { flex: 1 1 220px; }
.cl-fait { color: var(--green); }
.cl-docs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cl-docs li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cl-doc-nom {
  font: inherit; font-size: 14px; font-weight: 600; background: none; border: none; padding: 4px 0;
  color: var(--info); cursor: pointer; text-align: left; overflow-wrap: anywhere; min-height: 32px;
}
.cl-doc-nom:hover { text-decoration: underline; }
.cl-traite-btn { width: 100%; justify-content: center; font-weight: 700; margin-bottom: 10px; min-height: 44px; }
.cl-traite-ok {
  margin: 0 0 10px; padding: 10px 12px; border-radius: var(--radius); font-weight: 600;
  background: var(--green-bg); color: var(--green); border: 1px solid var(--border-ok);
}
.cl-carte-actions { display: flex; justify-content: flex-end; }
.cl-traite-ok { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cl-note.annulee .cl-note-texte { text-decoration: line-through; color: var(--muted); }
.cl-note-annuler {
  font: inherit; font-size: 11px; background: none; border: none; padding: 0; cursor: pointer;
  color: var(--info); text-decoration: underline;
}

/* La barre d'actions du dossier : traité, problème, clôturer */
.cl-barre { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; align-items: stretch; }
.cl-barre > .btn, .cl-barre > .cl-traite-ok { flex: 1 1 180px; justify-content: center; min-height: 44px; margin: 0; }
.cl-barre .cl-traite-btn { width: auto; margin: 0; }
.cl-probleme {
  display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap;
  margin-bottom: 10px; padding: 10px 12px; border-radius: var(--radius-card);
  background: var(--red-bg); color: var(--red); border: 1px solid var(--border-danger); border-left: 4px solid var(--red);
}
.cl-probleme p { margin: 4px 0 0; color: var(--text); white-space: pre-wrap; }
.cl-probleme-txt { color: var(--red); font-weight: 600; }
.cl-clos {
  display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap;
  margin-bottom: 10px; padding: 10px 12px; border-radius: var(--radius-card);
  background: var(--surface-hover); border: 1px solid var(--border-strong); font-weight: 600;
}

/* Administration : le cerveau du magasin et les accès de Claude */
.adm-cerveau, .adm-acces { margin-top: 16px; }
.adm-cerveau .card-head, .adm-acces .card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.adm-cerveau-frame { width: 100%; height: 860px; border: 1px solid var(--border); border-radius: var(--radius); margin-top: 8px; background: var(--surface); }
.adm-acces-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0 10px; }
.adm-acces-table th, .adm-acces-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.adm-acces-table th { color: var(--text-muted); font-weight: 600; }
.adm-acces-table td:first-child { font-weight: 600; white-space: nowrap; }
@media (max-width: 900px) {
  .adm-cerveau-frame { height: 640px; }
  .adm-acces-table td:first-child { white-space: normal; }
}

/* Écran « Cerveau du magasin » */
.cv-etat { margin-bottom: 14px; display: grid; gap: 4px; }
.cv-etat ol { margin: 4px 0; padding-left: 20px; }
.cv-ok { border-color: var(--border-ok); background: var(--ok-soft); color: var(--ok); }
.cv-attente { border-color: var(--border-warn); background: var(--warn-soft); color: var(--text); }
.cv-parcours, .cv-regles { margin: 8px 0 4px; padding-left: 22px; display: grid; gap: 8px; font-size: 14px; line-height: 1.45; }

/* Ventes et soldes (gérant) */
.vt-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.vt-kpi { display: grid; gap: 2px; }
.vt-kpi strong { font-size: 22px; }
.vt-kpi.vt-rouge { border-color: var(--border-danger); background: var(--danger-soft); }
.vt-kpi.vt-orange { border-color: var(--border-warn); background: var(--warn-soft); }
.vt-filtres { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.vt-table-wrap { overflow-x: auto; margin-bottom: 8px; }
.vt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vt-table th, .vt-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.vt-table th { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.vt-table .num { text-align: right; white-space: nowrap; }
.vt-table .mono { font-variant-numeric: tabular-nums; }
.vt-table tr.vt-rouge td { background: var(--danger-soft); }
.vt-table tr.vt-orange td { background: var(--warn-soft); }
.vt-table tr.vt-ok td { color: var(--text-muted); }
.vt-lien { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--text); text-decoration: underline; cursor: pointer; text-align: left; }

/* Journal de Claude : calendrier + détail du jour */
.jr-cadre { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.jr-entete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; text-transform: capitalize; }
.jr-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.jr-jour-nom { font-size: 12px; color: var(--text-muted); text-align: center; padding-bottom: 4px; }
.jr-case { position: relative; min-height: 64px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 6px; text-align: left; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 4px; }
.jr-case.vide { border: 0; background: none; cursor: default; }
.jr-case.aujourdhui { border-color: var(--primary); }
.jr-case.choisi { background: var(--surface-sunken); border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.jr-num { font-weight: 600; font-size: 13px; }
.jr-total { position: absolute; top: 6px; right: 6px; font-size: 11px; color: var(--text-muted); }
.jr-points { display: flex; flex-wrap: wrap; gap: 3px; margin-top: auto; }
.jr-p { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.jr-action { background: var(--info); }
.jr-controle { background: var(--text-muted); }
.jr-incident { background: var(--danger); }
.jr-apprentissage { background: var(--ok); }
.jr-automatisation { background: var(--warn); }
.jr-legende { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; color: var(--text-muted); }
.jr-legende span { display: inline-flex; align-items: center; gap: 5px; }
.jr-titre { text-transform: capitalize; margin: 0 0 8px; }
.jr-sous { font-size: 14px; margin: 14px 0 6px; }
.jr-liste, .jr-auto { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.jr-liste li { display: grid; grid-template-columns: 46px auto 1fr; gap: 8px; align-items: start; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.jr-liste p { margin: 2px 0; font-size: 13px; }
.jr-heure { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }
.jr-auto li { font-size: 13px; display: flex; gap: 10px; }
@media (max-width: 900px) {
  .vt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jr-cadre { grid-template-columns: 1fr; }
  .jr-case { min-height: 48px; }
}

/* Ce que Claude sait faire */
.cp-domaines { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0 14px; }
.cp-domaine { display: grid; gap: 2px; text-align: left; font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.cp-domaine.actif { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--surface-sunken); }
.cp-ico { font-size: 18px; }
.cp-titre { margin: 4px 0 8px; font-size: 15px; }
.cp-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cp-liste li { border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.cp-liste p { margin: 4px 0; font-size: 13px; }
@media (max-width: 900px) { .cp-domaines { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Contrôle de l'AR Nobilia (0049) ---------- */
.ar-bloc { border: 1px solid var(--line, #ddd); border-left-width: 6px; border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; display: grid; gap: 8px; }
.ar-bloc.ar-ok { border-color: var(--green); background: var(--green-bg); }
.ar-bloc.ar-ko { border-color: var(--red); background: var(--red-bg); }
.ar-bloc.ar-attente { border-color: var(--orange); background: var(--orange-bg); }
.ar-verdict { display: grid; gap: 2px; }
.ar-verdict strong { font-size: 1.15rem; }
.ar-ok .ar-verdict strong { color: var(--green); }
.ar-ko .ar-verdict strong { color: var(--red); }
.ar-resume { margin: 0; }
.ar-corr { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.ar-corr li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; }
.ar-corr-texte { flex: 1 1 260px; }
.ar-corr-corrigee .ar-corr-texte { text-decoration: line-through; opacity: .65; }
.ar-corr-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ar-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ar-nouvelle { flex: 1 1 220px; min-width: 0; }
/* L'écran « Contrôle des AR » */
.ar-liste { display: grid; gap: 10px; }
.ar-ligne { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; cursor: pointer; }
.ar-ligne .ar-corr { grid-column: 1 / -1; }

/* ---------- Mon tableau (vendeurs) ---------- */
.mt-grille { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.mt-section h2 { font-size: 1.05rem; margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.mt-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mt-ligne { padding: 8px 10px; border: 1px solid var(--line, #ddd); border-radius: var(--radius); cursor: pointer; }
.mt-ligne:hover { background: var(--surface-hover); }
.mt-ligne.mt-rouge { border-left: 4px solid var(--red); }
.mt-sous { margin: 4px 0 0; padding-left: 18px; }
.mt-ar { grid-column: 1 / -1; }

/* ---------- Agenda dans le planning (0051) ---------- */
.pl-rdv-btn.mesure { border-left: 3px solid #e6b800; }
.pl-rdv-btn.livraison { border-left: 3px solid var(--orange); }
.pl-rdv-btn.livraison.confirme { border-left-color: var(--green); }
.pl-rdv-btn.livraison.non-confirme { border-left-color: var(--red); }
.pl-rdv-btn.pose { border-left: 3px solid #3b6fd8; }
.pl-rdv-btn.sav { border-left: 3px solid #8a4fd8; }
.pl-filtres .sep { width: 12px; }
.chip.pl-type.mesure.active { box-shadow: inset 0 -3px #e6b800; }
.chip.pl-type.livraison.active { box-shadow: inset 0 -3px var(--orange); }
.chip.pl-type.pose.active { box-shadow: inset 0 -3px #3b6fd8; }
.chip.pl-type.sav.active { box-shadow: inset 0 -3px #8a4fd8; }

/* ---------- Mon tableau interactif (0052) ---------- */
.mt-haut { display: grid; gap: 12px; grid-template-columns: minmax(260px, 320px) 1fr; align-items: start; margin-bottom: 12px; }
@media (max-width: 760px) { .mt-haut { grid-template-columns: 1fr; } }
.mt-droite { display: grid; gap: 10px; }
.mc { padding: 10px 12px; }
.mc-tete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; text-transform: capitalize; }
.mc-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.mc-table th { font-weight: 600; color: var(--text-muted, #777); padding: 2px 0; text-align: center; }
.mc-table td { padding: 1px; text-align: center; }
.mc-sem { width: 34px; font-size: 11px; color: var(--vbk-red, #c8102e) !important; font-weight: 700; }
.mc-cette { background: var(--surface-hover); }
.mc-jour { width: 100%; min-height: 30px; border: 0; background: none; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font: inherit; color: inherit; padding: 2px 0; }
.mc-jour:hover { background: var(--surface-hover); }
.mc-jour.rdv { font-weight: 700; }
.mc-jour.auj { outline: 2px solid var(--vbk-red, #c8102e); }
.mc-jour.choisi { background: var(--vbk-red, #c8102e); color: #fff; }
.mc-points { display: flex; gap: 2px; margin-top: 1px; }
.mc-points i, .mc-leg i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.mc-leg i { margin: 0 3px 0 8px; }
.mc-points i.mesure, .mc-leg i.mesure { background: #e6b800; }
.mc-points i.livraison, .mc-leg i.livraison { background: var(--orange); }
.mc-points i.pose, .mc-leg i.pose { background: #3b6fd8; }
.mc-points i.sav, .mc-leg i.sav { background: #8a4fd8; }
.mc-legende, .mc-leg { margin: 4px 0 0; }
.mt-tuiles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.mt-tuile { border: 1px solid var(--line, #ddd); border-radius: var(--radius); background: var(--surface, #fff); padding: 10px 12px; text-align: left; cursor: pointer; display: grid; gap: 2px; font: inherit; color: inherit; border-left-width: 5px; transition: transform .1s; }
.mt-tuile:hover { transform: translateY(-1px); background: var(--surface-hover); }
.mt-tuile strong { font-size: 1.6rem; line-height: 1.1; }
.mt-tuile span { font-size: 13px; color: var(--text-muted, #666); }
.mt-tuile.rouge { border-left-color: var(--red); } .mt-tuile.rouge strong { color: var(--red); }
.mt-tuile.orange { border-left-color: var(--orange); }
.mt-tuile.vert { border-left-color: var(--green); }
.mt-tuile.bleu { border-left-color: #3b6fd8; }
.mt-tuile.gris { border-left-color: #999; }
.mt-tuile.active { box-shadow: 0 0 0 2px var(--vbk-red, #c8102e); }
.mt-jour-tete { display: flex; justify-content: space-between; align-items: center; }
.mt-jour-tete h2 { font-size: 1rem; margin: 0 0 6px; text-transform: capitalize; }
.mt-onglets { margin-top: 4px; }
.mt-section > summary { list-style: none; cursor: pointer; }
.mt-section > summary::-webkit-details-marker { display: none; }
.mt-section > summary h2::before { content: '▸ '; color: var(--text-muted, #888); }
.mt-section[open] > summary h2::before { content: '▾ '; }
.mt-compte { background: var(--vbk-red, #c8102e); color: #fff; border-radius: 10px; padding: 0 8px; font-size: 12px; }
.mt-compte.zero { background: var(--surface-hover); color: var(--text-muted, #888); }
.mt-large { grid-column: 1 / -1; }
.mt-focus { box-shadow: 0 0 0 2px var(--vbk-red, #c8102e); }
.ctl-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ctl-tete { width: 100%; display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: space-between; align-items: center; background: none; border: 0; padding: 12px 14px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.ctl-nom, .ctl-etat { display: grid; gap: 2px; }
.ctl-etat { justify-items: end; }
.ctl-corps { padding: 0 14px 12px; border-top: 1px solid var(--line, #eee); }
.ctl.ouvert { box-shadow: 0 0 0 1px var(--line, #ddd); }

/* ---------- Rendez-vous vendeurs (agenda Smart, 0053) ---------- */
.pl-rdv-btn.rdv { border-left: 3px solid #1f9d8a; }
.chip.pl-type.rdv.active { box-shadow: inset 0 -3px #1f9d8a; }
.mc-points i.rdv, .mc-leg i.rdv { background: #1f9d8a; }

/* ---------- Corrections d'AR en tableau : AR à gauche, plan à droite ---------- */
.ar-tab { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0; background: var(--surface, #fff); }
.ar-tab th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 6px 8px; border-bottom: 2px solid var(--line, #ddd); }
.ar-tab th:nth-child(2) { color: var(--red); }
.ar-tab th:nth-child(3) { color: #3b6fd8; }
.ar-tab td { padding: 7px 8px; border-bottom: 1px solid var(--line, #eee); vertical-align: top; }
.ar-tab-pos { width: 48px; font-weight: 700; white-space: nowrap; }
.ar-tab-ar { background: var(--red-bg); }
.ar-tab-plan { background: rgba(59, 111, 216, .08); }
.ar-tab-st { width: 1%; white-space: nowrap; }
.ar-tab .ar-corr-actions { display: flex; gap: 4px; margin-top: 4px; }
.ar-tab tr.ar-corr-corrigee td { opacity: .55; }
.ar-tab tr.ar-corr-corrigee .ar-tab-ar, .ar-tab tr.ar-corr-corrigee .ar-tab-plan { text-decoration: line-through; }
.ar-ligne-tab { grid-column: 1 / -1; overflow-x: auto; }
@media (max-width: 600px) {
  .ar-tab { font-size: 13px; }
  .ar-tab th, .ar-tab td { padding: 5px 4px; }
  .ar-tab-st { white-space: normal; }
  .ar-tab .ar-corr-actions { flex-direction: column; }
}
.ar-nouvelle-pos { width: 64px; flex: 0 0 64px; }

/* ---------- Mon tableau : tableaux déplaçables et SAV ---------- */
.mt-section > summary { display: flex; align-items: center; gap: 8px; }
.mt-section > summary h2 { flex: 1; margin: 0; }
.mt-poignee { cursor: grab; font-size: 18px; color: var(--text-muted, #999); padding: 0 4px; user-select: none; }
.mt-poignee:active { cursor: grabbing; }
.mt-fleches { display: flex; gap: 2px; opacity: .5; }
.mt-section:hover .mt-fleches { opacity: 1; }
.mt-section.mt-tire { opacity: .4; }
.mt-section.mt-cible { box-shadow: 0 0 0 3px #3b6fd8; }
.mt-astuce { align-self: center; margin-right: auto; }
.sav-tab-wrap { overflow-x: auto; }
.sav-tab { width: 100%; border-collapse: collapse; font-size: 14px; }
.sav-tab th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 6px 8px; border-bottom: 2px solid var(--line, #ddd); white-space: nowrap; }
.sav-tab td { padding: 7px 8px; border-bottom: 1px solid var(--line, #eee); vertical-align: top; }
.sav-tab tr.sav-libre td { background: var(--orange-bg); }
.sav-client { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; text-align: left; text-decoration: underline dotted; }
@media (max-width: 600px) { .sav-tab { font-size: 13px; } .sav-tab th, .sav-tab td { padding: 5px 4px; } .mt-astuce { display: none; } }

/* ---------- Agenda complet de Mon tableau (jour, semaine, mois) ---------- */
.ag { margin: 12px 0; }
.ag-tete { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ag-nav { display: flex; gap: 4px; }
.ag-titre { font-size: 1.05rem; text-transform: capitalize; }
.ag-vues { margin: 0; }
.ag-rdv { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 0; border-left: 4px solid #999; background: var(--surface-hover); border-radius: 6px; padding: 4px 6px; margin: 2px 0; cursor: pointer; font: inherit; color: inherit; line-height: 1.2; }
.ag-rdv:hover { filter: brightness(.95); }
.ag-rdv.statique { display: inline-flex; width: auto; cursor: default; }
.ag-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.ag-nom { font-size: 13px; }
.ag-rdv.rdv { border-left-color: #1f9d8a; background: rgba(31, 157, 138, .1); }
.ag-rdv.mesure { border-left-color: #e6b800; background: rgba(230, 184, 0, .12); }
.ag-rdv.livraison { border-left-color: var(--orange); background: var(--orange-bg); }
.ag-rdv.livraison.confirme { border-left-color: var(--green); background: var(--green-bg); }
.ag-rdv.livraison.non-confirme { border-left-color: var(--red); background: var(--red-bg); }
.ag-rdv.pose { border-left-color: #3b6fd8; background: rgba(59, 111, 216, .1); }
.ag-rdv.sav { border-left-color: #8a4fd8; background: rgba(138, 79, 216, .1); }
.ag-semaine { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 6px; overflow-x: auto; }
.ag-col { border: 1px solid var(--line, #eee); border-radius: 8px; padding: 4px; min-height: 120px; }
.ag-col.auj { border-color: var(--vbk-red, #c8102e); box-shadow: inset 0 3px var(--vbk-red, #c8102e); }
.ag-col-tete { width: 100%; background: none; border: 0; font: inherit; color: var(--text-muted, #666); text-transform: capitalize; padding: 2px 0 4px; cursor: pointer; }
.ag-col-tete strong { color: var(--text, #222); font-size: 1.1rem; }
.ag-mois-wrap { overflow-x: auto; }
.ag-mois { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 640px; }
.ag-mois th { font-size: 12px; color: var(--text-muted, #777); padding: 4px; text-transform: capitalize; }
.ag-mois td { border: 1px solid var(--line, #eee); vertical-align: top; padding: 2px 3px; height: 92px; }
.ag-mois td.hors { background: var(--surface-hover); opacity: .55; }
.ag-mois td.auj { box-shadow: inset 0 0 0 2px var(--vbk-red, #c8102e); }
.ag-mois .ag-rdv { padding: 2px 4px; }
.ag-mois .ag-nom { font-size: 12px; }
.ag-sem { width: 38px; color: var(--vbk-red, #c8102e) !important; font-weight: 700; font-size: 12px; text-align: center; vertical-align: middle !important; }
.ag-cette { background: rgba(200, 16, 46, .04); }
.ag-num { background: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; padding: 0 2px; color: inherit; }
.ag-plus { background: none; border: 0; font-size: 12px; color: var(--text-muted, #666); cursor: pointer; padding: 0; }
.ag-jour-liste { display: grid; gap: 6px; }
.ag-jour-liste .ag-rdv { padding: 8px 10px; }
.ag-jour-liste .ag-nom { font-size: 15px; font-weight: 600; }
.ag-vide { display: block; min-height: 20px; }
.ag-leg { margin: 8px 0 0; }
.ag-leg i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 3px 0 8px; }
.ag-leg i.rdv { background: #1f9d8a; } .ag-leg i.mesure { background: #e6b800; } .ag-leg i.livraison { background: var(--orange); } .ag-leg i.pose { background: #3b6fd8; } .ag-leg i.sav { background: #8a4fd8; }
.ag-fond { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 900; }
.ag-fiche { position: fixed; z-index: 901; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, 94vw); max-height: 88vh; overflow-y: auto; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.ag-fiche-tete { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ag-fiche-tete h2 { flex: 1; margin: 0; font-size: 1.15rem; }
.ag-fiche-tab { width: 100%; border-collapse: collapse; font-size: 14px; }
.ag-fiche-tab th { text-align: left; width: 34%; color: var(--text-muted, #666); font-weight: 600; padding: 6px 8px 6px 0; vertical-align: top; }
.ag-fiche-tab td { padding: 6px 0; border-bottom: 1px solid var(--line, #eee); }
.ag-fiche-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
@media (max-width: 700px) { .ag-semaine { grid-template-columns: repeat(7, 120px); } }

/* Filtres de types de l'agenda */
.ag-types { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -2px 0 10px; }
.ag-type-btn { border: 1px solid var(--line, #ddd); border-left-width: 4px; background: none; border-radius: 16px; padding: 3px 10px; font: inherit; font-size: 13px; cursor: pointer; opacity: .5; color: inherit; }
.ag-type-btn.actif { opacity: 1; font-weight: 600; }
.ag-type-btn.rdv { border-left-color: #1f9d8a; } .ag-type-btn.rdv.actif { background: rgba(31, 157, 138, .1); }
.ag-type-btn.mesure { border-left-color: #e6b800; } .ag-type-btn.mesure.actif { background: rgba(230, 184, 0, .12); }
.ag-type-btn.livraison { border-left-color: var(--orange); } .ag-type-btn.livraison.actif { background: var(--orange-bg); }
.ag-type-btn.pose { border-left-color: #3b6fd8; } .ag-type-btn.pose.actif { background: rgba(59, 111, 216, .1); }
.ag-type-btn.sav { border-left-color: #8a4fd8; } .ag-type-btn.sav.actif { background: rgba(138, 79, 216, .1); }

/* ---------- Menu en groupes (Clients, Argent, Claude, Réglages) ---------- */
.nav-groupe {
  margin: 14px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.nav-groupe[hidden] { display: none; }

/* ---------- Fiche client en onglets ---------- */
.cl-retour { display: flex; align-items: center; gap: 12px; }
.cl-retour-nom { font-size: 17px; }
.cl-onglets { margin: 12px 0 14px; position: sticky; top: 0; z-index: 5; background: var(--bg, #fff); padding: 6px 0; }
.cl-onglet-n {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; margin-left: 4px;
  background: var(--grey-bg); color: var(--muted); font-size: 11px; line-height: 18px; text-align: center;
}
.chip.active .cl-onglet-n { background: rgba(255,255,255,.25); color: inherit; }
.cl-onglet-alerte {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%; margin-left: 4px;
  background: var(--vbk-red); color: #fff; font-size: 11px; line-height: 16px; text-align: center; font-weight: 700;
}

/* Procédures de la centrale dans le Cerveau */
.cv-proc { border-top: 1px solid var(--line, #e5e5e5); padding: 8px 0; }
.cv-proc summary { cursor: pointer; padding: 4px 0; }
.cv-proc ol, .cv-proc ul { margin: 8px 0 4px 18px; display: grid; gap: 4px; }

/* Mails clients (parcours) et compteur d'économies, point 5 du 23/11/2026 */
.pc-onglets { margin-bottom: 12px; }
.pc-mail, .pc-modele { margin-bottom: 12px; }
.pc-mail-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 6px; }
.pc-champ { display: block; margin: 8px 0; }
.pc-champ span { display: block; margin-bottom: 3px; color: var(--muted, #666); }
.pc-champ input, .pc-champ textarea, .pc-ligne input { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--border, #ddd); border-radius: 8px; background: var(--surface, #fff); color: inherit; }
.pc-champ textarea { resize: vertical; line-height: 1.45; }
.pc-ligne { display: flex; gap: 8px; }
.pc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pc-corps { white-space: pre-wrap; font: inherit; margin: 6px 0; padding: 10px; background: var(--surface-2, #f6f6f6); border-radius: 8px; }
.pc-alerte { color: var(--vbk-red, #d5121e); }
.eco { margin-bottom: 14px; }
.eco-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.eco-chiffres > div { display: flex; flex-direction: column; gap: 2px; }
.eco-chiffres b { font-size: 28px; line-height: 1.1; }
.eco-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 14px; }
.eco-liste { list-style: none; padding: 0; margin: 6px 0 0; }
.eco-liste li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--border, #e5e5e5); }
.eco-cout { width: 70px; font: inherit; padding: 3px 6px; border: 1px solid var(--border, #ddd); border-radius: 6px; }

/* Congé d'un vendeur dans l'agenda (23/11/2026) */
.ag-rdv.conge { border-left-color: #8a8f98; background: repeating-linear-gradient(135deg, rgba(138,143,152,.12) 0 6px, rgba(138,143,152,.04) 6px 12px); }


/* ---------------------------------------------------------------
   Mode sombre (23/11/2026) : clair, sombre ou automatique (suit le
   réglage de l'appareil). Choix retenu sur l'appareil, bouton ◐ du
   bandeau. Seules les couleurs de fond, de texte et de bord changent :
   le bandeau noir et le rouge de marque restent identiques.
   --------------------------------------------------------------- */
:root { --surface-2: #F6F7F9; --line: #E4E7EA; color-scheme: light; }
html[data-theme="dark"] {
  --bg:             #121417;
  --surface:        #1B1E22;
  --border:         #2E333A;
  --text:           #E8EAED;
  --text-muted:     #9DA4AE;
  --ok:             #3CCB7F;
  --ok-soft:        #16301F;
  --warn:           #F0B04A;
  --warn-soft:      #33270F;
  --danger:         #F27C7C;
  --danger-soft:    #3A1C1C;
  --border-strong:  #3C424B;
  --border-ok:      #24563A;
  --border-warn:    #5A4317;
  --border-danger:  #5A2828;
  --border-dashed:  #3C424B;
  --line-soft:      #24282E;
  --surface-alt:    #1F2227;
  --surface-hover:  #272B31;
  --surface-sunken: #16191C;
  --surface-2:      #23272C;
  --line:           #2E333A;
  --row-hover:      #22262B;
  --row-danger:     #2A1B1B;
  --row-danger-hover: #331F1F;
  --row-select:     #1E2735;
  --row-select-hover: #253146;
  --row-flash:      #173323;
  --ok-soft-hover:  #1B3A27;
  --ok-dark:        #34B874;
  --skeleton-a:     #23272C;
  --skeleton-b:     #2B3036;
  --art:            #3C424B;
  --toast-bg:       #2B313A;
  --row-highlight:  #3A3214;
  --info:           #6FA4FF;
  --info-soft:      #172338;
  --border-info:    #284270;
  --overlay:        rgba(0, 0, 0, .6);
  --primary:        #4A5260;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .5);
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, .5);
  --shadow-modal: 0 12px 40px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) {
  --bg:             #121417;
  --surface:        #1B1E22;
  --border:         #2E333A;
  --text:           #E8EAED;
  --text-muted:     #9DA4AE;
  --ok:             #3CCB7F;
  --ok-soft:        #16301F;
  --warn:           #F0B04A;
  --warn-soft:      #33270F;
  --danger:         #F27C7C;
  --danger-soft:    #3A1C1C;
  --border-strong:  #3C424B;
  --border-ok:      #24563A;
  --border-warn:    #5A4317;
  --border-danger:  #5A2828;
  --border-dashed:  #3C424B;
  --line-soft:      #24282E;
  --surface-alt:    #1F2227;
  --surface-hover:  #272B31;
  --surface-sunken: #16191C;
  --surface-2:      #23272C;
  --line:           #2E333A;
  --row-hover:      #22262B;
  --row-danger:     #2A1B1B;
  --row-danger-hover: #331F1F;
  --row-select:     #1E2735;
  --row-select-hover: #253146;
  --row-flash:      #173323;
  --ok-soft-hover:  #1B3A27;
  --ok-dark:        #34B874;
  --skeleton-a:     #23272C;
  --skeleton-b:     #2B3036;
  --art:            #3C424B;
  --toast-bg:       #2B313A;
  --row-highlight:  #3A3214;
  --info:           #6FA4FF;
  --info-soft:      #172338;
  --border-info:    #284270;
  --overlay:        rgba(0, 0, 0, .6);
  --primary:        #4A5260;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .5);
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, .5);
  --shadow-modal: 0 12px 40px rgba(0, 0, 0, .6);
  color-scheme: dark;
  }
}
html[data-theme="dark"] img.logo-clair, html[data-theme="dark"] .pc-corps { filter: none; }
.theme-btn { font-size: 16px; }

/* ---------------------------------------------------------------
   Procédures (bibliothèque modulaire, 0061)
   --------------------------------------------------------------- */
.pr-refs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 10px 0; }
.pr-ref-groupe h3 { font-size: 13px; margin: 0 0 6px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.pr-ref-groupe ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.pr-ref-groupe .icon-btn { width: 22px; height: 22px; font-size: 11px; vertical-align: middle; }
.pr-ref-form { display: flex; gap: 6px; flex-wrap: wrap; }
.pr-ref-form input { flex: 1 1 160px; }
.pr-outils { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0 6px; }
.pr-outils .search { flex: 1 1 220px; }
.pr-groupe { margin-top: 12px; }
.pr-fiche { border-top: 1px solid var(--border); padding: 8px 0; }
.pr-fiche summary { cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; list-style: none; }
.pr-fiche summary::-webkit-details-marker { display: none; }
.pr-fiche[open] summary .pr-titre { font-weight: 600; }
.pr-id { font-variant-numeric: tabular-nums; min-width: 38px; }
.pr-titre { flex: 1 1 240px; }
.pr-etapes { margin: 10px 0 6px; padding-left: 22px; line-height: 1.6; font-size: 14px; }
.pr-etapes li { margin-bottom: 4px; }
.pr-edit { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.pr-edit textarea { width: 100%; font: inherit; }
.pr-edit-bas { display: flex; gap: 6px; flex-wrap: wrap; }
.pr-regles ul { padding-left: 18px; line-height: 1.6; }

.pr-erreurs { border-left: 3px solid var(--orange, #d97706); background: var(--orange-bg, rgba(217,119,6,.08)); padding: 6px 10px; margin: 6px 0; border-radius: 4px; font-size: 13.5px; }
.pr-erreurs p { margin: 2px 0 0; line-height: 1.5; }

.sys-frame { width: 100%; height: calc(100vh - 170px); min-height: 520px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }


/* =====================================================================
   Thème « chaleureux magasin » (23/11/2026) : crème, bois clair, coins
   ronds. Ne touche que le mode clair ; le mode sombre garde ses couleurs.
   ===================================================================== */
:root {
  --bg:             #F6F0E6;
  --surface:        #FFFCF7;
  --border:         #E9DDCC;
  --text:           #2E2620;
  --text-muted:     #7C6C5E;
  --border-strong:  #D7C4AA;
  --border-dashed:  #D7C4AA;
  --line-soft:      #F2E8DA;
  --surface-alt:    #FBF6EE;
  --surface-hover:  #F4EADB;
  --surface-sunken: #EFE4D3;
  --row-hover:      #FBF4EA;
  --row-select:     #F3E7D5;
  --row-select-hover: #EEDFC9;
  --skeleton-a:     #EFE5D7;
  --skeleton-b:     #F7F0E5;
  --art:            #D9C6AB;
  --toast-bg:       #4A3A2E;
  --bois:           #8A6648;
  --bois-fonce:     #6B4E37;
  --bois-clair:     #E4C79F;
  --primary:        #6B4E37;
  --radius: 12px;
  --radius-card: 16px;
  --shadow: 0 1px 2px rgba(74, 52, 30, .06), 0 2px 8px rgba(74, 52, 30, .06);
  --shadow-pop: 0 10px 28px rgba(74, 52, 30, .16);
}
html:not([data-theme="dark"]) h1,
html:not([data-theme="dark"]) .card-head h2 { font-family: Fraunces, Georgia, serif; font-weight: 600; letter-spacing: -.2px; }
html:not([data-theme="dark"]) h1 { font-size: 24px; }
html:not([data-theme="dark"]) .appbar {
  background: linear-gradient(90deg, var(--bois-fonce), var(--bois));
  border-bottom: 3px solid var(--vbk-red);
}
html:not([data-theme="dark"]) .sidebar { background: var(--surface-alt); }
html:not([data-theme="dark"]) .nav-item { border-radius: 10px; }
html:not([data-theme="dark"]) .nav-item.active { background: #F0E1CB; box-shadow: inset 3px 0 0 var(--vbk-red); }
.card { border-radius: var(--radius-card); }
.btn { border-radius: 10px; }
.pill { border-radius: 999px; }

/* Bandeau d'accueil : vraie photo de cuisine, traitement éditorial */
.hero {
  position: relative; border-radius: 20px; overflow: hidden; min-height: 230px;
  background: #2A231D var(--hero-photo, url("https://images.unsplash.com/photo-1783841193339-9a2ec13b4118?w=1800&q=80&auto=format&fit=crop")) var(--hero-pos, 62% 55%) / cover no-repeat;
  box-shadow: 0 18px 40px -22px rgba(30,20,12,.55); margin-bottom: 16px; display: flex; align-items: flex-end;
}
.hero::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(20,15,11,.78) 0%, rgba(20,15,11,.45) 40%, rgba(20,15,11,0) 72%),
              linear-gradient(0deg, rgba(20,15,11,.55) 0%, rgba(20,15,11,0) 55%); }
.hero-texte { position: relative; z-index: 1; padding: 22px 26px; }
.hero-sur { margin: 0 0 6px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,248,238,.85); font-weight: 600;
  display: flex; align-items: center; gap: 10px; }
.hero-sur::before { content: ""; width: 22px; height: 2px; background: var(--vbk-red); }
.hero-titre { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 42px; font-weight: 500; color: #FFF8EE; line-height: 1.05; letter-spacing: -.01em; text-shadow: 0 2px 18px rgba(0,0,0,.25); }
.hero-bonjour { margin: 6px 0 0; color: rgba(255,248,238,.82); font-size: 15px; }
.tuiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.tuile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; font: inherit; font-weight: 600; font-size: 14px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.tuile:hover { transform: translateY(-1px); box-shadow: var(--shadow-pop); border-color: var(--bois); }
.tuile-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--tuile-fond, #F3E6D4); color: var(--tuile-texte, var(--bois-fonce)); }
.tuile-ico svg, .appbar-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.appbar-btn svg { width: 17px; height: 17px; vertical-align: middle; }
html[data-theme="dark"] .tuile-ico { background: #2B2621; color: #E3C9A6; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) .tuile-ico { background: #2B2621; color: #E3C9A6; }
}
@media (max-width: 900px) {
  .tuiles { grid-template-columns: repeat(2, 1fr); }
  .hero { min-height: 190px; } .hero-titre { font-size: 34px; }
  .hero-texte { padding: 18px 20px; }
}

.pr-admin-groupe { border-top: 1px solid var(--border); padding: 8px 0; }
.pr-admin-groupe summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pr-admin-groupe summary .btn { margin-left: auto; }
.pr-admin-ligne { display: flex; gap: 8px; align-items: center; padding: 5px 4px 5px 18px; font-size: 13.5px; cursor: pointer; }
.pr-admin-ligne input { width: 18px; height: 18px; flex: none; }
#pr-admin-recherche { width: 100%; margin: 8px 0; }

.pc-delai { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 8px; }
.pc-delai input[type=number] { width: 70px; }
.pc-jour h3 { margin: 0 0 6px; font-size: 15px; }
.pc-envoye { border-top: 1px solid var(--border); padding: 7px 0; }
.pc-envoye summary { cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pc-actif { margin-left: auto; }

.pc-timeline { position: relative; padding-left: 22px; }
.pc-timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border-strong); }
.pc-phase { margin: 18px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.pc-etape { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin: 0 0 8px; }
.pc-etape summary { list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.pc-etape summary::-webkit-details-marker { display: none; }
.pc-point { position: absolute; left: -20px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--vbk-red); box-shadow: 0 0 0 3px var(--bg); }
.pc-off .pc-point { background: var(--border-strong); }
.pc-off .pc-etape-titre { opacity: .6; }
.pc-etape-titre { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pc-etape-corps { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.pc-etape-corps textarea { width: 100%; font: inherit; font-size: 13.5px; line-height: 1.5; }

/* Enseigne : logo en texte quand l'enseigne n'a pas encore son fichier logo */
.logo-mot { font-family: Fraunces, Georgia, serif; font-size: 22px; font-weight: 600; color: #fff; letter-spacing: .01em; white-space: nowrap; }
.logo-mot-login { color: var(--vbk-red); font-size: 30px; text-align: center; margin: 0 0 4px; }
.ens-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.ens-carte { font: inherit; text-align: left; border: 2px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); color: var(--text); cursor: pointer; padding: 0; }
.ens-carte.actif { border-color: var(--vbk-red); }
.ens-photo { height: 70px; background-size: cover; background-position: center; position: relative; }
.ens-barre { height: 8px; }
.ens-nom { padding: 8px 10px 10px; font-weight: 600; font-size: 13px; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.ens-provi { font-size: 10px; font-weight: 600; color: var(--text-muted, #8a7f74); text-transform: uppercase; letter-spacing: .05em; }

/* Mode sombre : la couleur principale reste lisible quelle que soit l'enseigne
   (une barre anthracite donnerait des boutons noirs sur fond noir). */
html[data-theme="dark"] { --primary: #4A4F57 !important; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) { --primary: #4A4F57 !important; } }
html[data-theme="dark"] .appbar { box-shadow: 0 1px 0 rgba(255,255,255,.06); }

/* Phrase d'accroche de l'enseigne */
.hero-accroche { margin: 4px 0 0; font-family: Fraunces, Georgia, serif; font-style: italic; font-size: 17px; color: #F3E3CC; letter-spacing: .01em; }
.hero-accroche + .hero-bonjour { margin-top: 8px; }
.login-accroche { margin: -2px 0 14px; text-align: center; font-family: Fraunces, Georgia, serif; font-style: italic; font-size: 15px; color: var(--vbk-red); }
.ens-acc { font-weight: 400; font-style: italic; color: var(--text-muted, #8a7f74); }

/* Licence et réseau des magasins */
.licence-bloc { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(15,16,18,.92); padding: 20px; }
.licence-carte { max-width: 440px; background: var(--surface); color: var(--text); border-radius: 18px; padding: 28px; box-shadow: var(--shadow-modal); border-top: 4px solid var(--vbk-red); }
.licence-carte h2 { font-family: Fraunces, Georgia, serif; margin: 4px 0 10px; }
.licence-sur { margin: 0; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--vbk-red); font-weight: 700; }
.rs-carte { margin-bottom: 14px; }
.rs-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.rs-tete h3 { margin: 0; font-family: Fraunces, Georgia, serif; }
.rs-statut { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #E8F5EC; color: #1E7A3E; }
.rs-suspendu, .rs-resilie { background: #FDE8E8; color: #B42318; }
.rs-essai { background: #FFF4DE; color: #9A6700; }
.rs-grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0 8px; }
.rs-grille > div { display: flex; flex-direction: column; gap: 2px; }
.rs-pastille { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.rs-vert { background: #2E9E5B; } .rs-rouge { background: #D92630; } .rs-gris { background: #A8A29E; }
.rs-actions { margin-top: 10px; }
@media (max-width: 700px) { .rs-grille { grid-template-columns: 1fr; } }

/* ---- Réseau : modules par magasin, ajout d'un magasin ---- */
.rs-modules { margin: 10px 0; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.rs-module { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.rs-module input { margin-top: 3px; accent-color: var(--vbk-red, #FF3640); width: 18px; height: 18px; }
.rs-module span { display: flex; flex-direction: column; }
.rs-ajout h3 { margin-top: 0; font-family: Fraunces, Georgia, serif; }
.rs-ajout-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }

/* ---- Banque ---- */
.bq-compte { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.bq-ajout { margin-top: 10px; }
.bq-ajout summary { cursor: pointer; font-weight: 600; }
.bq-ajout-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 10px 0; }
.bq-barre { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 16px 0 8px; flex-wrap: wrap; }
.bq-filtres { display: flex; gap: 6px; flex-wrap: wrap; }
.bq-filtres .chip { border: 1px solid var(--line-soft); background: transparent; border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.bq-filtres .chip.active { background: var(--bois-fonce, #141518); color: #fff; }
.bq-mvt { display: grid; grid-template-columns: 90px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.bq-date, .bq-quoi { display: flex; flex-direction: column; }
.bq-lien { color: var(--text, inherit); margin-top: 2px; }
.bq-montant { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.bq-in { color: #1E8E4E; } .bq-out { color: #B3261E; }
.bq-actions { display: flex; gap: 6px; }
.mono { font-family: ui-monospace, Menlo, monospace; }
@media (max-width: 700px) {
  .bq-mvt { grid-template-columns: 1fr auto; }
  .bq-actions { grid-column: 1 / -1; }
  .bq-compte { grid-template-columns: 1fr; }
}

/* ---- Présence de l'équipe (barre du haut, gérant) ---- */
.presence-equipe { display: flex; gap: 10px; align-items: center; margin-right: 10px; flex-wrap: wrap; }
.pr-membre { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; cursor: default; }
.pr-point { width: 9px; height: 9px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.pr-on { background: #1FA35B; }
.pr-off { background: #D93A3A; }
@media (max-width: 760px) { .presence-equipe .pr-membre { font-size: 0; gap: 0; } .presence-equipe { gap: 4px; } }

/* Signature éditeur */
.signature-ss { display: block; text-align: center; margin-top: 10px; font-size: 11px; color: var(--muted); text-decoration: none; letter-spacing: .02em; }
.signature-ss strong { font-weight: 600; }
.signature-ss:hover { color: var(--text); }
.sidebar-foot .signature-ss { text-align: left; padding: 0 8px; }
