:root {
  --ink: #15171C;
  --muted: #5B6170;
  --ground: #F4F5F7;
  --surface: #FFFFFF;
  --line: #E3E5EA;
  --line-soft: #ECEEF2;
  --accent: #2448C9;
  --accent-ink: #1F44B8;
  --accent-soft: #DCE4FA;
  --accent-pale: #C7D2F3;
  --warn: #C2410C;
  --warn-ink: #B4400B;
  --warn-dark: #8A3208;
  --warn-soft: #FBE3D3;
  --warn-pale: #FFF6F0;
  --warn-line: #F3C9AE;
  --side: #15171C;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: 'IBM Plex Sans', system-ui, sans-serif; font-size: 15px; line-height: 1.45; }
a { color: var(--accent); }
a:hover { color: #1A3596; }
h1, h2 { margin: 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.up { color: var(--accent-ink); font-weight: 600; }
.down { color: var(--warn-ink); font-weight: 600; }
.neutre { color: var(--muted); }

/* ---- Structure ---- */
.app { display: flex; min-height: 100vh; }
.sidebar { flex: 0 0 232px; background: var(--side); color: #E8EAEE; padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 8px; color: #C9CDD6; text-decoration: none; font-size: 14px; }
.sidebar a:hover { background: #20242C; color: #FFF; }
.sidebar a.active { background: #262A33; color: #FFF; font-weight: 500; }
.sidebar-foot { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid #2F343E; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #A3A9B6; }
.sidebar-foot a { padding: 6px 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 24px; }
.brand strong { font-size: 19px; font-weight: 700; color: #FFF; letter-spacing: -0.01em; }
.brand small { font-size: 12px; color: #A3A9B6; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #FFF; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.brand.dark small { color: var(--muted); }

.main { flex: 1; min-width: 0; padding: 28px 40px 48px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.eyebrow { font-size: 13px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }

.filtres { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filtres label { font-size: 13px; color: var(--muted); }
select, input[type=text], input[type=email], input[type=password], input:not([type]) {
  height: 44px; padding: 0 12px; border: 1px solid #D5D8DF; border-radius: 8px; background: #FFF; font: inherit; font-size: 14px; color: var(--ink);
}
.btn { height: 44px; padding: 0 16px; border: 1px solid #D5D8DF; border-radius: 8px; background: #FFF; font: inherit; font-size: 14px; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #AEB4C0; color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #FFF; font-weight: 600; }
.btn-primary:hover { background: #1A3596; color: #FFF; }

.flash { padding: 12px 16px; border-radius: 8px; font-size: 14px; background: var(--accent-soft); }
.flash-erreur { background: var(--warn-soft); color: var(--warn-dark); }

/* ---- Cartes ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card h2 { font-size: 17px; font-weight: 600; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-head.pad { padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.lien { font-size: 14px; font-weight: 500; align-self: flex-start; padding: 8px 0; }
.vide { align-items: flex-start; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

/* Rang réseau */
.rang { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 24px; padding: 18px 22px; }
.rang-num .mono { font-size: 34px; font-weight: 600; }
.rang-num sup { font-size: 16px; color: var(--muted); }
.rang-barre { flex: 1 1 320px; display: flex; flex-direction: column; gap: 6px; }
.rang-barre .track { position: relative; height: 10px; border-radius: 5px; }
.rang-barre .fill { background: var(--accent-pale); border-radius: 5px; }
.rang-barre .mark { position: absolute; top: -5px; width: 4px; height: 20px; margin-left: -2px; border-radius: 2px; background: var(--accent); }
.rang-legende { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.rang p { margin: 0; max-width: 300px; }

/* Indicateurs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kpi { gap: 10px; padding: 18px 20px; }
.kpi h2 { font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi-val { font-size: 27px; font-weight: 600; }
.kpi-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.kpi-alerte { background: var(--warn-pale); border-color: var(--warn-line); }
.kpi-alerte h2 { color: var(--warn-dark); }

/* Barres horizontales */
.track { height: 14px; background: var(--line-soft); border-radius: 3px; overflow: visible; }
.fill { height: 100%; background: var(--accent); border-radius: 3px; }
.barres { display: grid; grid-template-columns: 120px minmax(0, 1fr) 96px 56px; gap: 10px 12px; align-items: center; font-size: 13px; }
td .track { height: 10px; }

/* Points d'attention */
.alertes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.alertes li { display: flex; gap: 12px; padding: 12px 14px; border-radius: 8px; background: var(--warn-pale); }
.alertes li.alerte-up { background: #EEF2FC; }
.alertes li div { display: flex; flex-direction: column; gap: 2px; }
.alertes strong { font-size: 14px; }
.puce { flex: 0 0 8px; height: 8px; margin-top: 6px; border-radius: 4px; background: var(--warn); }
.alerte-up .puce { background: var(--accent); }

/* Stock */
.sparkbars { display: flex; align-items: flex-end; gap: 4px; height: 64px; }
.sparkbars div { flex: 1; background: var(--accent-pale); border-radius: 2px; min-height: 2px; }
.sparkbars div.courant { background: var(--accent); }
.mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; font-size: 13px; }
.mini dt { color: var(--muted); }
.mini dd { margin: 0; font-weight: 600; }
.colonnes { display: flex; gap: 10px; align-items: stretch; }
.col { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.col-zone { height: 220px; display: flex; align-items: flex-end; border-bottom: 1px solid #D5D8DF; padding-top: 20px; }
.col-barre { width: 100%; background: var(--accent-pale); border-radius: 4px 4px 0 0; display: flex; justify-content: center; min-height: 2px; }
.col-barre.courant { background: var(--accent); }
.col-barre span { font-size: 11px; margin-top: -18px; }
.col-label { font-size: 11px; color: var(--muted); text-align: center; }
.col-label.fort { color: var(--ink); font-weight: 600; }

/* Tableaux */
.table-wrap, .table-wrap.card.flush { overflow-x: auto; } /* une carte « flush » masque le débordement : le tableau doit quand même glisser */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
.liste th, .liste td { padding: 10px 12px; text-align: left; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.liste thead th { border-top: 0; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.liste tbody th { font-weight: 500; }
.liste .right { text-align: right; }
.w-34 { width: 34%; }

.matrice { min-width: 980px; }
.matrice thead th { background: #F7F8FA; padding: 14px 16px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; text-align: left; }
.matrice thead th.center { text-align: center; }
.matrice thead th.right { text-align: right; }
.matrice thead .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.matrice tbody tr { border-top: 1px solid var(--line-soft); }
.matrice tbody th { padding: 12px 16px; text-align: left; font-weight: 600; }
.matrice td { padding: 6px; font-family: var(--mono); font-size: 13px; }
.matrice td.right { padding: 12px 16px; text-align: right; }
.matrice tr.total { border-top: 2px solid var(--ink); background: #F7F8FA; }
.cell { border-radius: 6px; padding: 8px; text-align: center; background: #F1F2F5; white-space: nowrap; }
.cell .ref { color: var(--muted); }
.cell.n2 { background: var(--accent); color: #FFF; }
.cell.n1 { background: var(--accent-soft); }
.cell.n-1 { background: var(--warn-soft); }
.cell.n-2 { background: var(--warn); color: #FFF; }
.cell.n2 .ref, .cell.n-2 .ref { color: #FFF; opacity: 0.85; }
.cell.nx { color: var(--muted); }

.intro { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.intro p { margin: 0; max-width: 640px; }
.legende { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); }
.legende span { display: flex; align-items: center; gap: 6px; }
.legende i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.legende .n2 { background: var(--accent); }
.legende .n1 { background: var(--accent-soft); }
.legende .n-1 { background: var(--warn-soft); }
.legende .n-2 { background: var(--warn); }
.legende .l-mag { height: 3px; background: var(--accent); }
.legende .l-res { height: 0; border-top: 2px dashed #8A90A0; }

.courbe { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.courbe svg { width: 100%; height: auto; }
.serie-magasin { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.serie-reseau { fill: none; stroke: #8A90A0; stroke-width: 1.5; stroke-dasharray: 5 4; }
.pt-magasin { fill: var(--accent); }
.axe { font-size: 11px; fill: var(--muted); font-family: 'IBM Plex Sans', sans-serif; }

/* Import */
.depot { align-items: stretch; }
.depot-zone { border: 2px dashed #B7BECB; border-radius: 12px; padding: 28px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; cursor: pointer; color: var(--muted); }
.depot-zone strong { color: var(--ink); }
.depot input[type=file] { font: inherit; font-size: 14px; }
.depot .btn { align-self: flex-end; }
.fichiers { margin: 0; padding: 0; list-style: none; }
.fichiers li { display: grid; grid-template-columns: 28px minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 2fr); gap: 12px; align-items: center; padding: 12px 22px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.fichiers .statut { width: 22px; height: 22px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: #1A3596; }
.fichiers .st-alerte { background: var(--warn-pale); }
.fichiers .st-alerte .statut { background: var(--warn); color: #FFF; }
.fichiers .st-erreur .statut { background: #E8EAEE; color: var(--muted); }
.fichiers .resume { color: var(--muted); }
.fichiers .msg { font-size: 13px; color: var(--warn-dark); }
.actions { display: flex; justify-content: flex-end; gap: 12px; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); }
.badge.st-alerte { background: var(--warn-soft); }
.badge.st-erreur { background: #E8EAEE; }

/* Admin */
.cases { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.cases label, fieldset label, form.inline label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin-right: 12px; }
.form { display: flex; flex-direction: column; gap: 6px; }
.form label { font-size: 13px; color: var(--muted); margin-top: 6px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; padding: 8px 12px; }
.form .btn { align-self: flex-start; margin-top: 8px; }
.recherche { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.row { display: flex; gap: 8px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row-wrap label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.row input { flex: 1; }

/* Connexion */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.login { width: 100%; max-width: 400px; }
.login .nom-site { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.login form { display: flex; flex-direction: column; gap: 6px; }
.login label { font-size: 13px; color: var(--muted); margin-top: 8px; }
.login .btn { margin-top: 16px; justify-content: center; }

/* Tableaux compacts, primes */
.matrice.compacte { min-width: 900px; }
.matrice.compacte td { padding: 4px 6px; }
.matrice.compacte tbody th { padding: 10px 16px; white-space: nowrap; }
.matrice tr.fort { background: #FAFBFD; }
.matrice tr.fort th { color: var(--accent-ink); }
.cell.nu { background: transparent; text-align: right; padding: 8px 4px; }
td.right .cell { text-align: right; }
.w-20 { width: 14%; min-width: 90px; }
.pad { padding: 18px 22px; }
.champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 18px; }
.champs div { display: flex; flex-direction: column; gap: 4px; }
.champs label { font-size: 13px; font-weight: 500; }
.champs input { width: 100%; }
.saisie input, .saisie select { height: 40px; width: 100%; min-width: 90px; }
.saisie td { padding: 6px 8px; }
input[type=month] { height: 44px; padding: 0 12px; border: 1px solid #D5D8DF; border-radius: 8px; font: inherit; }

.objectifs { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.objectifs > div { display: flex; flex-direction: column; gap: 6px; }
.track.grand { height: 12px; border-radius: 6px; }
.fill-warn { background: var(--warn); }
@media (max-width: 860px) { .objectifs { grid-template-columns: 1fr; } }

/* Satisfaction */
.repartition { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line-soft); }
.r-pro { background: var(--accent); } .r-pas { background: #B7BECB; } .r-det { background: var(--warn); }
.onglets { display: flex; gap: 4px; flex-wrap: wrap; }
.onglets a { padding: 8px 12px; border-radius: 999px; font-size: 13px; text-decoration: none; color: var(--muted); border: 1px solid var(--line); }
.onglets a.actif { background: var(--ink); color: #FFF; border-color: var(--ink); }
.verbatims { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.verbatims li { display: flex; gap: 14px; padding: 12px 14px; border-radius: 10px; background: #F7F8FA; border-left: 0; }
.verbatims li.v-det { background: var(--warn-pale); }
.verbatims p { margin: 4px 0 0; }
.v-note { flex: 0 0 36px; height: 36px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-weight: 600; background: var(--accent-soft); color: #1A3596; }
.v-det .v-note { background: var(--warn); color: #FFF; }
.v-pas .v-note { background: #E8EAEE; color: var(--ink); }

.bloc-sat { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; scroll-margin-top: 16px; }
.titre-bloc { font-size: 21px; font-weight: 700; padding-bottom: 8px; border-bottom: 2px solid var(--ink); display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.card h3 { margin: 0; font-size: 16px; font-weight: 600; }
.sommaire { margin-bottom: -6px; }

/* Export : choix du type (PowerPoint, trames d'entretien) */
.export-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.card.export-type { flex-direction: row; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); border: 2px solid transparent; }
.card.export-type:hover { border-color: var(--accent-pale); color: var(--ink); }
.card.export-type.actif { border-color: var(--accent); background: #F5F8FF; }
.export-type > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.export-type-icone { flex: none; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.export-type.actif .export-type-icone { background: var(--accent); color: #FFF; }
.vendeurs-entretien { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.vendeur-entretien { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.vendeur-entretien:has(input:checked) { border-color: var(--accent); background: #F5F8FF; }
.vendeur-entretien input { margin-top: 3px; }
.vendeur-entretien > span { display: flex; flex-direction: column; gap: 2px; }
.pastille-cuisine { background: var(--ground); border-radius: 999px; padding: 1px 8px; color: var(--muted); font-weight: 600; }

/* Entretiens remplis rechargés */
.depot-entretiens { display: flex; flex-direction: column; gap: 10px; }
.depot-zone-entretiens { display: flex; align-items: center; gap: 14px; padding: 14px; border: 2px dashed var(--accent-pale); border-radius: 12px; background: #F5F8FF; cursor: pointer; }
.depot-zone-entretiens > span { display: flex; flex-direction: column; }
.secours-entretien summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.secours-entretien .filtres { margin-top: 8px; flex-wrap: wrap; }
.entretiens-gardes .liste td.right { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
form.inline { display: inline; margin: 0; }

/* Export PowerPoint */
.groupes-export { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.groupes-export fieldset { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.groupes-export legend { font-weight: 600; padding: 0 4px; }
.groupes-export label { display: flex; gap: 8px; align-items: center; min-height: 34px; font-size: 14px; }
.lienbtn { background: none; border: 0; padding: 8px 2px; color: var(--accent); font: inherit; cursor: pointer; }

.bascule { display: inline-flex; padding: 3px; background: #E8EAEE; border-radius: 10px; gap: 2px; }
.bascule label { display: flex; align-items: center; min-height: 38px; padding: 0 12px; border-radius: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }
.bascule label.actif { background: #FFF; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.bascule input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bascule label:focus-within { outline: 2px solid var(--accent); }

/* Plannings (inspiré de la vue Combo) */
.semaine-planning { margin-bottom: 4px; }
.planning { min-width: 1100px; font-size: 12px; table-layout: fixed; }
.planning th, .planning td { padding: 6px; border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); vertical-align: top; text-align: left; }
.planning .col-nom { width: 170px; border-left: 0; }
.planning thead th { background: #F7F8FA; font-size: 13px; color: var(--muted); font-weight: 400; text-align: center; padding: 10px 4px; }
.planning thead th strong { color: var(--ink); margin-left: 4px; }
.planning thead th.auj span { display: inline-block; background: var(--ink); color: #FFF; border-radius: 999px; padding: 4px 12px; }
.planning thead th.auj strong { color: #FFF; }
.planning .hors { background: repeating-linear-gradient(135deg, #FAFAFB 0 6px, #F3F4F6 6px 12px); color: #A3A9B6; }
.planning tbody th { font-weight: 400; }
.planning .nom { display: block; font-weight: 600; color: var(--accent-ink); }
.planning .compteurs { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.creneau { display: flex; flex-direction: column; gap: 3px; padding: 5px 6px; margin-bottom: 4px; border-radius: 5px; border-left: 4px solid rgba(0,0,0,.25); }
.creneau .activite { font-size: 10.5px; font-weight: 600; letter-spacing: .01em; color: #15171C; line-height: 1.15; }
.creneau .horaire { align-self: flex-start; font-size: 11.5px; background: rgba(255,255,255,.85); border-radius: 4px; padding: 1px 6px; color: #15171C; font-variant-numeric: tabular-nums; }
/* Couleurs des postes, identiques à Combo */
.act-ouv { background: #9DC593; }
.act-fer { background: #F8A97D; }
.act-mut { background: #F66A80; }
.act-ven { background: #E8CC8A; }
.act-cui { background: #7B93F8; }
.act-adm { background: #94D9AB; }
.act-elr { background: #FD8277; }
.act-for { background: #E0B77E; }
.act-sol { background: #E1A0B6; }
.act-chome { background: #F9FB8B; }
.act-aut { background: #E3E5EA; }
/* Absences Combo */
.absence { padding: 5px 6px; margin-bottom: 4px; border-radius: 5px; font-size: 10.5px; font-weight: 600; color: #5B6170; border: 1px dashed #C5CAD3; }
.abs-repos { background: repeating-linear-gradient(135deg, #F1F2F5 0 5px, #E8EAEE 5px 10px); }
.abs-conge { background: #DCE6F7; border-color: #9FB5E6; color: #1F3A9E; }
.abs-autre { background: #F2E4E7; border-color: #DDB4BD; color: #8A3446; }
.planning tr.total th, .planning tr.total td { border-top: 2px solid var(--ink); background: #F7F8FA; font-weight: 600; text-align: center; }
.planning tr.total th { text-align: left; }
.liste tr.total-ligne th, .liste tr.total-ligne td { border-top: 2px solid var(--ink); background: #F7F8FA; }
@media print { .planning { min-width: 0; } .semaine-planning { break-inside: avoid; } }

/* ==========================================================================
   Thème « esprit enseigne » : fond gris clair, blocs blancs à angles droits,
   boutons noirs, rouge réservé à l'identité (menu actif, accents, action principale).
   Les indicateurs gardent bleu = mieux que le réseau, orange = moins bien.
   ========================================================================== */
/* Les espaces de Plus Jakarta Sans sont très étroites : séparateurs de milliers et espaces insécables dessinés par une police système */
@font-face { font-family: "Espaces"; src: local("Arial"), local("Helvetica"), local("Liberation Sans"), local("DejaVu Sans"); unicode-range: U+0020, U+00A0, U+2009, U+202F; }
:root {
  --ink: #161616;
  --text: #333333;
  --muted: #6B6B6B;
  --ground: #F5F5F5;
  --line: #E4E4E4;
  --line-soft: #EEEEEE;
  --accent: #005EE2;
  --accent-ink: #0050C2;
  --accent-soft: #DCE8FB;
  --accent-pale: #B5CDF6;
  --brand: #E21212;
  --brand-dark: #B80D0D;
  --side: #FFFFFF;
  --sans: 'Espaces', 'Plus Jakarta Sans', system-ui, sans-serif;
  --mono: var(--sans);
}
body { font-family: var(--sans); color: var(--text); }
.mono { font-variant-numeric: tabular-nums; }
a { color: var(--accent); }
a:hover { color: var(--brand); }
h1, h2, h3 { color: var(--ink); }

/* Menu : blanc, rubrique active sur fond rouge */
.sidebar { background: var(--side); color: var(--text); border-right: 1px solid var(--line); }
.sidebar a { border-radius: 0; color: var(--text); font-weight: 600; }
.sidebar a:hover { background: var(--ground); color: var(--ink); }
.sidebar a.active { background: var(--brand); color: #FFF; font-weight: 700; }
.sidebar-foot { border-top-color: var(--line); color: var(--muted); }
.sidebar-foot a { color: var(--text); font-weight: 500; }
.brand strong { color: var(--ink); font-weight: 800; letter-spacing: -0.02em; border-left: 4px solid var(--brand); padding-left: 10px; }

/* En-tête de page */
.page-head h1 { font-weight: 800; letter-spacing: -0.02em; }
.eyebrow { color: var(--brand); font-weight: 700; }

/* Blocs à angles droits */
.card { border-radius: 0; border-color: transparent; }
.card h2 { font-weight: 700; }
.card-head.pad { border-bottom-color: var(--line); }
.kpi-val { font-weight: 800; }
.kpi h2 { font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: 0.03em; }
.flash, .alertes li, .cell, .badge, .legende i, .track, .fill, .rang-barre .track, .rang-barre .fill, .sparkbars div, .col-barre { border-radius: 0; }

/* Champs et boutons */
select, input[type=text], input[type=email], input[type=password], input:not([type]) { border-radius: 0; border-color: #8C8C8C; }
.btn { border-radius: 0; border-color: var(--text); color: var(--ink); font-weight: 600; }
.btn:hover { background: var(--ink); border-color: var(--ink); color: #FFF; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #FFF; font-weight: 700; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #FFF; }

/* Sélecteurs : élément actif en noir */
.bascule { border-radius: 0; background: #FFF; border: 1px solid var(--text); padding: 0; gap: 0; }
.bascule label { border-radius: 0; color: var(--text); font-weight: 600; }
.bascule label.actif { background: var(--ink); color: #FFF; box-shadow: none; }
.onglets a { border-radius: 0; border-color: var(--text); color: var(--text); font-weight: 600; background: #FFF; }
.onglets a.actif { background: var(--ink); border-color: var(--ink); color: #FFF; }

/* Planning */
.creneau { border-radius: 2px; }
.planning .nom { color: var(--ink); }
.planning thead th.auj span { background: var(--brand); border-radius: 0; }
.absence { border-radius: 2px; }

/* Connexion */
.login .nom-site { font-weight: 800; border-left: 4px solid var(--brand); padding-left: 10px; }

/* ---- Impression / export PDF (A4 paysage) ---- */
@page { size: A4 landscape; margin: 10mm; }
@media print {
  body { background: #FFF; font-size: 11px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sidebar, .no-print, .lien, .flash { display: none !important; }
  .main { padding: 0; gap: 10px; }
  .page-head h1 { font-size: 20px; }
  .card { padding: 12px; border-color: #CCC; break-inside: avoid; }
  .kpis { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .kpi-val { font-size: 18px; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  .matrice { min-width: 0; }
  .table-wrap { overflow: 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; }

/* Lecture AS400 des primes */
.as400 input { width: 92px; height: 36px; padding: 0 8px; }
.as400 select { height: 36px; min-width: 170px; max-width: 200px; }
.as400 tr.hors-vendeur th, .as400 tr.hors-vendeur input { color: var(--muted); }
.as400 tr.a-associer { background: #FFF6F0; }
.as400 input.a-verifier { border-color: #C2410C; background: #FFF6F0; }
.as400 tfoot th, .as400 tfoot td { padding: 8px 12px; border-top: 1px solid var(--line); }

/* Primes : origine des valeurs, colonnes calculées */
.legende-sources { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; color: var(--muted); }
.legende-sources span { display: flex; align-items: center; gap: 6px; }
.legende-sources i { width: 14px; height: 14px; display: inline-block; border: 1px solid #8C8C8C; }
.legende-sources .src-auto, .champ.src-auto input, td.src-auto input { background: #EEF4FD; }
.legende-sources .src-saisie, .champ.src-saisie input, td.src-saisie input { background: #FFF8E1; }
.champ { display: flex; flex-direction: column; gap: 4px; }
.prime-vente input { width: 92px; height: 36px; padding: 0 8px; }
.prime-vente td { vertical-align: top; }
.prime-vente .verse { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; text-align: right; }
.baremes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.statut-primes h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hors-objectif th { color: var(--warn-ink); }
.roles td.non { color: var(--muted); }

/* Rappel des objectifs et barèmes : encadré distinct, en tête des onglets de primes */
.card.rappel { background: #FFFBEA; border: 1px solid #F0D98A; border-left: 6px solid #E8B100; }
.card.rappel .liste th, .card.rappel .liste td { background: transparent; }
.rappel-etiquette { display: inline-block; background: #161616; color: #FFF; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; margin-right: 8px; vertical-align: middle; }
.rappel-grille { display: grid; grid-template-columns: minmax(320px, 1fr) 2fr; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .rappel-grille { grid-template-columns: 1fr; } }

/* Objectifs mensuels */
.objectifs-mensuels input { width: 140px; height: 36px; padding: 0 8px; }
.objectifs-mensuels tr.groupe th { background: var(--ground); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 12px; }
.saisie-unite { display: inline-flex; align-items: center; gap: 6px; }
td.src-saisie input { background: #FFF8E1; }

/* Plan de marche */
.plan-marche input, .repartition-vendeurs input[inputmode] { width: 110px; height: 34px; padding: 0 8px; }
.plan-marche tr.week-end th, .plan-marche tr.week-end td { background: #FAFAFA; }
.plan-marche tr.total-ligne th, .plan-marche tr.total-ligne td { background: #F1F1F1; font-weight: 700; }
.repartition-vendeurs tr.non-retenu th, .repartition-vendeurs tr.non-retenu td { color: var(--muted); }
.etat-docs { margin: 6px 0 0; padding-left: 16px; } .documents details summary { cursor: pointer; }


/* Tuiles d'objectifs des primes : un objectif = une tuile, son barème dessous, palier obtenu surligné */
.tuiles-objectifs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tuile-objectif { background: #FFF; border: 1px solid #EADFB4; border-top: 4px solid #B8B8B8; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tuile-objectif.ok { border-top-color: #005EE2; }
.tuile-objectif.ko { border-top-color: #C2410C; }
.tuile-objectif.regles { border-top-color: #161616; }
.tuile-objectif header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.tuile-objectif h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--ink); }
.pastille { font-size: 12px; font-weight: 700; padding: 3px 8px; white-space: nowrap; }
.pastille.ok { background: #DCE8FB; color: #0050C2; }
.pastille.ko { background: #FBE3D3; color: #8A3208; }
.tuile-objectif .chiffres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tuile-objectif .chiffres .lib { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tuile-objectif .chiffres strong { font-size: 22px; font-weight: 800; color: var(--ink); }
.tuile-objectif .chiffres span.mono { font-size: 14px; color: var(--text); }
.paliers { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }
.paliers li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 8px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.paliers li.obtenu { background: #DCE8FB; color: #0050C2; font-weight: 700; }
.total-collective { margin: 4px 0 0; font-size: 15px; }
.total-collective strong { font-size: 18px; color: var(--ink); }

/* ==========================================================================
   Ordinateur : éléments propres au téléphone masqués
   ========================================================================== */
.barre-mobile, .entete-mobile, .note-consultation, .planning-jours { display: none; }
details.selecteur > summary { display: none; }
details.selecteur { display: block; }

/* ==========================================================================
   Téléphone (≤ 860 px) : même design, mise en page adaptée, consultation seulement
   ========================================================================== */
@media (max-width: 860px) {
  body { font-size: 15px; }
  .app { flex-direction: column; }
  .sidebar { display: none; }
  .main { padding: 0 14px 96px; gap: 14px; }

  /* En-tête compact et barre de navigation en bas d'écran */
  .entete-mobile { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -14px; padding: 12px 14px; background: #FFF; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .entete-mobile strong { font-size: 17px; font-weight: 800; color: var(--ink); border-left: 4px solid var(--brand); padding-left: 8px; }
  .entete-mobile a { font-size: 13px; color: var(--muted); }
  .barre-mobile { display: grid; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #FFF; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .barre-mobile .bouton-plus { border: 0; background: none; font: inherit; cursor: pointer; }
  .barre-mobile a, .barre-mobile .bouton-plus { min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text); text-decoration: none; text-align: center; padding: 6px 2px; }
  .barre-mobile a.active, .barre-mobile .bouton-plus.active, .barre-mobile .bouton-plus[aria-expanded="true"] { color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }
  .barre-mobile a span, .barre-mobile .bouton-plus span { line-height: 1.15; }
  .matrice { min-width: 760px; }

  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-head h1 { font-size: 22px; }
  details.selecteur { display: block; background: #FFF; border: 1px solid var(--line); }
  details.selecteur > summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; font-weight: 700; color: var(--ink); cursor: pointer; list-style: none; }
  details.selecteur > summary::-webkit-details-marker { display: none; }
  details.selecteur > summary span { font-size: 13px; font-weight: 600; color: var(--brand); }
  details.selecteur .filtres { padding: 12px 14px 14px; border-top: 1px solid var(--line); }
  .filtres { gap: 8px; }
  .filtres select, .filtres .btn, .filtres .bascule { width: 100%; }
  .filtres label { width: 100%; margin-top: 4px; }
  .bascule label { flex: 1; justify-content: center; }

  /* Blocs : une colonne, chiffres sur 2 colonnes */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-val { font-size: 21px; }
  .kpi-foot { flex-direction: column; gap: 2px; font-size: 12px; }
  .card { padding: 16px; }
  .card.flush { padding: 0; }
  .card-head { flex-direction: column; align-items: flex-start; }
  .grid-2, .grid-3, .rappel-grille, .baremes, .champs, .objectifs { grid-template-columns: 1fr; }
  .rang { flex-direction: column; align-items: stretch; gap: 14px; }
  .rang-barre { flex: none; }
  .rang p { max-width: none; }
  .barres { grid-template-columns: 96px minmax(0, 1fr) 56px; }
  .barres span.mono { display: none; }
  .colonnes { overflow-x: auto; }
  .col { min-width: 34px; }
  .fichiers li { grid-template-columns: 28px minmax(0, 1fr); }
  .fichiers .resume, .fichiers .msg { grid-column: 2; }

  /* Tableaux : défilement horizontal, première colonne toujours visible */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { font-size: 13px; }
  .table-wrap table tr > :first-child { position: sticky; left: 0; z-index: 1; background: #FFF; box-shadow: 1px 0 0 var(--line); }
  .table-wrap table thead tr > :first-child { background: #F7F7F7; }
  .liste th, .liste td { padding: 9px 10px; }

  /* Consultation seulement : formulaires de saisie en lecture, boutons d'enregistrement masqués */
  .note-consultation { display: block; margin: 0; padding: 10px 12px; font-size: 13px; color: var(--muted); background: #FFF; border: 1px solid var(--line); }
  .main:not(:has(form[method="post"]:not(.saisie-mobile))) .note-consultation { display: none; }
  .main form[method="post"]:not(.saisie-mobile) button, .main form[method="post"]:not(.saisie-mobile) .actions, .main form[method="post"]:not(.saisie-mobile) input[type="file"], .main .depot { display: none !important; }
  .main form[method="post"]:not(.saisie-mobile) input:not([type="hidden"]), .main form[method="post"]:not(.saisie-mobile) select, .main form[method="post"]:not(.saisie-mobile) textarea {
    pointer-events: none; border-color: transparent; background: transparent !important; padding-left: 0; padding-right: 0; color: var(--ink); appearance: none; -webkit-appearance: none;
  }
  .main form[method="post"]:not(.saisie-mobile) input[type="checkbox"] { appearance: auto; -webkit-appearance: auto; }
  .statut-primes form { display: none; }

  /* Planning : vue jour par jour (la grille de la semaine reste sur ordinateur) */
  .semaine-planning { display: none; }
  .planning-jours { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -14px; padding: 0 14px 4px; -webkit-overflow-scrolling: touch; }
  .jour-carte { flex: 0 0 calc(100% - 28px); scroll-snap-align: center; background: #FFF; display: flex; flex-direction: column; }
  .jour-carte.hors { opacity: .55; }
  .jour-tete { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
  .jour-tete h2 { font-size: 18px; margin: 0; }
  .jour-tete.auj h2 { color: var(--brand); }
  .jour-ligne { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); }
  .jour-ligne .nom { font-weight: 700; color: var(--ink); font-size: 14px; }
  .jour-ligne .creneau, .jour-ligne .absence { margin-bottom: 4px; }
  .jour-vide { padding: 16px; color: var(--muted); }
  .jours-aide { font-size: 12px; color: var(--muted); margin: 0; }
}
@media (max-width: 380px) {
  .kpis { grid-template-columns: 1fr; }
  .barre-mobile a, .barre-mobile .bouton-plus { font-size: 10px; }
}
.planning-jours-aide { display: none; } @media (max-width: 860px) { .planning-jours-aide { display: block; } }

/* Prime sur téléphone : liste des vendeurs, fiche du mois */
.primes-mobile { display: none; }
@media (max-width: 860px) {
  .bureau-seulement { display: none !important; }
  .primes-mobile { display: flex; flex-direction: column; gap: 8px; }
  .total-equipe { margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; background: #161616; color: #FFF; padding: 14px 16px; font-size: 14px; }
  .total-equipe strong { font-size: 20px; }
  .fiche-prime { background: #FFF; border: 1px solid var(--line); }
  .fiche-prime summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; cursor: pointer; list-style: none; font-weight: 700; color: var(--ink); }
  .fiche-prime summary::-webkit-details-marker { display: none; }
  .fiche-prime summary::after { content: '›'; font-size: 22px; color: var(--muted); transition: transform .15s; }
  .fiche-prime[open] summary::after { transform: rotate(90deg); }
  .fiche-prime summary strong { margin-left: auto; }
  .fiche-corps { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 18px; border-top: 1px solid var(--line-soft); }
  .fiche-corps .lib { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .fiche-corps .montant { font-size: 30px; font-weight: 800; color: var(--ink); }
  .simulation-page .grid-2 { gap: 12px; }
}
/* Vue collaborateur de sa prime : même présentation que la simulation */
.prime-collaborateur { max-width: 640px; }
.prime-detail tr.prime-totale th, .prime-detail tr.prime-totale td { background: #161616; color: #FFF; font-size: 17px; }
.prime-detail tr.prime-totale strong { color: #FFF; }

/* Prime collective détaillée par critère */
.prime-detail tr.sous-titre th { padding-top: 16px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: transparent; }
.prime-detail tr.critere th { font-weight: 500; padding-left: 22px; }
.critere.ok .marque, .criteres-fiche li.ok .marque, .critere-cellule.ok { color: #0050C2; }
.critere.ko .marque, .criteres-fiche li.ko .marque, .critere-cellule.ko { color: #A0A0A0; }
.critere.ko td, .criteres-fiche li.ko { color: var(--muted); }
.criteres-fiche { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--line-soft); }
.criteres-fiche li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.criteres-fiche li.total { font-weight: 700; color: var(--ink); border-bottom: 0; }
.marque { display: inline-block; width: 1.1em; font-weight: 700; }
/* Commentaires de la Vue d'ensemble */
.commentaire { border-left: 3px solid var(--line); padding: 4px 0 4px 12px; }
.commentaire h3 { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.commentaire p { margin: 0 0 4px; white-space: normal; }
.commentaires-n1 .commentaire { border-left-color: #E8B100; }
.form-commentaire { display: flex; flex-direction: column; gap: 8px; }
.form-commentaire label { font-size: 13px; color: var(--muted); }
.form-commentaire textarea { width: 100%; min-height: 110px; padding: 10px 12px; border: 1px solid #8C8C8C; font: inherit; font-size: 15px; resize: vertical; }
.form-commentaire select { max-width: 320px; }

/* Onglets réservés à l'ordinateur */
.note-bureau { display: none; }
@media (max-width: 860px) {
  .page-bureau > :not(.entete-mobile):not(.note-bureau):not(.flash) { display: none !important; }
  .page-bureau > .note-bureau { display: block; margin: 16px 0 0; padding: 18px 16px; background: #FFF; border: 1px solid var(--line); font-weight: 600; color: var(--ink); }
  a[href^="objectifs.php"], a[href^="import.php"], a[href^="export.php"], a[href^="admin.php"] { display: none !important; }
}
/* Plan de marche sur téléphone : avancement du mois et des semaines */
.avancement-mobile { display: none; }
@media (max-width: 860px) {
  .avancement-mobile { display: flex; flex-direction: column; gap: 8px; }
  .avancement { background: #FFF; border: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
  .avancement.mois { background: #161616; color: #FFF; border-color: #161616; }
  .avancement.mois .muted { color: #BDBDBD; }
  .avancement.mois .up { color: #8DB8FF; } .avancement.mois .down { color: #FFB08A; }
  .avancement-tete { display: flex; justify-content: space-between; align-items: baseline; }
  .avancement-tete h2, .avancement-tete h3 { margin: 0; font-size: 16px; font-weight: 800; color: inherit; }
  .avancement.mois .avancement-tete span { font-size: 22px; font-weight: 800; }
  .avancement p { margin: 0; }
  .barre { height: 10px; background: #EEEEEE; }
  .avancement.mois .barre { background: #3A3A3A; }
  .barre > div { height: 10px; background: var(--brand); }
  .barre > div.ok { background: #005EE2; }
}
/* Historique personnel des simulations du mois */
.historique-simulations { margin-top: 16px; }
.liste-simulations { list-style: none; margin: 0; padding: 0; }
.liste-simulations li { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.liste-simulations li:first-child { border-top: 0; }
.liste-simulations li.actif { background: var(--accent-pale); box-shadow: inset 3px 0 0 var(--accent); }
.liste-simulations a { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 10px; color: inherit; text-decoration: none; }
.liste-simulations a > span:first-child { display: flex; flex-direction: column; }
.liste-simulations form { margin: 0; }
.btn-lien { border: 0; background: none; color: var(--muted); text-decoration: underline; padding: 0 10px; height: 36px; font-size: 13px; }

/* ---- Aide contextuelle : bouton rond fixe, fenêtre de présentation, visite guidée ---- */
.aide-bouton { position: fixed; right: 24px; bottom: 24px; z-index: 60; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--brand); color: #FFF; font: 800 24px/1 var(--sans); cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.22); display: grid; place-items: center; transition: transform .15s, background .15s; }
.aide-bouton:hover { background: var(--brand-dark); transform: scale(1.06); }
.aide-bouton:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.aide-bouton.aide-nouveau { animation: aide-pulse 1.6s ease-out 3; }
@keyframes aide-pulse { 0% { box-shadow: 0 0 0 0 rgba(226,18,18,.55); } 100% { box-shadow: 0 0 0 18px rgba(226,18,18,0); } }
.aide-active .aide-bouton { z-index: 40; }
.aide-fond { position: fixed; inset: 0; z-index: 80; background: rgba(17,17,17,.55); display: grid; place-items: center; padding: 16px; }
.aide-fenetre { background: #FFF; border-radius: 14px; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px 22px 18px; box-shadow: 0 20px 50px rgba(0,0,0,.3); border-top: 5px solid var(--brand); }
.aide-fenetre p { margin: 0 0 10px; color: var(--text); }
.aide-tete { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.aide-tete h2 { margin: 0; flex: 1; font-size: 20px; }
.aide-etiquette { background: var(--brand); color: #FFF; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 4px; }
.aide-fermer { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; width: 36px; height: 36px; border-radius: 50%; }
.aide-fermer:hover { background: var(--ground); color: var(--ink); }
.aide-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.aide-couche { position: fixed; inset: 0; z-index: 70; }
.aide-halo { position: fixed; z-index: 71; border-radius: 10px; box-shadow: 0 0 0 200vmax rgba(17,17,17,.6); outline: 3px solid var(--brand); outline-offset: 0; pointer-events: none; transition: top .25s, left .25s, width .25s, height .25s; }
.aide-bulle { position: fixed; z-index: 72; background: #FFF; border-radius: 12px; padding: 14px 16px 14px; box-shadow: 0 14px 40px rgba(0,0,0,.35); transition: top .25s, left .25s; }
.aide-bulle h3 { margin: 4px 0 6px; font-size: 17px; }
.aide-bulle p { margin: 0; color: var(--text); font-size: 14px; }
.aide-bulle-tete { display: flex; justify-content: space-between; align-items: center; }
.aide-compteur { font-size: 12px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .05em; }
.aide-bulle .aide-actions { margin-top: 12px; }
.aide-bulle .btn { height: 38px; }
.aide-points { display: flex; gap: 5px; margin-right: auto; }
.aide-points span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.aide-points span.actif { background: var(--brand); }
@media (max-width: 860px) {
  .aide-bouton { right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 46px; height: 46px; font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { .aide-halo, .aide-bulle, .aide-bouton { transition: none; animation: none; } }
@media print { .aide-bouton { display: none; } }

/* Historique (journal de bord) */
.journal-filtres { flex-wrap: wrap; }
.journal-filtres input[type="date"], .journal-filtres input[type="search"] { height: 44px; padding: 0 10px; border: 1px solid #D5D8DF; border-radius: 8px; font: inherit; }
.journal-table td { vertical-align: top; }
.journal-table .nowrap { white-space: nowrap; }
.badge-journal { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--ground); color: var(--ink); white-space: nowrap; }
.cat-connexion .badge-journal { background: #EEF2F7; }
.cat-primes .badge-journal, .cat-as400 .badge-journal { background: #FDECEC; color: var(--brand-dark); }
.cat-compte .badge-journal, .cat-onglets .badge-journal { background: var(--accent-soft); color: var(--accent-ink); }
.journal-detail { margin-top: 6px; }
.journal-detail summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; }
.journal-detail table { margin-top: 6px; font-size: 13px; }
.journal-detail th[scope="row"] { font-weight: 600; max-width: 260px; }
.journal-detail .avant { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.journal-detail .apres { color: var(--ink); font-weight: 600; }

/* Tuile « Plan de marche » de la Vue d'ensemble : sur 2 colonnes, à côté du taux de concrétisation */
.kpis-synthese { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpi-plan { grid-column: span 2; border-top: 3px solid var(--brand); }
.kpi-source { display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); text-decoration: none; margin-bottom: 6px; }
a.kpi-source:hover { text-decoration: underline; }
.kpi-plan-valeurs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpi-plan-valeurs > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-plan-valeurs > div + div { border-left: 1px solid var(--line); padding-left: 12px; }
.kpi-plan-valeurs .kpi-val { font-size: 22px; }
@media (max-width: 860px) { .kpis-synthese { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi-plan { grid-column: 1 / -1; } .kpi-plan-valeurs .kpi-val { font-size: 18px; } }

/* Menu « … Plus » du téléphone : panneau qui monte du bas */
.feuille-fond { position: fixed; inset: 0; z-index: 90; background: rgba(17,17,17,0); transition: background .2s; }
.feuille-fond.ouvert { background: rgba(17,17,17,.5); }
.feuille-plus { position: absolute; left: 0; right: 0; bottom: 0; background: #FFF; border-radius: 18px 18px 0 0; padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); max-height: 80vh; overflow-y: auto; transform: translateY(100%); transition: transform .2s ease-out; box-shadow: 0 -10px 30px rgba(0,0,0,.2); }
.feuille-fond.ouvert .feuille-plus { transform: translateY(0); }
.feuille-plus:focus { outline: none; }
.feuille-poignee { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.feuille-plus h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 8px 6px; }
.feuille-plus a { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 10px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: 16px; text-decoration: none; }
.feuille-plus a:active, .feuille-plus a:hover { background: var(--ground); }
.feuille-plus a.active { color: var(--brand); background: #FDECEC; }
.feuille-plus .feuille-deconnexion { color: var(--muted); border-top: 1px solid var(--line); border-radius: 0; margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .feuille-fond, .feuille-plus { transition: none; } }

/* Magasins & accès › Onglets affichés par rôle : séparateurs verticaux (fins entre colonnes, épais entre rôles) */
.matrice-onglets th, .matrice-onglets td { border-left: 1px solid var(--line); }
.matrice-onglets tbody th[scope="row"], .matrice-onglets thead th[rowspan] { border-left: 0; }
.matrice-onglets th.debut-role, .matrice-onglets td.debut-role { border-left: 3px solid #9A9A9A; }

/* ---- Taux de service ---- */
.taux-service { background: #15171C; color: #FFF; border: 0; display: flex; flex-direction: column; gap: 12px; }
.taux-service h2 { color: #FFF; margin: 0; font-size: 15px; }
.ts-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ts-formule { font-size: 12px; color: #C7D2F3; }
.ts-vide { margin: 0; color: #C7D2F3; } .ts-vide a { color: #FFF; }
.ts-chiffres { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.ts-taux { font-size: 40px; font-weight: 700; line-height: 1; }
.ts-ecart { font-size: 14px; } .ts-ecart.atteint { color: #9FB8F5; } .ts-ecart.manque { color: #FBC7A6; }
.ts-n1 { font-size: 14px; color: #C7D2F3; }
.ts-jauge { position: relative; height: 8px; background: #2B2F38; border-radius: 4px; }
.ts-jauge-val { position: absolute; left: 0; top: 0; bottom: 0; background: #7F97E8; border-radius: 4px; }
.ts-jauge-obj { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #FFF; }
.ts-detail { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: #C7D2F3; align-items: baseline; }
.ts-detail strong { color: #FFF; font-weight: 600; }
.ts-detail a { color: #FFF; margin-left: auto; font-weight: 600; }
.ts-alerte { color: #FBC7A6; font-weight: 600; }
.table-taux .col-taux { background: #F3F6FE; white-space: nowrap; }
.table-taux thead .col-taux { background: #DCE4FA; color: #1F44B8; }
.mini-jauge { display: inline-block; width: 64px; height: 6px; background: #ECEEF2; border-radius: 3px; margin-right: 10px; vertical-align: middle; }
.mini-jauge span { display: block; height: 6px; background: #2448C9; border-radius: 3px; }
.pastille { display: inline-block; font-family: var(--mono); font-size: 13px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pastille.atteint { background: #DCE4FA; color: #1F44B8; }
.pastille.manque { background: #FBE3D3; color: #8A3208; }
.statut-service { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--ground); color: var(--muted); white-space: nowrap; }
.statut-service.st-libelle, .statut-service.st-hors_periode, .statut-service.st-pourcentage { background: #FBE3D3; color: #8A3208; }
.statut-service.st-absent { background: #C2410C; color: #FFF; }
.statut-service.st-codic { background: #DCE4FA; color: #1F44B8; }
.services-as400 input[size] { width: auto; }
tr.st-exclue { color: var(--muted); }
.ts-fiche-tete h2 { margin: 2px 0 0; font-size: 22px; }
.card.ts-formule-bloc { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px; }
.table-taux tbody th[scope="row"] { white-space: nowrap; }
.ts-formule-bloc > div { display: flex; flex-direction: column; padding: 10px 14px; background: #F3F6FE; border-radius: 8px; }
.ts-formule-bloc > div span { font-size: 12px; color: var(--muted); }
.ts-formule-bloc > div strong { font-size: 17px; }
.ts-formule-bloc .op { font-size: 20px; color: var(--muted); }
.ts-formule-bloc .resultat { background: #15171C; color: #FFF; }
.ts-formule-bloc .resultat span, .ts-formule-bloc .resultat small { color: #C7D2F3; }
.ts-formule-bloc .resultat strong { font-size: 22px; }
.ts-alertes { background: #FFF6F0; border-color: #F3C9AE; }
.ts-alertes h2 { color: #8A3208; margin: 0 0 6px; font-size: 15px; }
.ts-alertes ul { margin: 0; padding-left: 18px; color: #8A3208; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.mon-taux-val { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 4px 0; }
.mon-taux-val strong { font-size: 30px; }
/* Évolution sur 12 mois */
.evo-ts { display: flex; align-items: stretch; gap: 10px; min-width: 620px; padding-top: 6px; }
.evo-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.evo-val { font-size: 11px; color: var(--muted); }
.evo-zone { position: relative; width: 100%; max-width: 44px; height: 170px; display: flex; align-items: flex-end; }
.evo-barre { width: 100%; background: #9FB2EE; border-radius: 3px 3px 0 0; }
.evo-col.courant .evo-barre { background: #2448C9; }
.evo-col.courant .evo-val { color: var(--ink); font-weight: 700; }
.evo-n1 { position: absolute; left: -3px; right: -3px; height: 3px; background: #15171C; }
.evo-obj { position: absolute; left: -6px; right: -6px; border-top: 2px dashed #C2410C; }
.evo-mois { font-size: 12px; color: var(--muted); }
.l-ts, .l-ts-n1, .l-ts-obj { display: inline-block; vertical-align: middle; margin-right: 6px; }
.l-ts { width: 12px; height: 12px; background: #2448C9; border-radius: 2px; }
.l-ts-n1 { width: 12px; height: 4px; background: #15171C; }
.l-ts-obj { width: 14px; border-top: 2px dashed #C2410C; }
/* Import › Téléchargement exceptionnel */
.exceptionnel { border-top: 2px solid var(--ink); padding-top: 18px; display: flex; flex-direction: column; gap: 16px; }
.exceptionnel-tete h2 { margin: 0; }
.exceptionnel-tete p { margin: 4px 0 0; }
.exceptionnel h3 { margin: 0; font-size: 16px; }
.exceptionnel details > summary { cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.verif-ref { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 10px 0; }
.verif-ref > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; }
.verif-ref strong { font-size: 20px; }
.verif-ref .alerte { border-color: #F3C9AE; background: #FFF6F0; color: #8A3208; }
.detail-ref { margin: 8px 0; }
.detail-ref summary { cursor: pointer; font-weight: 600; }
@media (max-width: 860px) {
  .ts-taux { font-size: 32px; }
  .ts-detail a { margin-left: 0; }
}

/* Lecture AS400 : points à contrôler */
.points-controle { border-bottom: 1px solid var(--line); background: #FFF9F5; }
.points-controle h2 { display: flex; align-items: center; gap: 10px; }
.points-controle ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.points-controle li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid #F3C9AE; border-radius: 8px; background: #FFF; font-size: 14px; }
.points-controle li.verifie { border-color: var(--line); opacity: .75; }
.points-controle li input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.type-point { display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #8A3208; margin-right: 4px; }
.attribuer-page select { margin-left: 4px; }
tr.ligne-deduite { background: #FFF6F0; }
.deduit { font-size: 11px; font-weight: 700; color: #8A3208; text-transform: uppercase; }
.bandeau-as400 a { font-weight: 700; }

/* Taux de service hors vendeurs cuisine */
.ts-hc { display: flex; gap: 16px; flex-wrap: wrap; align-items: baseline; font-size: 14px; color: #C7D2F3; }
.ts-hc strong { color: #FFF; font-size: 18px; }
.ts-hc .atteint { color: #9FB8F5; } .ts-hc .manque { color: #FBC7A6; }
.ts-hc-detail { font-size: 12px; color: #9AA3B5; margin: 0; } .ts-hc-detail a { color: #FFF; }
.etiquette-cuisine { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #E6F4F1; color: #0F5F57; vertical-align: middle; }
.ligne-hc th, .ligne-hc td { background: #F4FBF9; }
.evo-zone { gap: 3px; }
.evo-barre-hc { width: 100%; background: #0F766E; border-radius: 3px 3px 0 0; opacity: .85; }
.l-ts-hc { display: inline-block; vertical-align: middle; margin-right: 6px; width: 12px; height: 12px; background: #0F766E; border-radius: 2px; }

/* Documents à fournir : une tuile allongée par document, rouge si manquant, verte si fourni */
.docs-source { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tuiles-docs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tuile-doc { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; border: 1px solid; }
.tuile-doc.manquant { background: #FDECEC; border-color: #F2B8B8; }
.tuile-doc.fourni { background: #E8F6EE; border-color: #A9DDBF; }
.tuile-doc-etat { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #FFF; font-weight: 800; font-size: 14px; }
.manquant .tuile-doc-etat { background: #C81E1E; }
.fourni .tuile-doc-etat { background: #1E7A46; }
.tuile-doc.a-verifier { background: var(--warn-pale); border-color: var(--warn-line); }
.a-verifier .tuile-doc-etat { background: var(--warn); }
.tuile-doc-texte { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tuile-doc-texte strong { color: var(--ink); }
.tuile-doc-texte .small { color: var(--muted); }
.tuile-doc-texte em { font-style: normal; }
.tuile-doc-detail { flex: none; display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-weight: 600; max-width: 40%; }
.manquant .tuile-doc-detail { color: #9B1C1C; }
.fourni .tuile-doc-detail { color: #1E7A46; }
@media (max-width: 860px) { .tuile-doc { flex-wrap: wrap; } .tuile-doc-detail { align-items: flex-start; text-align: left; max-width: none; margin-left: 38px; } }

/* Documents manquants : bouton « Charger » directement sur la tuile */
.tuile-doc-actions { flex: none; display: flex; flex-direction: column; gap: 4px; }
.charger-doc { margin: 0; }
.btn-charger { height: 34px; padding: 0 12px; font-size: 13px; font-weight: 700; background: #FFF; border-color: #C81E1E; color: #9B1C1C; white-space: nowrap; }
.btn-charger:hover { background: #C81E1E; color: #FFF; }
.charger-doc.envoi .btn-charger { opacity: .6; pointer-events: none; }
.charger-doc.envoi .btn-charger::after { content: ' · envoi…'; }
.card.depot-haut { display: flex; flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }
.depot-haut label { flex: 1; min-width: 200px; }
.depot-haut input[type="file"] { max-width: 260px; }
@media (max-width: 860px) { .tuile-doc-actions { margin-left: 38px; } }

/* Calendrier des imports : cases-jauges qui se remplissent selon les documents fournis */
.cal-annees { display: flex; align-items: center; gap: 10px; }
.cal-annee { font-size: 22px; }
.cal-titre { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cal-mois { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.cal-case { --rempli: 0%; --teinte: #C81E1E; position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; height: 92px; padding: 10px 12px;
  border: 2px solid var(--teinte); border-radius: 10px; text-decoration: none; color: var(--ink); overflow: hidden; isolation: isolate;
  background: linear-gradient(to top, color-mix(in srgb, var(--teinte) 30%, #FFF) var(--rempli), #FFF var(--rempli)); transition: transform .12s, box-shadow .12s; }
a.cal-case:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.1); }
.cal-case.complet { --teinte: #1E7A46; }
.cal-case.partiel { --teinte: #D97706; }
.cal-case.vide { --teinte: #C81E1E; }
.cal-case.a-venir { --teinte: #D5D8DF; color: var(--muted); background: #F7F7F7; border-style: dashed; }
.cal-case.courant { outline: 3px solid var(--accent); outline-offset: 2px; }
.cal-nom { font-weight: 700; }
.cal-compte { font-size: 13px; font-weight: 700; color: color-mix(in srgb, var(--teinte) 85%, #000); }
.a-venir .cal-compte { color: var(--muted); font-weight: 400; }
.cal-semaines { display: flex; flex-direction: column; gap: 8px; }
.cal-ligne { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 10px; }
.cal-ligne-mois { font-weight: 600; color: var(--muted); }
.cal-ligne ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cal-case.petite { height: 58px; padding: 6px 10px; flex-direction: row; align-items: flex-end; }
.leg { display: inline-block; padding: 0 8px; border-radius: 999px; font-weight: 600; }
.leg.complet { background: #DDF1E5; color: #1E7A46; } .leg.partiel { background: #FCE8CC; color: #9A5304; } .leg.vide { background: #FBDCDC; color: #9B1C1C; }
.btn-calendrier { height: 36px; }
@media (max-width: 1100px) { .cal-mois { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) { .cal-mois { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cal-ligne { grid-template-columns: 1fr; } .cal-ligne ol { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cal-en-cours { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }

/* Import : fenêtre de résultat d'analyse et fenêtre d'attente */
.fenetre-fond { position: fixed; inset: 0; z-index: 85; background: rgba(17,17,17,.55); display: grid; place-items: center; padding: 16px; }
.fenetre-fond[hidden] { display: none; }
.fenetre-import { background: #FFF; border-radius: 14px; width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 20px 22px; box-shadow: 0 20px 50px rgba(0,0,0,.3); border-top: 5px solid var(--brand); display: flex; flex-direction: column; gap: 10px; }
.fenetre-tete { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.fenetre-tete h2 { margin: 0; font-size: 20px; }
.fenetre-tete .aide-fermer { text-decoration: none; display: grid; place-items: center; }
.resultats-analyse { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.resultats-analyse li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; border: 1px solid; }
.resultats-analyse li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.resultats-analyse .statut { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #FFF; font-weight: 800; }
.resultats-analyse .st-ok { background: #E8F6EE; border-color: #A9DDBF; } .resultats-analyse .st-ok .statut { background: #1E7A46; }
.resultats-analyse .st-alerte { background: #FFF4E5; border-color: #F5C98B; } .resultats-analyse .st-alerte .statut { background: #D97706; }
.resultats-analyse .st-erreur { background: #FDECEC; border-color: #F2B8B8; } .resultats-analyse .st-erreur .statut { background: #C81E1E; }
.resultats-analyse .msg { color: #8A3208; }
.fenetre-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 0; }
.fenetre-actions .muted { margin-right: auto; }
.fenetre-import.attente { width: min(420px, 100%); text-align: center; align-items: center; }
.fenetre-import.attente h2 { margin: 0; }
.barre-attente { width: 100%; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.barre-attente span { display: block; width: 35%; height: 100%; background: var(--brand); border-radius: 3px; animation: attente 1.1s ease-in-out infinite; }
@keyframes attente { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { .barre-attente span { animation: none; width: 100%; opacity: .5; } }
.objectif-semaine { color: var(--accent); font-weight: 600; }
.kpi-obj { margin: 2px 0 4px; }
.kpi-obj .pastille { font-size: 12px; white-space: normal; border-radius: 8px; line-height: 1.35; padding: 3px 8px; }

/* Comparatif magasins : une tuile par indicateur, magasins classés en barres */
.choix-magasins { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #FFF; font-size: 13px; font-weight: 600; cursor: pointer; }
.cmp-famille { margin: 14px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cmp-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.cmp-tuile { display: flex; flex-direction: column; gap: 10px; }
.cmp-tuile h3 { margin: 0; font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cmp-tuile ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cmp-tuile li { display: grid; grid-template-columns: 18px 96px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; padding: 3px 6px; border-radius: 6px; }
.cmp-tuile li.courant { box-shadow: inset 3px 0 0 var(--brand); font-weight: 700; }
.cmp-tuile li.courant .cmp-nom { color: var(--brand); }
.cmp-rang { color: var(--muted); font-size: 12px; text-align: right; display: flex; justify-content: flex-end; }
.cmp-rang .medaille { color: #B8860B; }
.cmp-nom { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-barre { position: relative; height: 8px; background: var(--line-soft); border-radius: 4px; }
.cmp-plein { display: block; height: 8px; background: #2448C9; border-radius: 4px; }
.cmp-plein.negatif { background: #C2410C; }
.cmp-reseau { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #15171C; }
.cmp-val { font-weight: 700; white-space: nowrap; }
.cmp-pied { margin: auto 0 0; padding-top: 8px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.cmp-pied strong { color: var(--ink); }
.leg-reseau { display: inline-block; width: 2px; height: 12px; background: #15171C; margin-right: 5px; vertical-align: middle; }
.leg-courant { color: var(--brand); font-weight: 700; }
.cmp-sans, .cmp-vide { margin: 0; }
.leg-meilleur { background: #DCE4FA; color: #1F44B8; padding: 0 6px; border-radius: 4px; font-weight: 600; }
.leg-moins-bon { background: #FBE3D3; color: #8A3208; padding: 0 6px; border-radius: 4px; font-weight: 600; }

/* Univers & réseau : une tuile par univers */
.univers-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.univers-tuile { display: flex; flex-direction: column; gap: 10px; }
.univers-tuile.total { grid-column: 1 / -1; border-top: 3px solid var(--brand); }
.univers-tuile.total .univers-indicateurs { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.univers-tuile header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.univers-tuile h2 { margin: 0; font-size: 16px; }
.univers-rang { font-size: 12px; color: var(--muted); white-space: nowrap; }
.univers-ca { display: flex; flex-direction: column; gap: 2px; }
.univers-ca .kpi-val { font-size: 24px; }
.univers-indicateurs { margin: 0; display: grid; grid-template-columns: 1fr; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.univers-indicateurs > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.univers-indicateurs dt { font-size: 13px; color: var(--muted); }
.univers-indicateurs dd { margin: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; justify-content: flex-end; text-align: right; }
.ecart-u { font-size: 12px; font-weight: 700; white-space: nowrap; }
.ecart-u.up { color: #1F44B8; } .ecart-u.down { color: #C2410C; } .ecart-u.neutre { color: var(--muted); }
.bascule-vue { display: inline-flex; gap: 0; align-self: flex-start; }
.bascule-vue .btn { border-radius: 0; height: 36px; }
.bascule-vue .btn:first-child { border-radius: 8px 0 0 8px; } .bascule-vue .btn:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
.bascule-vue .btn[aria-pressed="true"] { background: var(--ink); color: #FFF; border-color: var(--ink); }
.vue-univers { display: flex; flex-direction: column; gap: 14px; }
.vue-univers[hidden] { display: none; }
.univers-tuile.total .univers-indicateurs > div { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; background: var(--ground); border-radius: 8px; }
.univers-tuile.total .univers-indicateurs dd { justify-content: flex-start; text-align: left; }
.univers-tuile.total .univers-indicateurs dd strong { font-size: 18px; }
.univers-rangs { margin: 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.univers-rangs strong { color: var(--ink); }
.univers-recap { display: flex; flex-direction: column; gap: 4px; }
.univers-recap p { margin: 0; }

/* Magasins & accès : ordre d'affichage des onglets */
.ordre-onglets { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 12px; }
.ordre-onglets > p, .ordre-onglets > .actions { grid-column: 1 / -1; }
.ordre-onglets h3 { margin: 0 0 8px; font-size: 14px; }
.liste-ordre { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; counter-reset: ordre; }
.liste-ordre li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #FFF; counter-increment: ordre; }
.liste-ordre li::before { content: counter(ordre); font-size: 12px; color: var(--muted); width: 18px; }
.ordre-nom { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.ordre-fleches { display: flex; gap: 4px; }
.btn-fleche { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #FFF; cursor: pointer; font-size: 15px; }
.btn-fleche:hover { background: var(--ground); }
.liste-ordre li:first-child .btn-fleche[data-sens="-1"], .liste-ordre li:last-child .btn-fleche[data-sens="1"] { opacity: .3; }

/* Univers & réseau v2 : tuiles lisibles sur téléphone (jauges magasin / repère réseau) */
.univers-tuile header { align-items: center; }
.univers-tuile h2 { font-size: 17px; }
.univers-rang-badge { display: inline-flex; align-items: baseline; gap: 3px; padding: 4px 10px; border-radius: 999px; background: var(--ink); color: #FFF; }
.univers-rang-badge strong { font-size: 15px; } .univers-rang-badge sup { font-size: 9px; } .univers-rang-badge small { font-size: 11px; opacity: .75; }
.univers-ca { display: flex; flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
.univers-ca-val { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.pastille-evol { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pastille-evol.up { background: #DCE4FA; color: #1F44B8; } .pastille-evol.down { background: #FBE3D3; color: #8A3208; }
.pastille-evol small { font-weight: 500; opacity: .8; }
.univers-sous { margin: -4px 0 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.univers-vs-total { white-space: nowrap; }
.univers-jauges { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr; gap: 12px; }
.univers-tuile.total .univers-jauges { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.jauge-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.jauge-lib { font-size: 13px; font-weight: 600; color: var(--text); }
.jauge-ligne { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.jauge { position: relative; flex: 1; height: 10px; border-radius: 5px; background: var(--line-soft); }
.jauge-mag { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: #2448C9; }
.jauge-res { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; border-radius: 2px; background: #15171C; }
.jauge-val { font-size: 16px; min-width: 64px; text-align: right; color: var(--ink); }
.jauge-ref { display: block; text-align: right; }
.leg-res { display: inline-block; width: 3px; height: 12px; background: #15171C; border-radius: 2px; vertical-align: middle; margin: 0 2px; }
.univers-tuile .ecart-u { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--ground); }
@media (max-width: 860px) { .univers-ca-val { font-size: 24px; } .univers-grille { gap: 12px; } }

/* Univers : une mini-tuile par indicateur, liseré et pastille colorés selon l'écart au réseau */
.univers-tuile .ecart-u.up { background: #DCE4FA; color: #1F44B8; }
.univers-tuile .ecart-u.down { background: #FBE3D3; color: #8A3208; }
.uni-mini-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.univers-tuile.total .uni-mini-grille { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.uni-mini { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px 12px; border-radius: 10px; background: var(--ground); border-left: 4px solid var(--line); min-width: 0; }
.uni-mini.up { border-left-color: #2448C9; } .uni-mini.down { border-left-color: #C2410C; }
.uni-mini-lib { font-size: 12px; color: var(--muted); font-weight: 600; }
.uni-mini strong { font-size: 20px; color: var(--ink); line-height: 1.15; }
.univers-tuile .uni-mini .ecart-u { padding: 1px 7px; }

/* Site de test : bandeau rayé permanent en haut de chaque page */
.bandeau-test { position: sticky; top: 0; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; padding: 6px 16px; font-size: 13px; color: #FFF;
  background: repeating-linear-gradient(-45deg, #B4400B 0 14px, #C2410C 14px 28px); text-align: center; }
.bandeau-test strong { letter-spacing: .08em; }
.bandeau-test a { color: #FFF; font-weight: 700; }
.login-page .bandeau-test { position: fixed; left: 0; right: 0; top: 0; }
.test-copie { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
/* Import groupé : PDF scanné (AS400) à confirmer, lectures à contrôler */
.resultats-analyse .st-confirmer .statut { background: var(--accent-soft); color: var(--accent-ink); }
.confirmer-ocr { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-weight: 600; color: var(--accent-ink); cursor: pointer; }
.lus-as400 ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lus-as400 li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.alerte-entretien { background: var(--warn-pale); border: 1px solid var(--warn-line); color: var(--warn-dark); margin: 0; }
/* Vérification des chiffres pré-remplis par l'AS400 (Prime encadrement, Prime) */
.verif-as400 ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.verif-as400 li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid; }
.verif-as400 li.verifie { background: #E8F6EE; border-color: #A9DDBF; }
.verif-as400 li.a-verifier { background: var(--warn-pale); border-color: var(--warn-line); }
.verif-as400 li.vide { background: #FDECEC; border-color: #F2B8B8; }
.verif-marque { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #FFF; font-weight: 800; font-size: 13px; }
.verifie .verif-marque { background: #1E7A46; } .a-verifier .verif-marque { background: var(--warn); } .vide .verif-marque { background: #C81E1E; }
.verif-texte { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.verif-texte .small { color: var(--muted); }
.verif-as400 form { margin: 0; }

/* Effacer les données importées d'un mois */
.effacer-mois { border: 1px solid #F2B8B8; }
.effacer-mois ul { margin: 6px 0 10px; }
.confirmer-effacement { display: flex; gap: 8px; align-items: center; font-weight: 600; color: #8A1C1C; }
.btn-danger { background: #C81E1E; border-color: #C81E1E; color: #FFF; }
.btn-danger:hover { background: #A51717; color: #FFF; }
