:root {
  --fond: #f6f3fc; --carte: #fff; --texte: #2b2540; --doux: #6d6787; --trait: #e4def3;
  --violet: #7a5cc7; --violet-fonce: #5b3fa8; --violet-pale: #ece6fa;
  --vert: #1f9d6b; --vert-pale: #dff5ea; --orange: #c9780a; --orange-pale: #fdeed3;
  --rouge: #cf3d4f; --rouge-pale: #fde3e6; --bleu: #2f7fd0; --bleu-pale: #e0eefc;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--texte); background: var(--fond); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 15px; margin: 0 0 10px; }
.doux { color: var(--doux); } .petit { font-size: 12px; }

.cadre { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.menu { background: linear-gradient(180deg, #5b3fa8, #7a5cc7); color: #fff; padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.menu .marque { font-weight: 700; font-size: 17px; padding: 4px 10px 14px; }
.menu .marque small { display: block; font-weight: 400; opacity: .8; font-size: 12px; }
.menu .rub { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; padding: 14px 10px 4px; }
.menu a { color: #fff; text-decoration: none; padding: 8px 10px; border-radius: 9px; display: flex; gap: 9px; align-items: center; }
.menu a:hover { background: rgba(255,255,255,.14); } .menu a.actif { background: #fff; color: var(--violet-fonce); font-weight: 600; }
.menu a.bientot { opacity: .55; cursor: default; } .menu a.bientot:hover { background: none; }
.menu .pied { margin-top: auto; padding: 12px 10px 0; font-size: 12px; border-top: 1px solid rgba(255,255,255,.25); }
.menu .pied button { background: rgba(255,255,255,.16); border: 0; color: #fff; padding: 6px 10px; border-radius: 8px; cursor: pointer; margin-top: 8px; }
.page { padding: 24px 28px 60px; min-width: 0; }
.entete { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: 14px; padding: 16px 18px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(91,63,168,.06); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--carte); border: 1px solid var(--trait); border-radius: 14px; padding: 14px 16px; border-left: 5px solid var(--violet); }
.kpi .t { color: var(--doux); font-size: 12px; } .kpi .v { font-size: 24px; font-weight: 700; margin-top: 2px; } .kpi .s { font-size: 12px; color: var(--doux); }
.kpi.vert { border-left-color: var(--vert); } .kpi.orange { border-left-color: var(--orange); } .kpi.rouge { border-left-color: var(--rouge); } .kpi.bleu { border-left-color: var(--bleu); }

.defile { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 12px; color: var(--doux); font-weight: 600; padding: 8px 10px; border-bottom: 2px solid var(--trait); background: #faf8fe; vertical-align: bottom; position: sticky; top: 0; }
td { padding: 7px 10px; border-bottom: 1px solid #f0ecf8; vertical-align: top; }
td.n, th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.neg { color: var(--rouge); } tr.total td { font-weight: 700; background: #faf8fe; border-top: 2px solid var(--trait); }
tr.clic { cursor: pointer; } tr.clic:hover td { background: var(--violet-pale); }
td.objet { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--doux); }
.note { color: var(--doux); font-size: 12px; margin: 8px 0 0; }

.pastille { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--violet-pale); color: var(--violet-fonce); }
.pastille.vert { background: var(--vert-pale); color: var(--vert); } .pastille.orange { background: var(--orange-pale); color: var(--orange); }
.pastille.rouge { background: var(--rouge-pale); color: var(--rouge); } .pastille.bleu { background: var(--bleu-pale); color: var(--bleu); } .pastille.gris { background: #eeecf3; color: var(--doux); }
.grp { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.grp i { width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 13px; }

.filtres { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
input, select, textarea { border: 1px solid #d5cdea; border-radius: 9px; padding: 7px 10px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--violet); outline-offset: 0; border-color: var(--violet); }
.btn { background: var(--violet); color: #fff; border: 0; border-radius: 9px; padding: 8px 14px; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--violet-fonce); } .btn.clair { background: var(--violet-pale); color: var(--violet-fonce); } .btn.petit { padding: 4px 9px; font-weight: 500; }
.erreur { background: var(--rouge-pale); color: var(--rouge); padding: 8px 12px; border-radius: 9px; margin: 10px 0; }
.info { background: var(--bleu-pale); color: #1d5c9c; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; }
.ok { background: var(--vert-pale); color: #136b48; padding: 10px 14px; border-radius: 10px; margin: 10px 0; }

.connexion { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #5b3fa8, #9a82dd); padding: 20px; }
.connexion .boite { background: #fff; border-radius: 18px; padding: 30px; width: 100%; max-width: 380px; box-shadow: 0 20px 50px rgba(40,20,90,.3); }
.champ { display: block; margin: 12px 0; } .champ span { display: block; font-size: 12px; color: var(--doux); margin-bottom: 4px; } .champ input, .champ select, .champ textarea { width: 100%; }
code.cle { display: block; background: var(--violet-pale); padding: 10px; border-radius: 9px; font-size: 15px; letter-spacing: .08em; word-break: break-all; margin: 8px 0; }

.volet { position: fixed; inset: 0 0 0 auto; width: min(460px, 100vw); background: #fff; box-shadow: -10px 0 40px rgba(40,20,90,.2); padding: 22px; overflow-y: auto; z-index: 10; }
.voile { position: fixed; inset: 0; background: rgba(40,25,80,.3); z-index: 9; }
.volet dl { display: grid; grid-template-columns: 130px 1fr; gap: 5px 10px; margin: 12px 0; } .volet dt { color: var(--doux); font-size: 12px; } .volet dd { margin: 0; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.barres { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.barres div { flex: 1; text-align: center; font-size: 11px; color: var(--doux); display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.barres b { display: block; border-radius: 6px 6px 0 0; background: var(--rouge); min-height: 2px; } .barres b.pos { background: var(--vert); }
.barres span { font-variant-numeric: tabular-nums; }

@media (max-width: 800px) {
  .cadre { grid-template-columns: 1fr; } .page { padding: 16px; } .deux { grid-template-columns: 1fr; }
  .menu { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; gap: 4px; }
  .menu .marque { width: 100%; padding: 2px 6px 6px; } .menu .marque small, .menu .rub, .menu a.bientot { display: none; }
  .menu a { padding: 6px 9px; font-size: 13px; } .menu .pied { margin: 6px 0 0; width: 100%; border: 0; padding: 0 6px; } .menu .pied br { display: none; } .menu .pied button { margin: 0 0 0 8px; }
}
