/* CRM REP — Ventes (équipe 1) : clients, doublons, pipeline des dossiers de vente, tâches et rappels. Préfixe vt-. */

/* ---------- Onglets des pages de ventes ---------- */
.vt-onglets { margin: -6px 0 14px; max-width: 100%; overflow-x: auto; }
.vt-onglets a { padding: 6px 12px; color: var(--muted); white-space: nowrap; }
.vt-onglets a.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--red); }
.vt-kpis { margin-bottom: 14px; }
a.kpi:hover { border-color: var(--line-2); }

/* ---------- Clients ---------- */
.vt-recherche select.in { width: auto; min-width: 180px; }
.vt-alerte { border: 1px solid rgba(245, 158, 11, .45); background: var(--amber-bg); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; display: grid; gap: 6px; }
.vt-alerte.rouge { border-color: rgba(208, 32, 42, .5); background: var(--red-bg); }
.vt-alerte > .btn { justify-self: start; }
.vt-sosie { display: flex; align-items: center; gap: 10px; background: rgba(0, 0, 0, .35); border-radius: 8px; padding: 7px 10px; }
.vt-sosie > a, .vt-sosie > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vt-sosie small, .vt-choix small, .vt-fiche-mini small, .vt-pick-list small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.vt-sosie em, .vt-paire em { font-style: normal; font-size: 12px; color: var(--amber); white-space: nowrap; }
a.vt-sosie:hover { background: rgba(0, 0, 0, .55); }
.vt-puces { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.vt-puce { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; min-width: 120px; }
.vt-puce small { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.vt-puce a { color: var(--red-2); }
select.in.vt-mini { padding: 3px 6px; width: auto; min-width: 140px; }
.vt-titre { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.vt-titre h2 { margin: 0; }
.vt-paire { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.vt-paire:last-child { border-bottom: 0; }
.vt-fiche-mini { display: flex; flex-direction: column; min-width: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.vt-fiche-mini:hover { border-color: var(--line-2); }
.vt-choix { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: pointer; }
.vt-choix span { display: flex; flex-direction: column; }
.vt-choix:has(input:checked) { border-color: var(--red); background: var(--red-bg); }

/* ---------- Pipeline ---------- */
.vt-board { display: grid; grid-template-columns: repeat(var(--n, 8), minmax(210px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.vt-col { display: flex; flex-direction: column; transition: border-color .15s; }
.vt-col.vise { border-color: var(--red); }
.vt-col.gagne h3 span:first-child { color: var(--green); }
.vt-col.perdu h3 span:first-child { color: var(--red-2); }
.vt-col.suspendu h3 span:first-child { color: var(--muted); }
.vt-cartes { flex: 1; min-height: 60px; }
.vt-carte { display: block; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: grab; }
.vt-carte:hover { border-color: var(--line-2); }
.vt-carte.glisse { opacity: .35; }
.vt-carte.sans { border-left: 3px solid var(--amber); }
.vt-carte.retard { border-left: 3px solid var(--red); }
.vt-carte .top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.vt-carte .top span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-carte .what { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.vt-carte .bottom { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--faint); margin-top: 6px; }
.vt-carte.sans .bottom span:first-child { color: var(--amber); }
.vt-carte.retard .bottom span:first-child { color: var(--red-2); }
.vt-etapes { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; }
.vt-etapes button { flex: 1; min-width: 104px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); padding: 8px 10px; cursor: pointer; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.vt-etapes button:first-child { border-radius: 8px 0 0 8px; }
.vt-etapes button:last-child { border-radius: 0 8px 8px 0; }
.vt-etapes button:hover:not(:disabled) { color: var(--text); border-color: #4a4a55; }
.vt-etapes button.on { background: var(--red); border-color: var(--red); color: #fff; cursor: default; }
.vt-etapes button.on.gagne { background: var(--green); border-color: var(--green); }
.vt-encadre { border: 1px dashed var(--line-2); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.vt-pick { position: relative; }
.vt-pick-list { display: grid; gap: 4px; margin-top: 4px; }
.vt-pick-list button { display: flex; flex-direction: column; align-items: flex-start; text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.vt-pick-list button:hover { border-color: var(--red); }

/* ---------- 4 pipelines (Soumission, Vente, Commande, Remise à neuf) ---------- */
.vt-pipes { margin: 0 0 6px; max-width: 100%; overflow-x: auto; }
.vt-pipes button { white-space: nowrap; font-weight: 600; }
.vt-pipe-aide { margin: 0 0 12px; font-size: 13px; }
.vt-col.financement h3 span:first-child, .vt-col.signature h3 span:first-child, .vt-col.agenda h3 span:first-child,
.vt-col.cmd_livree h3 span:first-child, .vt-col.rn_pret h3 span:first-child { color: var(--green); }
.vt-carte .vt-vers-vente { display: block; margin-top: 8px; text-align: center; cursor: pointer; }
.vt-etapes button.hors { opacity: .4; }
.vt-tache.hors .vt-tache-txt > div { color: var(--faint); }
.vt-rn-applique { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.vt-rn-choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 12px; margin-top: 8px; }
.vt-rn-choix label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }

/* ---------- Tâches ---------- */
.vt-tache { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.vt-tache:last-child { border-bottom: 0; }
.vt-tache-txt { flex: 1; min-width: 0; }
.vt-tache-txt small { color: var(--faint); font-size: 12px; }
.vt-tache-txt small a { color: var(--muted); text-decoration: underline; }
.vt-tache.retard .vt-tache-txt small { color: var(--red-2); }
.vt-tache.faite .vt-tache-txt > div { text-decoration: line-through; color: var(--faint); }
.vt-tache .iconbtn svg { width: 18px; height: 18px; }
.vt-coche { position: relative; flex: none; width: 22px; height: 22px; margin-top: 1px; cursor: pointer; }
.vt-coche input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.vt-coche span { display: block; width: 22px; height: 22px; border: 2px solid var(--line-2); border-radius: 6px; }
.vt-coche input:checked + span { background: var(--green); border-color: var(--green); }
.vt-coche input:checked + span::after { content: ""; display: block; width: 6px; height: 11px; border: solid #000; border-width: 0 2px 2px 0; transform: translate(6px, 2px) rotate(45deg); }
.vt-coche input:focus-visible + span { outline: 2px solid var(--red); }
.vt-raccourcis { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }

/* ---------- Téléphone ---------- */
@media (max-width: 760px) {
  .vt-recherche select.in { flex: 1; min-width: 0; }
  .vt-recherche .search { min-width: 100%; }
  .vt-board { grid-template-columns: repeat(var(--n, 8), 82vw); scroll-snap-type: x mandatory; }
  .vt-pipes button { flex: 1 0 auto; }
  .vt-col { scroll-snap-align: start; }
  .vt-paire { grid-template-columns: 1fr; }
  .vt-puce { flex: 1 1 40%; }
  .vt-coche, .vt-coche span { width: 26px; height: 26px; }
  .vt-coche input:checked + span::after { transform: translate(8px, 3px) rotate(45deg); }
}

/* Inventaire en photos (Vente neuf / Vente usagé) */
.vt-inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 12px; }
.vt-inv-c { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 14px; overflow: hidden; background: var(--card, rgba(255,255,255,.04)); color: inherit; cursor: pointer; font: inherit; }
.vt-inv-c:hover, .vt-inv-c:focus-visible { border-color: var(--accent, #e31d1d); transform: translateY(-2px); }
.vt-inv-c img, .vt-inv-vide { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: rgba(255,255,255,.05); }
.vt-inv-vide { display: grid; place-items: center; opacity: .5; }
.vt-inv-t { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.vt-inv-t span { font-size: .82rem; opacity: .75; }
.vt-inv-p { font-weight: 700; opacity: 1 !important; font-size: .95rem !important; }
.vt-choix { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.vt-choix .btn { padding: 16px 10px; font-size: 1.05rem; }
