/* =====================================================
   Back Laser CRM — Design System v3 « Back Laser »
   Charte de back-laser.fr : encre graphite, accent brique, fond crème,
   Archivo (titres) + IBM Plex Sans (texte), angles vifs.
   Tokens normatifs : ce fichier ; principes : openspec/specs/ui-design-system/spec.md
   ===================================================== */

:root {
  /* ── Primaire brique (accent de la charte) ── */
  --primary:       #B8321A;
  --primary-light: #E2502C;
  --primary-dark:  #151918;   /* survol des boutons primaires = encre (comme le site) */
  --primary-tint:  #F7E9E5;

  /* ── Encre de marque ── */
  --ink:           #151918;

  /* ── Alias legacy (styles inline non encore migrés) ── */
  --navy:          #B8321A;
  --navy-light:    #151918;
  --gold:          #b45309;   /* warning brun/ambre */
  --gold-light:    #d97706;
  --teal:          #B8321A;

  /* ── Sidebar CLAIRE ── */
  --sidebar-bg:    #ffffff;
  --sidebar-border:#E2DFD8;
  --nav-inactive:  #5E6361;
  --nav-active-bg: #F7E9E5;
  --nav-active-tx: #151918;

  /* ── Surfaces & fond ── */
  --cream:         #F1EFEA;
  --bg:            #F1EFEA;
  --bg-app:        #F1EFEA;
  --bg-card:       #ffffff;
  --white:         #ffffff;
  --surface-2:     #F1EFEA;   /* fond doux : tracks, hover, tint neutre */

  /* ── Texte ── */
  --text:          #151918;
  --text-light:    #5E6361;   /* secondaire */
  --text-secondary:#5E6361;
  --text-muted:    #8A8F8C;

  /* ── Bordures ── */
  --border:        #E2DFD8;
  --border-light:  #F1EFEA;

  /* ── Statuts (+ tints) ── */
  --success:       #15803d;
  --success-tint:  #dcfce7;
  --danger:        #9f1239;   /* framboise : distinct de l'accent brique */
  --danger-tint:   #ffe4e6;
  --warning:       #b45309;
  --warning-tint:  #fef3c7;

  /* ── Layout ── */
  --sidebar-w:     240px;

  /* ── Rayons (angles vifs, comme back-laser.fr) ── */
  --radius:        2px;       /* boutons / champs */
  --radius-btn:    2px;
  --radius-lg:     4px;       /* cartes */
  --radius-card:   4px;
  --radius-xl:     6px;       /* modales */
  --radius-pill:   9999px;

  /* ── Ombres (unique + variantes hover/overlay) ── */
  --shadow:        0 1px 2px rgba(21,25,24,.05);
  --shadow-card:   0 1px 2px rgba(21,25,24,.05);
  --shadow-md:     0 4px 12px rgba(21,25,24,.08);
  --shadow-lg:     0 16px 40px rgba(21,25,24,.16);

  /* ── Focus ── */
  --focus-ring:    0 0 0 3px rgba(184,50,26,.28);

  /* ── Échelle d'espacement STRICTE (4/8/12/16/24/32/48) ── */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-card: 28px;   /* padding intérieur des cartes */
  --gap:    20px;    /* gap de grille */

  /* ── Typographie ── */
  --font-display:  'Archivo', 'Arial Narrow', system-ui, sans-serif;
  --font-body:     'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:     'IBM Plex Mono', ui-monospace, monospace;
}

/* Titres : Archivo légèrement étiré, comme sur back-laser.fr */
.sidebar-logo h1, .page-header h2, .card-header h3, .login-logo h1,
.kpi-value, .stat-value, .modal-header h3 { font-stretch: 108%; }

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* Chiffres alignés partout où on affiche des nombres */
.kpi-value, .stat-value, .col-count, .card-cost, .card-margin,
.funnel-count, .top-amount, .crm-big-value, .detail-value,
th, td, .badge { font-variant-numeric: tabular-nums; }

/* ── Icônes (sprite) ── */
.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  vertical-align: middle;
}
.icon-lg { width: 20px; height: 20px; }
.icon--xs { width: 12px; height: 12px; vertical-align: -2px; }
.card-lost-btn .icon { width: 10px; height: 10px; }

/* ── Layout ── */
.app {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar (claire) ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  flex-shrink: 0;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  padding: 26px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo h1 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1.2;
}
.sidebar-logo h1 img { display: block; width: 180px; height: auto; }
.sidebar-logo span {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 500;
}

.sidebar-nav {
  padding: 12px 12px;
  flex: 1;
  list-style: none;
}
.sidebar-nav li { margin-bottom: 2px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--nav-inactive);
  font-size: 14px;
  font-weight: 500;
  transition: background .12s, color .12s;
  position: relative;
}
.sidebar-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.sidebar-nav a.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-tx);
  font-weight: 600;
}
.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px; bottom: 6px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.sidebar-nav .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
/* Icône SVG dans la nav (après migration emoji → sprite) */
.sidebar-nav a .icon { width: 18px; height: 18px; opacity: .9; }
.sidebar-nav a.active .icon { opacity: 1; }

.sidebar-footer {
  padding: 16px 16px 24px;
  border-top: 1px solid var(--border);
}
.sidebar-footer .user-email {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Main content ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0; /* empêche kanban/table de dilater la page */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.page-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1.2;
}
.page-header .sub { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }

.page-body {
  padding: 32px 40px;
  flex: 1;
}

/* ── Boutons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 20px;
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border: none;
  white-space: nowrap;
  transition: background .12s, box-shadow .12s;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

/* Secondaire = blanc bordé (alias .btn-ghost conservé) */
.btn-secondary,
.btn-ghost {
  background: var(--white);
  color: #44403c;
  border: 1px solid #d6d3d1;
}
.btn-secondary:hover,
.btn-ghost:hover { background: var(--bg-app); color: var(--text); }

.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-light); }

.btn-danger { background: var(--white); color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; }

