/* Interface manager Sweet & Soda : styles (reprise de la maquette validée). */
:root {
  --bleu: #3B3BFF;
  --indigo: #2A00BA;
  --indigo-presse: #1F0090;
  --marine: #081F3C;
  --gris: #33475F;
  --gris-clair: #5B6B80;
  --lavande: #F3F0FF;
  --champ: #F5F6FA;
  --trait: #A9B3C3;
  --trait-doux: #E1E5EC;
  --fond: #F3F4F8;
  --ombre-1: 0 1px 2px rgba(8, 31, 60, .08), 0 4px 14px rgba(8, 31, 60, .06);
  --police: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--police); color: var(--marine); background: var(--fond); -webkit-font-smoothing: antialiased; font-synthesis: none; }
::selection { background: rgba(42, 0, 186, .2); }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
input { caret-color: var(--indigo); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.appli { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.menu { position: sticky; top: 0; display: flex; flex-direction: column; gap: 26px; height: 100vh; padding: 24px 16px 18px; background: #fff; box-shadow: 1px 0 0 var(--trait-doux); }
.menu-marque { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.menu-marque img { width: 44px; height: 44px; }
.menu-marque b { display: block; font-size: 16px; line-height: 22px; font-weight: 700; }
.menu-marque span { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--gris); }
.menu-liens { display: grid; gap: 4px; }
.menu-liens a { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--gris); text-decoration: none; transition: background-color .18s ease-out, color .18s ease-out; }
.menu-liens a:hover { background: var(--champ); color: var(--marine); }
.menu-liens a[aria-current="page"] { background: #ECE6FF; color: var(--indigo); }
.menu-appli { padding: 0 12px; font-size: 14px; font-weight: 600; color: var(--indigo); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.menu-note { margin: -14px 0 0; padding: 0 12px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--gris); }
.menu-compte { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 14px 4px 0 8px; border-top: 1px solid var(--trait-doux); }
.menu-compte b { display: block; font-size: 14px; line-height: 20px; }
.menu-compte span { font-size: 13px; color: var(--gris); }
.menu-compte button { display: grid; place-items: center; width: 40px; height: 40px; margin-left: auto; border-radius: 10px; color: var(--gris); }
.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: #E6E1FB; color: var(--marine); font-size: 13px; font-weight: 700; }

.contenu { min-width: 0; padding: 22px 32px 20px; }
.page { display: none; }
.page.visible { display: block; }
.page-tete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 16px; }
.page-tete h1 { margin: 0; font-size: 28px; line-height: 36px; font-weight: 700; letter-spacing: -.015em; }
.page-tete p { margin: 2px 0 0; font-size: 15px; line-height: 22px; font-weight: 500; color: var(--gris); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tableau-defile { position: relative; overflow-x: auto; }
.segments { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--trait); }
.segment { height: 36px; padding: 0 16px; border-radius: 9px; font-size: 14px; font-weight: 600; transition: background-color .18s ease-out, color .18s ease-out; }
.segment[aria-pressed="true"] { background: var(--indigo); color: #fff; }
.periode-nav { display: flex; align-items: center; gap: 2px; height: 42px; padding: 0 4px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--trait); font-size: 14px; font-weight: 600; }
.periode-nav button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; }
.periode-nav button:disabled { color: #B9C0CC; cursor: default; }
.periode-nav span { min-width: 124px; padding: 0 4px; text-align: center; white-space: nowrap; }
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px; font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; transition: background-color .18s ease-out; }
.principal { background: var(--indigo); color: #fff; }
.principal:hover { background: var(--indigo-presse); }
.secondaire { background: #fff; color: var(--indigo); box-shadow: inset 0 0 0 2px var(--indigo); }
.secondaire:hover { background: var(--lavande); }
.lien { height: 32px; font-size: 14px; font-weight: 600; color: var(--indigo); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

/* indicateurs et jauges : remplissage indigo, piste lavande, repère = où en être aujourd'hui */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kpi, .panneau { min-width: 0; background: #fff; border-radius: 18px; box-shadow: var(--ombre-1); }
.kpi { padding: 14px 20px 14px; }
.kpi-nom { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; color: var(--gris); }
.kpi-valeur { display: flex; align-items: baseline; gap: 6px; margin: 2px 0 0; }
.kpi-valeur b { font-size: 34px; line-height: 38px; font-weight: 700; letter-spacing: -.01em; }
.kpi-valeur span { font-size: 16px; font-weight: 600; color: var(--gris); }
.jauge, .mini-jauge { position: relative; border-radius: 5px; background: #E6E1FB; }
.jauge { height: 10px; margin: 8px 0 8px; }
.mini-jauge { height: 6px; }
.jauge-rempli { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--indigo); }
.jauge-repere { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--marine); }
.mini-jauge .jauge-repere { top: -4px; bottom: -4px; }
.kpi-aide { margin: 0; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--gris); }
.legende-repere { display: flex; align-items: center; gap: 8px; margin: 8px 0 12px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--gris); }
.legende-repere i { width: 2px; height: 16px; border-radius: 1px; background: var(--marine); }

.panneau { padding: 16px 20px 18px; }
.panneau h2 { margin: 0 0 6px; font-size: 18px; line-height: 26px; font-weight: 700; }
.panneau-tete { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.panneau-tete h2 { margin: 0; }
.grille-bas { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.tableau { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 20px; }
.tableau th { padding: 9px 12px; text-align: left; font-size: 13px; font-weight: 600; color: var(--gris); white-space: nowrap; border-bottom: 1px solid var(--trait-doux); }
.tableau td { padding: 9px 12px; vertical-align: middle; border-bottom: 1px solid var(--trait-doux); }
.tableau tbody tr:last-child td { border-bottom-color: #C9CEDA; }
.tableau tfoot th, .tableau tfoot td { padding-top: 12px; padding-bottom: 4px; border-bottom: 0; font-size: 15px; font-weight: 700; color: var(--marine); }
.tableau th:first-child, .tableau td:first-child { padding-left: 0; }
.tableau th:last-child, .tableau td:last-child { padding-right: 0; }
.tableau.compact td { padding-top: 7px; padding-bottom: 7px; }
.tableau tbody tr:last-child td.sans-bord, .tableau.compact tbody tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; }
.droite { text-align: right; }
.cellule-nom { display: flex; align-items: center; gap: 10px; font-weight: 600; white-space: nowrap; }
.cellule-nom small { display: block; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--gris); }
.cellule-jauge { min-width: 130px; }
.cellule-jauge p { margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.cellule-jauge b { font-weight: 700; }
.cellule-jauge span { font-weight: 500; color: var(--gris); }
.saisie { font-size: 14px; font-weight: 500; color: var(--gris); white-space: nowrap; }
.resultat { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.resultat .ic { width: 18px; height: 18px; color: var(--gris); }

.graphe-note { margin: -4px 0 0; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--gris); }
.colonnes { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: 136px; margin: 22px 0 0 46px; border-bottom: 1px solid #C9CEDA; background: linear-gradient(#E6E8EE, #E6E8EE) 0 0 / 100% 1px no-repeat, linear-gradient(#E6E8EE, #E6E8EE) 0 50% / 100% 1px no-repeat; }
.axe-y { position: absolute; left: -46px; width: 38px; text-align: right; font-size: 12px; line-height: 12px; font-weight: 500; color: var(--gris); font-variant-numeric: tabular-nums; transform: translateY(-50%); }
.colonne { position: relative; display: flex; align-items: flex-end; justify-content: center; outline: none; }
.colonne .barre { position: relative; width: 24px; border-radius: 4px 4px 0 0; background: #8F80DD; }
.colonne .projection { position: absolute; bottom: 0; left: 50%; width: 24px; margin-left: -12px; border: 1.5px dashed var(--indigo); border-bottom: 0; border-radius: 4px 4px 0 0; }
.colonne.courante .barre { background: var(--indigo); }
.colonne .valeur { position: absolute; left: 50%; transform: translateX(-50%); font-size: 13px; font-weight: 700; white-space: nowrap; }
.colonne .bulle { position: absolute; z-index: 3; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); padding: 6px 10px; border-radius: 10px; background: var(--marine); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s ease-out; }
.colonne:hover .bulle, .colonne:focus-visible .bulle { opacity: 1; }
.axe-y + .colonne .bulle { left: 0; transform: none; }
.colonne:last-child .bulle { left: auto; right: 0; transform: none; }
.etiquettes-x { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin: 6px 0 0 46px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--gris); text-align: center; }
.etiquettes-x .courante { color: var(--marine); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Réglages ---------- */
.grille-reglages { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; margin-top: 16px; }
.etat { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.etat .ic { width: 16px; height: 16px; }
.etat.actif { color: #0E6A37; }
.etat.inactif { color: var(--gris); }
.inactif-ligne td:not(:last-child) { color: var(--gris); }
.note { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--gris); }
.note .ic { width: 18px; height: 18px; margin-top: 1px; }
.champ-nombre { width: 100%; max-width: 104px; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--champ); box-shadow: inset 0 0 0 1.5px var(--trait); font-size: 15px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; outline: none; }
.champ-nombre:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--indigo); }
.panneau-pied { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--gris); }
.depot { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 4px; padding: 20px; border: 2px dashed #9AA5B6; border-radius: 16px; background: var(--champ); text-align: center; }
.depot > .ic { width: 30px; height: 30px; color: var(--indigo); }
.depot b { font-size: 16px; line-height: 22px; }
.depot span { font-size: 13px; color: var(--gris); }
.depot small { max-width: 52ch; margin-top: 4px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--gris); }

.message { position: fixed; z-index: 60; left: 50%; bottom: 24px; display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 14px; background: var(--marine); color: #fff; font-size: 15px; font-weight: 600; box-shadow: 0 14px 36px rgba(8, 31, 60, .25); opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity .2s ease-out, transform .22s cubic-bezier(.2, .8, .2, 1); }
.message.visible { opacity: 1; transform: translate(-50%, 0); }
.message .ic { color: #7BE0A6; }

@media (max-width: 1180px) {
  .kpis, .grille-bas, .grille-reglages { grid-template-columns: 1fr; }
  .tableau th, .tableau td { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 860px) {
  .appli { grid-template-columns: minmax(0, 1fr); }
  .menu { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; box-shadow: 0 1px 0 var(--trait-doux); }
  .menu-liens { order: 3; flex: 1 1 100%; grid-auto-flow: column; justify-content: start; overflow-x: auto; }
  .menu-liens a { height: 42px; white-space: nowrap; }
  .menu-appli, .menu-note, .menu-compte div { display: none; }
  .menu-compte { order: 2; margin: 0 0 0 auto; padding: 0; border: 0; }
  .contenu { padding: 18px 16px 28px; }
  .page-tete { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* ---------- interface réelle : accès refusé, formulaires, import, boîtes de dialogue ---------- */
.bloque { display: grid; place-items: center; min-height: 100vh; padding: 24px; text-align: center; }
.bloque div { max-width: 420px; }
.bloque img { width: 72px; height: 72px; }
.bloque h1 { margin: 14px 0 6px; font-size: 24px; line-height: 30px; }
.bloque p { margin: 0 0 18px; color: var(--gris); font-size: 16px; line-height: 24px; }
.vide-tableau { padding: 18px 0 6px; font-size: 15px; line-height: 22px; color: var(--gris); }
dialog { width: min(440px, calc(100vw - 32px)); padding: 22px 22px 18px; border: 0; border-radius: 20px; color: var(--marine); box-shadow: 0 30px 80px rgba(8, 31, 60, .3); }
dialog::backdrop { background: rgba(8, 31, 60, .4); }
dialog h2 { margin: 0 0 14px; font-size: 20px; line-height: 28px; font-weight: 700; }
.champ { margin-bottom: 14px; }
.champ label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--gris); }
.champ input, .champ select { width: 100%; height: 46px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--champ); box-shadow: inset 0 0 0 1.5px var(--trait); font: inherit; font-size: 15px; font-weight: 500; outline: none; }
.champ input:focus, .champ select:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--indigo); }
.champ input:read-only { color: var(--gris); }
.champ small { display: block; margin-top: 6px; font-size: 13px; line-height: 18px; color: var(--gris); }
.actions-dialogue { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.erreur-formulaire { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: #FDECEE; color: #8E0F19; font-size: 14px; line-height: 20px; font-weight: 600; }
.depot.survol { border-color: var(--indigo); background: var(--lavande); }
.apercu { margin-top: 14px; }
.apercu-resume { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 10px; font-size: 14px; line-height: 20px; font-weight: 600; }
.apercu-resume span { color: var(--gris); font-weight: 500; }
.apercu .tableau { font-size: 13px; }
.apercu .tableau td { padding-top: 6px; padding-bottom: 6px; }
.problemes { margin: 10px 0 0; padding: 0 0 0 18px; max-height: 120px; overflow-y: auto; font-size: 13px; line-height: 19px; color: var(--gris); }
.apercu-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.apercu-actions label { font-size: 14px; font-weight: 600; color: var(--gris); }
.apercu-actions select { height: 42px; padding: 0 10px; border: 0; border-radius: 12px; background: var(--champ); box-shadow: inset 0 0 0 1.5px var(--trait); font: inherit; font-size: 14px; }
.bouton:disabled { opacity: .5; cursor: default; }
.quand { white-space: nowrap; }
.liens-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 16px; }
.cellule-nom.libre { white-space: normal; }


/* ---------- statuts : mêmes couleurs que l'appli (anneau pour « à visiter », demi-disque pour « à prospecter ») ---------- */
:root { --st-a_visiter: #6F37FF; --st-visite: #16181D; --st-interesse: #DD6B00; --st-client: #1F9D55; --st-perdu: #E3202B; }
.st-a_visiter { --c: var(--st-a_visiter); }
.st-visite { --c: var(--st-visite); }
.st-interesse { --c: var(--st-interesse); }
.st-client { --c: var(--st-client); }
.st-perdu { --c: var(--st-perdu); }
.point { display: inline-block; flex: none; width: 11px; height: 11px; margin-right: 8px; border-radius: 50%; background: var(--c); }
.point.st-a_visiter { background: #fff; box-shadow: inset 0 0 0 2.5px var(--c); }
.point.st-visite { background: linear-gradient(90deg, var(--c) 50%, #fff 50%); box-shadow: inset 0 0 0 1.5px var(--c); }

/* ---------- chiffres clés (ceux du fichier de suivi de l'équipe) ---------- */
.chiffres { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.chiffre { min-width: 0; padding: 12px 16px; border-radius: 16px; background: #fff; box-shadow: var(--ombre-1); }
.chiffre p { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--gris); }
.chiffre b { display: block; margin-top: 2px; font-size: 24px; line-height: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chiffre span { display: block; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--gris); }

/* ---------- commerces par statut ---------- */
.barres { display: grid; gap: 12px; margin-top: 14px; }
.barre-ligne { display: grid; grid-template-columns: 140px minmax(0, 1fr) 64px; align-items: center; gap: 12px; font-size: 15px; line-height: 20px; }
.barre-nom { display: flex; align-items: center; font-weight: 600; white-space: nowrap; }
.barre-piste { height: 12px; overflow: hidden; border-radius: 6px; background: #EEF0F5; }
.barre-rempli { display: block; height: 100%; border-radius: 6px; background: var(--c); }
.barre-ligne b { text-align: right; font-weight: 700; }

/* ---------- agenda de l'équipe ---------- */
.agenda-equipe { min-width: 1000px; table-layout: fixed; }
.agenda-equipe thead th:first-child { width: 170px; }
.agenda-equipe thead th { text-transform: none; }
.agenda-equipe tbody th { padding: 10px 12px 10px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--trait-doux); }
.agenda-equipe td { padding: 10px 8px; vertical-align: top; font-size: 13px; line-height: 18px; border-left: 1px solid var(--trait-doux); }
.agenda-equipe .aujourdhui { background: #F7F5FF; }
.agenda-equipe thead th.aujourdhui { color: var(--indigo); }
.agenda-equipe ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.agenda-equipe li { padding: 6px 8px; border-radius: 8px; background: var(--champ); overflow-wrap: anywhere; }
.agenda-equipe li b { font-weight: 700; }
.agenda-equipe time { display: block; font-weight: 700; color: var(--indigo); font-variant-numeric: tabular-nums; }
.agenda-equipe .ag-tournee, .agenda-equipe .ag-evenement { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-weight: 600; }
.agenda-equipe .ag-tournee { background: var(--lavande); }
.agenda-equipe .ag-evenement time { width: 100%; }
.agenda-equipe .ic { width: 16px; height: 16px; }
.ag-retard { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; padding: 6px 8px; border-radius: 8px; background: #FDECEE; color: #8E0F19; font-size: 13px; font-weight: 700; }
.ag-retard .ic { width: 16px; height: 16px; }
.ag-plus { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--gris); }
@media (max-width: 1180px) {
  .chiffres { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}
