/* ═══════════════════════════════════════════════════════════════════════
   CourtierPilot — Upgrade v27 : styles additionnels
   Ajouter ce fichier APRÈS style.css dans les pages HTML
   ═══════════════════════════════════════════════════════════════════════ */


/* ── Zone d'upload photos ────────────────────────────────────────────── */

.photo-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--surface-soft);
  margin-bottom: 16px;
}

.photo-upload-zone:hover,
.photo-drop-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.photo-drop-content svg {
  color: var(--muted);
  margin-bottom: 12px;
}

.photo-drop-content p {
  margin: 4px 0;
  font-size: 14px;
}


/* ── Barre de progression ────────────────────────────────────────────── */

.photo-upload-progress {
  margin-bottom: 16px;
}

.photo-progress-bar {
  height: 6px;
  background: var(--surface-soft);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.photo-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}


/* ── Grille d'édition des photos (property-edit) ─────────────────────── */

.photo-grid-editor {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.photo-grid-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--surface-soft);
  border: 2px solid transparent;
  transition: border-color 0.15s, opacity 0.15s;
  cursor: grab;
}

.photo-grid-item:active {
  cursor: grabbing;
}

.photo-grid-dragging {
  opacity: 0.4;
}

.photo-grid-drop-target {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}

.photo-grid-main {
  border-color: var(--accent);
}

.photo-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-touch-callout: none; /* empêche le menu natif « Copier/Télécharger l'image » sur appui long (Safari/iOS) */
  -webkit-user-select: none;
  user-select: none;
}

.photo-grid-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
}

.photo-badge-main {
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.photo-btn-main,
.photo-btn-delete {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: grid;
  place-items: center;
  transition: background 0.15s, transform 0.1s;
}

.photo-btn-main {
  background: rgba(255,255,255,0.9);
  color: var(--accent);
}
.photo-btn-main:hover {
  background: var(--accent);
  color: white;
  transform: scale(1.1);
}

.photo-btn-delete {
  background: rgba(255,255,255,0.9);
  color: var(--danger);
}
.photo-btn-delete:hover {
  background: var(--danger);
  color: white;
  transform: scale(1.1);
}

.photo-grid-reorder {
  position: absolute;
  bottom: 6px;
  left: 6px;
  display: flex;
  gap: 4px;
}

.photo-btn-move {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.9);
  color: var(--primary);
  transition: background 0.15s, transform 0.1s;
}

.photo-btn-move:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

.photo-btn-move:disabled {
  opacity: 0.35;
  cursor: default;
}


/* ── Galerie carrousel (property-detail + public) ────────────────────── */

.photo-gallery {
  width: 100%;
}

.gallery-main {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-soft);
}

.gallery-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.gallery-nav:hover {
  background: white;
  transform: translateY(-50%) scale(1.08);
}

.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }

.gallery-counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}

.gallery-thumb {
  width: 72px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: opacity 0.15s, border-color 0.15s;
}

.gallery-thumb:hover {
  opacity: 0.85;
}

.gallery-thumb-active {
  opacity: 1;
  border-color: var(--accent);
}


/* ── Correctif : débordement horizontal causé par la galerie photos ─────
   Sur certaines fiches (ex. plusieurs photos dans le carrousel), la
   grille .detail-grid pouvait s'élargir au-delà de la largeur de l'écran
   et décaler toute la page vers la droite. On force la galerie à rester
   contenue dans sa colonne, avec un filet de sécurité global. ────────── */

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

#property-gallery-container,
#public-gallery-container {
  min-width: 0;
  max-width: 100%;
}

.photo-gallery {
  min-width: 0;
  max-width: 100%;
}

.gallery-thumbs {
  max-width: 100%;
}