/* Bouton inactif (enregistrement en cours, sélection vide, captcha…) : visiblement grisé.
   Pleins → fond gris ; blancs bordés → texte et bordure atténués, fond inchangé. */
.btn:disabled { cursor: not-allowed; }
.btn-primary:disabled, .btn-primary:disabled:hover,
.btn-gold:disabled,    .btn-gold:disabled:hover,
.btn-danger:disabled,  .btn-danger:disabled:hover,
.btn-success:disabled, .btn-success:disabled:hover { background: var(--text-muted); color: #fff; }
.btn-secondary:disabled, .btn-secondary:disabled:hover,
.btn-ghost:disabled,     .btn-ghost:disabled:hover { background: var(--white); color: var(--text-muted); border-color: var(--border); }

/* ── Cartes ── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}
.card--spaced  { margin-bottom: var(--sp-4, 16px); }
.card--padded  { padding: var(--sp-card); }          /* padding 28px sur les cartes à formulaires / sections */
.card-body     { padding: var(--sp-card); }
.card-header {
  padding: 20px var(--sp-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--text);
}

/* ── Badges (pilule) ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-actif,
.badge-positif,
.badge-success { background: var(--success-tint); color: var(--success); }
.badge-perdu,
.badge-negatif,
.badge-danger  { background: var(--danger-tint);  color: var(--danger);  }
.badge-warning { background: var(--warning-tint); color: var(--warning); margin-left: 6px; }
.badge-teal    { background: var(--primary-tint); color: var(--primary); }
.badge-archive,
.badge-neutral { background: var(--surface-2);     color: var(--text-secondary); }

/* ── Formulaires ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--white);
  color: var(--text);
  transition: border-color .12s, box-shadow .12s;
  appearance: auto;
}
textarea.form-control { height: auto; padding: 10px 12px; min-height: 84px; resize: vertical; }
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}
.form-control[readonly] {
  background: var(--surface-2);
  color: var(--text-light);
}
.form-control.is-invalid { border-color: var(--danger); }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin: 24px 0 16px;
}

/* ── Valeur calculée ── */
.calc-display {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-btn);
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.calc-display.positive { background: var(--success); }
.calc-display.negative { background: var(--danger); }
.calc-display.neutral  { background: var(--text-light); }
.calc-label { font-size: 11px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }

/* ── Tableaux ── */
.table-wrapper { overflow-x: auto; position: relative; }
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg-app);
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
tr:hover td { background: var(--primary-tint); }
tr:last-child td { border-bottom: none; }

/* Dernière colonne collante (action toujours visible) */
table th:last-child,
table td:last-child {
  position: sticky;
  right: 0;
  background: var(--white);
  box-shadow: -2px 0 6px rgba(0,0,0,.04);
}
table th:last-child { background: var(--bg-app); }
tr:hover td:last-child { background: var(--primary-tint); }

/* ── Modale ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28,25,23,.45);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 680px;
  position: relative;
  border: 1px solid var(--border);
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.02em;
  color: var(--text);
}
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-light);
  line-height: 1;
  padding: 4px;
  border-radius: var(--radius-btn);
  transition: background .12s, color .12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }

/* ── Kanban ── */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: calc(100vh - 160px);
  align-items: flex-start;
}
.kanban-col {
  min-width: 240px;
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-btn);
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.kanban-col-header .col-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.kanban-col-header .col-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}
.kanban-col-header .col-count {
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
  padding: 4px 0;
}

.kanban-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: grab;
  transition: box-shadow .18s, transform .18s, border-color .18s;
  user-select: none;
  position: relative;
}
.kanban-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #d6d3d1;
  transform: translateY(-1px);
}
.kanban-card.sortable-ghost { opacity: .4; }
.kanban-card.sortable-drag  { box-shadow: var(--shadow-lg); cursor: grabbing; }

.kanban-card .card-laser   { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.kanban-card .card-serial  { font-size: 11px; color: var(--text-light); margin-bottom: 8px; }
.kanban-card .card-info    { display: flex; flex-direction: column; gap: 3px; }
.kanban-card .card-vendor  { font-size: 11px; color: var(--text-light); }
.kanban-card .card-cost    { font-size: 12px; font-weight: 600; color: var(--text); }
.kanban-card .card-margin  { font-size: 11px; font-weight: 700; }
.kanban-card .card-margin.pos { color: var(--success); }
.kanban-card .card-margin.neg { color: var(--danger); }
.kanban-card .card-link { font-size: 11px; color: var(--primary); font-weight: 600; margin-top: 6px; display: block; }
.kanban-card .card-nego { font-size: 11px; color: var(--primary); font-weight: 600; }

/* Bouton « Marquer perdu » — au survol de la carte */
.card-lost-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--danger-tint);
  color: var(--danger);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
  z-index: 1;
  padding: 0;
  line-height: 1;
}
.kanban-card:hover .card-lost-btn { opacity: 1; }

/* Entête des tableaux Achats / Ventes */
.board-section-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.kanban-board--section { min-height: 120px; }

/* Point d'alerte sur carte kanban */
.kanban-alert-dot {
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  position: absolute;
  top: 8px; right: 8px;
  flex-shrink: 0;
}

/* ── Onglets ── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  transition: color .12s, border-color .12s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ── Filtres / recherche ── */
.filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.search-input {
  height: 42px;
  padding: 0 12px 0 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 14px;
  width: 260px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a8a29e' stroke-width='1.75'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath stroke-linecap='round' d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") 12px center / 16px no-repeat;
  transition: border-color .12s, box-shadow .12s;
}
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

