/* ============================================================
   style.css — Toute l'apparence du CRM Steel-Meca
   ------------------------------------------------------------
   Charte graphique posée dès la phase 2 pour ne jamais re-styler :
   variables de couleurs, typographies Space Grotesk / Inter,
   règle fond clair (transparence, précision) pour l'outil de travail.

   Exception documentée (CDC §8.4) : les couleurs feu tricolore
   .note-A à .note-E, réservées à la note de santé (phase 4).
   ============================================================ */

:root {
  /* --- Palette de la charte --- */
  --bleu-electrique: #0047FF;
  --bleu-nuit: #0A1628;
  --cyan: #00D4FF;
  --steel: #6B8CAE;
  --light: #EEF2FB;
  --blanc: #FFFFFF;

  /* --- Exception CDC §8.4 : note de santé uniquement --- */
  --note-a: #2e8b57;
  --note-b: #7cb342;
  --note-c: #f0a020;
  --note-d: #e07030;
  --note-e: #c23b3b;

  /* --- Typographies --- */
  --titres: "Space Grotesk", sans-serif;
  --texte: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--light);
  color: var(--bleu-nuit);
  font-family: var(--texte);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ================= En-tête ================= */

.entete {
  background: var(--bleu-nuit);
  padding: 14px 20px;
}
.entete-contenu {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo { height: 44px; width: auto; }
.marque { display: flex; flex-direction: column; }
.marque-nom {
  font-family: var(--titres);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 2.5px;
  color: var(--blanc);
}
.marque-sous {
  font-family: var(--titres);
  font-weight: 300;
  font-size: 9.5px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--cyan);
}

/* ================= Contenu ================= */

.contenu {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px;
}

.carte {
  background: var(--blanc);
  border-radius: 16px;
  border-left: 3px solid var(--bleu-electrique);
  padding: 28px 32px;
}

h1 {
  font-family: var(--titres);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 1px;
  margin: 0 0 18px;
}

/* ================= Liste des clients ================= */

.liste { border-collapse: collapse; width: 100%; font-size: 14px; }
.liste th {
  font-family: var(--titres);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--steel);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(107, 140, 174, 0.4);
}
.liste td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(107, 140, 174, 0.25);
}
.liste tbody tr:hover { background: var(--light); cursor: pointer; }
.denomination { font-weight: 600; }
.donnee { font-variant-numeric: tabular-nums; color: var(--steel); }
.compte {
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 1px;
  color: var(--steel);
  margin: 14px 0 0;
}

