/* Interface v2 — socle visuel (refonte). Chargé APRÈS app.css : redéfinit les jetons et les composants sans changer
   les classes utilisées par le JavaScript, pour qu'aucune fonction ne se perde. */
/* Police Inter hébergée par l'app (licence OFL) : aucune requête vers un service tiers, compatible avec la CSP du site. */
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  /* Marque Montreal Polymers */
  --navy: #0b2545; --navy-600: #12346a; --navy-50: #eef2f8;
  --teal: #0f766e; --teal-50: #e6f4f2;
  --orange: #d9741a; --orange-50: #fdf1e6;
  --green: #15803d; --green-50: #e8f5ec;
  --gold: #b7791f; --gold-50: #fdf6e3;
  --red: #b42318; --red-50: #fdecea;
  --blue: #1d4ed8; --blue-50: #eaf0fd;
  /* Neutres */
  --bg: #f6f7f9; --card: #ffffff; --soft: #f9fafb; --text: #101828; --text-2: #344054; --muted: #667085;
  --line: #e4e7ec; --line-2: #d0d5dd; --chip: #f2f4f7;
  /* Formes */
  --radius: 10px; --radius-sm: 8px; --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05); --shadow-md: 0 4px 12px rgba(16, 24, 40, .08); --shadow-lg: 0 16px 40px rgba(16, 24, 40, .16);
  --side: 236px;
}
body { font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
h2 { font-size: 15px; font-weight: 600; color: var(--text); }
h3 { color: var(--text); }
.muted { color: var(--muted); }
a { color: var(--teal); }

/* Icônes (sprite Lucide) */
.ic { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.ic.lg { width: 20px; height: 20px; }
h1 .ic, h2 .ic { width: 18px; height: 18px; color: var(--muted); margin-right: 2px; }

/* Boutons : un principal par écran, le reste secondaire */
.btn { border-radius: var(--radius-sm); padding: 8px 14px; font-weight: 600; font-size: 14px; line-height: 20px; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn.primary { background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.btn.primary:hover { background: var(--navy-600); }
.btn.ghost { background: #fff; color: var(--text-2); border-color: var(--line-2); box-shadow: var(--shadow); }
.btn.ghost:hover { background: var(--soft); border-color: var(--line-2); color: var(--text); }
.btn.orange { background: var(--orange); color: #fff; }
.btn.orange:hover { filter: brightness(.95); }
.btn.green { background: var(--green); color: #fff; }
.btn.green:hover { filter: brightness(.95); }
.btn.danger { background: var(--red); color: #fff; }
.btn.link { color: var(--muted); font-weight: 500; }
.btn.link:hover { color: var(--text); }
.btn.small { padding: 5px 10px; font-size: 13px; line-height: 18px; }
.btn:focus-visible, .chip:focus-visible, a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* Champs */
input, textarea, select { border-color: var(--line-2); border-radius: var(--radius-sm); padding: 9px 12px; box-shadow: var(--shadow); }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(15, 118, 110, .18); border-color: var(--teal); }
label { color: var(--text-2); font-weight: 500; }
label.check input { box-shadow: none; }

/* Cartes, pastilles, badges de statut */
.card, .tblock, .kpi, .run, .empty, .lead, .fu-panel, .triage-panel, .turbo-bar, .hide-panel, .inbox-item { box-shadow: var(--shadow); border: 1px solid var(--line); border-radius: var(--radius); }
.card { padding: 18px 20px; }
.chip { border-color: var(--line-2); color: var(--text-2); font-weight: 500; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.tag { font-size: 12px; font-weight: 500; border-radius: 999px; padding: 2px 9px; background: var(--chip); color: var(--text-2); border: 1px solid transparent; white-space: nowrap; }
.tag.st-approuve { background: var(--blue-50); color: var(--blue); }
.tag.st-envoye { background: var(--green-50); color: var(--green); }
.tag.st-repondu, .tag.st-gagne { background: var(--gold-50); color: var(--gold); }
.tag.st-ecarte { background: var(--red-50); color: var(--red); }
.tag.cat-hot { background: var(--orange); color: #fff; }
.prio { border-radius: 6px; font-size: 11px; padding: 1px 7px; }
.prio.A { background: var(--green); } .prio.B { background: var(--gold); color: #fff; }
.badge { background: var(--orange); font-size: 12px; font-weight: 600; padding: 0 8px; line-height: 20px; }
.kpi small { color: var(--muted); font-weight: 500; }
.kpi div { font-size: 24px; color: var(--text); }
.notice { background: var(--teal-50); border-color: #b9e2dc; color: var(--teal); }

/* Fenêtres : plus sobres, et les fiches s'ouvrent en panneau latéral (voir plus bas) */
dialog { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 24px; }
dialog::backdrop { background: rgba(16, 24, 40, .45); backdrop-filter: blur(2px); }
.modal-x { background: transparent; color: var(--muted); font-size: 22px; }
.modal-x:hover { background: var(--chip); color: var(--text); }
#toast { background: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-lg); font-weight: 500; }

/* Fenêtre de confirmation de l'app (remplace celle du navigateur) */
#confirm-dlg { width: min(440px, calc(100vw - 32px)); }
#confirm-dlg p { margin: 0 0 20px; color: var(--text-2); white-space: pre-line; }

/* ---------- Structure : menu latéral (ordinateur) ---------- */
@media (min-width: 761px) {
  #app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
  #app > main { min-width: 0; }
  .top { position: sticky; top: 0; height: 100vh; flex-direction: column; align-items: stretch; gap: 0; padding: 16px 12px; border-bottom: 0; border-right: 1px solid var(--line); background: #fff; overflow-y: auto; }
  .top .brand { padding: 2px 8px 16px; }
  .top .tabs { flex-direction: column; gap: 1px; flex: 1; overflow: visible; }
  .tabs .nav-group { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 4px; }
  .tabs a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; font-size: 14px; }
  .tabs a .ic { color: var(--muted); }
  .tabs a:hover { background: var(--soft); color: var(--text); }
  .tabs a.on { background: var(--navy-50); color: var(--navy); font-weight: 600; }
  .tabs a.on .ic { color: var(--navy); }
  .tabs a .badge { margin-left: auto; }
  .tabs a.sub { padding-left: 36px; font-size: 13px; }
  .side-foot { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; position: relative; }
  main { max-width: 1280px; width: 100%; padding: 28px 32px 48px; }
}
.side-foot { display: none; }
@media (min-width: 761px) { .side-foot { display: block; } .top > #lang-btn, .top > #logout { display: none; } }
.profile-btn { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; text-align: left; color: var(--text); }
.profile-btn:hover { background: var(--soft); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.profile-btn small { display: block; color: var(--muted); font-size: 12px; }
.profile-menu { position: absolute; bottom: 56px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 30; }
.profile-menu a, .profile-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 6px; font: inherit; font-size: 14px; color: var(--text-2); text-decoration: none; cursor: pointer; text-align: left; }
.profile-menu a:hover, .profile-menu button:hover { background: var(--soft); color: var(--text); }
.profile-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* En-tête de page */
.head { align-items: center; margin-bottom: 20px; }
.head h1 { display: flex; align-items: center; gap: 8px; }

/* ---------- Tableau de données (Acheteurs, et ensuite les autres listes) ---------- */
.dtable-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; }
.dtable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.dtable th { position: sticky; top: 0; z-index: 1; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dtable th[data-sortkey] { cursor: pointer; user-select: none; }
.dtable th[data-sortkey]:hover { color: var(--text); }
.dtable th.sorted { color: var(--navy); }
.dtable td { padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dtable tr:last-child td { border-bottom: 0; }
.dtable tbody tr { cursor: pointer; transition: background .08s; }
.dtable tbody tr:hover { background: var(--soft); }
.dtable tbody tr.selected { background: var(--navy-50); }
.dtable tbody tr.hot td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
.dtable .c-sel { width: 36px; } .dtable .c-sel input { width: 16px; height: 16px; box-shadow: none; accent-color: var(--navy); }
.dtable .company { font-weight: 600; color: var(--text); display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dtable .sub { color: var(--muted); font-size: 12.5px; display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dtable .pills { display: flex; flex-wrap: wrap; gap: 4px; max-width: 200px; }
.dtable .icons { display: flex; gap: 8px; color: var(--muted); }
.dtable .icons .off { opacity: .22; }
.dtable .heat { width: 64px; height: 6px; background: var(--chip); border-radius: 4px; overflow: hidden; display: inline-block; vertical-align: middle; }
.dtable .heat span { display: block; height: 100%; background: linear-gradient(90deg, #f2c14e, var(--orange)); }
.dtable .c-act { text-align: right; white-space: nowrap; }
.dtable .c-act .btn { padding: 5px 10px; font-size: 13px; }
.view-toggle { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); }
.view-toggle button { border: 0; background: #fff; padding: 6px 10px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; }
.view-toggle button + button { border-left: 1px solid var(--line-2); }
.view-toggle button.on { background: var(--navy-50); color: var(--navy); font-weight: 600; }

/* ---------- Fiches en panneau latéral (acheteur, client, fournisseur) ---------- */
@media (min-width: 761px) {
  dialog.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(760px, 92vw); border-radius: 0; padding: 0; }
  dialog.drawer[open] { animation: drawer-in .18s ease-out; }
  @keyframes drawer-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
}

/* ---------- Aujourd'hui ---------- */
.today-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.today-kpis a { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; text-decoration: none; color: inherit; transition: border-color .12s, box-shadow .12s; }
.today-kpis a:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); }
.today-kpis small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; font-size: 13px; }
.today-kpis b { display: block; font-size: 26px; font-weight: 700; color: var(--text); margin-top: 4px; }
.today-kpis a.alert b { color: var(--orange); }
.tblock h2 .ic { color: var(--muted); }
.trow { border-top-color: var(--line); }
.trow b { color: var(--text); }

/* ---------- Téléphone : la barre du bas garde les icônes ---------- */
@media (max-width: 760px) {
  .tabs .nav-group, .tabs a.sub { display: none; }
  .today-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .today-kpis a { padding: 10px 12px; }
  .today-kpis b { font-size: 22px; }
  .bottom-nav span .ic { width: 20px; height: 20px; }
}

/* En-tête de page : titre à gauche, sélecteurs et actions à droite */
.head > div:first-child { flex: 1 1 320px; }

/* Offres : vignette de la liste, fiche en panneau latéral */
.othumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; border: 1px solid var(--line); background: var(--soft); }
.empty-thumb { display: grid; place-items: center; color: var(--muted); }
.offer-detail .card { box-shadow: none; border: 0; border-radius: 0; margin: 0; padding: 28px 28px 24px; }
.offer-detail .offer pre { max-height: none; mask-image: none; }
.cnt { color: inherit; opacity: .75; }

/* Suivi : colonnes à hauteur d'écran, défilement dans chaque colonne */
@media (min-width: 761px) {
  .col { max-height: calc(100vh - 260px); overflow-y: auto; }
  .col h3 { position: sticky; top: -10px; background: #e9edf3; padding: 8px 4px; margin: -10px -4px 8px; z-index: 1; }
}
.col { background: #eef1f5; border: 1px solid var(--line); }
.pcard { border: 1px solid var(--line); box-shadow: var(--shadow); }

/* Sous-onglets (Réglages, Approvisionnement) : style onglets plutôt que pastilles */
#anav, #snav, .subtabs { border-bottom: 1px solid var(--line); gap: 2px; flex-wrap: wrap; padding-bottom: 0; }
#anav .chip, #snav .chip, .subtabs .chip { border: 0; border-radius: 0; background: none; color: var(--muted); padding: 8px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px; }
#anav .chip.on, #snav .chip.on, .subtabs .chip.on { color: var(--navy); border-bottom-color: var(--navy); background: none; font-weight: 600; }

/* Fiche acheteur dans le panneau : en-tête puis suivi */
#lead-modal-body .crm { border-top: 1px solid var(--line); background: var(--soft); }

/* Barres de filtres : sélecteurs à leur largeur naturelle, recherche alignée */
.toolbar { align-items: center; }
.toolbar > .row { flex-wrap: wrap; }
.toolbar select, .toolbar input[type=search], .offer-tools input[type=search], .lead-tools select { width: auto; min-width: 180px; max-width: 320px; }
.toolbar input[type=search] { min-width: 240px; }
@media (max-width: 760px) { .toolbar select, .toolbar input[type=search] { max-width: none; width: 100%; } }

/* Comptes rendus rédigés par l'IA (recherches) : mis en forme, hauteur limitée */
.md { font-size: 13.5px; color: var(--text-2); margin: 8px 0 0; max-height: 220px; overflow: auto; line-height: 1.55; padding-right: 6px; }
.md .md-h { display: block; margin-top: 6px; color: var(--text); }
.md .md-li { display: block; padding-left: 14px; position: relative; }
.md .md-li::before { content: "•"; position: absolute; left: 2px; color: var(--muted); }

/* Sélecteur de langue (bas du menu latéral) */
.lang-seg { display: flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; margin: 0 4px 10px; }
.lang-seg button { flex: 1; border: 0; background: #fff; padding: 6px 8px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.lang-seg button + button { border-left: 1px solid var(--line-2); }
.lang-seg button.on { background: var(--navy-50); color: var(--navy); font-weight: 600; }

/* Dictée vocale */
.mic-btn { display: inline-flex; align-items: center; gap: 5px; margin: 6px 0 2px; padding: 3px 9px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; color: var(--muted); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
.mic-btn:hover { color: var(--text); border-color: var(--muted); }
.mic-btn .ic { width: 14px; height: 14px; }
.mic-btn.rec { background: var(--red-50); color: var(--red); border-color: var(--red); animation: mic-pulse 1.2s infinite; }
.mic-btn.busy { opacity: .7; cursor: progress; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 4px rgba(180, 35, 24, .15); } }

/* Texte traduit automatiquement dans la langue de la cible */
.auto-tr { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0; font-size: 12px; color: var(--teal); }
.auto-tr .btn.link { padding: 0; font-size: 12px; }

/* Autocomplétion : suite proposée sous le champ */
.ac-sug { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 2px; padding: 6px 10px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--soft); color: var(--muted); font-size: 13.5px; cursor: pointer; }
.ac-sug:hover { color: var(--text); border-color: var(--muted); }
.ac-key { flex: none; font-size: 11px; font-weight: 600; color: var(--text-2); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: #fff; }
.ac-text { font-style: italic; white-space: pre-wrap; }

/* Dictée : jauge de voix dans le bouton, champ entouré pendant l'écoute, choix de la langue parlée */
.mic-wrap { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 2px; }
.mic-wrap .mic-btn { margin: 0; position: relative; }
.mic-level { display: none; width: 46px; height: 6px; border-radius: 3px; background: rgba(180, 35, 24, .15); overflow: hidden; }
.mic-level b { display: block; height: 100%; width: 0; background: var(--red); transition: width .08s; }
.mic-btn.rec .mic-level { display: inline-block; }
.mic-lang { width: auto; min-width: 0; padding: 2px 6px; font-size: 12px; border-radius: 999px; box-shadow: none; color: var(--muted); }
textarea.dictating, input.dictating { outline: 3px solid rgba(180, 35, 24, .25); border-color: var(--red); }

/* Filtres des acheteurs : retour à la ligne au lieu d'élargir la page (téléphone) */
.toolbar { flex-wrap: wrap; min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; max-width: 100%; }
@media (max-width: 760px) { .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .filters .chip { flex: none; } }
@media (max-width: 760px) {
  .filters { width: 100%; max-width: calc(100vw - 32px); }
  .row:has(> #open-schedule) { flex-wrap: wrap; }
}
/* Téléphone : rien ne doit élargir la page (sinon le navigateur dézoome) */
@media (max-width: 760px) {
  .toolbar { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
  .toolbar > * { min-width: 0; max-width: 100%; }
  .toolbar > .row { flex-wrap: wrap; }
  .toolbar > .row > * { flex: 1 1 auto; min-width: 0; max-width: 100%; }
  .toolbar select, .toolbar input[type=search] { min-width: 0; }
  .chips { flex-wrap: wrap; }
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.chips .chip { max-width: 100%; white-space: normal; text-align: left; }
@media (max-width: 760px) { select { max-width: 100%; min-width: 0; } .row > select { flex: 1 1 140px; } }
@media (max-width: 760px) { .toolbar > .row > .btn { white-space: normal; flex: 1 1 100%; justify-content: center; } }

/* Entreprises : profil, liste de la plateforme, guide de démarrage */
.company-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 10px; }
.onboarding ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.onboarding li a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.onboarding li.done a { color: var(--muted); text-decoration: line-through; }
.onboarding li .ic { width: 16px; height: 16px; }
@media (max-width: 760px) { #super-companies { overflow-x: auto; } }

/* Messagerie IMAP / SMTP */
.imap-box { margin: 10px 0 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; background: var(--soft); }
.imap-box summary { cursor: pointer; font-weight: 500; font-size: 13.5px; }
.imap-box[open] summary { margin-bottom: 10px; }
.imap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; align-items: end; }

/* Admin simplifié : entreprises en lignes, création en 3 champs, détails IA repliés */
.co-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.co-row:first-child { border-top: 0; }
.co-row.off { opacity: .55; }
.co-row > .grow { flex: 1; min-width: 0; }
.co-logo { flex: none; width: 34px; height: 34px; font-size: 12px; }
.super-add { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; align-items: end; padding: 12px; margin: 10px 0; background: var(--soft); border-radius: var(--radius-sm); }
.super-add .row, .super-add p { grid-column: 1 / -1; margin: 0; }
.company-form textarea { width: 100%; }
.company-adv { margin-top: 12px; }
.company-adv summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.company-adv[open] summary { margin-bottom: 10px; }

.visit-banner { position: sticky; top: 0; z-index: 60; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 8px 14px; background: #f2c200; color: #121518; font-size: 14px; }

.ai-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 10px; }
.ai-kpis > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line, #e3e3e3); border-radius: 10px; }
.ai-kpis b { font-size: 22px; }
.ai-co { border-top: 1px solid var(--line, #e3e3e3); padding: 8px 0; }
.ai-co summary { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; cursor: pointer; }
.ai-meter { width: 120px; height: 8px; border-radius: 4px; background: var(--line, #e3e3e3); overflow: hidden; }
.ai-meter span { display: block; height: 100%; background: #2f7d5b; }
.ai-meter span.hot { background: #c0392b; }
.ai-detail { padding: 10px 0 4px; display: grid; gap: 12px; }
.ai-bars { display: flex; align-items: flex-end; gap: 2px; height: 34px; }
.ai-bars i { flex: 1; max-width: 14px; background: #2f7d5b; border-radius: 2px 2px 0 0; opacity: .85; }
.ai-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ai-table th, .ai-table td { text-align: right; padding: 4px 6px; border-bottom: 1px solid var(--line, #eee); }
.ai-table th:first-child, .ai-table td:first-child { text-align: left; }
@media (max-width: 640px) { .ai-table { display: block; overflow-x: auto; } }

/* Espace « Prospection clients Polyfinder » (super admin) : pas de modules métier des clients */
body.pf-space .supply-only, body.pf-space a[data-tab="radar"], body.pf-space a[data-tab="transport"], body.pf-space .nav-group.pf-hide { display: none !important; }

.pf-back { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 9px 12px; border-radius: 8px; background: #f2c200; color: #121518 !important; font-weight: 600; text-decoration: none; }
.pf-back:hover { filter: brightness(.95); }

/* Pays déjà prospectés pour l'offre (fenêtre « Lancer une prospection ») */
.chip.was { border-style: dashed; }
.chip small, small.was { font-size: 11px; font-weight: 500; opacity: .75; margin-left: 4px; }

/* Salutation juste après la connexion */
.hello-toast { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: 200; padding: 18px 28px; border-radius: 14px;
  background: #121518; color: #fff; font-size: 20px; font-weight: 600; box-shadow: 0 20px 50px rgba(0,0,0,.25); transition: opacity .5s, transform .5s; }
.hello-toast.out { opacity: 0; transform: translate(-50%, -10px); }
@media (prefers-reduced-motion: reduce) { .hello-toast { transition: none; } }

.hello-note { margin-top: 6px; font-size: 17px; font-weight: 500; text-align: center; }
.hello-toast { text-align: center; }

.hello-note .beat { display: inline-block; margin-left: 4px; animation: beat 1s ease-in-out infinite; transform-origin: center; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.3); } 30% { transform: scale(1); } 45% { transform: scale(1.22); } 60% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .hello-note .beat { animation: none; } }

/* Suivi des envois */
.track-card { padding: 18px 20px; margin: 0 0 16px; }
.track-card h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.ts-progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 12px 0 6px; }
.ts-progress span { display: block; height: 100%; background: var(--text); border-radius: 99px; }
.ts-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
.ts-tile { text-align: left; background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; font: inherit; color: inherit; }
.ts-tile:hover { border-color: var(--text); }
.ts-tile small { display: block; color: var(--muted); }
.ts-tile b { display: block; font-size: 24px; line-height: 1.2; }
.ts-tile span { display: block; color: var(--muted); font-size: 12px; }
.ts-hours { display: flex; align-items: flex-end; gap: 3px; height: 48px; margin: 6px 0; }
.ts-hours i { flex: 1; background: var(--text); border-radius: 2px 2px 0 0; min-height: 2px; }
.ts-hours i.z { background: var(--line); }
.track-dlg { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.track-dlg h2 { margin: 0; display: flex; gap: 8px; align-items: center; }
.track-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.track-filters .chip { border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 5px 12px; cursor: pointer; font: inherit; color: inherit; }
.track-filters .chip.on { background: var(--text); color: var(--card); border-color: var(--text); }
.track-row { border-top: 1px solid var(--line); padding: 12px 0; }
.track-row .pill { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); margin-left: 4px; vertical-align: middle; }
.track-row .pill.ok { background: #e6f4ea; border-color: #b7dfc2; color: #1e6b34; }
.track-row .pill.bad { background: #fdecea; border-color: #f5c2bd; color: #a3261a; }
.track-row .pill.muted { color: var(--muted); }
.tr-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 14px; margin: 8px 0 0; }
.tr-facts dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.tr-facts dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.track-card .row.between, .track-dlg .row.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ts-tile.static { cursor: default; }
.ts-tile.static:hover { border-color: var(--line); }
.ts-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 4px 0 8px; }
.ts-list h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.ts-list ol { list-style: none; margin: 0; padding: 0; }
.ts-list li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px solid var(--line); font-size: 13px; }
.ts-list li span { overflow-wrap: anywhere; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #1e8e3e; margin-right: 6px; vertical-align: middle; animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.ts-days { display: flex; align-items: flex-end; gap: 4px; height: 78px; margin: 8px 0 2px; }
.ts-days .tsd { flex: 1; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; height: 100%; gap: 3px; min-width: 0; }
.ts-days .tsd i { display: block; background: var(--text); border-radius: 2px 2px 0 0; min-height: 2px; }
.ts-days .tsd i.z { background: var(--line); }
.ts-days .tsd small { font-size: 10px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; }
@media (max-width: 600px) { .ts-days .tsd small { display: none; } }
.pf-trial { display: block; }
.pf-trial > summary { display: flex; gap: 12px; align-items: center; cursor: pointer; list-style: none; }
.pf-trial > summary::-webkit-details-marker { display: none; }
.pf-trial ol { margin: 8px 0 4px; padding-left: 20px; }