/* ── État vide ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; color: var(--text-muted); }
.empty-state .empty-icon .icon { width: 40px; height: 40px; }
.empty-state p { font-size: 14px; margin-bottom: 16px; }

/* ── Alerte (bandeau message) ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-error   { background: var(--danger-tint);  color: var(--danger);  border: 1px solid #fecaca; }
.alert-success { background: var(--success-tint); color: var(--success); border: 1px solid #bbf7d0; }

/* ── Spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Cartes statistiques ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--gap);
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-card);
  box-shadow: var(--shadow-card);
  transition: box-shadow .18s, border-color .18s;
}
.stat-card:hover { box-shadow: var(--shadow-md); border-color: #d6d3d1; }
.stat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 8px; }
.stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1;
}
.stat-sub   { font-size: 12px; color: var(--text-light); margin-top: 6px; }

/* ── Page de connexion (fond clair) ── */
.login-page {
  min-height: 100vh;
  background: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
}
.login-card form .btn { margin-top: 8px; }
/* Bouton inactif pendant le captcha : style général .btn:disabled (section Boutons) */
.login-captcha-hint { text-align: center; margin-top: var(--sp-3); }
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}
.login-logo h1 img { display: block; width: 240px; max-width: 100%; height: auto; margin: 0 auto; }
.login-logo p  { font-size: 13px; color: var(--text-light); margin-top: 12px; }

/* ── Badge notifications (nav sidebar) — #notif-badge / #alert-badge ── */
.alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  margin-left: auto;
}

/* ── Journal d'interactions (legacy) ── */
.interaction-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}
.interaction-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: var(--radius-btn);
  font-size: 12px;
}
.interaction-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.interaction-meta { color: var(--text-light); font-size: 11px; margin-top: 2px; }
.interaction-note { color: var(--text); margin-top: 3px; }
.interaction-form { background: var(--surface-2); border-radius: var(--radius-btn); padding: 12px; margin-top: 8px; }

/* ── Grille KPI dashboard ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
  margin-bottom: 28px;
}
.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-card);
  box-shadow: var(--shadow-card);
  transition: box-shadow .18s, border-color .18s;
}
.kpi-card:hover { box-shadow: var(--shadow-md); border-color: #d6d3d1; }
.kpi-label {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1;
}
.kpi-sub   { font-size: 12px; color: var(--text-light); margin-top: 10px; }
.kpi-delta { margin-top: 10px; }

/* ── Sélecteur de période → segmented control (blanc actif) ── */
.period-selector {
  display: inline-flex;
  gap: 2px;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 3px;
}
.period-btn {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .12s, color .12s, box-shadow .12s;
}
.period-btn.active {
  background: var(--white);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.period-btn:hover:not(.active) { color: var(--text); }
.period-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ── Segmented control générique (actif teal plein) ── */
.segmented, .seg-control {
  display: inline-flex;
  gap: 2px;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 3px;
}
.segmented > button, .seg-btn {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  transition: background .12s, color .12s;
}
.segmented > button.active, .seg-btn.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.segmented > button:not(.active):hover, .seg-btn:not(.active):hover {
  background: var(--white);
  color: var(--text);
}

/* ── Section dashboard ── */
.dashboard-section { margin-bottom: 28px; }
.dashboard-section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* =====================================================
   NOUVEAUX COMPOSANTS (consommés par les tâches 2-6)
   ===================================================== */

/* ── Timeline / bulles / composer (fiche contact) ── */
.timeline { display: flex; flex-direction: column; }
.timeline-scroll {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 4px 2px;
  min-height: 0;
}
.timeline-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 40px 20px; }

.bubble-row { display: flex; flex-direction: column; max-width: 100%; }
.bubble-row.out { align-items: flex-end; }
.bubble-row.in  { align-items: flex-start; }
.bubble-row.note { align-items: center; }

.bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: anywhere;
  /* NE PAS mettre white-space:pre-wrap ici : les sauts de ligne entre les
     <template> / commentaires HTML s'affichent comme du contenu visible.
     Le pre-wrap est scoped au <span> qui porte le texte du message. */
}
/* Préserve les sauts de ligne intentionnels des messages WhatsApp
   sans rendre les espaces/newlines du template HTML source */
.bubble > span { white-space: pre-wrap; }
.bubble-in {
  background: var(--surface-2);
  border-bottom-left-radius: 4px;
}
.bubble-out {
  background: var(--primary-tint);
  border: 1px solid var(--primary-tint);
  border-bottom-right-radius: 4px;
}
.bubble-note {
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  text-align: center;
  max-width: 90%;
  padding: 4px 12px;
}
.bubble-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; padding: 0 4px; }

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--white);
}
.composer .composer-input {
  flex: 1;
  min-height: 42px;
  max-height: 140px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  resize: none;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color .12s, box-shadow .12s;
}
.composer .composer-input:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
.composer .composer-send {
  height: 42px; width: 42px;
  flex-shrink: 0;
  border-radius: var(--radius-btn);
  border: none;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.composer .composer-send:hover { background: var(--primary-dark); }
.composer .composer-send:disabled { background: var(--text-muted); cursor: not-allowed; }

/* ── Cartes de message campagne ── */
.msg-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--sp-card);
}
.msg-card + .msg-card { margin-top: 16px; }
.msg-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.msg-card-name { font-size: 14px; font-weight: 650; color: var(--text); }
.msg-card-sub  { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.msg-card-body {
  background: var(--bg-app);
  border-radius: var(--radius-btn);
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg-card-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.msg-spinner { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 13px; padding: 8px 0; }
.msg-fallback { color: var(--text-muted); font-size: 12px; font-style: italic; margin-top: 8px; }
.msg-error {
  background: var(--danger-tint);
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: var(--radius-btn);
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 8px;
}

/* ── Ligne de vivier (matching contact ↔ modèle) ── */
.vivier-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--white);
  transition: border-color .12s, box-shadow .12s;
}
.vivier-row + .vivier-row { margin-top: 8px; }
.vivier-row:hover { border-color: #d6d3d1; box-shadow: var(--shadow); }
.vivier-info { flex: 1; min-width: 0; }
.vivier-name { font-size: 14px; font-weight: 600; color: var(--text); }
.vivier-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Entonnoir pipeline (dashboard) ── */
.funnel-row { display: flex; flex-direction: column; gap: 12px; }
.funnel-item { display: flex; flex-direction: column; gap: 6px; }
.funnel-meta { display: flex; align-items: center; justify-content: space-between; }
.funnel-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.funnel-count { font-size: 13px; font-weight: 700; color: var(--text); }
.funnel-track, .funnel-bar {
  height: 7px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.funnel-fill, .funnel-bar > span {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

/* ── Barre de progression générique (campagnes) ── */
.prog-track { height: 6px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.prog-fill  { height: 100%; border-radius: var(--radius-pill); background: var(--primary); }

/* ── Top-liste (top acheteurs) + avatars initiales ── */
.top-list { display: flex; flex-direction: column; gap: 12px; }
.top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-btn);
  background: var(--bg-app);
}
.avatar-initials {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatar-initials.sm { width: 30px; height: 30px; font-size: 11px; }
.top-info { flex: 1; min-width: 0; }
.top-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-sub  { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.top-amount { font-size: 14px; font-weight: 700; color: var(--text); flex-shrink: 0; }

/* ── Ligne d'alerte relance (dashboard) ── */
.alert-list { display: flex; flex-direction: column; }
.alert-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}
.alert-row + .alert-row { border-top: 1px solid var(--border); }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); flex-shrink: 0; }
.alert-info { flex: 1; min-width: 0; }
.alert-contact { font-size: 14px; font-weight: 600; color: var(--text); }
.alert-detail { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ── Lien CRM (voir plus →) ── */
.crm-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-top: 14px;
}
.crm-link:hover { color: var(--primary-dark); }
.crm-big-value {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--text);
  line-height: 1;
  margin-top: 8px;
}

