/* ============ Gestion commerciale SOPHARMAL — thème ============ */
:root {
  --nav: #0f2238; --nav-2: #16304d; --nav-texte: #c9d6e6; --nav-doux: #7f95b0;
  --primaire: #1660c4; --primaire-fonce: #0f4c9e; --primaire-clair: #eaf2fd;
  --accent: #19a974; --accent-clair: #e6f6ef;
  --vert: #157a4b; --vert-clair: #e5f5ec; --orange: #b45309; --orange-clair: #fef3e2; --rouge: #c0261a; --rouge-clair: #fdecea;
  --texte: #18212f; --texte-2: #4a5568; --gris: #6b778a; --bord: #e1e6ed; --bord-2: #ccd4de; --fond: #f2f4f7; --carte: #fff; --ligne: #f6f8fb; --survol: #edf3fc;
  --rayon: 10px; --ombre: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04); --ombre-forte: 0 18px 50px rgba(15, 34, 56, .22);
  font-family: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  font-size: 13.5px; color: var(--texte); -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); }
a { color: var(--primaire); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.ico { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Barres de défilement fines et discrètes */
* { scrollbar-width: thin; scrollbar-color: #c3cbd6 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c9d0da; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #a3aebd; background-clip: padding-box; border: 3px solid transparent; }
::-webkit-scrollbar-corner { background: transparent; }
nav.menu { scrollbar-color: #2b4766 transparent; }
nav.menu::-webkit-scrollbar-thumb { background: #2a4565; background-clip: padding-box; }

/* ============ Mise en page ============ */
.app { display: grid; grid-template-columns: 236px 1fr; height: 100vh; overflow: hidden; transition: grid-template-columns .2s; }
.app.replie { grid-template-columns: 60px 1fr; }
nav.menu { background: var(--nav); color: var(--nav-texte); display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; }
.marque { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; border-bottom: 1px solid #1d3654; }
.logo { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, #1fb67a, #1660c4); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px; flex: none; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.marque b { color: #fff; font-size: 15px; letter-spacing: .02em; display: block; }
.marque small { color: var(--nav-doux); font-size: 11.5px; }
nav.menu .groupe { padding: 16px 18px 6px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--nav-doux); white-space: nowrap; }
nav.menu a { display: flex; align-items: center; gap: 11px; margin: 1px 8px; padding: 7px 10px; border-radius: 7px; color: var(--nav-texte); white-space: nowrap; position: relative; }
nav.menu a:hover { background: var(--nav-2); color: #fff; text-decoration: none; }
nav.menu a.actif { background: #1c3b60; color: #fff; font-weight: 600; }
nav.menu a.actif::before { content: ""; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
nav.menu a .lib { flex: 1; overflow: hidden; text-overflow: ellipsis; }
nav.menu .pastille { background: #f59e0b; color: #1b1300; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; line-height: 18px; }
nav.menu .bas { margin-top: auto; padding: 10px 8px 14px; border-top: 1px solid #1d3654; }
.app.replie nav.menu .groupe, .app.replie nav.menu .lib, .app.replie .marque div, .app.replie nav.menu .pastille { display: none; }
.app.replie nav.menu a { justify-content: center; padding: 9px 0; }

.droite { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
header.barre { height: 56px; flex: none; background: #fff; border-bottom: 1px solid var(--bord); display: flex; align-items: center; gap: 12px; padding: 0 20px 0 12px; }
.icone-btn { border: none; background: none; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--texte-2); cursor: pointer; padding: 0; }
.icone-btn:hover { background: var(--fond); color: var(--texte); }
.fil { font-size: 13px; color: var(--gris); white-space: nowrap; }
.fil b { color: var(--texte); font-weight: 600; }
.recherche-globale { margin-left: auto; display: flex; align-items: center; gap: 8px; width: min(440px, 40vw); height: 36px; padding: 0 12px; border: 1px solid var(--bord); border-radius: 9px; background: var(--fond); color: var(--gris); cursor: text; }
.recherche-globale:hover { border-color: var(--bord-2); background: #fff; }
.recherche-globale span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
kbd { font: 600 11px/1 inherit; padding: 3px 6px; border: 1px solid var(--bord-2); border-bottom-width: 2px; border-radius: 5px; background: #fff; color: var(--texte-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #1660c4, #19a974); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; cursor: pointer; border: none; flex: none; }
.menu-util { position: absolute; right: 16px; top: 52px; background: #fff; border: 1px solid var(--bord); border-radius: 10px; box-shadow: var(--ombre-forte); min-width: 230px; padding: 6px; z-index: 60; animation: apparition .12s ease-out; }
.menu-util .qui { padding: 10px 12px; border-bottom: 1px solid var(--bord); margin-bottom: 4px; }
.menu-util .qui b { display: block; }
.menu-util a { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 7px; color: var(--texte); }
.menu-util a:hover { background: var(--fond); text-decoration: none; }

main { flex: 1; overflow-y: auto; padding: 22px 28px 48px; scroll-behavior: smooth; }
#page { max-width: 1500px; margin: 0 auto; animation: apparition .18s ease-out; }
@keyframes apparition { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.entete h1 { font-size: 21px; font-weight: 650; margin: 0; letter-spacing: -.01em; }
.entete .sous { color: var(--gris); margin-top: 4px; font-size: 13px; }

/* Barre de chargement */
#chargement { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--accent), var(--primaire)); z-index: 200; transition: width .3s ease, opacity .3s; opacity: 0; }
#chargement.actif { opacity: 1; width: 70%; transition: width 2s cubic-bezier(.1,.7,.2,1); }

/* ============ Boutons ============ */
button, .btn { font: inherit; font-weight: 500; border: 1px solid var(--bord-2); background: #fff; color: var(--texte); height: 34px; padding: 0 14px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; box-shadow: 0 1px 1px rgba(16,24,40,.04); transition: background .12s, border-color .12s, box-shadow .12s; }
button:hover, .btn:hover { background: #f6f8fb; border-color: #b9c3cf; text-decoration: none; }
button:focus-visible, .btn:focus-visible { outline: 2px solid #9cc1f3; outline-offset: 1px; }
button.principal { background: var(--primaire); border-color: var(--primaire); color: #fff; }
button.principal:hover { background: var(--primaire-fonce); border-color: var(--primaire-fonce); }
button.succes { background: var(--accent); border-color: var(--accent); color: #fff; }
button.succes:hover { background: #12915f; }
button.danger { color: var(--rouge); border-color: #f0bdb8; }
button.danger:hover { background: var(--rouge-clair); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.petit, .btn.petit { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ============ Cartes et indicateurs ============ */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--ombre); }
.carte h2 { font-size: 14.5px; font-weight: 650; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.grille { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 16px; }
.grille2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.kpi { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px 16px; box-shadow: var(--ombre); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primaire); opacity: .85; }
.kpi:nth-child(2)::after { background: var(--accent); } .kpi:nth-child(3)::after { background: #7c3aed; } .kpi:nth-child(4)::after { background: #f59e0b; } .kpi:nth-child(5)::after { background: #0891b2; } .kpi:nth-child(6)::after { background: #db2777; }
.kpi .lib { color: var(--gris); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .val { font-size: 22px; font-weight: 650; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .det { color: var(--gris); font-size: 12px; margin-top: 4px; }

/* ============ Tableaux ============ */
.outils { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.champ-recherche { position: relative; }
.champ-recherche svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--gris); width: 15px; height: 15px; }
.champ-recherche input { width: 300px; padding-left: 32px; }
.outils .compte { color: var(--gris); font-size: 12.5px; margin-left: auto; }
.cadre-table { border: 1px solid var(--bord); border-radius: var(--rayon); overflow: auto; max-height: calc(100vh - 230px); background: #fff; box-shadow: var(--ombre); }
.carte .cadre-table { box-shadow: none; max-height: 480px; }
table.liste { width: 100%; border-collapse: separate; border-spacing: 0; }
table.liste th { text-align: left; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--gris); padding: 0 12px; height: 38px; border-bottom: 1px solid var(--bord); background: #f8fafc; position: sticky; top: 0; z-index: 1; white-space: nowrap; user-select: none; }
table.liste th.triable { cursor: pointer; }
table.liste th.triable:hover { color: var(--texte); background: #f0f4f9; }
table.liste th .fleche { display: inline-block; width: 10px; margin-left: 4px; color: var(--primaire); }
table.liste td { padding: 0 12px; height: 38px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
table.liste tbody tr:nth-child(even) td { background: #fbfcfd; }
table.liste tbody tr:hover td { background: var(--survol); }
table.liste tbody tr:last-child td { border-bottom: none; }
table.liste tr.cliquable { cursor: pointer; }
table.liste .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.liste tfoot td { font-weight: 650; border-top: 1px solid var(--bord-2); background: #f8fafc; position: sticky; bottom: 0; }
.plus-lignes { display: flex; justify-content: center; padding: 10px; border-top: 1px solid var(--bord); background: #fafbfc; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: #eef1f5; color: #475467; white-space: nowrap; line-height: 18px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.vert { background: var(--vert-clair); color: var(--vert); }
.badge.orange { background: var(--orange-clair); color: var(--orange); }
.badge.rouge { background: var(--rouge-clair); color: var(--rouge); }
.badge.bleu { background: var(--primaire-clair); color: var(--primaire); }
.alerte { padding: 11px 14px 11px 40px; border-radius: 9px; margin-bottom: 14px; border: 1px solid; line-height: 1.5; position: relative; }
.alerte::before { content: "i"; position: absolute; left: 13px; top: 11px; width: 17px; height: 17px; border-radius: 50%; border: 1.6px solid currentColor; font: 700 11px/14px Georgia, serif; text-align: center; opacity: .8; }
.alerte.orange::before, .alerte.rouge::before { content: "!"; font-family: inherit; }
.alerte.orange { background: var(--orange-clair); border-color: #f7d4a3; color: #7a3d03; }
.alerte.rouge { background: var(--rouge-clair); border-color: #f3c0bb; color: #8a1a10; }
.alerte.bleu { background: var(--primaire-clair); border-color: #c4dbf7; color: #0f3f80; }
.alerte ul { margin: 4px 0 0; padding-left: 18px; }
.vide { color: var(--gris); padding: 34px 18px !important; text-align: center; height: auto !important; }
.gris { color: var(--gris); }
.rouge-txt { color: var(--rouge); }
.vert-txt { color: var(--vert); }

/* ============ Formulaires ============ */
label { display: block; font-size: 12.5px; color: var(--texte-2); margin-bottom: 5px; font-weight: 600; }
input, select, textarea { font: inherit; height: 34px; padding: 0 10px; border: 1px solid var(--bord-2); border-radius: 8px; width: 100%; background: #fff; color: var(--texte); transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; padding: 8px 10px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primaire); }
input:hover, select:hover, textarea:hover { border-color: #aeb9c7; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primaire); box-shadow: 0 0 0 3px rgba(22, 96, 196, .15); }
input.num { text-align: right; font-variant-numeric: tabular-nums; }
.champs { display: grid; gap: 14px 18px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); margin-bottom: 16px; }
.champs .large { grid-column: 1 / -1; }
.case { display: flex; align-items: center; gap: 9px; font-weight: 500; color: var(--texte); cursor: pointer; }
.case input { width: auto; height: auto; }
h3 { font-size: 13.5px; margin: 18px 0 10px; color: var(--texte); font-weight: 650; }
table.saisie { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 10px; border: 1px solid var(--bord); border-radius: 9px; overflow: hidden; }
table.saisie th { text-align: left; font-size: 11.5px; color: var(--gris); padding: 8px; font-weight: 600; background: #f8fafc; border-bottom: 1px solid var(--bord); text-transform: uppercase; letter-spacing: .03em; }
table.saisie td { padding: 5px 6px; border-bottom: 1px solid #eef1f5; }
table.saisie tr:last-child td { border-bottom: none; }
table.saisie input, table.saisie select { height: 32px; }

/* ============ Fenêtres ============ */
.voile { position: fixed; inset: 0; background: rgba(15, 25, 40, .45); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; z-index: 50; animation: fondu .15s ease-out; }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
.modale { background: #fff; border-radius: 14px; width: min(1000px, 100%); box-shadow: var(--ombre-forte); animation: monte .18s ease-out; }
@keyframes monte { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }
.modale.etroite { width: min(560px, 100%); }
.modale header { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--bord); }
.modale header h2 { margin: 0; font-size: 16.5px; font-weight: 650; }
.modale .corps { padding: 20px 22px; max-height: 70vh; overflow-y: auto; }
.modale footer { padding: 14px 22px; border-top: 1px solid var(--bord); display: flex; justify-content: flex-end; gap: 8px; background: #f8fafc; border-radius: 0 0 14px 14px; }
.fermer { border: none; background: none; box-shadow: none; font-size: 22px; padding: 0 8px; height: 32px; color: var(--gris); }
.fermer:hover { background: var(--fond); }

/* Recherche globale (Ctrl+K) */
.palette { width: min(640px, 100%); background: #fff; border-radius: 14px; box-shadow: var(--ombre-forte); overflow: hidden; animation: monte .15s ease-out; }
.palette .saisie { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--bord); }
.palette .saisie input { border: none; box-shadow: none; height: 54px; font-size: 16px; padding: 0; }
.palette .resultats { max-height: 60vh; overflow-y: auto; padding: 6px; }
.palette .grp { padding: 10px 12px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gris); }
.palette .res { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--texte); }
.palette .res .t { flex: 1; min-width: 0; }
.palette .res .t div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette .res small { color: var(--gris); }
.palette .res.sel, .palette .res:hover { background: var(--primaire-clair); }
.palette .res .pic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--fond); color: var(--texte-2); }
.palette .pied { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--bord); color: var(--gris); font-size: 12px; background: #f8fafc; }

#toast { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
#toast div { display: flex; align-items: center; gap: 10px; background: #18212f; color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 440px; animation: glisse .2s ease-out; }
#toast div.erreur { background: var(--rouge); }
#toast div svg { color: #5ee0a8; }
#toast div.erreur svg { color: #fff; }
@keyframes glisse { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* Connexion */
.connexion { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 20% 20%, #1c4f8a 0, transparent 50%), radial-gradient(circle at 85% 80%, #138a60 0, transparent 45%), #0f2238; }
.connexion form { background: #fff; padding: 36px 34px; border-radius: 16px; width: 380px; box-shadow: 0 30px 70px rgba(0,0,0,.35); animation: monte .25s ease-out; }
.connexion .logo { width: 44px; height: 44px; font-size: 22px; border-radius: 11px; margin-bottom: 16px; }
.connexion h1 { margin: 0 0 4px; font-size: 21px; }
.connexion p { margin: 0 0 24px; color: var(--gris); }
.connexion .champ { margin-bottom: 14px; }
.connexion input { height: 40px; }
.connexion button { width: 100%; justify-content: center; height: 42px; margin-top: 8px; font-size: 14px; }

/* ============ Documents imprimables ============ */
.document { background: #fff; width: 210mm; min-height: 297mm; margin: 20px auto; padding: 14mm; box-shadow: 0 4px 24px rgba(0,0,0,.12); font-size: 12px; }
.doc-entete { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--primaire); padding-bottom: 12px; margin-bottom: 14px; }
.doc-entete .soc b { font-size: 17px; color: var(--primaire); }
.doc-entete .ident { font-size: 11px; color: #344054; line-height: 1.5; }
.doc-titre { text-align: right; }
.doc-titre h1 { margin: 0; font-size: 22px; color: var(--primaire); letter-spacing: .04em; }
.doc-client { border: 1px solid var(--bord); border-radius: 6px; padding: 10px 12px; margin-left: auto; width: 55%; margin-bottom: 14px; line-height: 1.5; }
.doc-infos { display: flex; gap: 24px; margin-bottom: 12px; flex-wrap: wrap; }
.document table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.document th { background: var(--primaire); color: #fff; padding: 6px; font-size: 11px; text-align: left; }
.document td { padding: 5px 6px; border-bottom: 1px solid #e4e7ec; }
.doc-totaux { width: 45%; margin-left: auto; }
.doc-totaux td { padding: 4px 6px; }
.doc-totaux tr.ttc td { font-weight: 700; font-size: 14px; background: var(--primaire-clair); }
.doc-lettres { margin: 12px 0; padding: 8px 10px; background: #fafbfc; border-left: 3px solid var(--primaire); }
.doc-signatures { display: flex; justify-content: space-between; margin-top: 30px; }
.doc-signatures div { width: 45%; border: 1px dashed var(--bord-2); height: 90px; padding: 6px; color: var(--gris); }
.doc-pied { margin-top: 24px; font-size: 10px; color: var(--gris); text-align: center; border-top: 1px solid var(--bord); padding-top: 6px; }
body.impression { overflow: auto; }

@media print {
  body { background: #fff; }
  .document { box-shadow: none; margin: 0; width: auto; min-height: 0; padding: 0; }
  .non-imprime { display: none !important; }
  @page { size: A4; margin: 12mm; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 60px 1fr; }
  nav.menu .groupe, nav.menu .lib, .marque div { display: none; }
  main { padding: 16px; }
  .fil { display: none; }
}

/* Ajustements */
[hidden] { display: none !important; }
table.liste tbody tr:hover td.vide { background: #fff; }
.grille { grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); }

/* Liste avec recherche (remplace les longues listes déroulantes) */
.combo { position: relative; }
.combo select { display: none; }
.combo input { padding-right: 30px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b778a' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; text-overflow: ellipsis; }
.combo-liste { position: fixed; z-index: 400; background: #fff; border: 1px solid var(--bord-2); border-radius: 9px; box-shadow: 0 12px 34px rgba(15,34,56,.2); max-height: 300px; overflow-y: auto; padding: 4px; animation: fondu .1s; }
.combo-liste div { padding: 7px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-liste div.sel { background: var(--primaire-clair); color: var(--primaire-fonce); }
.combo-liste div mark { background: #fff1b8; color: inherit; border-radius: 2px; }
.combo-liste .rien { color: var(--gris); cursor: default; }

/* Statistiques */
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--bord); margin-bottom: 18px; }
.onglets button { border: none; box-shadow: none; background: none; border-radius: 8px 8px 0 0; height: 40px; padding: 0 18px; color: var(--gris); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.onglets button:hover { background: var(--fond); color: var(--texte); }
.onglets button.actif { color: var(--primaire); border-bottom-color: var(--primaire); }
.filtres { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filtres input[type=date], .filtres select { width: auto; }
.evol { font-size: 12px; font-weight: 600; margin-left: 6px; }
.evol.haut { color: var(--vert); } .evol.bas { color: var(--rouge); }
.graph { width: 100%; display: block; overflow: visible; }
.graph text { font-family: inherit; }
.graph .barre { fill: var(--primaire); transition: opacity .1s; }
.graph .barre.vide { fill: #d7dee8; }
.graph g.mk:hover .barre { fill: var(--primaire-fonce); }
.graph .grille-l { stroke: #e9edf2; stroke-width: 1; }
.graph .axe { fill: var(--gris); font-size: 11.5px; }
.graph .lib { fill: var(--texte); font-size: 12.5px; }
.graph .val { fill: var(--texte-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.bulle { position: fixed; z-index: 500; pointer-events: none; background: #18212f; color: #fff; padding: 8px 11px; border-radius: 8px; font-size: 12.5px; box-shadow: 0 8px 24px rgba(0,0,0,.25); line-height: 1.45; }
.bulle b { font-weight: 650; }
.part { display: inline-block; height: 6px; border-radius: 3px; background: var(--primaire); opacity: .55; vertical-align: middle; margin-right: 6px; }

.graph .barre.n1 { fill: #b9c6d8; }
.legende { display: flex; gap: 18px; font-size: 12.5px; color: var(--texte-2); margin: -4px 0 6px; }
.legende i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.pastille-n { background: var(--primaire); } .pastille-n1 { background: #b9c6d8; }

.selecteur-exo { width: auto; height: 34px; font-weight: 600; color: var(--primaire-fonce); background-color: var(--primaire-clair); border-color: #c4dbf7; margin-left: 8px; }

/* ---------- Barre d'actions et menu contextuel (façon Intellixe) ---------- */
.barre-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; margin-bottom: 8px; background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; }
.barre-actions button { background: transparent; border-color: transparent; box-shadow: none; }
.barre-actions button:not(:disabled):hover { background: var(--survol); border-color: var(--bord); }
.barre-actions button[data-ba="supprimer"]:not(:disabled) { color: var(--rouge); }
.barre-actions button:disabled { opacity: .4; cursor: default; }
.barre-actions .aide-clic { margin-left: auto; font-size: 12px; padding-right: 6px; }
table.liste tbody tr.choisie td, table.liste tbody tr.choisie:hover td { background: var(--primaire-clair); }
table.liste tbody tr.choisie td:first-child { box-shadow: inset 3px 0 0 var(--primaire); }
.menu-ctx { position: fixed; z-index: 1000; min-width: 230px; padding: 5px; background: #fff; border: 1px solid var(--bord); border-radius: 10px; box-shadow: var(--ombre-forte); animation: monte .12s ease-out; }
.menu-ctx button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: none; box-shadow: none; text-align: left; font-size: 13.5px; color: var(--texte); cursor: pointer; }
.menu-ctx button span { flex: 1; }
.menu-ctx button:not(:disabled):hover { background: var(--primaire-clair); color: var(--primaire-fonce); }
.menu-ctx button:disabled { opacity: .4; cursor: default; }
.menu-ctx button.danger-txt { color: var(--rouge); }
.menu-ctx button.danger-txt:not(:disabled):hover { background: var(--rouge-clair); color: var(--rouge); }
.menu-ctx kbd { font: 11px/1 inherit; color: var(--gris); border: 1px solid var(--bord); border-radius: 4px; padding: 2px 5px; }
.menu-ctx hr { border: 0; border-top: 1px solid var(--bord); margin: 4px 2px; }
.menu-ctx .ico { width: 16px; height: 16px; }
.actions-doc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
table.liste.edition input { width: 100px; padding: 4px 6px; }

/* ---------- Filtres façon Intellixe ---------- */
.filtres { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; }
.filtre { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--gris); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.filtre input, .filtre select { min-width: 120px; padding: 5px 8px; font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--texte); }
.filtre.large input { min-width: 200px; }
.filtre input[type=checkbox] { min-width: 0; width: 18px; height: 18px; margin: 6px 0; }
/* ---------- Panneau du bas des journaux ---------- */
.panneau { margin-top: 10px; background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; overflow: hidden; }
.onglets-p { display: flex; gap: 2px; padding: 4px 6px 0; background: var(--fond, #f4f6fa); border-bottom: 1px solid var(--bord); }
.onglets-p button { border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: none; box-shadow: none; padding: 6px 14px; font-size: 13px; color: var(--gris); }
.onglets-p button.actif { background: var(--carte); border-color: var(--bord); color: var(--primaire-fonce); font-weight: 600; margin-bottom: -1px; }
.corps-p { padding: 10px 12px; max-height: 320px; overflow: auto; }
.mini-kpis { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.mini-kpis > div { flex: 1 1 130px; padding: 8px 10px; border: 1px solid var(--bord); border-radius: 8px; background: #fff; }
.mini-kpis span { display: block; font-size: 11.5px; color: var(--gris); text-transform: uppercase; letter-spacing: .02em; }
.mini-kpis b { font-size: 15px; font-variant-numeric: tabular-nums; }
table.liste.compacte td, table.liste.compacte th { padding: 4px 8px; font-size: 12.5px; }
.kpi.cliquable { cursor: pointer; }
.kpi.cliquable:hover { border-color: var(--primaire); }
.kpi.score-vert::after { background: var(--vert) !important; width: 5px; }
.kpi.score-orange::after { background: #d97706 !important; width: 5px; }
.kpi.score-rouge::after { background: var(--rouge) !important; width: 5px; }
.onglets-fiche { display: flex; flex-wrap: wrap; gap: 4px; margin: 16px 0 0; }
.onglets-fiche button { border-radius: 8px 8px 0 0; border-bottom-color: transparent; box-shadow: none; background: transparent; }
.onglets-fiche button.actif { background: var(--carte); color: var(--primaire-fonce); font-weight: 600; border-color: var(--bord); border-bottom-color: var(--carte); position: relative; z-index: 1; margin-bottom: -1px; }
.onglets-fiche + .carte { border-top-left-radius: 0; margin-top: 0; }
/* ---------- Impression : situation client, lot de documents ---------- */
.saut-page { page-break-after: always; break-after: page; height: 0; }
.document table.compact td, .document table.compact th { padding: 3px 6px; font-size: 11px; }
.document .doc-resume { width: 55%; margin: 10px 0 14px auto; border-collapse: collapse; }
.document .doc-resume td { padding: 4px 8px; border-bottom: 1px solid #ddd; }
.document .doc-resume tr.ttc td { font-weight: 700; border-top: 2px solid #333; }
.document h3 { margin: 14px 0 6px; font-size: 13px; }
.document tr.gris td { color: #666; font-style: italic; }
.alerte.vert { background: var(--vert-clair); border-color: var(--vert); color: var(--vert); }
ol.etapes { margin: 8px 0 14px 18px; padding: 0; line-height: 1.55; }
