/* ============ Thème sobre — Skaelia Prospection ============ */
:root {
  --fond: #EDECE8;
  --surface: #FAFAF8;
  --surface-2: #F3F2EF;
  --texte: #2B2B2B;
  --texte-2: #71716C;
  --accent: #3D4451;
  --accent-hover: #2C313B;
  --bordure: #DCDAD4;
  --bordure-2: #E7E5E0;
  --ok: #3E6B4F;
  --attention: #8A6D3B;
  --erreur: #96453D;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Inter", "Segoe UI", sans-serif;
  background: var(--fond);
  color: var(--texte);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 1500px; margin: 0 auto; padding: 0 24px 70px; }
.txt-recherche { color: var(--accent); font-size: 12.5px; font-weight: 600; }

h1 { font-size: 26px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 650; }

/* ---------- Boutons ---------- */
.btn {
  font-family: inherit; font-size: 14.5px; font-weight: 600;
  border: 1px solid transparent; border-radius: 8px;
  padding: 10px 18px; cursor: pointer; transition: background .15s, border .15s;
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
}
.btn-primaire { background: var(--accent); color: #fff; }
.btn-primaire:hover { background: var(--accent-hover); }
.btn-secondaire { background: var(--surface); color: var(--texte); border-color: var(--bordure); }
.btn-secondaire:hover { border-color: var(--accent); }
.btn-discret { background: none; color: var(--texte-2); border: none; padding: 8px 10px; }
.btn-discret:hover { color: var(--texte); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Header ---------- */
.entete { background: var(--surface); border-bottom: 1px solid var(--bordure); }
.entete-interieur {
  max-width: 1060px; margin: 0 auto; padding: 13px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 8px; }
.logo-img { width: 26px; height: 26px; display: block; }
.logo-img-grande { width: 34px; height: 34px; }
.logo-texte { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.logo-texte-grand { font-size: 22px; }
.logo-ai {
  background: #2263FF; color: #fff; font-size: 11px; font-weight: 800;
  padding: 3px 7px; border-radius: 6px; line-height: 1;
}
.logo-sous { font-size: 12.5px; color: var(--texte-2); border-left: 1px solid var(--bordure); padding-left: 10px; margin-left: 4px; }
.entete-droite { display: flex; align-items: center; gap: 8px; }
.utilisateur-email { font-size: 13.5px; color: var(--texte-2); }

/* Navigation principale (Prospection / Mes contacts) */
.nav-principale { display: flex; gap: 4px; margin-left: 8px; }
.nav-onglet {
  font-family: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
  background: none; border: none; color: var(--texte-2);
  padding: 8px 14px; border-radius: 8px; transition: background .15s, color .15s;
  display: inline-flex; align-items: center; gap: 7px;
}
.nav-onglet:hover { color: var(--texte); }
.nav-onglet.actif { background: var(--accent); color: #fff; }
.pastille {
  font-size: 11.5px; font-weight: 700; min-width: 18px; text-align: center;
  background: var(--surface-2); color: var(--texte); border-radius: 999px; padding: 1px 6px;
}
.nav-onglet.actif .pastille { background: rgba(255,255,255,.25); color: #fff; }

/* Barre au-dessus du tableau contacts */
.barre-table { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.barre-info { font-size: 13px; color: var(--texte-2); }
.btn-petit { padding: 7px 13px; font-size: 13.5px; }

/* Boutons d'ajout / suppression dans les tableaux */
.btn-ajout {
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--surface-2); color: var(--accent); border: 1px solid var(--bordure);
  border-radius: 7px; padding: 5px 11px; white-space: nowrap; transition: all .15s;
}
.btn-ajout:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-suppr {
  font-family: inherit; font-size: 14px; cursor: pointer;
  background: none; border: none; color: var(--texte-2);
  width: 28px; height: 28px; border-radius: 7px; transition: all .15s;
}
.btn-suppr:hover { background: rgba(150,69,61,.1); color: var(--erreur); }

/* Filtre prospection (mini-interrupteur) */
.filtre-prospection { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--texte-2); cursor: pointer; }
.filtre-prospection input { position: absolute; opacity: 0; pointer-events: none; }
.inter-visuel-mini {
  width: 34px; height: 19px; border-radius: 999px; flex-shrink: 0;
  background: var(--bordure); position: relative; transition: background .18s;
}
.inter-visuel-mini::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 999px; background: #fff;
  transition: left .18s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.filtre-prospection input:checked ~ .inter-visuel-mini { background: var(--accent); }
.filtre-prospection input:checked ~ .inter-visuel-mini::after { left: 17px; }

/* Barre Nicoka */
.barre-nicoka { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.barre-nicoka #nkRecherche { flex: 1; min-width: 220px; }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 16px; }
.pg-info { font-size: 13.5px; color: var(--texte-2); }

.badge-erreur { color: var(--erreur); background: rgba(150,69,61,.1); }
.txt-faible { color: var(--texte-2); font-size: 12px; }
.cellule-offre { max-width: 260px; }
.cellule-offre a { display: inline-block; }

/* Blocs d'options (Prendre contact manuellement / étape) */
.option-bloc {
  background: var(--surface-2); border: 1px solid var(--bordure);
  border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
}
.option-bloc.desactive { opacity: .5; }
.option-titre { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.message-prospect {
  font-family: inherit; font-size: 13.5px; line-height: 1.45; resize: vertical;
  border: 1px solid var(--bordure); border-radius: 8px; padding: 10px; background: var(--surface);
}

/* Tout prospecter */
.prospect-liste { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; margin-bottom: 8px; }
.prospect-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--bordure-2); border-radius: 9px; padding: 9px 13px;
}
.prospect-check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.prospect-check small { color: var(--texte-2); }
.pr-canaux { display: flex; gap: 4px; flex-shrink: 0; }
.pr-canal { cursor: pointer; }
.pr-canal input { position: absolute; opacity: 0; }
.pr-canal span {
  display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--texte-2);
  padding: 5px 12px; border: 1px solid var(--bordure); border-radius: 999px; transition: all .12s;
}
.pr-canal input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.pr-canal input:disabled + span { opacity: .4; cursor: not-allowed; }
.etape-entete { margin-bottom: 4px; }

/* Modale « Prendre contact » */
.modale-contact { max-width: 480px; }
.options-contact { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.option-contact {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  background: var(--surface-2); border: 1px solid var(--bordure);
  border-radius: 10px; padding: 13px 16px; color: var(--texte); transition: all .15s;
}
a.option-contact:hover { border-color: var(--accent); transform: translateY(-1px); }
.option-contact.desactive { opacity: .55; }
.oc-icone {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: #fff;
}
.oc-linkedin { background: #0A66C2; }
.oc-mail { background: #3D4451; }
.oc-tel { background: #3E6B4F; }
.oc-texte { display: flex; flex-direction: column; }
.oc-texte b { font-size: 15px; }
.oc-texte small { font-size: 12.5px; color: var(--texte-2); }
.oc-actions { display: flex; gap: 6px; align-items: center; }

/* ---------- Cartes ---------- */
.carte {
  background: var(--surface); border: 1px solid var(--bordure);
  border-radius: 12px; padding: 26px;
}

/* ---------- Recherche ---------- */
.zone-recherche { margin: 46px 0 34px; }
.zone-recherche h1 { margin-bottom: 6px; }
.zone-recherche .sous-titre { color: var(--texte-2); margin-bottom: 22px; }
.barre-recherche { display: flex; gap: 10px; flex-wrap: wrap; }
.barre-recherche input {
  flex: 1; min-width: 200px;
  font-family: inherit; font-size: 15.5px; color: var(--texte);
  background: var(--surface); border: 1px solid var(--bordure);
  border-radius: 8px; padding: 11px 14px; outline: none; transition: border .15s;
}
.barre-recherche input:focus { border-color: var(--accent); }
.barre-recherche .champ-lieu { flex: 0 1 240px; }

/* Options de recherche (panneau dépliable) */
.lien-options {
  font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  background: none; border: none; color: var(--accent); padding: 12px 2px 0; margin-top: 4px;
}
.lien-options:hover { color: var(--accent-hover); }
.panneau-options {
  margin-top: 14px; background: var(--surface); border: 1px solid var(--bordure);
  border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 18px;
}
.opt-titre { font-size: 15px; font-weight: 700; color: var(--texte); }
.suggestions-offres { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip-offre {
  font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  background: var(--surface-2); color: var(--texte-2);
  border: 1px solid var(--bordure); border-radius: 999px; padding: 4px 11px; transition: all .12s;
}
.chip-offre:hover { border-color: var(--accent); color: var(--accent); }
.opt-lancer { display: flex; justify-content: flex-end; margin-top: 4px; }
.btn-grand { padding: 13px 26px; font-size: 15.5px; }
.champ-large { grid-column: 1 / -1; }
.opt-ligne { display: flex; flex-direction: column; gap: 10px; }
.opt-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span {
  display: inline-block; font-size: 13.5px; font-weight: 600; color: var(--texte-2);
  background: var(--surface-2); border: 1px solid var(--bordure);
  padding: 7px 15px; border-radius: 999px; transition: all .12s;
}
.pill:hover span { border-color: var(--accent); color: var(--texte); }
.pill input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill-desactive { cursor: not-allowed; }
.pill-desactive span { opacity: .5; }

/* ---------- Champs génériques ---------- */
.champ { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.champ-libelle { font-size: 13px; font-weight: 600; color: var(--texte-2); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select {
  font-family: inherit; font-size: 15px; color: var(--texte);
  background: var(--surface); border: 1px solid var(--bordure);
  border-radius: 8px; padding: 10px 13px; outline: none; transition: border .15s;
  width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; }

/* ---------- Historique des recherches ---------- */
.histo-entete { display: flex; align-items: center; justify-content: space-between; margin: 34px 0 14px; gap: 12px; }
.titre-historique { font-size: 16px; font-weight: 650; }
.grille-historique { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.carte-histo-conteneur { position: relative; }
.histo-suppr {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 26px; height: 26px; border-radius: 7px; border: none; cursor: pointer;
  background: var(--surface-2); color: var(--texte-2); font-size: 13px; transition: all .15s;
}
.histo-suppr:hover { background: rgba(150,69,61,.12); color: var(--erreur); }
.carte-histo {
  font-family: inherit; text-align: left; cursor: pointer; width: 100%;
  background: var(--surface); border: 1px solid var(--bordure);
  border-radius: 10px; padding: 16px 40px 16px 18px;
  display: flex; flex-direction: column; gap: 5px; transition: border .15s, transform .15s;
}
.carte-histo:hover { border-color: var(--accent); transform: translateY(-2px); }
.histo-titre { font-size: 15.5px; font-weight: 650; color: var(--texte); text-transform: capitalize; }
.histo-date { font-size: 12.5px; color: var(--texte-2); }
.histo-stats { font-size: 13px; color: var(--texte-2); margin-top: 3px; }
.histo-stats b { color: var(--texte); font-weight: 650; }

/* ---------- Suivi ---------- */
.bloc-suivi { margin-top: 26px; }
.suivi-entete { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--bordure); border-top-color: var(--accent);
  animation: tourner .9s linear infinite;
}
@keyframes tourner { to { transform: rotate(360deg); } }
.journal {
  max-height: 260px; overflow-y: auto; font-size: 13.5px;
  display: flex; flex-direction: column; gap: 5px;
  background: var(--surface-2); border: 1px solid var(--bordure-2);
  border-radius: 8px; padding: 14px;
}
.journal-ligne { display: flex; gap: 12px; }
.journal-heure { color: var(--texte-2); flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ---------- Résultats ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 18px; }
.stat {
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px;
  padding: 14px 20px; display: flex; align-items: baseline; gap: 9px;
}
.stat-nombre { font-size: 24px; font-weight: 700; }
.stat-libelle { font-size: 13.5px; color: var(--texte-2); }
.res-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }

.onglets { display: flex; gap: 2px; border-bottom: 1px solid var(--bordure); margin-bottom: 0; }
.onglet {
  font-family: inherit; font-size: 14.5px; font-weight: 600;
  background: none; border: none; color: var(--texte-2);
  padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent;
}
.onglet.actif { color: var(--texte); border-bottom-color: var(--accent); }

.carte-table {
  background: var(--surface); border: 1px solid var(--bordure);
  border-top: none; border-radius: 0 0 12px 12px; overflow: hidden;
}
.table-defilante { overflow-y: auto; overflow-x: hidden; max-height: 620px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; table-layout: auto; }
thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2); color: var(--texte-2);
  text-align: left; font-weight: 600; padding: 10px 12px;
  border-bottom: 1px solid var(--bordure);
}
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--bordure-2); vertical-align: top; word-break: break-word; }
tbody tr:hover { background: var(--surface-2); }
td a { color: var(--accent); font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }
.badge {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 5px; white-space: nowrap;
}
.badge-nouveau { color: #fff; background: var(--accent); }
.tag-nouveau {
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--ok); text-transform: lowercase; margin-left: 6px;
  vertical-align: middle;
}
.badge-ok { color: var(--ok); background: rgba(62, 107, 79, .12); }
.badge-moyen { color: var(--attention); background: rgba(138, 109, 59, .12); }
.badge-neutre { color: var(--texte-2); background: var(--surface-2); border: 1px solid var(--bordure-2); }
.badge-client { color: #fff; background: var(--accent); }
.badge-prospect { color: var(--texte-2); background: var(--surface-2); border: 1px solid var(--bordure-2); }
.cellule-postes { max-width: 380px; }
.offre-ligne { margin-bottom: 3px; }
.cellule-postes .offre-lien { display: inline; }
.offre-date { font-size: 12px; color: var(--texte-2); margin-left: 7px; white-space: nowrap; }

/* ---------- Pages d'authentification ---------- */
.page-auth {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 30px 20px; gap: 18px;
}
.auth-logo { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.carte-auth { width: 100%; max-width: 400px; }
.carte-auth h1 { font-size: 19px; margin-bottom: 4px; }
.carte-auth .sous-titre { font-size: 13.5px; color: var(--texte-2); margin-bottom: 18px; }
.auth-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.auth-lien { font-size: 13.5px; color: var(--texte-2); text-align: center; }
.auth-lien a, .auth-lien button {
  font-family: inherit; font-size: inherit; color: var(--accent); font-weight: 600;
  background: none; border: none; cursor: pointer; text-decoration: none;
}
.auth-lien a:hover, .auth-lien button:hover { text-decoration: underline; }
/* Séparateur « ou » et bouton Google */
.separateur-ou { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--texte-2); font-size: 13px; }
.separateur-ou::before, .separateur-ou::after { content: ""; flex: 1; height: 1px; background: var(--bordure); }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; font-family: inherit; font-size: 14.5px; font-weight: 600;
  background: var(--surface); color: var(--texte); text-decoration: none;
  border: 1px solid var(--bordure); border-radius: 8px; padding: 11px 18px;
  cursor: pointer; transition: border .15s, background .15s;
}
.btn-google:hover { border-color: var(--accent); background: var(--surface-2); }

.message-info {
  font-size: 13.5px; border-radius: 8px; padding: 11px 14px; margin-bottom: 14px;
  background: var(--surface-2); border: 1px solid var(--bordure-2); color: var(--texte);
}
.message-info.erreur { color: var(--erreur); border-color: rgba(150, 69, 61, .3); background: rgba(150, 69, 61, .06); }
.message-info.succes { color: var(--ok); border-color: rgba(62, 107, 79, .3); background: rgba(62, 107, 79, .06); }
.lien-copiable {
  font-size: 12.5px; word-break: break-all; background: var(--surface-2);
  border: 1px dashed var(--bordure); border-radius: 8px; padding: 10px; margin-top: 10px;
  user-select: all;
}

/* ---------- Modales ---------- */
.voile {
  position: fixed; inset: 0; background: rgba(43, 43, 43, .45);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
.modale {
  background: var(--surface); border-radius: 12px; padding: 28px;
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
}
.modale h2 { margin-bottom: 16px; }
.modale-actions { display: flex; gap: 10px; margin-top: 6px; }
.separateur { border: none; border-top: 1px solid var(--bordure-2); margin: 18px 0; }

/* ---------- Divers ---------- */
[hidden] { display: none !important; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--texte); color: #fff; font-weight: 600; font-size: 14px;
  padding: 11px 20px; border-radius: 8px; z-index: 80;
  animation: apparaitre .2s ease;
}
@keyframes apparaitre { from { opacity: 0; transform: translate(-50%, 8px); } }

@media (max-width: 700px) {
  .barre-recherche { flex-direction: column; }
  .barre-recherche .champ-lieu { flex: 1; }
}

/* ---- Connexions (pastilles d'en-tête + bloc Réglages) ---- */
.chips-connexions {
  display: inline-flex; gap: 6px; align-items: center;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.chip-cnx {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: 11px; font-weight: 800; color: #fff;
  background: #9aa0a6; position: relative;
}
.chip-cnx[data-etat="ok"] { background: var(--ok, #3e6b4f); }
.chip-cnx[data-etat="ko"] { background: var(--erreur, #96453d); }
.chip-cnx[data-etat="ko"]::after {
  content: "!"; position: absolute; top: -4px; right: -4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; color: var(--erreur, #96453d);
  font-size: 9px; line-height: 12px; text-align: center;
  border: 1px solid var(--erreur, #96453d);
}
.cnx-bloc { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.cnx-ligne { display: flex; gap: 10px; align-items: flex-start; }
.cnx-texte { display: flex; flex-direction: column; gap: 3px; }
.cnx-avance { margin-top: 6px; }
.cnx-avance summary { cursor: pointer; }