/* ── Panneau inline (ajout vivier / contacts) ── */
.panel-inline {
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px var(--sp-card);
}
.panel-inline-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 14px;
}

/* ── Grille détail (en-tête opportunité) ── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
}
.detail-item { display: flex; flex-direction: column; gap: 4px; }
.detail-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.detail-value { font-size: 14px; font-weight: 600; color: var(--text); }

/* ── Bande de miniatures photos ── */
.photo-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.photo-strip img, .photo-strip-thumb {
  width: 84px; height: 84px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════
   Tâche 5 — Fiche contact + Campagne
   ═══════════════════════════════════════════════════ */

/* ── Layout fiche contact (2 colonnes) ── */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 1023px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ── Colonne flex stack (gap 20) ── */
.col-stack { display: flex; flex-direction: column; gap: 20px; }

/* ── Carte avec flex colonne ── */
.card--col { display: flex; flex-direction: column; }

/* ── Titre de section dans une carte ── */
.card-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.card-section-title--inline { margin-bottom: 0; }

/* ── Timeline fiche contact : hauteur fixe ── */
.contact-grid .timeline-scroll { height: 70vh; scroll-behavior: smooth; }

/* ── Bulles — aliases direction Alpine (sortant / entrant / note_interne) ── */
.bubble-row.sortant      { align-items: flex-end; }
.bubble-row.entrant      { align-items: flex-start; }
.bubble-row.note_interne { align-items: center; }
.bubble-row.sortant .bubble {
  background: var(--primary-tint);
  border: 1px solid var(--primary-tint);
  border-bottom-right-radius: 4px;
}
.bubble-row.entrant .bubble {
  background: var(--surface-2);
  border-bottom-left-radius: 4px;
}
.bubble-row.note_interne .bubble {
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  text-align: center;
  max-width: 90%;
  padding: 4px 12px;
}
.bubble-row.note_interne .bubble-meta { text-align: center; }

/* ── En-tête de bulle (canal label, au-dessus) ── */
.bubble-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.canal-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
/* ── Horodatage à l'intérieur de la bulle ── */
.bubble-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.bubble-row.sortant .bubble-time      { text-align: right; }
.bubble-row.note_interne .bubble-time { text-align: center; }

/* ── Médias dans bulle ── */
.bubble-img  { max-width: 240px; border-radius: var(--radius); cursor: pointer; display: block; margin-top: 6px; }
.bubble-link { font-size: 13px; display: inline-block; margin-top: 4px; }

/* ── Notice composer (absent de numéro WhatsApp) ── */
.composer-notice { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }

/* ── Aides formulaire ── */
.form-hint       { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.tag-list        { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.badge--clickable{ cursor: pointer; }
.input-row       { display: flex; gap: 8px; }
.form-actions    { display: flex; justify-content: flex-end; margin-top: 8px; }
.input--upper    { text-transform: uppercase; }

/* ── Groupe checkbox / radio ── */
.check-group { display: flex; gap: 16px; flex-wrap: wrap; }
.check-item  { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* ── Spinner 14 px ── */
.spinner--sm { width: 14px !important; height: 14px !important; border-width: 2px !important; flex-shrink: 0; }

/* ── Bouton succès ── */
.btn-success       { background: var(--success); color: #fff; border: none; }
.btn-success:hover { background: #047857; }
/* ── Bouton danger outline ── */
.btn--danger-outline { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn--danger-outline:hover { background: var(--danger-tint); }

/* ── États vides ── */
.empty-note      { color: var(--text-muted); font-size: 13px; padding: 4px 0; }
.loading-state   { text-align: center; padding: 80px; }
.not-found-card  { text-align: center; padding: 48px 32px; }
.nf-icon         { font-size: 36px; margin-bottom: 16px; }
.nf-title        { margin-bottom: 8px; }
.nf-desc         { color: var(--text-muted); margin-bottom: 24px; }

/* ── Listes d'items (intérêts, négociations) ── */
.item-list    { display: flex; flex-direction: column; gap: 10px; }
.item-box     { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-btn); }
.item-head    { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.item-meta    { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.item-actions { display: flex; gap: 8px; margin-top: 6px; }
.text-muted-sm  { font-size: 12px; color: var(--text-muted); }

/* ── Liens utilitaires ── */
.link-disabled { font-size: 12px; color: var(--text-muted); cursor: default; border-bottom: 1px dotted var(--text-muted); text-decoration: none; }
.link-inherit  { color: inherit; text-decoration: none; }
.link-back     { font-size: 13px; color: var(--primary); text-decoration: none; }
.link-primary  { color: var(--primary); }

/* ── Sidebar footer : Déconnexion pleine largeur ── */
.sidebar-footer .btn-ghost { width: 100%; }

/* ── Page header inner row ── */
.page-header-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ── Campagne : en-tête page ── */
.camp-head       { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.camp-breadcrumb { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.camp-title      { font-size: 20px; font-weight: 700; margin: 0; }
.card-head-row   { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }

/* ── Panneau inline dans une carte ── */
.card .panel-inline { margin-top: 14px; }

/* ── Campagne : KPI compacts ── */
.kpi-grid--compact { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.kpi-card--sm {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 10px 18px;
  min-width: 72px;
}
.kpi-card--sm .kpi-value  { font-size: 22px; }
.kpi-card--sm .kpi-label  { margin-bottom: 0; margin-top: 2px; font-size: 11px; }
.kpi-value--envoye  { color: var(--primary); }
.kpi-value--repondu { color: var(--success); }
.kpi-value--ecarte  { color: var(--danger);  }

/* ── Badges statut campagne ── */
.badge-camp-brouillon { background: var(--surface-2);    color: var(--text-secondary); }
.badge-camp-en_cours  { background: var(--primary-tint); color: var(--primary); }
.badge-camp-terminee  { background: var(--success-tint); color: var(--success); }

/* ── Badges statut message ── */
.badge-msg-brouillon { background: var(--surface-2);    color: var(--text-secondary); }
.badge-msg-envoye    { background: var(--primary-tint); color: var(--primary); }
.badge-msg-repondu   { background: var(--success-tint); color: var(--success); }
.badge-msg-ecarte    { background: var(--danger-tint);  color: var(--danger); text-decoration: line-through; }

/* ── Badge violet (formule d'adresse) ── */
.badge-violet { background: #f3e8ff; color: #6b21a8; }
/* ── Badge taille XS ── */
.badge--xs    { font-size: 10px; padding: 1px 7px; }
/* ── Badge flex-shrink:0 (dans msg-card-head) ── */
.badge--shrink0 { flex-shrink: 0; }

/* ── Campagne : candidats ── */
.candidats-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; margin: 12px 0; }
.candidat-row   { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.candidat-row:last-child  { border-bottom: none; }
.candidat-flex            { flex: 1; min-width: 0; }
.candidat-name            { font-weight: 500; }
.candidat-meta            { font-size: 12px; color: var(--text-muted); margin-left: 6px; }
.candidat-nowatsapp       { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ── Card avec margin-bottom 20px ── */
.card--mb { margin-bottom: 20px; }

/* ── Campagne : sous-composants msg-card ── */
.msg-card-contact { flex: 1; min-width: 0; }
.msg-card-badges  { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.msg-card-head .badge { flex-shrink: 0; }
.msg-error--row   { display: flex; align-items: center; gap: 10px; }

/* ── Campagne : textes de statut de message ── */
.msg-status-text { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.msg-status-date { font-size: 11px; margin-top: 4px; }
.msg-repondu     { font-size: 13px; margin-top: 4px; }
.msg-readonly    { font-size: 13px; color: var(--text-muted); margin-top: 4px; white-space: pre-wrap; }

/* ═══════════════════════════════════════════════════
   Tâche 6 — Page opportunité
   ═══════════════════════════════════════════════════ */

/* ── Layout 2 colonnes opportunité (col droite 360px fixe) ── */
.opp-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,360px);
  gap: 20px;
  align-items: start;
}
@media (max-width: 1023px) {
  .opp-grid { grid-template-columns: 1fr; }
}

/* ── Séparateur section (titre secondaire) ── */
.card-section-title--sep { margin-top: 18px; }

/* ── Bande récap coût / marge (teal-tint) ── */
.recap-band {
  margin-top: 18px;
  padding: 14px;
  background: var(--primary-tint);
  border-radius: var(--radius-btn);
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.recap-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 2px;
}
.recap-value { font-size: 16px; font-weight: 600; }

/* ── Marge positive / négative ── */
.marge-positive { color: var(--success); font-weight: 600; }
.marge-negative { color: var(--danger);  font-weight: 600; }

/* ── Rangée enregistrer ── */
.save-row { display: flex; justify-content: flex-end; margin-top: 16px; }

/* ── Spinner inline (avec marge droite) ── */
.spinner--inline { margin-right: 6px; flex-shrink: 0; }

/* ── Spinner grand (loader page) ── */
.spinner--lg { width: 28px !important; height: 28px !important; border-width: 3px !important; }

/* ── Icône hero (état introuvable) ── */
.icon--hero { width: 36px; height: 36px; color: var(--text-muted); }

/* ── Photo strip compacte (76×56) — surcharge .photo-strip ── */
.photo-strip--compact {
  flex-wrap: wrap;
  overflow-x: visible;
  padding-bottom: 0;
  margin-bottom: 12px;
  gap: 8px;
}
.photo-strip--compact .photo-thumb-wrap {
  width: 76px;
  height: 56px;
  aspect-ratio: unset;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.photo-strip--compact img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Bouton ✕ minature compacte (différent du .photo-delete-btn galerie) */
.photo-thumb-del {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-strip--compact .photo-thumb-wrap:hover .photo-thumb-del { opacity: 1; }

/* ── Rangée boutons photos ── */
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── État vide avec marge basse ── */
.empty-note--mb { margin-bottom: 12px; }

/* ── Transactions similaires ── */
.txn-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.txn-item:last-child { border-bottom: none; }
.txn-price { font-weight: 600; font-size: 13px; min-width: 80px; }
.txn-year  { color: var(--text-muted); font-size: 12px; }
.txn-date  { color: var(--text-muted); font-size: 12px; margin-left: auto; }

/* ── Badges achat / vente ── */
.badge-achat { background: #dbeafe; color: #1e40af; }
.badge-vente { background: #d1fae5; color: #065f46; }

/* ── Badge pill compact (padding 2-8, radius 10) ── */
.badge--pill { padding: 2px 8px; border-radius: var(--radius); font-weight: 500; white-space: nowrap; }

/* ── Badge statut opportunité (teal) ── */
.badge-statut-opp { background: var(--primary-tint); color: var(--primary); }

/* ── Badges intérêt vivier ── */
.badge-interet-confirme  { background: #d1fae5; color: #065f46; }
.badge-interet-a_valider { background: #fef3c7; color: #92400e; }

/* ── Tag acquéreur (dans table négo) ── */
.buyer-tag {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius);
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 500;
  margin-left: 4px;
  white-space: nowrap;
}

/* ── Carte avec margin-top 20px ── */
.card--mt { margin-top: 20px; }

/* ── En-tête de section (titre + bouton) ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Compteur d'items dans titre ── */
.section-count {
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
  color: var(--text-muted);
}

/* ── Boutons compacts (taille réduite) ── */
.btn--compact    { font-size: 12px; padding: 4px 12px; }
.btn--compact-sm { font-size: 12px; padding: 4px 10px; white-space: nowrap; flex-shrink: 0; }

/* ── Bouton retour (page header) ── */
.btn--back { padding: 6px 14px; font-size: 15px; }

/* ── Vendeur — bloc identité ── */
.vendor-ident { margin-bottom: 14px; }
.vendor-name  { font-weight: 600; color: var(--primary); text-decoration: none; }
.vendor-sub   { font-size: 12px; color: var(--text-muted); }

/* ── Fil de commentaires ── */
.commentaires-fil {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 12px;
}
.comment-bubble {
  background: var(--surface-2);
  border-radius: var(--radius-btn);
  padding: 8px 12px;
  font-size: 13px;
}
.comment-date { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ── Input flex (pleine largeur dans .input-row) ── */
.input-flex { flex: 1; min-width: 0; }

/* ── Scroll horizontal tables ── */
.table-scroll     { overflow-x: auto; }
.table-scroll--mt { margin-top: 10px; overflow-x: auto; }

/* ── Colonnes table négociations ── */
.nego-col-contact { min-width: 160px; }
.nego-col-echange { min-width: 130px; }
.nego-col-action  { min-width: 200px; }

/* ── Texte tronqué 160px ── */
.text-truncate-160 {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

/* ── Texte 11px muted ── */
.text-xs-muted { font-size: 11px; color: var(--text-muted); }

/* ── Ligne négo close (atténuée) ── */
.nego-row--closed { opacity: .7; }

/* ── Bouton toggle (section close/ouverte) ── */
.btn-toggle {
  font-size: 12px;
  padding: 4px 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  cursor: pointer;
  color: var(--text-muted);
}
.btn-toggle:hover { background: var(--surface-2); }

/* ── Séparateur section négos closes ── */
.negos-closees-sep { margin-top: 16px; }

/* ── Panneau ajout compact ── */
.panel-inline--sm {
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 12px;
  margin-bottom: 14px;
}

/* ── Texte d'erreur inline dans panneau ── */
.error-text--sm { color: var(--danger); font-size: 12px; margin-bottom: 8px; }

/* ── Input recherche dans panneau vivier ── */
.vivier-search {
  width: 100%;
  box-sizing: border-box;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  margin-bottom: 8px;
  outline: none;
}
.vivier-search:focus { border-color: var(--primary); box-shadow: var(--focus-ring); }

/* ── Liste candidats (scroll) ── */
.vivier-candidates {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--white);
  margin-bottom: 8px;
}
.vivier-candidate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
}

/* ── Checkbox avec flex-shrink:0 ── */
.check-flex { flex-shrink: 0; cursor: pointer; }

/* ── Lien contact (vivier, commentaires) ── */
.link-name-primary { font-weight: 500; color: var(--primary); text-decoration: none; }

/* ── Date dans la ligne vivier ── */
.vivier-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* ── Rangée d'actions (flex gap-8) ── */
.action-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Flex-row gap-4 (inputs prochaine action) ── */
.flex-row--sm { display: flex; gap: 4px; flex-wrap: wrap; }

/* ── Inputs inline table négos ── */
.nego-input-prix { width: 90px; }
.nego-input-date { width: 120px; }
.nego-input-note { width: 140px; }
.nego-input-prix,
.nego-input-date,
.nego-input-note,
.nego-select {
  font-size: 12px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--white);
}

/* ── Ligne cliquable négo ── */
.nego-row         { cursor: pointer; }
.nego-row:hover td { background: var(--surface-2); }

/* ── Table négociations (13px) ── */
.negos-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.negos-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  padding: 0 8px 8px 0;
  white-space: nowrap;
}
.negos-table td {
  padding: 7px 8px 7px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.negos-table tr:last-child td { border-bottom: none; }

/* ═══════════════════════════════════════════════════
   Hamburger — masqué sur desktop
   ═══════════════════════════════════════════════════ */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-btn);
  flex-shrink: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s cubic-bezier(.4,0,.2,1), opacity .2s, width .2s;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28,25,23,.4);
  z-index: 99;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.sidebar-backdrop.open { display: block; }

/* ═══════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════ */

/* MacBook 13" — légèrement plus compact */
@media (max-width: 1360px) {
  :root { --sidebar-w: 224px; }
  .page-body { padding: 24px 28px; }
  .page-header { padding: 18px 28px; }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 208px; }
  .page-body { padding: 20px 24px; }
  .page-header { padding: 16px 24px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* Sidebar → drawer off-canvas (fond clair) */
  .sidebar {
    position: fixed !important;
    top: 0; left: 0;
    width: 280px !important;
    height: 100vh;
    height: 100dvh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1), box-shadow .28s;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    overflow-y: auto;
    min-height: unset !important;
    overscroll-behavior: contain;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 12px 0 48px rgba(0,0,0,.18);
  }
  .sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    overflow-x: visible;
    padding: 8px 12px;
    flex: 1;
  }
  .sidebar-nav a { padding: 13px 14px; font-size: 15px; }
  .sidebar-nav .nav-icon { font-size: 18px; }
  .sidebar-logo { padding: 22px 20px 16px; }
  .sidebar-footer { display: flex !important; flex-direction: column; }

  /* Layout */
  .hamburger-btn { display: flex; }
  .app { flex-direction: column; }
  .main { margin-left: 0; }

  /* Page header : sticky + compact */
  .page-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--white);
    box-shadow: 0 1px 8px rgba(0,0,0,.05);
    padding: 10px 14px !important;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;
  }
  .page-header > div { flex: 1; min-width: 0; }
  .page-header h2 {
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .page-header .sub { font-size: 11px; }
  .page-body { padding: 16px 14px !important; }

  /* Zones tactiles */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; }

  /* Tableaux */
  .table-wrapper { -webkit-overflow-scrolling: touch; border-radius: var(--radius-btn); }
  th { font-size: 10px; padding: 8px 10px; }
  td { padding: 10px; font-size: 13px; }

  /* Kanban */
  .kanban-board { gap: 10px; }
  .kanban-col { min-width: 210px; width: 210px; }

  /* Filtres */
  .filters { flex-wrap: wrap; }
  .filters .search-input { width: 100%; }

  /* Composants nouveaux — mobile */
  .bubble { max-width: 85%; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .modal { max-width: 100%; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: var(--radius-card) var(--radius-card) 0 0; max-height: 92dvh; overflow-y: auto; }
  .page-body { padding: 12px !important; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* ── Photos ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.photo-thumb-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-btn);
  overflow: hidden;
  background: var(--surface-2);
}

.photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  display: block;
  transition: opacity .15s, transform .2s;
}

.photo-thumb:hover { opacity: .9; transform: scale(1.02); }

.photo-thumb-wrap:hover .photo-delete-btn { opacity: 1; }

.photo-delete-btn {
  position: absolute;
  top: 6px; right: 6px;
  width: 28px; height: 28px;
  min-width: 28px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}

.photo-spinner {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.7);
  display: flex; align-items: center; justify-content: center;
}

.photo-status {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: rgba(255,255,255,.7);
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}

.photo-lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: var(--radius-btn);
}

.photo-lightbox-close {
  position: absolute;
  top: 16px; right: 20px;
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
  transition: background .15s;
}
.photo-lightbox-close:hover { background: rgba(255,255,255,.22); }

.photo-lightbox-counter {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.85);
  font-size: 13px;
  font-weight: 600;
  background: rgba(0,0,0,.35);
  padding: 4px 14px;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
}

.photo-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  font-size: 36px;
  width: 52px; height: 72px;
  cursor: pointer;
  border-radius: var(--radius-btn);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  line-height: 1;
}
.photo-lightbox-nav:hover { background: rgba(255,255,255,.25); }
.photo-lightbox-nav.prev { left: 12px; }
.photo-lightbox-nav.next { right: 12px; }

@media (max-width: 768px) {
  .photo-lightbox-nav { display: none; }
  .photo-lightbox { touch-action: pan-y; }
}

.photo-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-card);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  color: var(--text-light);
}

.photo-upload-zone:hover {
  border-color: var(--primary);
  background: var(--primary-tint);
  color: var(--primary);
}

/* Photos — page standalone (pas de sidebar) */
.photos-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px;
}

.photos-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: nowrap;
}
.photos-header-title { flex: 1; min-width: 0; }
.photos-header-title h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* FAB — bouton d'upload flottant (mobile) */
.photo-fab {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(184,50,26,.35);
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: transform .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.photo-fab:active { transform: scale(.9); box-shadow: 0 2px 8px rgba(184,50,26,.3); }

@media (max-width: 768px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .photo-delete-btn { opacity: 1; width: 38px; height: 38px; font-size: 16px; top: 5px; right: 5px; }
  .photos-page { padding: 12px; padding-bottom: 88px; }
  .photos-header { margin-bottom: 14px; }
  .photo-fab { display: flex; }
  .photo-upload-card { display: none; }
}

@media (max-width: 480px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}

/* ── Utilitaires bouton ── */
.btn-block { width: 100%; }

/* ── Spinner variantes ── */
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 28px; height: 28px; border-width: 3px; }
.btn-primary .spinner { border-color: rgba(255,255,255,.3); border-top-color: #fff; }

/* ── États génériques ── */
.page-loading { text-align: center; padding: 40px; }
.card-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-light);
}
.card-empty .empty-icon { display: flex; justify-content: center; margin-bottom: 12px; color: var(--text-muted); }
.card-flush { padding: 0 !important; overflow: hidden; }

/* ── Ligne de notification (centre notifications) ── */
.notif-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: var(--bg-hover, #f8fafc); }
.notif-row.unread { background: var(--primary-tint); }
.notif-row.unread:hover { background: var(--primary-tint); }
.notif-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--primary);
  display: flex;
  align-items: center;
}
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 14px; font-weight: 500; color: var(--text); }
.notif-title.unread { font-weight: 600; }
.notif-date { font-size: 12px; color: var(--text-light); margin-top: 3px; }
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 6px;
}