/* ── Correctif : pastille de score coupée sur les cartes visiteurs ──────
   Quand le courriel (ou un autre texte) est long et ne contient aucun
   espace, la colonne de texte refusait de rétrécir et poussait la
   pastille "xx/100" hors de la carte. On force le texte à rétrécir/
   passer à la ligne et on garde la pastille à sa taille fixe. ─────────── */

.lead-card-top > div:not(.lead-score) {
  min-width: 0;
  flex: 1 1 auto;
}

/* Le nom reste sur une seule ligne, tronqué avec "…" au besoin — un
   word-break ici ferait éclater le nom lettre par lettre si la carte
   devient très étroite (voir correctif ci-dessous pour le tableau de bord). */
.lead-card-top h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-card-top p.muted {
  overflow-wrap: break-word;
  word-break: break-word;
}

.lead-score {
  flex-shrink: 0;
}


/* ── Correctif : cartes "Prospects chauds" trop étroites (tableau de
   bord + fiche propriété) ───────────────────────────────────────────────
   .lead-grid-compact garde 3 (ou 2) colonnes selon la largeur de l'écran,
   sans tenir compte du fait qu'ici le conteneur n'occupe qu'environ la
   moitié de la largeur (panneau .dashboard-two-columns) : les cartes
   devenaient beaucoup trop étroites pour leur contenu. On force une seule
   colonne dans ce contexte précis, où la carte peut alors utiliser toute
   la largeur du panneau. */
.dashboard-two-columns .lead-grid-compact {
  grid-template-columns: 1fr;
}


/* ── Page Paramètres v27b : navigation de sections + signature ──────── */

.settings-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.settings-section-nav a {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--surface);
}

.settings-section-nav a:hover {
  background: var(--surface-soft);
}

.settings-save-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.settings-save-bar .form-message {
  margin: 0;
}


/* ── Signature de courriel — éditeur + aperçu ────────────────────────── */

.signature-editor-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px;
  align-items: start;
  min-width: 0;
}

.signature-editor-fields {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.signature-editor-preview {
  min-width: 0;
  position: sticky;
  top: 20px;
}

.signature-image-upload-zone {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.signature-image-preview {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
}

.signature-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.signature-image-placeholder {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  padding: 4px;
}

.signature-image-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.signature-preview-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f8fafc;
  padding: 18px;
  min-width: 0;
}

.signature-preview-main {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.signature-preview-photo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--primary);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 18px;
}

.signature-preview-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.signature-preview-name {
  min-width: 0;
}

.signature-preview-name strong {
  display: block;
  font-size: 15px;
}

.signature-preview-name span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.signature-preview-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.signature-preview-links a {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--primary);
  padding: 6px 10px;
  font-weight: 900;
  font-size: 12px;
  text-decoration: none;
}

.signature-preview-tagline {
  margin-top: 10px;
  font-size: 12px;
  font-style: italic;
  color: #8b5a18;
}

@media (max-width: 920px) {
  .signature-editor-grid {
    grid-template-columns: 1fr;
  }

  .signature-editor-preview {
    position: static;
  }
}


/* ── Historique courriels ────────────────────────────────────────────── */

.email-history {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.email-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-soft);
  border-radius: 12px;
}

.email-history-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.email-history-content {
  flex: 1;
  min-width: 0;
}

.email-history-content strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-history-content span {
  font-size: 12px;
}