/* --- Badges de catégorie (tons de la charte uniquement) --- */
.badge {
  display: inline-block;
  font-family: var(--titres);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 1px;
  border-radius: 6px;
  padding: 3px 10px;
  color: var(--blanc);
  background: var(--steel);
}
.badge-client_actif { background: var(--bleu-electrique); }
.badge-prospect_chaud { background: #2f6bff; }
.badge-prospect_froid { background: var(--steel); }
.badge-client_inactif { background: #3d5a7a; }
.badge-ancien_client { background: var(--bleu-nuit); }
.badge-fournisseur { background: #1a3a6e; }
.badge-autre { background: var(--steel); }

/* ================= Messages ================= */

.message {
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 14px;
}
.message-info { background: var(--light); color: var(--bleu-nuit); }
.message-erreur {
  background: var(--bleu-nuit);
  color: var(--blanc);
  border-left: 3px solid var(--cyan);
}

/* ================= Pied de page ================= */

.pied {
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--steel);
  text-align: center;
  padding: 18px;
}

/* ================= Note de santé (phase 4) =================
   Classes prêtes pour la fiche client — exception feu tricolore. */
.note-A { color: var(--note-a); }
.note-B { color: var(--note-b); }
.note-C { color: var(--note-c); }
.note-D { color: var(--note-d); }
.note-E { color: var(--note-e); }

/* ================= Phase 3 : formulaires et actions ================= */

/* Espacement entre les cartes empilées */
.carte-espacee { margin-bottom: 24px; }

/* --- Barre de recherche (création de fiche) --- */
.recherche { display: flex; gap: 10px; margin-bottom: 14px; }
.recherche input {
  flex: 1;
  font: inherit;
  padding: 10px 14px;
  border: 1px solid rgba(107, 140, 174, 0.5);
  border-radius: 8px;
  background: var(--blanc);
  color: var(--bleu-nuit);
}
.recherche input:focus { outline: 2px solid var(--bleu-electrique); border-color: transparent; }

/* --- Boutons --- */
button {
  font-family: var(--titres);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--blanc);
  background: var(--bleu-electrique);
  border: 0;
  border-radius: 8px;
  padding: 9px 18px;
  cursor: pointer;
}
button:hover { background: #0038c9; }
button.secondaire { background: var(--steel); }
button.secondaire:hover { background: #59779a; }

/* Boutons d'action dans les tableaux : discrets */
.actions { text-align: right; white-space: nowrap; }
.actions button {
  font-size: 11px;
  padding: 4px 10px;
  background: transparent;
  color: var(--bleu-electrique);
  border: 1px solid rgba(0, 71, 255, 0.35);
  margin-left: 4px;
}
.actions button:hover { background: var(--light); }
.actions button.danger { color: var(--bleu-nuit); border-color: rgba(10, 22, 40, 0.3); }
.actions button.danger:hover { background: var(--bleu-nuit); color: var(--blanc); }

/* --- Panneau de modification --- */
.panneau {
  margin-top: 20px;
  padding: 22px 24px;
  background: var(--light);
  border-radius: 12px;
  border-left: 3px solid var(--bleu-electrique);
}
.panneau h2 {
  font-family: var(--titres);
  font-weight: 600;
  font-size: 17px;
  margin: 0 0 14px;
}
.formulaire {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
}
.formulaire label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: var(--titres);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--steel);
}
.formulaire input, .formulaire select, .formulaire textarea {
  font: 14px/1.4 var(--texte);
  color: var(--bleu-nuit);
  padding: 8px 12px;
  border: 1px solid rgba(107, 140, 174, 0.5);
  border-radius: 8px;
  background: var(--blanc);
}
.formulaire input:focus, .formulaire select:focus, .formulaire textarea:focus {
  outline: 2px solid var(--bleu-electrique);
  border-color: transparent;
}
.pleine-largeur { grid-column: 1 / -1; }
.boutons { display: flex; gap: 10px; }

/* Succès : même sobriété que l'info, liseré bleu électrique */
.message-succes { background: var(--light); color: var(--bleu-nuit); border-left: 3px solid var(--bleu-electrique); }

@media (max-width: 640px) {
  .formulaire { grid-template-columns: 1fr; }
  .recherche { flex-direction: column; }
}

/* ================= Phase 4 : mise en page latérale + fiche ================= */

/* --- Structure : panneau latéral fixe + zone principale --- */
.application {
  flex: 1;
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 20px;
  width: 100%;
  /* Pleine largeur (demande du 6 juillet) : l'écran entier travaille,
     la fiche s'étale et on descend beaucoup moins. */
  max-width: none;
  padding: 20px 24px;
  align-items: start;
}
.lateral {
  background: var(--blanc);
  border-radius: 16px;
  padding: 14px;
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 110px);
}
.lateral input[type="search"] {
  font: inherit;
  padding: 9px 12px;
  border: 1px solid rgba(107, 140, 174, 0.5);
  border-radius: 8px;
}
.lateral input[type="search"]:focus { outline: 2px solid var(--bleu-electrique); border-color: transparent; }
.liste-laterale { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.vide-lateral { padding: 8px 6px; }

.item-lateral {
  text-align: left;
  background: transparent;
  color: var(--bleu-nuit);
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--texte);
  letter-spacing: 0;
}
.item-lateral:hover { background: var(--light); }
.item-lateral.actif { background: var(--bleu-electrique); color: var(--blanc); }
.item-lateral.actif .item-sous { color: rgba(255, 255, 255, 0.8); }
.item-nom { font-weight: 600; font-size: 14px; }
.item-sous { font-size: 11.5px; color: var(--steel); font-weight: 400; }
.pastille {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-right: 5px; background: var(--steel);
  vertical-align: 1px;
}
.pastille-client_actif { background: var(--bleu-electrique); }
.pastille-prospect_chaud { background: var(--cyan); }
.pastille-prospect_froid { background: var(--steel); }
.pastille-client_inactif { background: #3d5a7a; }
.pastille-ancien_client, .pastille-fournisseur { background: var(--bleu-nuit); }
.pleine-largeur-bouton { width: 100%; }

/* --- Fiche client --- */
.lien-retour {
  background: transparent; color: var(--steel);
  padding: 0 0 10px; font-size: 12px; letter-spacing: 1px;
}
.lien-retour:hover { background: transparent; color: var(--bleu-electrique); }

.fiche { background: var(--blanc); border-radius: 16px; padding: 24px 28px; }
.fiche-entete {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 18px; flex-wrap: wrap;
}
.fiche-entete h1 { margin: 0 0 6px; font-size: 26px; }
.fiche-actions {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin: 14px 0 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(107, 140, 174, 0.3);
}

/* Note de santé — feu tricolore (exception documentée, CDC §8.4) */
.fiche-note { text-align: right; }
.note-badge {
  display: inline-flex; align-items: baseline; gap: 8px;
  border-radius: 12px; padding: 8px 16px; color: var(--blanc);
}
.note-badge.note-A { background: var(--note-a); }
.note-badge.note-B { background: var(--note-b); }
.note-badge.note-C { background: var(--note-c); }
.note-badge.note-D { background: var(--note-d); }
.note-badge.note-E { background: var(--note-e); }
.note-badge.note-inconnue { background: var(--steel); }
.note-lettre { font-family: var(--titres); font-weight: 700; font-size: 30px; line-height: 1; }
.note-chiffre { font-family: var(--titres); font-weight: 500; font-size: 14px; }
.note-mentions { margin-top: 6px; }
.etiquette {
  display: inline-block; font-size: 10px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  background: var(--bleu-nuit); color: var(--blanc);
  border-radius: 6px; padding: 2px 8px; margin-left: 4px;
}

/* Deux volets */
.fiche-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.titre-volet {
  font-family: var(--titres); font-weight: 700; font-size: 10px;
  letter-spacing: 3px; text-transform: uppercase; color: var(--steel);
  margin: 0 0 2px;
}
.colonne { display: flex; flex-direction: column; gap: 14px; }

.bloc {
  background: var(--light); border-radius: 12px; padding: 16px 18px;
}
.bloc h2 {
  font-family: var(--titres); font-weight: 600; font-size: 14px;
  letter-spacing: 0.5px; margin: 0 0 10px;
}
.ligne-info {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 4px 0; font-size: 13.5px;
  border-bottom: 1px solid rgba(107, 140, 174, 0.18);
}
.ligne-info:last-of-type { border-bottom: 0; }
.ligne-info span { color: var(--steel); }
.ligne-info strong { font-weight: 500; text-align: right; }
.alerte-texte { color: var(--bleu-nuit); text-decoration: underline; }

.jauge {
  height: 5px; border-radius: 3px; background: rgba(107, 140, 174, 0.25);
  margin: 2px 0 8px;
}
.jauge-remplie { height: 100%; border-radius: 3px; background: var(--bleu-electrique); }

.carte-siege { height: 190px; border-radius: 10px; margin-top: 10px; z-index: 0; }
.tendance { margin-bottom: 8px; }
.sparkline { width: 100%; height: 48px; }
.liste-serree td, .liste-serree th { padding: 5px 8px; }

.liens-actu { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.liens-actu a { color: var(--bleu-electrique); font-weight: 600; text-decoration: none; }
.liens-actu a:hover { text-decoration: underline; }

/* Volet chaud */
.bloc-appreciation .etoiles { margin-bottom: 8px; }
.etoile {
  background: transparent; border: 0; padding: 0 3px;
  font-size: 28px; color: rgba(107, 140, 174, 0.45); cursor: pointer;
}
.etoile.pleine { color: var(--bleu-electrique); }
.etoile:hover { background: transparent; }
.commentaire-appreciation {
  width: 100%; font: 14px/1.4 var(--texte); color: var(--bleu-nuit);
  padding: 8px 12px; border: 1px solid rgba(107, 140, 174, 0.5);
  border-radius: 8px; background: var(--blanc); margin-bottom: 8px;
}
.bloc-a-venir { opacity: 0.65; }

/* Responsive */
@media (max-width: 900px) {
  .application { grid-template-columns: 1fr; }
  .lateral { position: static; max-height: 240px; }
  .fiche-colonnes { grid-template-columns: 1fr; }
}


/* ================= Page Clients v2 : volets, filtres, flux ================= */

.volets-lateral { display: flex; gap: 4px; }
.volet-bouton {
  flex: 1; font-family: var(--titres); font-weight: 600; font-size: 12px;
  letter-spacing: .5px; background: var(--light); color: var(--steel);
  border: 0; border-radius: 8px; padding: 8px;
}
.volet-bouton.actif { background: var(--bleu-nuit); color: var(--blanc); }

.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  font-family: var(--titres); font-weight: 600; font-size: 10.5px; letter-spacing: .4px;
  border: 1px solid rgba(0, 71, 255, .35); background: transparent; color: var(--bleu-electrique);
  border-radius: 14px; padding: 4px 10px;
}
.chip.actif { background: var(--bleu-electrique); color: var(--blanc); border-color: var(--bleu-electrique); }

/* Mini-formulaires des blocs de fiche */
.mini-form { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.mini-ligne { display: flex; gap: 7px; flex-wrap: wrap; align-items: flex-end; }
.mini-ligne > input, .mini-ligne > select { flex: 1; min-width: 90px; }
.mini-form input, .mini-form select, .mini-form textarea {
  font: 13px/1.4 var(--texte); color: var(--bleu-nuit);
  padding: 7px 10px; border: 1px solid rgba(107, 140, 174, .5);
  border-radius: 8px; background: var(--blanc);
}
.mini-form input:focus, .mini-form select:focus, .mini-form textarea:focus {
  outline: 2px solid var(--bleu-electrique); border-color: transparent;
}
.mini-form button { align-self: flex-start; font-size: 12px; padding: 7px 14px; }
.mini-label {
  display: flex; flex-direction: column; gap: 3px; flex: 1;
  font-family: var(--titres); font-weight: 700; font-size: 9px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--steel);
}

/* Flux d'interactions */
.flux-item {
  border-left: 2px solid var(--bleu-electrique);
  padding: 6px 0 6px 12px; margin-bottom: 8px;
}
.flux-tete { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.flux-item p { margin: 3px 0 0; font-size: 13px; }
.etiquette-claire { background: var(--steel); }

/* Statuts d'actions */
.statut-select {
  font: 11.5px var(--titres); font-weight: 600; color: var(--blanc);
  border: 0; border-radius: 6px; padding: 4px 6px;
}
.statut-a_lancer { background: var(--bleu-electrique); }
.statut-en_cours { background: #2f6bff; }
.statut-en_attente_retour { background: var(--steel); }
.statut-fait { background: var(--bleu-nuit); }
.action-faite td { opacity: .55; }
.action-faite td:first-child { text-decoration: line-through; }

.suppr-discret {
  background: transparent; border: 0; color: var(--steel);
  font-size: 12px; padding: 0 4px; cursor: pointer;
}
.suppr-discret:hover { color: var(--bleu-nuit); background: transparent; }


/* ================= Recherche rapide (en-tête) ================= */

.rapide { position: relative; margin-left: 18px; flex: 0 1 340px; }
.rapide input {
  width: 100%; font: 13px var(--texte); color: var(--blanc);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px; padding: 8px 12px;
}
.rapide input::placeholder { color: rgba(255, 255, 255, 0.55); }
.rapide input:focus { outline: 2px solid var(--cyan); border-color: transparent; }

.resultats-rapides {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  background: var(--blanc); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(10, 22, 40, 0.25);
  overflow: hidden;
}
.resultat-rapide {
  display: flex; flex-direction: column; gap: 1px; width: 100%;
  text-align: left; background: transparent; color: var(--bleu-nuit);
  border: 0; border-bottom: 1px solid rgba(107, 140, 174, 0.2);
  border-radius: 0; padding: 9px 13px;
  font-family: var(--texte); letter-spacing: 0;
}
.resultat-rapide:last-child { border-bottom: 0; }
.resultat-rapide:hover { background: var(--light); }
.rr-titre { font-weight: 600; font-size: 13.5px; }
.rr-sous { font-size: 11.5px; color: var(--steel); }

.filtre-flux { margin-bottom: 10px; }
.filtre-flux select {
  font: 12.5px var(--texte); color: var(--bleu-nuit);
  padding: 6px 10px; border: 1px solid rgba(107, 140, 174, 0.5);
  border-radius: 8px; background: var(--blanc); width: 100%;
}

@media (max-width: 640px) { .rapide { display: none; } }


/* ================= Bandeau de navigation (pages) ================= */

.nav-pages { display: flex; gap: 3px; margin-left: 22px; flex-wrap: wrap; }
.page-bouton {
  font-family: var(--titres); font-weight: 500; font-size: 12.5px; letter-spacing: .6px;
  color: rgba(255, 255, 255, 0.65); background: transparent;
  border: 0; border-radius: 8px; padding: 8px 13px;
}
.page-bouton:hover { color: var(--blanc); background: rgba(255, 255, 255, 0.08); }
.page-bouton.actif { color: var(--blanc); background: var(--bleu-electrique); }
.entete-contenu { flex-wrap: wrap; }

.page-a-venir h1 { margin-bottom: 8px; }
.page-a-venir p { max-width: 640px; }


/* Très grands écrans : le volet froid passe sur 2 colonnes internes */
@media (min-width: 1600px) {
  .fiche-colonnes { grid-template-columns: 1.15fr 1fr; }
  .colonne:first-child { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: start; }
  .colonne:first-child .titre-volet { grid-column: 1 / -1; }
}


/* ================= Module 7.4 : page Commandes & import ================= */

.commandes-tete { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 12px; }
.commandes-tete h1 { margin-bottom: 4px; }
.bouton-import {
  display: inline-block; cursor: pointer;
  font-family: var(--titres); font-weight: 600; font-size: 13px; letter-spacing: .5px;
  color: var(--blanc); background: var(--bleu-electrique);
  border-radius: 8px; padding: 10px 18px;
}
.bouton-import:hover { background: #0038c9; }
.lien-client {
  background: transparent; border: 0; padding: 0; cursor: pointer;
  color: var(--bleu-nuit); font-weight: 600; font-size: 14px;
  font-family: var(--texte); letter-spacing: 0; text-align: left;
}
.lien-client:hover { color: var(--bleu-electrique); background: transparent; }
.statut-cmd-en_cours { background: var(--bleu-electrique); }
.statut-cmd-soldee { background: var(--bleu-nuit); }
.statut-cmd-annulee { background: var(--steel); }


/* ================= Module 7.5 : devis & relances ================= */
.statut-devis-en_cours { background: var(--bleu-electrique); }
.statut-devis-accepte { background: var(--bleu-nuit); }
.statut-devis-refuse { background: var(--steel); }
.relance-a-faire { background: var(--bleu-electrique); }
.relance-depassee { background: var(--bleu-nuit); }

/* ================= Lot 7.6 : onglet Actions + dashboard + pop-up ================= */

.barre-actions { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.sous-onglets { display: flex; gap: 4px; }
.sous-onglet {
  font-family: var(--titres); font-weight: 600; font-size: 12px; letter-spacing: .5px;
  background: var(--light); color: var(--steel); border: 0; border-radius: 8px; padding: 7px 14px;
}
.sous-onglet.actif { background: var(--bleu-nuit); color: var(--blanc); }
.statut-en_attente_retour { background: var(--steel); }

/* Calendrier */
.cal-navigation { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.cal-navigation button { padding: 4px 12px; }
.cal-titre { margin: 0; font-size: 12px; }
.cal-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-tete {
  font-family: var(--titres); font-weight: 700; font-size: 9px; letter-spacing: 2px;
  color: var(--steel); text-transform: uppercase; padding: 4px 6px;
}
.cal-case { min-height: 76px; background: var(--light); border-radius: 8px; padding: 5px 6px; }
.cal-vide { background: transparent; }
.cal-jour { font-family: var(--titres); font-weight: 600; font-size: 10.5px; color: var(--steel); }
.cal-action {
  display: block; width: 100%; text-align: left; border: 0; border-radius: 5px;
  color: var(--blanc); font-size: 10.5px; line-height: 1.25; padding: 3px 6px; margin-top: 3px;
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--texte); letter-spacing: 0;
}
.cal-action.statut-a_lancer { background: var(--bleu-electrique); }
.cal-action.statut-en_cours { background: #2f6bff; }
.cal-action.statut-en_attente_retour { background: var(--steel); }
.cal-action.statut-fait { background: var(--bleu-nuit); opacity: .6; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
.kanban-col { background: var(--light); border-radius: 10px; padding: 10px; min-height: 120px; }
.kanban-col.survol { outline: 2px dashed var(--bleu-electrique); }
.kanban-titre { margin: 0 0 8px; }
.kanban-carte {
  background: var(--blanc); border-radius: 8px; padding: 9px 11px; margin-bottom: 8px;
  border-left: 2px solid var(--bleu-electrique); cursor: grab;
}
.kanban-carte:active { cursor: grabbing; }
.kanban-quoi { font-weight: 500; font-size: 13px; }
@media (max-width: 900px) { .kanban { grid-template-columns: 1fr 1fr; } }

/* Dashboard */
.grille-dash { display: grid; grid-template-columns: 340px 1fr 340px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .grille-dash { grid-template-columns: 1fr; } }
.carte-dash { background: var(--blanc); border-radius: 14px; padding: 16px 18px; margin-bottom: 16px; }
.titre-dash {
  font-family: var(--titres); font-weight: 600; font-size: 13.5px; letter-spacing: .5px;
  margin: 0 0 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.kpis-dash { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
@media (max-width: 1100px) { .kpis-dash { grid-template-columns: 1fr; } }
.kpi-dash { background: var(--blanc); border-radius: 14px; padding: 14px 16px; border-left: 3px solid var(--bleu-electrique); }
.kpi-valeur { font-family: var(--titres); font-weight: 700; font-size: 24px; letter-spacing: .5px; }
.item-dash { padding: 9px 0; border-bottom: 1px solid rgba(107, 140, 174, .18); font-size: 13px; }
.item-dash:last-child { border-bottom: 0; }
.item-quoi { font-weight: 500; margin: 2px 0; }
.quand-dash {
  font-family: var(--titres); font-weight: 600; font-size: 10.5px; letter-spacing: 1px;
  color: var(--steel); text-transform: uppercase; margin-right: 4px;
}
.veille-concurrent { background: var(--bleu-nuit); }
.veille-prospect { background: var(--cyan); color: var(--bleu-nuit); }
.lien-actu { color: var(--bleu-electrique); font-weight: 600; font-size: 12px; text-decoration: none; }
.lien-actu:hover { text-decoration: underline; }
.legende-dash { display: flex; gap: 16px; font-size: 11.5px; color: var(--steel); margin-bottom: 8px; flex-wrap: wrap; }
.pastille-leg { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.pastille-ligne { height: 3px; width: 14px; border-radius: 5px; vertical-align: 2px; }
.graph-dash { width: 100%; height: auto; }
.anneau-bloc { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.anneau { width: 165px; height: 165px; flex-shrink: 0; }
.anneau-legende { flex: 1; min-width: 200px; }
.leg-ligne {
  display: flex; justify-content: space-between; gap: 10px; padding: 4px 0;
  font-size: 12.5px; border-bottom: 1px solid rgba(107, 140, 174, .15);
}
.leg-ligne:last-child { border-bottom: 0; }

/* Pop-up mini-fiche */
.popup-fond {
  position: fixed; inset: 0; background: rgba(10, 22, 40, .55);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.popup-fond.visible { display: flex; }
.popup {
  background: var(--blanc); border-radius: 16px; padding: 24px 28px;
  max-width: 540px; width: 100%; max-height: 85vh; overflow-y: auto; position: relative;
}
.popup h1 { font-size: 21px; margin: 0 0 6px; }
.popup .bloc { margin-top: 12px; }
.popup-fermer {
  position: absolute; top: 12px; right: 14px; background: transparent;
  border: 0; color: var(--steel); font-size: 15px; cursor: pointer; padding: 4px;
}
.popup-fermer:hover { color: var(--bleu-nuit); background: transparent; }

/* Hors page Clients : la grille abandonne la colonne latérale (pleine page) */
.application.pleine-page { grid-template-columns: 1fr; }


/* ================= Lot 7.7 : cartes candidats, fiche contact, stats ================= */

.cartes-candidats { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-top: 14px; }
.carte-candidat { background: var(--light); border-radius: 12px; padding: 14px 16px; }
.candidat-tete { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.candidat-nom { font-family: var(--titres); font-weight: 600; font-size: 15px; margin: 0 0 2px; }
.candidat-tete button { white-space: nowrap; }

.stats-page { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .stats-page { grid-template-columns: 1fr; } }
.stat-carte { background: var(--light); border-radius: 12px; padding: 14px 16px; }
.stats-categories .ligne-ca { display: grid; grid-template-columns: 90px 1fr 90px; gap: 10px; align-items: center; padding: 5px 0; font-size: 12.5px; }
.barre-fond { height: 12px; border-radius: 6px; background: rgba(107, 140, 174, 0.18); overflow: hidden; }
.barre { height: 100%; border-radius: 6px; background: var(--bleu-electrique); }
.montant { font-variant-numeric: tabular-nums; color: var(--steel); text-align: right; font-size: 11.5px; }
.taux-bloc { display: flex; flex-direction: column; gap: 8px; }
.taux-valeur { font-family: var(--titres); font-weight: 700; font-size: 30px; }
.jauge-large { height: 10px; }

/* Mise en page : les tableaux larges défilent dans leur carte au lieu de la déborder */
.carte, .bloc { overflow-x: auto; }

/* ================= Lot 7.9 ================= */
.grille-dash { grid-template-columns: 340px 1fr 340px; }
.bandeau-creation {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: var(--blanc); border-radius: 14px; padding: 12px 16px; margin-bottom: 16px;
  border-left: 3px solid var(--bleu-electrique);
}
.bandeau-titre { margin: 0; white-space: nowrap; }
.bandeau-creation input, .bandeau-creation select {
  font: 13px var(--texte); color: var(--bleu-nuit);
  padding: 8px 11px; border: 1px solid rgba(107, 140, 174, 0.5); border-radius: 8px;
}
.bandeau-creation input[name="intitule"] { flex: 2; min-width: 200px; }
.bandeau-creation select[name="client_id"] { flex: 1; min-width: 150px; }
.item-cliquable { cursor: pointer; border-radius: 8px; }
.item-cliquable:hover { background: var(--light); }
.bloc-appreciation-compact .etoile { font-size: 20px; }
.bloc-appreciation-compact h2 { margin-bottom: 6px; }
.flux-defilant { max-height: 460px; overflow-y: auto; padding-right: 4px; }
.filtre-flux-grille { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.filtre-flux-grille select {
  font: 12px var(--texte); color: var(--bleu-nuit); width: 100%;
  padding: 6px 8px; border: 1px solid rgba(107, 140, 174, 0.5); border-radius: 8px; background: var(--blanc);
}
.flux-veille { border-left-color: var(--bleu-nuit); }
.tri-colonne {
  background: transparent; border: 0; padding: 0; cursor: pointer;
  font-family: var(--titres); font-weight: 700; font-size: 9.5px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--steel);
}
.tri-colonne.actif, .tri-colonne:hover { color: var(--bleu-electrique); background: transparent; }
.ajout-manuel { margin-bottom: 12px; }
.ajout-manuel summary {
  cursor: pointer; font-family: var(--titres); font-weight: 600;
  font-size: 12.5px; color: var(--bleu-electrique); padding: 4px 0;
}
.ajout-manuel form { margin-top: 8px; }
.recherche-actions {
  font: 13px var(--texte); color: var(--bleu-nuit); flex: 1; min-width: 220px;
  padding: 7px 11px; border: 1px solid rgba(107, 140, 174, 0.5); border-radius: 8px;
}

/* ================= Prospection ================= */
.filtres-prospection { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.filtres-prospection input, .filtres-prospection select {
  font: 13px var(--texte); color: var(--bleu-nuit);
  padding: 8px 11px; border: 1px solid rgba(107, 140, 174, 0.5); border-radius: 8px;
}
.filtres-prospection input[name="q"] { flex: 1; min-width: 220px; }
.chips-prospection { margin-top: 6px; }
.prospection-corps { display: grid; grid-template-columns: 1fr 440px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .prospection-corps { grid-template-columns: 1fr; } }
.prospect-ligne {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 9px 6px; border-bottom: 1px solid rgba(107, 140, 174, 0.18);
}
.prospect-ligne:last-of-type { border-bottom: 0; }
.prospect-cesse { opacity: 0.5; }
.prospect-ligne button { white-space: nowrap; }
#carte-prospection { height: 560px; border-radius: 12px; z-index: 0; }
.prospection-carte { position: sticky; top: 70px; }

.graphes-dash { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.graphes-dash .carte-dash { margin-bottom: 0; }
@media (max-width: 1400px) { .graphes-dash { grid-template-columns: 1fr; } }

/* Carte des clients (accueil) + tri latéral */
#carte-clients { height: 440px; border-radius: 12px; z-index: 0; }
.tri-lateral {
  font: 12px var(--texte); color: var(--bleu-nuit); width: 100%;
  padding: 6px 8px; border: 1px solid rgba(107, 140, 174, 0.5); border-radius: 8px;
  background: var(--blanc); margin-bottom: 8px;
}


/* ================= Lot 7.12 : chiffrage devis + cartes prospects ================= */
.chiffrage-grille { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .chiffrage-grille { grid-template-columns: 1fr; } }
.chiffrage-total { border-top: 2px solid var(--bleu-nuit); margin-top: 6px; padding-top: 8px; }
.chiffrage-total strong { font-family: var(--titres); font-size: 19px; color: var(--bleu-electrique); }
.valider-commande { background: var(--bleu-nuit); }
.cartes-prospects { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.carte-prospect { background: var(--light); border-radius: 12px; padding: 12px 14px; }
.etiquettes-prospect { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.sante-A, .sante-B { background: var(--bleu-electrique); }
.sante-C { background: var(--cyan); color: var(--bleu-nuit); }
.sante-D, .sante-E { background: var(--steel); }

/* ================= Lot 7.14 : affaires (BL · factures · encours) ================= */
.statut-fait { background: var(--bleu-nuit); }
.affaire { background: var(--light); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.affaire-tete { margin-bottom: 4px; }

/* ================= Phase 5 : écran de connexion ================= */
#ecran-connexion {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: var(--bleu-nuit);
}
#ecran-connexion[hidden] { display: none; }
.connexion-carte {
  width: min(360px, 90vw); display: flex; flex-direction: column; gap: 12px;
  padding: 28px;
}
.connexion-carte h1 { margin: 0; }
#connexion-erreur { color: #c0392b; min-height: 1em; }