/* ── Task 3: Clinique — migration inline → classes ── */

/* Actions côté droit du page-header */
.page-header-actions { display: flex; gap: 10px; align-items: center; }

/* Wrapper de section kanban (Achats / Ventes) */
.board-section { margin-bottom: 32px; }

/* Indicateur champ requis dans les labels */
.form-required { color: var(--danger); }

/* Barre filtre / recherche (card + flex) */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding: 16px; margin-bottom: 16px; }

/* Gestion alias (modal catalogue) */
.alias-add-row  { display: flex; gap: 8px; margin-bottom: 8px; }
.alias-tags     { display: flex; gap: 6px; flex-wrap: wrap; }

/* Modal largeur md (520px) */
.modal--md { max-width: 520px; }

/* Modal largeur lg (560px) */
.modal--lg { max-width: 560px; }

/* Bouton ghost rouge (supprimer en modal) */
.btn-ghost-danger { color: var(--danger); margin-right: auto; }

/* Admin — formulaire d'invitation */
.admin-invite-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.admin-invite-form .form-group { margin: 0; }
.admin-invite-email { flex: 1; min-width: 200px; }
.admin-invite-role  { width: 180px; }

/* Admin — messages de retour inline */
.feedback-error   { font-size: 13px; color: var(--danger);  margin-top: 10px; }
.feedback-success { font-size: 13px; color: var(--success); margin-top: 10px; }