.email-type-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.email-type-followup  { background: #dbeafe; color: #1e40af; }
.email-type-invitation { background: var(--accent-soft); color: #8b5a18; }
.email-type-seller_report { background: #dcfce7; color: #15803d; }

/* Journal d'activité — badges par type d'entité (mêmes dimensions que
   .email-type-badge, réutilisé tel quel pour la chronologie combinée) */
.activity-type-property   { background: #dcfce7; color: #15803d; }
.activity-type-open_house { background: #dbeafe; color: #1e40af; }
.activity-type-visitor    { background: #fee2e2; color: #b42318; }
.activity-type-settings   { background: #ede9fe; color: #5b21b6; }
.activity-type-team       { background: #fef3c7; color: #92400e; }
.activity-type-autre      { background: var(--surface-soft); color: var(--muted); }

/* Quatre types de courriel existaient en base sans couleur ni étiquette : le
   journal affichait « DAILY_DIGEST » en capitales, sans pastille visible.
   Mêmes teintes que leurs voisines ci-dessus — les relances automatiques
   reprennent la famille des relances manuelles, puisque c'est le même geste
   fait par l'app plutôt que par le courtier. */
.email-type-automated_followup { background: var(--accent-soft); color: #8b5a18; }
.email-type-team_invite { background: #fef3c7; color: #92400e; }
.email-type-account { background: var(--surface-soft); color: var(--muted); }
.email-type-daily_digest,
.email-type-daily_digest_equipe { background: #dbeafe; color: #1e40af; }


/* ── Bouton envoi courriel dans followup-box ─────────────────────────── */

#send-email-direct-button,
#send-invitation-email-button {
  position: relative;
}


/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .photo-grid-editor {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }

  .gallery-nav {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .gallery-thumb {
    width: 56px;
    height: 40px;
  }

  .photo-upload-zone {
    padding: 28px 16px;
  }

  /* La pastille passe SOUS le texte, alignée sur la colonne du texte (donc
     pas sous l'icône) et calée à gauche.

     Pourquoi ici et pas dans style.css : cette feuille est chargée APRÈS
     style.css et y redéfinit .email-history-item en display:flex. Une règle
     mobile écrite dans style.css était donc écrasée — le sélecteur a la même
     spécificité, c'est le dernier chargé qui l'emporte. C'est ce qui a fait
     échouer plusieurs corrections apparemment correctes.

     L'ancienne tentative (flex-wrap + margin-left) ne suffisait pas : avec
     flex-shrink: 0 sur la pastille et white-space: nowrap, la colonne de
     texte était écrasée bien avant que le retour à la ligne se déclenche. */
  .email-history-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    row-gap: 8px;
  }

  .email-type-badge {
    grid-column: 2;
    justify-self: start;
    margin-left: 0;
    white-space: normal;
  }
}


/* ── Fusion de contacts (bouton retiré — voir historique du projet) ──────
   .merged-notice reste nécessaire : elle affiche la bannière sur une fiche
   déjà fusionnée avant que le bouton soit retiré (ex. Cynthia Pouliot). */

.merged-notice {
  border: 1px solid rgba(181, 131, 58, 0.35);
  background: #fdf6e9;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
}

.merged-notice strong {
  flex-basis: 100%;
}

.merged-notice p {
  margin: 0;
  flex: 1 1 320px;
}

/* Fusion de contacts — panneau « Autres visites de ce contact » mis en
   évidence en haut de la fiche visiteur (voir loadVisitorDetailPage dans
   app.js), plutôt qu'enfoui plus bas dans la page. */
.other-visits-panel {
  border: 1px solid var(--accent, #b5833a);
  border-left: 4px solid var(--accent, #b5833a);
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.other-visits-panel h3 {
  margin-top: 0;
}

/* Fusion de contacts — signale, sur une ligne de visite, un nom différent
   du nom principal de la fiche : un signe qu'un regroupement (par
   téléphone ou courriel partagé) pourrait concerner 2 personnes
   différentes plutôt qu'une seule et même personne. */
.contact-visit-row-mismatch {
  background: #fdf0ec;
  border-radius: 8px;
  padding-left: 6px;
}

.mismatch-name {
  color: #c0392b;
  font-weight: 700;
}

/* Badge "type de prospect" — calculé automatiquement (voir
   deriveProspectTypeBadge dans app.js) à partir des réponses déjà
   recueillies (propriété à vendre, préautorisation, intérêt exprimé).
   Aucune saisie manuelle : le courtier voit d'un coup d'œil qui est un
   vendeur potentiel, un acheteur ou encore à qualifier. */
.prospect-type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.prospect-type-seller {
  background: #fbf1de;
  color: #8b5a18;
}

.prospect-type-buyer {
  background: #e6f0ff;
  color: #1d4ed8;
}

.prospect-type-unknown {
  background: #eef1f5;
  color: #64748b;
}


/* ── Accessibilité — lien d'évitement + focus visible ────────────────────
   Le lien « Aller au contenu principal » permet à une personne au clavier
   ou au lecteur d'écran de sauter directement le menu latéral (répété sur
   chaque page) plutôt que de le retraverser à chaque changement de page.
   Cette règle et .button:focus-visible/.sidebar-nav a:focus-visible sont
   volontairement séparées de style.css pour rester dans les ajouts v27,
   sans toucher aux règles de base. */

.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 1000;
  background: #153b63;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

.button:focus-visible,
.sidebar-nav a:focus-visible,
.settings-section-nav a:focus-visible,
.view-toggle-btn:focus-visible {
  outline: 3px solid rgba(21, 59, 99, 0.45);
  outline-offset: 2px;
}

/* Cible générique pour tout lien/bouton qui n'a pas déjà un style de focus
   plus spécifique ailleurs (ex. .stat-card-clickable, déjà géré dans
   style.css avec un remplacement équivalent — box-shadow + bordure). */
a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(21, 59, 99, 0.45);
  outline-offset: 2px;
}


/* ── Mode équipe — sélecteur de compte (sidebar) ─────────────────────────
   Masqué par défaut (hidden côté HTML) ; affiché en JS uniquement si la
   personne connectée a au moins une invitation d'équipe active — donc
   invisible pour l'immense majorité des courtiers solos. */

.sidebar-account-switcher {
  margin: 4px 0 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.sidebar-account-switcher label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
  margin-bottom: 4px;
}

.sidebar-account-switcher select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 700;
}

/* ── Mode équipe — gestion des invitations (Paramètres) ──────────────────*/

.team-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-soft);
  border-radius: 12px;
  margin-bottom: 10px;
}

.team-member-row:last-child { margin-bottom: 0; }

.team-member-row > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.team-invite-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.team-invite-row .form-field {
  flex: 1 1 220px;
  min-width: 0;
}


/* ── Calendrier général (page calendar.html, bouton du tableau de bord) ── */

.calendarpage-agenda-day {
  margin-bottom: 22px;
}

.calendarpage-agenda-day:last-child {
  margin-bottom: 0;
}

.calendarpage-agenda-day h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.calendarpage-agenda-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendarpage-agenda-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}

.calendarpage-agenda-row:hover {
  border-color: var(--primary);
}

.calendarpage-agenda-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.calendarpage-agenda-row-main strong {
  font-size: 14px;
}

.calendarpage-agenda-row-time {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.calendarpage-month-grid {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.calendarpage-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  margin-bottom: 6px;
}

.calendarpage-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.calendarpage-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.calendarpage-cell {
  background: white;
  min-height: 96px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: var(--text);
}

.calendarpage-cell-empty {
  background: var(--surface-soft);
}

.calendarpage-cell-today {
  background: #f0f7f4;
}

.calendarpage-cell-daynum {
  font-size: 13px;
  font-weight: 900;
}

.calendarpage-cell-today .calendarpage-cell-daynum {
  color: var(--primary);
}

.calendarpage-cell-chips {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.calendarpage-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendarpage-chip-visite {
  background: #e4ecf5;
  color: var(--primary);
}

.calendarpage-chip-suivi {
  background: #fdf1e2;
  color: #8a5a1d;
}

.calendarpage-chip-suivi_retard {
  background: #fbe3e0;
  color: #c0392b;
}

.calendarpage-chip-more {
  background: transparent;
  color: var(--muted);
}

@media (max-width: 760px) {
  .calendarpage-weekdays {
    display: none;
  }

  .calendarpage-days {
    grid-template-columns: 1fr;
  }

  .calendarpage-cell {
    min-height: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .calendarpage-cell-empty {
    display: none;
  }

  .calendarpage-cell-chips {
    flex: 1;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .calendarpage-agenda-row {
    flex-wrap: wrap;
  }
}


/* Relances automatiques — file d'approbation en un clic */

.nav-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #e0563d;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}

.relances-queue-list {
  display: grid;
  gap: 16px;
}

.relance-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fafc;
  padding: 18px;
  display: grid;
  gap: 10px;
  transition: opacity 0.2s ease;
}

.relance-card-done {
  opacity: 0.55;
}

.relance-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.relance-card-header strong {
  display: block;
  font-size: 16px;
}

.relance-card-header .muted {
  display: block;
  font-size: 13px;
}

.relance-step-badge {
  background: #e6f0ff;
  color: #1d4ed8;
  white-space: nowrap;
}

.relance-card-meta {
  font-size: 13px;
}

.relance-draft-textarea {
  min-height: 160px;
  resize: vertical;
  background: white;
  line-height: 1.55;
}

.relance-card-status {
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 760px) {
  .relance-card-header {
    flex-direction: column;
  }
}


/* Ajout manuel d'un prospect — fenêtre modale générique + badge de provenance */

.source-manual-badge {
  background: #eef1f5;
  color: #475569;
}

.cp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 35, 56, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  z-index: 1000;
}

.cp-modal {
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  max-width: 640px;
  width: 100%;
  padding: 28px;
  box-shadow: 0 30px 60px rgba(15, 35, 56, 0.35);
}

.cp-modal h2 {
  margin-top: 0;
  margin-bottom: 6px;
}

.cp-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: white;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.cp-modal-close:hover {
  background: #f1f5f9;
}

@media (max-width: 640px) {
  .cp-modal-overlay {
    padding: 16px;
  }

  .cp-modal {
    padding: 20px;
  }
}

/* Boucle de feedback IA — modale « raison de non-qualification » */

.outcome-reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 14px;
}

.outcome-reason-chip {
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.outcome-reason-chip:hover {
  border-color: var(--primary);
  background: #eef2f7;
}

.outcome-reason-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 18px;
}

/* ── Dictée vocale → profil IA (fiche visiteur) ──────────────────────────
   Panneau "Notes vocales & profil IA" sur visitor-detail.html : capture
   d'une note (dictée via Web Speech API ou tapée), extraction structurée
   via extract-profile.php, carte de révision éditable avant écriture en
   base, puis résumé du profil déjà enregistré. */

.ai-profile-box {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fafc;
  padding: 16px;
  margin-bottom: 22px;
}

.voice-note-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.voice-record-button.is-recording {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
  animation: cp-voice-pulse 1.4s ease-in-out infinite;
}

@keyframes cp-voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

#voice-note-textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  background: white;
  line-height: 1.5;
}

.ai-profile-review {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.ai-profile-review .compact-form-grid input,
.ai-profile-review .compact-form-grid select {
  background: white;
}

.ai-profile-current {
  margin-top: 14px;
}

.ai-profile-current:empty {
  display: none;
}

.ai-profile-summary {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent, #b5833a);
  border-radius: 12px;
  background: white;
  padding: 14px 16px;
}

.ai-profile-summary h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.ai-profile-summary .info-list {
  margin: 0;
}

.ai-profile-summary .muted {
  margin-top: 8px;
}

/* ── Propriétés correspondantes (fiche visiteur) ─────────────────────────
   Petit badge au-dessus de chaque property-card réutilisée pour indiquer
   pourquoi la propriété a été suggérée (budget et/ou secteur). */

.property-match-badges {
  display: flex;
  gap: 6px;
  margin: 0 0 6px;
}

.property-match-item {
  display: flex;
  flex-direction: column;
}