/* Admin — sélecteur rôle compact */
.form-control-sm { height: auto; width: auto; padding: 4px 8px; font-size: 13px; }

/* Admin — cellule vide dans table */
.table-empty-cell { text-align: center; color: var(--text-light); padding: 24px; }

/* Admin — QR d'appairage WhatsApp */
.qr-panel   { padding: 16px 20px; border-top: 1px solid var(--border); }
.qr-panel p { margin: 0 0 12px; font-size: 14px; }
.qr-img     { width: 240px; height: 240px; display: block; }

/* Import CSV — zone actions et rapport */
.import-actions { margin-top: 16px; display: flex; align-items: center; gap: 12px; }
.import-hint    { font-size: 13px; color: var(--danger); }
.import-errors-block { margin-top: 12px; }

/* ── Task 4: Dashboard + Contacts — migration inline → classes ── */

/* Layout deux colonnes (top acheteurs | CRM) */
.dashboard-col-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
  align-items: start;
}

/* Grille mini KPI CRM (intérêts + négos) */
.crm-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

/* Statistiques campagne */
.campagne-stat-row { display: flex; gap: 24px; padding: 16px; }
.campagne-stat-value { font-size: 24px; font-weight: 700; line-height: 1; color: var(--text); }
.campagne-stat-value--success { color: var(--success); }
.campagne-stat-value--primary { color: var(--primary); }
.campagne-stat-label { font-size: 11px; color: var(--text-light); margin-top: 3px; }

/* Liste d'alertes relance scrollable */
.alert-scroll { max-height: 240px; overflow-y: auto; }

/* État vide relances (toutes négos actives) */
.relance-all-ok {
  padding: 20px;
  text-align: center;
  color: var(--success);
  font-size: 13px;
  font-weight: 600;
}

/* Spinner XL (32 px — dashboard) */
.spinner-xl { width: 32px; height: 32px; border-width: 3px; }

/* Page loading avec grand padding (dashboard) */
.page-loading-lg { text-align: center; padding: 60px; }

/* Card contenant le canvas Chart.js funnel */
.card-funnel { padding: 20px; }

/* KPI card cliquable (lien vers page) */
.kpi-card--link { cursor: pointer; }

/* Sous-info dans les card-header */
.card-header-sub { font-size: 12px; color: var(--text-light); }

/* Lien fiche contact dans tableau (nom souligné) */
.table-name-link { color: inherit; text-decoration: underline dotted; }

/* État vide campagne */
.campagne-empty { padding: 20px; text-align: center; color: var(--text-light); font-size: 13px; }

/* ── Task 4.5: Contacts — migration derniers styles inline vers classes ── */

/* Input recherche largeur réduite */
.search-input--narrow { max-width: 280px; }

/* Label filtre checkbox (À compléter, etc.) */
.filter-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-light);
  cursor: pointer;
}

/* Spacing entre badges côte à côte (rôles contact) — scopé aux cellules de table */
td .badge + .badge { margin-left: 4px; }

/* Groupe de checkboxes en ligne (rôles modal) */
.form-checkbox-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Label checkbox (rôles modal) */
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Input texte en majuscules (pays, codes) */
.input-uppercase {
  text-transform: uppercase;
}

@media (max-width: 1023px) {
  .dashboard-col-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .crm-tiles { grid-template-columns: 1fr; }
  .campagne-stat-row { flex-wrap: wrap; gap: 16px; }
}

/* ============================================================
   Toast d'erreur de chargement (créé par signalerErreur, supabase-client.js)
   ============================================================ */
.toast-erreur {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 12px);
  max-width: 420px;
  padding: 12px 20px;
  background: #7f1d1d;
  color: #fef2f2;
  font-size: 13px;
  line-height: 1.4;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 1000;
}
.toast-erreur--visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================================
   Résumé IA de conversation (fiche contact + page opportunité)
   ============================================================ */
.resume-ia-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.resume-ia-head .card-section-title { margin-bottom: 0; flex: 1; }
.resume-ia-attente {
  font-size: 12px;
  color: var(--text-muted, #78716c);
  font-style: italic;
}
.resume-ia-texte {
  white-space: pre-line;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text, #1c1917);
  margin-top: 10px;
}
.resume-ia-texte--sm {
  font-size: 12px;
  margin-top: 6px;
  max-width: 420px;
}
.resume-ia-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted, #78716c);
}
.resume-ia-vide {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted, #78716c);
}
.resume-ia-toggle {
  font-size: 12px;
  padding: 2px 0;
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════════
   Ajout manuel d'intérêts (fiche contact) + fiche produit
   ══════════════════════════════════════════════════════════════ */
.interet-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.interet-add-row .form-control { flex: 1; min-width: 0; }
.interet-add-row .btn          { flex-shrink: 0; }

.action-row--mt { margin-top: 10px; }

@media (max-width: 480px) {
  .interet-add-row { flex-direction: column; align-items: stretch; }
  .interet-add-row .btn { width: 100%; }
}

/* Variante : table à 6 colonnes — défile au lieu de comprimer ses en-têtes.
   Pas de colonne d'action ici : on neutralise la dernière colonne collante
   (règle globale `table th:last-child`), qui viendrait recouvrir les colonnes
   du milieu pendant le défilement horizontal. */
.negos-table--wide       { min-width: 720px; }
.negos-table--wide th,
.negos-table--wide td    { white-space: nowrap; padding-right: 14px; }
.negos-table--wide th:last-child,
.negos-table--wide td:last-child {
  position: static;
  background: transparent;
  box-shadow: none;
}
