/* Police DM Sans auto-hébergée — remplace l'appel externe à Google Fonts,
   même correctif que côté FR (SRI impossible sur Google Fonts : le contenu
   servi varie selon le navigateur). Fichiers à déposer dans un dossier
   fonts/ à la racine, à côté d'index.html — mêmes fichiers que la version
   FR, réutilisables tels quels. */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/dm-sans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/dm-sans-500.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/dm-sans-600.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/dm-sans-700.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/dm-sans-400-italic.woff2') format('woff2');
}

:root {
  --crm-primary: #385D8D;
  --crm-primary-light: #5B7C99;
  --crm-secondary: #06b6d4;
  --crm-accent: #f59e0b;
  --crm-bg: #f8fafc;
  --crm-bg-alt: #f1f5f9;
  --crm-card: #ffffff;
  --crm-border: #e2e8f0;
  --crm-text: #0f172a;
  --crm-text-muted: #64748b;
  --crm-text-light: #94a3b8;
  --crm-success: #10b981;
  --crm-danger: #ef4444;
  --crm-warning: #f59e0b;
  --crm-info: #3b82f6;
  --crm-purple: #385D8D;
  --crm-radius: 14px;
  --crm-radius-sm: 8px;
  --crm-radius-lg: 20px;
  --crm-radius-xl: 28px;
  --crm-shadow: 0 4px 16px rgba(0,0,0,0.07);
  --crm-shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
  --crm-sidebar-w: 200px;
  --crm-sidebar-w-sm: 80px;
  --dm-bg: #f1f5f9;
  --dm-surface: #ffffff;
  --dm-border: #e2e8f0;
  --dm-text: #1e293b;
  --dm-muted: #64748b;
  --dm-sidebar: #ffffff;
  --dm-header: #ffffff;
  --dm-input-bg: #ffffff;
  --dm-input-bd: #e2e8f0;
  --dm-th: #f8fafc;
  --dm-tr-hover: #f8fafc;
}
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
html {
  overscroll-behavior: none;
}
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--crm-bg);
  color: var(--crm-text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--crm-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
.auth-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #385D8D 0%, #06b6d4 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}
.auth-card {
  background: var(--crm-card);
  padding: 40px;
  border-radius: var(--crm-radius-xl);
  width: 90%;
  max-width: 460px;
  text-align: center;
  box-shadow: 0 24px 48px rgba(0,0,0,0.2);
}
.auth-logo {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--crm-primary), var(--crm-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.auth-tagline {
  font-size: 13px;
  color: var(--crm-text-muted);
  margin-bottom: 28px;
}
.auth-card h2 {
  margin-bottom: 24px;
  font-size: 20px;
  color: var(--crm-text);
}
.auth-card input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--crm-bg);
}
.auth-card input:focus {
  outline: none;
  border-color: var(--crm-primary);
  box-shadow: 0 0 0 3px rgba(56,93,141,0.15);
}
.auth-card .btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(90deg, var(--crm-primary), var(--crm-secondary));
  color: white;
  border: none;
  border-radius: var(--crm-radius);
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  font-size: 15px;
  transition: opacity 0.2s, transform 0.2s;
}
.auth-card .btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
.auth-switch {
  margin-top: 20px;
  color: var(--crm-text-muted);
  font-size: 14px;
}
.auth-switch a {
  color: var(--crm-primary);
  cursor: pointer;
  font-weight: 500;
}
.auth-forgot {
  font-size: 13px;
  color: var(--crm-text-muted);
  cursor: pointer;
  margin-top: 8px;
  display: inline-block;
}
.auth-forgot:hover { color: var(--crm-primary); }
.password-wrapper {
  position: relative;
  margin-bottom: 14px;
}
.password-wrapper input {
  margin-bottom: 0;
  padding-right: 48px;
}
.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--crm-text-muted);
  padding: 4px;
}
.crm-container {
  display: flex;
  min-height: 100vh;
}
@media (min-width: 1025px) {
  .crm-sidebar {
    width: var(--crm-sidebar-w);
    background: var(--crm-card);
    border-right: 1px solid var(--crm-border);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width 0.2s;
  }
  .crm-logo {
    padding: 22px 20px;
    border-bottom: 1px solid var(--crm-border);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, var(--crm-primary), var(--crm-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .crm-logo-img { height: 80px; width: auto; max-width: none; display: block; }
  .crm-nav { padding: 16px 12px; flex: 1; }
  .crm-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    margin-bottom: 4px;
    border-radius: var(--crm-radius-sm);
    color: var(--crm-text-muted);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
  }
  .crm-nav-item:hover {
    background: rgba(56,93,141,0.08);
    color: var(--crm-primary);
  }
  .crm-nav-item.active {
    background: linear-gradient(90deg, rgba(56,93,141,0.12), rgba(6,182,212,0.08));
    color: var(--crm-primary);
    font-weight: 600;
  }
  .nav-icon { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
  .nav-icon svg { width: 18px; height: 18px; stroke: currentColor; transition: stroke 0.15s; }
  .nav-label { font-size: 13px; font-weight: 500; }
  .crm-main {
    flex: 1;
    margin-left: var(--crm-sidebar-w);
    padding: 28px 36px;
    min-width: 0;
  }
}
@media (max-width: 1024px) {
  .crm-sidebar {
    width: var(--crm-sidebar-w-sm);
    background: var(--crm-card);
    border-right: 1px solid var(--crm-border);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 100;
  }
  .crm-logo {
    padding: 14px 8px;
    border-bottom: 1px solid var(--crm-border);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(90deg, var(--crm-primary), var(--crm-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .crm-logo-img { height: 56px; width: auto; max-width: none; display: block; }
  .crm-nav { padding: 8px 6px; flex: 1; }
  .crm-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 0;
    margin-bottom: 2px;
    border-radius: var(--crm-radius-sm);
    color: var(--crm-text-muted);
    cursor: pointer;
    transition: all 0.15s;
  }
  .crm-nav-item:hover {
    background: rgba(56,93,141,0.08);
    color: var(--crm-primary);
  }
  .crm-nav-item.active {
    background: rgba(56,93,141,0.12);
    color: var(--crm-primary);
  }
  .nav-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
  .nav-icon svg { width: 20px; height: 20px; stroke: currentColor; }
  .nav-label {
    font-size: 10px;
    font-weight: 500;
    display: block;
    word-break: break-word;
    text-align: center;
    line-height: 1.2;
  }
  .crm-main {
    flex: 1;
    margin-left: var(--crm-sidebar-w-sm);
    padding: 20px 16px;
    min-width: 0;
  }
}
.nav-separator {
  height: 1px;
  background: var(--crm-border);
  margin: 8px 12px;
  opacity: 0.6;
}
.crm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--crm-border);
  flex-wrap: wrap;
  gap: 14px;
}
.crm-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--crm-text);
}
#globalSearch {
  padding: 9px 18px;
  border-radius: 40px;
  border: 1px solid var(--crm-border);
  width: 240px;
  font-size: 14px;
  background: var(--crm-card);
  transition: all 0.2s;
  margin-right: auto;
}
#globalSearch:focus {
  outline: none;
  border-color: var(--crm-primary);
  box-shadow: 0 0 0 3px rgba(56,93,141,0.12);
  width: 280px;
}
.crm-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--crm-card);
  border-radius: 40px;
  border: 1px solid var(--crm-border);
}
.crm-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
  background: linear-gradient(135deg, var(--crm-primary), var(--crm-secondary));
  flex-shrink: 0;
}
#userEmail {
  font-size: 13px;
  color: var(--crm-text-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.logout-btn {
  background: none;
  border: 1px solid var(--crm-border);
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  color: var(--crm-text-muted);
}
.logout-btn:hover {
  background: var(--crm-danger);
  color: white;
  border-color: var(--crm-danger);
}
#darkModeToggle {
  background: none;
  border: 1px solid var(--crm-border);
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}
.online-status {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.online-status.online {
  background: var(--crm-success);
  box-shadow: 0 0 0 2px rgba(16,185,129,0.25);
}
.online-status.offline { background: var(--crm-danger); }
.offline-queue-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--crm-warning, #b45309);
  background: rgba(180,83,9,0.1);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.bg-load-indicator {
  font-size: 14px;
  font-weight: 600;
  color: var(--crm-primary);
  background: rgba(37,99,235,0.10);
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.pending-marker {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--crm-warning, #b45309);
  background: rgba(180,83,9,0.1);
  padding: 1px 8px;
  border-radius: 999px;
  vertical-align: middle;
}
.crm-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--crm-card);
  border-radius: var(--crm-radius-lg);
  padding: 22px;
  border: 1px solid var(--crm-border);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--crm-shadow);
}
.stat-card h3 {
  font-size: 12px;
  color: var(--crm-text-muted);
  margin-bottom: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--crm-primary);
  line-height: 1;
}
.stat-trend {
  font-size: 12px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-trend.up { color: var(--crm-success); }
.stat-trend.down { color: var(--crm-danger); }
.stats-mini {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.stat-mini-card {
  background: var(--crm-card);
  border-radius: var(--crm-radius);
  padding: 16px;
  border: 1px solid var(--crm-border);
  text-align: center;
}
.stat-mini-card .value {
  font-size: 22px;
  font-weight: 700;
  color: var(--crm-primary);
}
.stat-mini-card .label {
  font-size: 12px;
  color: var(--crm-text-muted);
  margin-top: 4px;
}
.welcome-banner {
  background: linear-gradient(135deg, rgba(56,93,141,0.08), rgba(6,182,212,0.05));
  border-radius: var(--crm-radius);
  padding: 14px 20px;
  margin-bottom: 20px;
  border-left: 4px solid var(--crm-primary);
  font-size: 14px;
  color: var(--crm-text);
}
.vat-alert {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: var(--crm-radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 10px;
}
.vat-alert .vat-alert-icon { font-size: 18px; flex-shrink: 0; }
.btn-add, .btn-export, .btn-import, .btn-filter,
.btn-primary, .btn-secondary, .btn-danger, .btn-success {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--crm-radius-sm);
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
  border: none;
  white-space: nowrap;
}
.btn-add, .btn-primary {
  background: var(--crm-primary);
  color: white;
}
.btn-add:hover, .btn-primary:hover {
  background: #5b21b6;
  transform: translateY(-1px);
}
.btn-export, .btn-success {
  background: var(--crm-success);
  color: white;
}
.btn-export:hover, .btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}
.btn-import {
  background: var(--crm-info);
  color: white;
}
.btn-import:hover {
  background: #2563eb;
  transform: translateY(-1px);
}
.btn-filter, .btn-secondary {
  background: var(--crm-card);
  color: var(--crm-text);
  border: 1px solid var(--crm-border);
}
.btn-filter:hover, .btn-secondary:hover {
  background: var(--crm-bg);
}
.btn-danger {
  background: var(--crm-danger);
  color: white;
}
.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}
.btn-icon {
  background: none;
  border: 1px solid var(--crm-border);
  width: 34px;
  height: 34px;
  border-radius: var(--crm-radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.15s;
  color: var(--crm-text-muted);
}
.btn-icon:hover {
  background: var(--crm-bg);
  color: var(--crm-primary);
  border-color: var(--crm-primary);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  pointer-events: none;
}
.search-bar, .filter-select {
  padding: 10px 16px;
  border-radius: var(--crm-radius-sm);
  border: 1px solid var(--crm-border);
  font-size: 14px;
  background: var(--crm-card);
  color: var(--crm-text);
  transition: all 0.2s;
  width: 100%;
}
.search-bar:focus, .filter-select:focus {
  outline: none;
  border-color: var(--crm-primary);
  box-shadow: 0 0 0 3px rgba(56,93,141,0.12);
}
.filter-group {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-select { flex: 1; min-width: 120px; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
  color: var(--crm-text);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--crm-card);
  color: var(--crm-text);
  transition: all 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--crm-primary);
  box-shadow: 0 0 0 3px rgba(56,93,141,0.12);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.product-type-row { display: flex; gap: 10px; margin-bottom: 10px; }
.product-type-opt {
flex: 1;
display: flex;
align-items: center;
gap: 8px;
padding: 12px;
border: 1.5px solid var(--crm-border);
border-radius: var(--crm-radius-sm);
background: var(--crm-card);
font-size: 14px;
font-weight: 600;
cursor: pointer;
transition: all 0.15s;
}
.product-type-opt:has(input:checked) { border-color: var(--crm-primary); background: rgba(56,93,141,0.1); }
.product-type-opt input { accent-color: var(--crm-primary); }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-hint {
  font-size: 12px;
  color: var(--crm-text-muted);
  margin-top: 4px;
}
.contacts-table {
  background: var(--crm-card);
  border-radius: var(--crm-radius-lg);
  border: 1px solid var(--crm-border);
  overflow-x: auto;
  margin-bottom: 24px;
}
.contacts-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
.contacts-table th,
.contacts-table td {
  padding: 13px 12px;
  text-align: left;
  border-bottom: 1px solid var(--crm-border);
  border-right: 1px solid var(--crm-border);
  font-size: 14px;
}
.contacts-table th:last-child,
.contacts-table td:last-child { border-right: none; }
@media (min-width: 1025px) {
.contacts-table th:last-child,
.contacts-table td:last-child {
  width: 160px;
  padding-right: 8px;
  white-space: nowrap;
}
.contacts-table td.col-value {
  min-width: 130px;
}
}
.contacts-table th {
  background: var(--crm-bg);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted);
  position: sticky;
  top: 0;
  z-index: 1;
}
.contacts-table tr:last-child td { border-bottom: none; }
.contacts-table tr:hover td {
  background: rgba(56,93,141,0.03);
}
.contact-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
/* Status badges — both English (current data values: lead / contacted /
   customer) and the legacy French class names are kept as aliases so
   nothing breaks if older records or other code still reference them. */
.status-lead, .status-prospect { background: #fef3c7; color: #d97706; }
.status-contacted, .status-contact { background: #dbeafe; color: #2563eb; }
.status-customer, .status-client { background: #d1fae5; color: #059669; }
.score-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  min-width: 68px;
  white-space: nowrap;
}
/* Priority badges — same English/French alias logic as status above.
   script.js generates score-hot / score-warm / score-cold from
   contact.score, so these are the ones that must exist for the badge
   background colour to actually show up. */
.score-hot, .score-chaud { background: #fee2e2; color: #b91c1c; }
.score-warm, .score-tiede { background: #ffedd5; color: #b45309; }
.score-cold, .score-froid { background: #e0e7ff; color: #1e40af; }
.health-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.health-bar {
  width: 60px;
  height: 6px;
  background: var(--crm-border);
  border-radius: 3px;
  overflow: hidden;
}
.health-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.health-fill.high { background: var(--crm-success); }
.health-fill.medium { background: var(--crm-warning); }
.health-fill.low { background: var(--crm-danger); }
#columnsConfigList {
  max-height: 380px;
  overflow-y: auto;
  margin-bottom: 20px;
}
.column-config-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--crm-border);
  gap: 10px;
}
.column-config-item label {
  font-size: 14px;
  cursor: pointer;
  flex: 1;
  color: var(--crm-text);
}
.column-config-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--crm-primary);
}
.col-resizer {
  position: absolute;
  right: 0;
  top: 0;
  width: 5px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  background: transparent;
}
.col-resizer:hover { background: rgba(56,93,141,0.3); }
.crm-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 16px;
}
.crm-modal.active { display: flex; }
.modal-content {
  background: var(--crm-card);
  border-radius: var(--crm-radius-xl);
  width: 100%;
  max-width: 660px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: var(--crm-shadow-lg);
  animation: modalIn 0.2s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-content h3 {
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: 700;
  color: var(--crm-text);
}
.modal-content input,
.modal-content select,
.modal-content textarea {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  font-family: inherit;
  font-size: 14px;
  background: var(--crm-card);
  color: var(--crm-text);
  transition: all 0.2s;
}
.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
  outline: none;
  border-color: var(--crm-primary);
  box-shadow: 0 0 0 3px rgba(56,93,141,0.12);
}
.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  flex-wrap: wrap;
}
.devis-table-wrap {
  overflow-x: auto;
  margin-bottom: 16px;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
}
.devis-lines-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
.devis-lines-table th {
  background: var(--crm-bg);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted);
  text-align: left;
  border-bottom: 1px solid var(--crm-border);
}
.devis-lines-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--crm-border);
  vertical-align: middle;
}
.devis-lines-table tr:last-child td { border-bottom: none; }
.devis-lines-table input,
.devis-lines-table select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--crm-border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--crm-card);
  color: var(--crm-text);
  transition: border-color 0.2s;
}
.devis-lines-table input:focus,
.devis-lines-table select:focus {
  outline: none;
  border-color: var(--crm-primary);
}
.devis-line-total {
  font-weight: 600;
  color: var(--crm-primary);
  white-space: nowrap;
  text-align: right;
}
.devis-totals {
  background: var(--crm-bg);
  border-radius: var(--crm-radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}
.devis-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--crm-border);
}
.devis-total-row:last-child {
  border-bottom: none;
  font-weight: 700;
  font-size: 16px;
  color: var(--crm-primary);
  margin-top: 4px;
}
.inv-card {
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s;
}
.inv-card:hover { box-shadow: var(--crm-shadow); }
.inv-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.inv-number {
  font-family: monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--crm-primary);
  margin-right: 10px;
}
.inv-client {
  font-size: 14px;
  font-weight: 600;
  color: var(--crm-text);
}
.inv-amounts {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--crm-text-muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.inv-ttc {
  font-weight: 600;
  color: var(--crm-text);
}
.inv-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.inv-btn {
  padding: 7px 14px;
  border-radius: var(--crm-radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--crm-border);
  background: var(--crm-card);
  color: var(--crm-text);
  transition: all 0.15s;
}
.inv-btn:hover { background: var(--crm-bg); }
.inv-btn-green { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.inv-btn-green:hover { background: #a7f3d0; }
.inv-btn-purple { background: #385D8D; color: #fff; }
.inv-btn-purple:hover { background: rgba(56,93,141,0.85); }
.inv-btn-blue { background: #2563eb; color: #fff; }
.inv-btn-orange { background: #fed7aa; color: #9a3412; border-color: #fdba74; }
.inv-btn-orange:hover { background: #fdba74; }
.inv-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.inv-status-draft { background: #f1f5f9; color: #64748b; }
.inv-status-sent { background: #dbeafe; color: #1d4ed8; }
.inv-status-accepted { background: #d1fae5; color: #065f46; }
.inv-status-invoiced { background: #ede9fe; color: #5b21b6; }
.inv-status-paid { background: #d1fae5; color: #047857; }
.inv-status-overdue { background: #fee2e2; color: #b91c1c; }
.inv-status-credit_note { background: #fef3c7; color: #92400e; }
.inv-relance-badge { font-size: 10px; background: #fef3c7; color: #92400e; padding: 2px 6px; border-radius: 8px; margin-left: 6px; }
.inv-echu-badge { font-size: 10px; background: #fee2e2; color: #991b1b; padding: 2px 6px; border-radius: 8px; margin-left: 6px; }
.inv-pl-badge { font-size: 10px; background: #d1fae5; color: #065f46; padding: 2px 6px; border-radius: 8px; margin-left: 6px; cursor: help; }
.inv-due { font-size: 11px; color: var(--crm-text-muted); margin-left: 6px; }
.inv-card-echu { border-left: 3px solid #ef4444; }
.product-card {
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: box-shadow 0.15s;
}
.product-card:hover { box-shadow: var(--crm-shadow); }
.product-card-clickable { cursor: pointer; }
.product-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--crm-text);
}
.product-desc {
  font-size: 12px;
  color: var(--crm-text-muted);
  margin-top: 2px;
}
.product-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--crm-primary);
  white-space: nowrap;
}
.product-vat {
  font-size: 11px;
  color: var(--crm-text-muted);
}
.product-right { text-align: right; flex-shrink: 0; }
.product-actions { margin-top: 8px; display: flex; gap: 6px; justify-content: flex-end; }
.product-ref { font-size: 11px; color: var(--crm-text-muted); }
.timeline {
  position: relative;
  padding-left: 24px;
  margin-top: 16px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--crm-border);
}
.timeline-item {
  position: relative;
  margin-bottom: 16px;
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  padding: 12px 14px;
  transition: box-shadow 0.15s;
}
.timeline-item:hover { box-shadow: var(--crm-shadow); }
.timeline-dot {
  position: absolute;
  left: -20px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--crm-card);
  flex-shrink: 0;
}
.timeline-dot.note { background: var(--crm-info); }
.timeline-dot.call { background: var(--crm-success); }
.timeline-dot.email { background: var(--crm-accent); }
.timeline-dot.appointment { background: var(--crm-primary); }
.timeline-dot.quote { background: var(--crm-warning); }
.timeline-type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--crm-text-muted);
  margin-bottom: 4px;
}
.timeline-content {
  font-size: 14px;
  color: var(--crm-text);
  line-height: 1.5;
}
.timeline-date {
  font-size: 11px;
  color: var(--crm-text-light);
  margin-top: 4px;
}
.timeline-empty { color: var(--crm-text-muted); font-size: 13px; }
.timeline-title { margin-bottom: 12px; }
.ai-assistant {
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 420px;
}
.ai-assistant-header {
  padding: 14px 18px;
  background: linear-gradient(90deg, var(--crm-primary), var(--crm-secondary));
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
}
.ai-badge {
  background: rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ai-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
}
.ai-message.user {
  background: var(--crm-primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.ai-message.assistant {
  background: var(--crm-bg);
  color: var(--crm-text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--crm-border);
}
.ai-message.loading {
  background: var(--crm-bg);
  align-self: flex-start;
  border: 1px solid var(--crm-border);
}
.ai-typing-dots {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}
.ai-typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--crm-text-muted);
  border-radius: 50%;
  animation: dotPulse 1.4s infinite;
}
.ai-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}
.ai-input-row {
  padding: 12px 14px;
  border-top: 1px solid var(--crm-border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.ai-input-row input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--crm-border);
  border-radius: 20px;
  font-size: 14px;
  background: var(--crm-bg);
  color: var(--crm-text);
  font-family: inherit;
  transition: border-color 0.2s;
}
.ai-input-row input:focus {
  outline: none;
  border-color: var(--crm-primary);
}
.ai-send-btn {
  background: var(--crm-primary);
  color: white;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.ai-send-btn:hover { background: #5b21b6; }
.ai-suggestions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 14px;
  border-top: 1px solid var(--crm-border);
}
.ai-suggestion-chip {
  padding: 5px 12px;
  background: rgba(56,93,141,0.08);
  color: var(--crm-primary);
  border: 1px solid rgba(56,93,141,0.2);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ai-suggestion-chip:hover {
  background: rgba(56,93,141,0.16);
}
.ai-summary {
  background: linear-gradient(135deg, rgba(56,93,141,0.06), rgba(6,182,212,0.04));
  border: 1px solid rgba(56,93,141,0.2);
  border-radius: var(--crm-radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--crm-text);
  line-height: 1.6;
}
.ai-summary-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--crm-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.kanban-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}
.kanban-column {
  background: var(--crm-bg);
  border-radius: var(--crm-radius);
  padding: 16px;
  min-height: 400px;
  border: 2px dashed transparent;
  transition: border-color 0.2s;
}
.kanban-column.drag-over {
  border-color: var(--crm-primary);
  background: rgba(56,93,141,0.04);
}
.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.kanban-column h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--crm-text);
}
.kanban-count {
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--crm-text-muted);
}
.kanban-total {
  font-size: 12px;
  color: var(--crm-primary);
  font-weight: 600;
}
.kanban-card {
  background: var(--crm-card);
  border-radius: var(--crm-radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--crm-border);
  cursor: grab;
  transition: all 0.2s;
  user-select: none;
}
.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.kanban-card:active { cursor: grabbing; opacity: 0.7; }
.kanban-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}
.kanban-company { font-size: 12px; color: var(--crm-text-muted); }
.kanban-value { font-size: 12px; color: var(--crm-primary); font-weight: 600; margin-top: 6px; }
.kanban-score { margin-top: 6px; }
.wf-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
}
.wf-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--crm-border);
  background: var(--crm-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--crm-text-muted);
  transition: all 0.2s;
  flex-shrink: 0;
}
.wf-dot.active {
  border-color: var(--crm-primary);
  background: var(--crm-primary);
  color: white;
}
.wf-dot.done {
  border-color: var(--crm-success);
  background: var(--crm-success);
  color: white;
}
.wf-step-line {
  flex: 1;
  height: 2px;
  background: var(--crm-border);
  max-width: 60px;
}
.wf-step-labels {
  display: flex;
  justify-content: space-around;
  margin-bottom: 24px;
}
.wf-step-lbl {
  font-size: 12px;
  color: var(--crm-text-muted);
  text-align: center;
  transition: color 0.2s;
}
.wf-step-lbl.active { color: var(--crm-primary); font-weight: 600; }
.wf-step-lbl.done { color: var(--crm-success); }
.wf-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.wf-choice-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.wf-choice-card {
  background: var(--crm-bg);
  border: 2px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  padding: 16px 14px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.wf-choice-card:hover {
  border-color: var(--crm-primary);
  background: rgba(56,93,141,0.04);
}
.wf-choice-card.selected {
  border-color: var(--crm-primary);
  background: rgba(56,93,141,0.08);
}
.wf-choice-icon { font-size: 24px; margin-bottom: 8px; }
.wf-choice-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--crm-text);
}
.wf-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 6px;
}
.wf-pill-trigger { background: #dbeafe; color: #1d4ed8; }
.wf-pill-condition { background: #fef3c7; color: #d97706; }
.wf-pill-action { background: #d1fae5; color: #065f46; }
.wf-rule-card {
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.wf-rule-card:hover { box-shadow: var(--crm-shadow); }
.wf-rule-left { flex: 1; }
.wf-rule-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.wf-rule-arrow {
  font-size: 18px;
  color: var(--crm-text-muted);
  margin: 4px 0;
}
.wf-rule-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.wf-badge-active {
  background: #d1fae5;
  color: #065f46;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.wf-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--crm-text-muted);
  transition: color 0.15s;
  padding: 4px;
}
.wf-delete-btn:hover { color: var(--crm-danger); }
.wf-param-block { margin-top: 14px; }
.wf-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--crm-text);
  margin-bottom: 6px;
}
.wf-required { color: var(--crm-danger); }
.wf-input, .wf-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--crm-card);
  color: var(--crm-text);
  transition: border-color 0.2s;
}
.wf-input:focus, .wf-textarea:focus {
  outline: none;
  border-color: var(--crm-primary);
  box-shadow: 0 0 0 3px rgba(56,93,141,0.1);
}
.wf-textarea { min-height: 80px; resize: vertical; }
.wf-hint {
  font-size: 12px;
  color: var(--crm-text-muted);
  margin-top: 6px;
}
.wf-hint code {
  background: var(--crm-bg);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11px;
}
.wf-status-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.wf-status-btn {
  padding: 8px 16px;
  border: 2px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  background: var(--crm-card);
  color: var(--crm-text);
  transition: all 0.15s;
}
.wf-status-btn.selected {
  border-color: var(--crm-primary);
  background: rgba(56,93,141,0.08);
  color: var(--crm-primary);
}
.wf-info-block {
  background: var(--crm-bg);
  border-radius: var(--crm-radius-sm);
  padding: 16px;
  text-align: center;
}
.wf-info-icon { font-size: 32px; margin-bottom: 8px; }
.wf-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--crm-text-muted);
}
.wf-empty-icon { font-size: 48px; margin-bottom: 12px; }
.wf-empty-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--crm-text); }
.wf-empty-sub { font-size: 14px; }
.wf-detail-text { font-size: 12px; color: var(--crm-text-muted); }
.wf-back-btn { display: none; }
.wf-save-btn { display: none; }
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}
.chart-card {
  background: var(--crm-card);
  border-radius: var(--crm-radius-lg);
  padding: 22px;
  border: 1px solid var(--crm-border);
}
.chart-card h3 {
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--crm-text);
}
.chart-card canvas {
  max-height: 250px;
  width: 100%;
}
.funnel-card { grid-column: span 2; }
.funnel-steps {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
  flex-wrap: wrap;
  gap: 16px;
}
.funnel-step {
  text-align: center;
  flex: 1;
  min-width: 100px;
  padding: 16px;
  background: var(--crm-bg);
  border-radius: var(--crm-radius);
  border: 1px solid var(--crm-border);
}
.funnel-step .count {
  font-size: 28px;
  font-weight: 700;
  color: var(--crm-primary);
}
.funnel-step .label {
  font-size: 13px;
  color: var(--crm-text-muted);
  margin-top: 6px;
}
.funnel-step .percent {
  font-size: 12px;
  color: var(--crm-success);
  margin-top: 4px;
}
.funnel-empty { text-align: center; color: var(--crm-text-muted); font-size: 13px; padding: 20px; }
.ai-weekly-comment {
  background: linear-gradient(135deg, rgba(56,93,141,0.06), rgba(6,182,212,0.04));
  border: 1px solid rgba(56,93,141,0.2);
  border-radius: var(--crm-radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--crm-text);
}
.appointment-container { max-width: 1100px; }
.appointment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 36px;
}
.appointment-calendar {
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-lg);
  padding: 20px;
}
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.calendar-header h3 {
  font-size: 16px;
  font-weight: 600;
}
.calendar-header button {
  background: none;
  border: 1px solid var(--crm-border);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  color: var(--crm-text);
}
.calendar-header button:hover {
  background: var(--crm-bg);
  border-color: var(--crm-primary);
}
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  color: var(--crm-text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
  color: var(--crm-text);
}
.calendar-day:hover { background: rgba(56,93,141,0.12); }
.calendar-day.selected {
  background: var(--crm-primary);
  color: white;
  font-weight: 600;
}
.calendar-day.today {
  border: 2px solid var(--crm-primary);
  color: var(--crm-primary);
  font-weight: 600;
}
.calendar-day.has-appointment {
  border: 2px solid var(--crm-warning);
  font-weight: 600;
}
.calendar-day.disabled {
  color: var(--crm-text-light);
  cursor: not-allowed;
  opacity: 0.4;
}
.appointment-form {
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-lg);
  padding: 22px;
}
.appointments-upcoming { margin-top: 40px; }
#obOverlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}
#obModal {
  background: var(--crm-card);
  border-radius: var(--crm-radius-xl);
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 36px;
  box-shadow: 0 32px 64px rgba(0,0,0,0.25);
}
.ob-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.ob-logo {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--crm-primary), var(--crm-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ob-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--crm-text);
  margin: 0;
}
.ob-subtitle {
  font-size: 13px;
  color: var(--crm-text-muted);
  margin: 2px 0 0;
}
.ob-progress-bar {
  height: 6px;
  background: var(--crm-border);
  border-radius: 3px;
  margin-bottom: 10px;
  overflow: hidden;
}
.ob-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--crm-primary), var(--crm-secondary));
  border-radius: 3px;
  transition: width 0.4s ease;
}
.ob-progress-fill-start { width: 20%; }
.ob-steps-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 28px;
}
.ob-step-lbl {
  font-size: 11px;
  color: var(--crm-text-light);
  text-align: center;
  flex: 1;
  transition: color 0.2s;
}
.ob-step-lbl.active { color: var(--crm-primary); font-weight: 600; }
.ob-step-lbl.done { color: var(--crm-success); }
.ob-content { min-height: 280px; }
.ob-step-intro { text-align: center; margin-bottom: 24px; }
.ob-step-icon { font-size: 40px; margin-bottom: 10px; }
.ob-step-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--crm-text);
  margin-bottom: 8px;
}
.ob-step-desc {
  font-size: 14px;
  color: var(--crm-text-muted);
  line-height: 1.6;
}
.ob-fields { display: flex; flex-direction: column; gap: 14px; }
.ob-field-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--crm-text);
  margin-bottom: 6px;
}
.ob-input, .ob-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--crm-bg);
  color: var(--crm-text);
  transition: all 0.2s;
}
.ob-input:focus, .ob-select:focus {
  outline: none;
  border-color: var(--crm-primary);
  box-shadow: 0 0 0 3px rgba(56,93,141,0.12);
}
.ob-required { color: var(--crm-danger); }
.ob-hint { font-size: 12px; color: var(--crm-text-muted); margin-top: 5px; }
.ob-hint-mt { margin-top: 12px; }
.ob-import-zone {
  border: 2px dashed var(--crm-border);
  border-radius: var(--crm-radius);
  padding: 32px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}
.ob-import-zone:hover,
.ob-import-zone.drag-over {
  border-color: var(--crm-primary);
  background: rgba(56,93,141,0.04);
}
.ob-import-icon { font-size: 36px; margin-bottom: 10px; }
.ob-import-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--crm-text);
  margin-bottom: 4px;
}
.ob-import-sub {
  font-size: 13px;
  color: var(--crm-text-muted);
  margin-bottom: 12px;
}
.ob-csv-ok {
  margin-top: 14px;
  background: #d1fae5;
  border-radius: var(--crm-radius-sm);
  padding: 12px 14px;
  color: #065f46;
}
.ob-csv-count {
  font-size: 14px;
  font-weight: 600;
  color: #065f46;
  display: block;
  margin-bottom: 6px;
}
.ob-csv-sample { display: flex; flex-wrap: wrap; gap: 6px; }
.ob-csv-tag {
  background: white;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.ob-csv-more {
  background: #d1fae5;
  color: #6b7280;
  border-color: #a7f3d0;
}
.ob-tutorial { display: flex; flex-direction: column; gap: 14px; }
.ob-tuto-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--crm-bg);
  border-radius: var(--crm-radius-sm);
  padding: 14px;
}
.ob-tuto-num {
  width: 28px;
  height: 28px;
  background: var(--crm-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.ob-tuto-text {
  font-size: 14px;
  color: var(--crm-text);
  line-height: 1.5;
}
.ob-tuto-tag {
  display: inline-block;
  background: rgba(56,93,141,0.1);
  color: var(--crm-primary);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
}
.ob-tuto-tip {
  background: #fef3c7;
  border-radius: var(--crm-radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.6;
}
.ob-finish { text-align: center; }
.ob-finish-icon { font-size: 56px; margin-bottom: 12px; }
.ob-finish-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--crm-text);
  margin-bottom: 8px;
}
.ob-finish-sub {
  font-size: 14px;
  color: var(--crm-text-muted);
  margin-bottom: 20px;
}
.ob-finish-recap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  text-align: left;
}
.ob-recap-item {
  padding: 10px 14px;
  border-radius: var(--crm-radius-sm);
  font-size: 14px;
  border: 1px solid var(--crm-border);
}
.ob-recap-item.done { background: #d1fae5; border-color: #a7f3d0; color: #065f46; }
.ob-recap-item.pending { background: var(--crm-bg); color: var(--crm-text-muted); }
.ob-finish-cta {
  font-size: 14px;
  color: var(--crm-text-muted);
  line-height: 1.6;
}
.ob-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--crm-border);
}
.ob-flex-spacer { flex: 1; }
.ob-btn {
  padding: 10px 20px;
  border-radius: var(--crm-radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ob-btn-next, .ob-btn-finish {
  background: var(--crm-primary);
  color: white;
}
.ob-btn-next:hover, .ob-btn-finish:hover { background: #5b21b6; }
.ob-btn-back {
  background: var(--crm-card);
  color: var(--crm-text);
  border: 1px solid var(--crm-border);
}
.ob-btn-back:hover { background: var(--crm-bg); }
.ob-btn-skip {
  background: none;
  color: var(--crm-text-muted);
  font-size: 13px;
  padding: 8px 12px;
}
.ob-btn-skip:hover { color: var(--crm-text); }
.ob-btn-hidden { display: none; }
.ob-file-label { cursor: pointer; }
.ob-file-input { display: none; }
.public-devis-page {
  min-height: 100vh;
  background: var(--crm-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.public-devis-card {
  background: var(--crm-card);
  border-radius: var(--crm-radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 680px;
  box-shadow: var(--crm-shadow-lg);
  border: 1px solid var(--crm-border);
}
.public-devis-logo {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--crm-primary), var(--crm-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 28px;
  display: block;
}
.public-devis-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--crm-text);
  margin-bottom: 6px;
}
.public-devis-subtitle {
  font-size: 14px;
  color: var(--crm-text-muted);
  margin-bottom: 24px;
}
.public-devis-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 14px;
}
.public-devis-table th {
  background: var(--crm-bg);
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--crm-text-muted);
  border-bottom: 1px solid var(--crm-border);
}
.public-devis-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--crm-border);
  color: var(--crm-text);
}
.public-devis-totals {
  background: var(--crm-bg);
  border-radius: var(--crm-radius-sm);
  padding: 16px;
  margin-bottom: 24px;
}
.public-accept-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(90deg, var(--crm-primary), var(--crm-secondary));
  color: white;
  border: none;
  border-radius: var(--crm-radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.public-accept-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
.public-accepted-state {
  text-align: center;
  padding: 32px;
}
.public-accepted-icon { font-size: 56px; margin-bottom: 12px; }
.public-legal-notice {
  font-size: 11px;
  color: var(--crm-text-light);
  line-height: 1.6;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--crm-border);
}
.settings-tab-btns {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--crm-bg);
  padding: 4px;
  border-radius: var(--crm-radius-sm);
  width: fit-content;
  flex-wrap: wrap;
}
.settings-tab-btn {
  padding: 8px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--crm-text-muted);
  border-radius: 6px;
  transition: all 0.15s;
}
.settings-tab-btn.active {
  background: var(--crm-card);
  color: var(--crm-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.settings-section {
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  overflow-x: auto;
}
.settings-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--crm-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.charts-load-error {
  background: rgba(239,68,68,0.08);
  border: 1px solid var(--crm-danger,#ef4444);
  border-radius: var(--crm-radius-lg);
  padding: 16px 18px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--crm-text);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.settings-subheading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted);
  margin-bottom: 8px;
}
.settings-info-block { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 14px; margin: 16px 0; font-size: 13px; color: #14532d; }
.settings-info-block p { margin: 0; }
.settings-warning-block {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 14px;
  margin: 16px 0;
  font-size: 13px;
  color: #9a3412;
}
.settings-warning-block p { margin: 0; line-height: 1.6; }
.vat-preview-box {
  background: var(--crm-bg);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  padding: 18px 20px;
  margin: 16px 0;
}
.vat-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.vat-preview-table tr {
  border-bottom: 1px solid var(--crm-border);
}
.vat-preview-table tr:last-child {
  border-bottom: none;
}
.vat-preview-table td {
  padding: 9px 4px;
  color: var(--crm-text);
}
.vat-preview-table td:last-child {
  text-align: right;
  color: var(--crm-primary);
  font-weight: 700;
}
.vat-preview-gaps {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--crm-border);
}
.vat-preview-gaps p {
  font-size: 12.5px;
  color: #92400e;
  line-height: 1.6;
  margin-bottom: 6px;
}
.vat-preview-gaps p:last-child { margin-bottom: 0; }
.monthly-targets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.monthly-target-item {
  background: var(--crm-bg);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.monthly-target-item label {
  font-size: 11px;
  font-weight: 600;
  color: var(--crm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.monthly-target-item input {
  padding: 7px 10px;
  border: 1px solid var(--crm-border);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--crm-primary);
  background: var(--crm-card);
  transition: all 0.2s;
}
.monthly-target-item input:focus {
  outline: none;
  border-color: var(--crm-primary);
}
.team-member-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  margin-bottom: 10px;
  gap: 12px;
}
.team-member-info { flex: 1; }
.team-member-email {
  font-weight: 600;
  font-size: 14px;
  color: var(--crm-text);
}
.team-member-role {
  font-size: 12px;
  color: var(--crm-text-muted);
  margin-top: 2px;
}
.team-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.role-admin { background: #ede9fe; color: #5b21b6; }
.role-sales { background: #dbeafe; color: #1d4ed8; }
.role-viewer { background: #f1f5f9; color: #64748b; }
.team-upgrade-box {
  background: linear-gradient(135deg, rgba(56,93,141,0.08), rgba(6,182,212,0.05));
  border: 1px solid rgba(56,93,141,0.2);
  border-radius: var(--crm-radius-lg);
  padding: 32px;
  text-align: center;
}
.team-upgrade-icon { font-size: 32px; margin-bottom: 12px; }
.team-empty { color: var(--crm-text-muted); font-size: 14px; }
.team-invite-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.team-invite-input { flex: 1; min-width: 200px; }
.team-members-list { margin-top: 12px; }
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: white;
  padding: 12px 28px;
  border-radius: 40px;
  z-index: 10001;
  display: none;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: slideUp 0.3s ease;
  white-space: nowrap;
  max-width: 90vw;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
#loadingOverlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10001;
  flex-direction: column;
  gap: 18px;
}
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  color: white;
  font-size: 15px;
  font-weight: 500;
}
body.dark-mode {
  --crm-bg: #0f172a;
  --crm-bg-alt: #1e293b;
  --crm-card: #1e293b;
  --crm-border: #334155;
  --crm-text: #f1f5f9;
  --crm-text-muted: #94a3b8;
  --crm-text-light: #64748b;
  --crm-shadow: 0 4px 16px rgba(0,0,0,0.4);
  --crm-shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
  --crm-primary: #8fa9bf;
  background: #0f172a;
  color: #f1f5f9;
}
body.dark-mode .crm-sidebar { background: #1e293b; border-color: #334155; }
body.dark-mode .crm-logo { -webkit-text-fill-color: transparent; }
body.dark-mode .crm-nav-item { color: #94a3b8; }
body.dark-mode .crm-nav-item:hover { background: rgba(143,169,191,0.1); color: #8fa9bf; }
body.dark-mode .crm-nav-item.active { background: rgba(143,169,191,0.15); color: #8fa9bf; }
body.dark-mode .nav-label { -webkit-text-fill-color: currentColor; }
body.dark-mode .crm-header { border-color: #334155; }
body.dark-mode #globalSearch { background: #1e293b; border-color: #334155; color: #f1f5f9; }
body.dark-mode .crm-user { background: #1e293b; border-color: #334155; }
body.dark-mode #userEmail { color: #94a3b8; }
body.dark-mode .logout-btn { border-color: #475569; color: #94a3b8; }
body.dark-mode #darkModeToggle { border-color: #475569; }
body.dark-mode .stat-card,
body.dark-mode .stat-mini-card,
body.dark-mode .chart-card,
body.dark-mode .contacts-table,
body.dark-mode .inv-card,
body.dark-mode .product-card,
body.dark-mode .appointment-calendar,
body.dark-mode .appointment-form,
body.dark-mode .settings-section,
body.dark-mode .ai-assistant { background: #1e293b; border-color: #334155; }
body.dark-mode table { background: #1e293b; }
body.dark-mode th { background: #0f172a; color: #94a3b8; }
body.dark-mode td { color: #cbd5e1; border-color: #334155; }
body.dark-mode .contacts-table tr:hover td { background: rgba(143,169,191,0.06); }
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode .ob-input,
body.dark-mode .ob-select,
body.dark-mode .wf-input,
body.dark-mode .wf-textarea,
body.dark-mode .ai-input-row input,
body.dark-mode .devis-lines-table input,
body.dark-mode .devis-lines-table select {
  background: #334155;
  border-color: #475569;
  color: #f1f5f9;
}
body.dark-mode input::placeholder { color: #64748b; }
body.dark-mode .modal-content,
body.dark-mode #obModal { background: #1e293b; color: #f1f5f9; }
body.dark-mode .kanban-column { background: #0f172a; }
body.dark-mode .kanban-card { background: #1e293b; color: #f1f5f9; }
body.dark-mode .wf-rule-card { background: #1e293b; border-color: #334155; }
body.dark-mode .wf-choice-card { background: #0f172a; border-color: #334155; }
body.dark-mode .wf-choice-card:hover,
body.dark-mode .wf-choice-card.selected { background: rgba(143,169,191,0.1); }
body.dark-mode .wf-info-block { background: #0f172a; }
body.dark-mode .wf-param-block { background: #0f172a; }
/* Status badges (dark mode) — English class names alongside the legacy
   French ones, mirroring the light-mode aliases above. */
body.dark-mode .status-lead, body.dark-mode .status-prospect { background: #78350f; color: #fcd34d; }
body.dark-mode .status-contacted, body.dark-mode .status-contact { background: #1e3a5f; color: #93c5fd; }
body.dark-mode .status-customer, body.dark-mode .status-client { background: #064e3b; color: #6ee7b7; }
/* Priority badges (dark mode) — same alias logic. */
body.dark-mode .score-hot, body.dark-mode .score-chaud { background: #7f1d1d; color: #fca5a5; }
body.dark-mode .score-warm, body.dark-mode .score-tiede { background: #7c2d12; color: #fdba74; }
body.dark-mode .score-cold, body.dark-mode .score-froid { background: #1e1b4b; color: #a5b4fc; }
body.dark-mode .calendar-day { color: #f1f5f9; }
body.dark-mode .calendar-day:hover { background: rgba(143,169,191,0.15); }
body.dark-mode .calendar-day.disabled { color: #475569; }
body.dark-mode .welcome-banner { background: rgba(143,169,191,0.1); border-color: rgba(143,169,191,0.3); }
body.dark-mode .monthly-target-item { background: #0f172a; border-color: #334155; }
body.dark-mode .monthly-target-item input { background: #1e293b; }
body.dark-mode .funnel-step { background: #1e293b; border-color: #334155; }
body.dark-mode .devis-totals { background: #0f172a; }
body.dark-mode .vat-alert { background: #78350f; border-color: #b45309; color: #fde68a; }
body.dark-mode .ai-message.assistant,
body.dark-mode .ai-message.loading { background: #0f172a; border-color: #334155; }
body.dark-mode .ai-input-row { border-color: #334155; }
body.dark-mode .settings-tab-btns { background: #0f172a; }
body.dark-mode .settings-tab-btn.active { background: #1e293b; }
body.dark-mode .team-member-card { background: #1e293b; border-color: #334155; }
body.dark-mode .timeline-item { background: #1e293b; border-color: #334155; }
body.dark-mode .timeline::before { background: #334155; }
body.dark-mode .ob-recap-item.done { background: #064e3b; border-color: #065f46; color: #6ee7b7; }
body.dark-mode .ob-recap-item.pending { background: #0f172a; color: #64748b; }
body.dark-mode .ob-tuto-step { background: #0f172a; }
body.dark-mode .ob-tuto-tip { background: #78350f; color: #fde68a; }
body.dark-mode .ob-import-zone { border-color: #334155; }
body.dark-mode .ob-import-zone:hover { border-color: var(--crm-primary); }
body.dark-mode .public-devis-card { background: #1e293b; border-color: #334155; }
body.dark-mode .ai-assistant-header { background: linear-gradient(90deg, #5b21b6, #0891b2); }
body.dark-mode .settings-info-block { background: #1e293b; border-color: #334155; color: #f1f5f9; }
body.dark-mode .settings-warning-block { background: #1e293b; border-color: #334155; color: #f1f5f9; }
body.dark-mode .upgrade-inline { background: #1e293b; border-color: #334155; color: #f1f5f9; }
body.dark-mode .vat-preview-box { background: #0f172a; border-color: #334155; }
body.dark-mode .vat-preview-table tr { border-color: #334155; }
body.dark-mode .vat-preview-table td { color: #cbd5e1; }
body.dark-mode .vat-preview-table td:last-child { color: #8fa9bf; }
body.dark-mode .vat-preview-gaps { border-color: #334155; }
body.dark-mode .vat-preview-gaps p { color: #fdba74; }
/* Help system — feature-help dropdown (the small "?" trigger placed at
   the top of each view) plus the in-page Settings -> Help accordion and
   the "download full guide" PDF entry point. Kept visually consistent
   with the existing accordion styling used elsewhere in Settings. */
.feature-help-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--crm-bg);
  border: 1px solid var(--crm-border);
  color: var(--crm-text-muted);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.feature-help-trigger:hover {
  color: var(--crm-primary);
  border-color: var(--crm-primary);
  background: rgba(56,93,141,0.06);
}
.feature-help-panel {
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-left: 4px solid var(--crm-primary);
  border-radius: var(--crm-radius);
  padding: 18px 20px;
  margin-bottom: 18px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--crm-text);
  animation: fadeIn 0.2s ease-out;
}
.feature-help-panel h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--crm-primary);
  margin-bottom: 8px;
}
.feature-help-panel ul,
.feature-help-panel ol { margin: 6px 0 6px 20px; }
.feature-help-panel li { margin-bottom: 4px; }
.feature-help-panel p { margin-bottom: 8px; }
.feature-help-panel p:last-child { margin-bottom: 0; }
.help-download-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, rgba(56,93,141,0.08), rgba(6,182,212,0.05));
  border: 1px solid rgba(56,93,141,0.2);
  border-radius: var(--crm-radius-lg);
  padding: 20px 22px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  color: var(--crm-text);
}
.help-download-text h3 { margin-bottom: 4px; color: var(--crm-text); }
.help-download-text p { font-size: 13px; color: var(--crm-text-muted); margin: 0; }
body.dark-mode .feature-help-panel { background: #1e293b; border-color: #334155; }
body.dark-mode .feature-help-trigger { background: #0f172a; border-color: #334155; color: #94a3b8; }
body.dark-mode .feature-help-trigger:hover { background: rgba(143,169,191,0.1); border-color: #8fa9bf; color: #8fa9bf; }
@media (max-width: 1200px) {
  .monthly-targets-grid { grid-template-columns: repeat(3, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .funnel-card { grid-column: span 1; }
}
@media (max-width: 900px) {
  .kanban-columns { grid-template-columns: 1fr; }
  .appointment-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .crm-stats { grid-template-columns: 1fr 1fr; }
  .stats-mini { grid-template-columns: repeat(2, 1fr); }
  .modal-content { padding: 20px; border-radius: var(--crm-radius-lg); }
  .monthly-targets-grid { grid-template-columns: repeat(2, 1fr); }
  #globalSearch { width: 160px; }
  #globalSearch:focus { width: 200px; }
  .wf-choices { grid-template-columns: 1fr 1fr; }
  .inv-amounts { gap: 12px; }
  .ai-assistant { height: 360px; }
  .help-download-block { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .crm-stats { grid-template-columns: 1fr; }
  .stats-mini { grid-template-columns: 1fr 1fr; }
  .monthly-targets-grid { grid-template-columns: 1fr 1fr; }
  .crm-header { gap: 8px; }
  #userEmail { display: none; }
  .modal-content { padding: 16px; }
  .ob-modal { padding: 24px; }
  .wf-choices { grid-template-columns: 1fr; }
  .devis-lines-table { font-size: 12px; }
  .kanban-columns { gap: 12px; }
  .public-devis-card { padding: 24px; }
}
.text-primary { color: var(--crm-primary); }
.text-muted { color: var(--crm-text-muted); }
.text-success { color: var(--crm-success); }
.text-danger { color: var(--crm-danger); }
.text-warning { color: var(--crm-warning); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-mono { font-family: monospace; }
.text-sm { font-size: 14px; margin-top: 4px; }
.text-xs { font-size: 11px; margin-top: 4px; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--crm-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--crm-text-light); }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.25s ease-out; }
:focus-visible {
  outline: 2px solid var(--crm-primary);
  outline-offset: 2px;
}
.td-empty { text-align: center; padding: 20px; color: var(--crm-text-muted); }
.td-empty-sm { text-align: center; padding: 16px; color: var(--crm-text-muted); }
.health-label { font-size: 12px; color: var(--crm-text-muted); }
.health-score-val { font-size: 12px; font-weight: 600; }
.reminder-done { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; background: #d1fae5; color: #059669; }
.reminder-pending { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; background: #fef3c7; color: #d97706; }
.wa-link { margin-left: 8px; }
.files-empty { font-size: 12px; color: var(--crm-text-muted); }
.files-title { margin-bottom: 8px; }
.facturx-details { margin-top: 16px; border: 1px solid var(--crm-border); border-radius: 10px; overflow: hidden; }
.facturx-summary { padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 13px; background: var(--crm-bg-alt); list-style: none; display: flex; align-items: center; gap: 8px; user-select: none; color: var(--crm-text); }
.facturx-summary::-webkit-details-marker { display: none; }
.facturx-badge { background: #385D8D; color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 12px; font-weight: 700; }
.facturx-fields { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.tooltip-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; background: #385D8D; color: #fff; border-radius: 50%; font-size: 10px; font-weight: 700; cursor: help; margin-left: 4px; vertical-align: middle; }
.tooltip-icon { position: relative; }
.tooltip-bubble {
  position: fixed;
  z-index: 10050;
  max-width: 280px;
  background: #1f2430;
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.tooltip-bubble.visible { opacity: 1; transform: translateY(0); }
.tooltip-bubble::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 14px;
  border-width: 0 5px 5px 5px;
  border-style: solid;
  border-color: transparent transparent #1f2430 transparent;
}
.tooltip-icon:focus-visible { outline: 2px solid #385D8D; outline-offset: 2px; }
button + .tooltip-icon,
.flex > .tooltip-icon {
  margin-left: 8px;
  align-self: center;
}
.upgrade-desc { color: var(--crm-text-muted); font-size: 13px; margin: 8px 0; }
.upgrade-plans { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.upgrade-plan-card { border: 2px solid var(--crm-border); border-radius: 10px; padding: 12px 20px; min-width: 120px; text-align: center; position: relative; background: var(--crm-card); color: var(--crm-text); }
.upgrade-plan-recommended { border-color: #385D8D; background: #faf5ff; color: #1e1b2e; }
.upgrade-plan-name { font-weight: 700; font-size: 14px; color: inherit; }
.upgrade-plan-badge { background: #385D8D; color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 10px; margin-top: 4px; display: inline-block; }
.upgrade-inline { background: #faf5ff; border: 1px solid #e9d5ff; border-radius: 8px; padding: 16px; text-align: center; color: #3b0764; }
.btn-upgrade { background: #385D8D; color: #fff; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; margin-top: 8px; }
.modal-content-wide { max-width: 800px; }
.modal-content-upgrade { max-width: 480px; text-align: center; }
.upgrade-rocket { font-size: 48px; margin-bottom: 12px; }
.upgrade-modal-buttons { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.plan-badge { font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 700; vertical-align: middle; }
.plan-badge-pro { background: #385D8D; color: #fff; }
.plan-badge-solo { background: #3b82f6; color: #fff; }
.chatbot-integration-block { background: var(--crm-bg-alt); border: 1px solid var(--crm-border); border-radius: 10px; padding: 16px; margin-bottom: 16px; color: var(--crm-text); }
.chatbot-snippet { background: #1e293b; color: #e2e8f0; padding: 14px; border-radius: 8px; font-size: 11px; line-height: 1.6; overflow: auto; margin: 12px 0; white-space: pre-wrap; word-break: break-all; }
.chatbot-q-item { display: flex; align-items: center; justify-content: space-between; background: var(--crm-bg-alt); border: 1px solid var(--crm-border); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; color: var(--crm-text); }
.chatbot-q-text { font-size: 13px; }
.chatbot-lead-card { background: var(--crm-bg); border: 1px solid var(--crm-border); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.chatbot-lead-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.chatbot-lead-name { font-weight: 700; font-size: 14px; }
.chatbot-lead-date { font-size: 11px; color: var(--crm-text-muted); }
.chatbot-lead-info { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chatbot-lead-tag { font-size: 11px; background: var(--crm-bg-alt); border: 1px solid var(--crm-border); padding: 2px 8px; border-radius: 10px; color: var(--crm-text); }
.score-tag-hot, .score-tag-chaud { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.score-tag-warm, .score-tag-tiede { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.score-tag-cold, .score-tag-froid { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.chatbot-lead-contacts { font-size: 12px; color: var(--crm-text-muted); display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.chatbot-lead-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.toggle-label input[type="checkbox"] { display: none; }
.toggle-slider { display: inline-block; flex-shrink: 0; width: 44px; height: 24px; background: #cbd5e1; border-radius: 12px; position: relative; transition: background .2s; }
.toggle-label input:checked~.toggle-slider { background: #385D8D; }
.toggle-slider::after { content: ""; position: absolute; width: 18px; height: 18px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: left .2s; }
.toggle-label input:checked~.toggle-slider::after { left: 23px; }
.help-accordion { border: 1px solid var(--crm-border); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.help-accordion-btn { width: 100%; text-align: left; padding: 14px 16px; background: var(--crm-card); border: none; border-bottom: 1px solid var(--crm-border); cursor: pointer; font-size: 14px; font-weight: 600; color: var(--crm-text); display: flex; justify-content: space-between; align-items: center; box-shadow: inset 0 0 0 1px var(--crm-border); }
.help-accordion-btn:hover { background: var(--crm-border); }
.help-accordion-arrow { font-size: 12px; color: var(--crm-text-muted); transition: transform .2s; }
.help-accordion-body { padding: 16px; font-size: 13px; line-height: 1.7; color: var(--crm-text); }
.help-accordion-body h4 { margin: 14px 0 6px; color: #385D8D; }
.help-accordion-body ul, .help-accordion-body ol { margin-left: 20px; }
.help-accordion-body li { margin-bottom: 4px; }
.help-accordion-body pre { background: #1e293b; color: #e2e8f0; padding: 12px; border-radius: 6px; font-size: 11px; overflow: auto; margin: 8px 0; }
#mentionsLegales { width: 100%; font-size: 12px; padding: 8px; border-radius: 6px; border: 1px solid var(--crm-border); background: var(--crm-bg); color: var(--crm-text); resize: vertical; font-family: inherit; }
.mentions-textarea { width: 100%; font-family: inherit; }
.view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.view-header-col { display: flex; flex-direction: column; gap: 4px; }
.contacts-table-header { display: flex; align-items: center; justify-content: space-between; padding: 20px; flex-wrap: wrap; gap: 12px; }
.filter-select-half { flex: 0.5; }
.filter-select-lg { width: 180px; }
.input-readonly { background: var(--crm-bg); }
.catalog-list { max-height: 360px; overflow-y: auto; }
.col-desc { min-width: 200px; }
.col-qty { width: 70px; }
.col-price { width: 110px; }
.col-vat { width: 80px; }
.col-remise { width: 80px; }
.col-total { width: 100px; }
.col-del { width: 40px; }
.btn-link { background: none; border: none; color: var(--crm-purple); cursor: pointer; font-size: inherit; padding: 0; text-decoration: underline; }
.devis-qty-input { width: 60px; }
.devis-price-input { width: 90px; }
.quote-vat-select { width: 70px; }
.devis-remise-input { width: 65px; }
.devis-del-btn { color: var(--crm-danger); }
.custom-tooltip {
  position: fixed;
  background: #1e293b;
  color: white;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
}
.custom-tooltip-visible {
  opacity: 1;
}
.col-resize-host {
  position: relative;
}
.sidebar-hidden-mobile {
  transform: translateX(-100%);
}

/* ── PLANS GRID ─────────────────────────────────────── */
.plans-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:16px;margin-top:16px;}
.plan-card{background:var(--crm-card);border:1px solid var(--crm-border);border-radius:12px;padding:20px 16px;display:flex;flex-direction:column;text-align:center;}
.plan-card h4{font-size:13px;color:var(--crm-text-muted);font-weight:700;text-transform:uppercase;letter-spacing:0.04em;margin-bottom:6px;}
.plan-amt{font-size:26px;font-weight:800;margin-bottom:12px;color:var(--crm-text);}
.plan-amt span{font-size:12px;font-weight:500;color:var(--crm-text-muted);}
.plan-card ul{list-style:none;margin:0 0 16px;flex:1;text-align:left;}
.plan-card li{font-size:12.5px;color:var(--crm-text-muted);padding:4px 0;display:flex;gap:6px;}
.plan-card li::before{content:'✓';color:#10b981;font-weight:700;}
.plan-card-featured{border:2px solid #385D8D;}
.plan-card-current{border:2px solid #10b981;background:rgba(16,185,129,0.06);}
.plan-current-badge{font-size:12.5px;font-weight:700;color:#10b981;padding:8px;}
.gmail-connected{display:flex;align-items:center;justify-content:space-between;gap:12px;background:rgba(16,185,129,0.06);border:1px solid #10b981;border-radius:10px;padding:14px 18px;color:var(--crm-text);}
@media (max-width:1080px){.plans-grid{grid-template-columns:repeat(3,1fr);}}
@media (max-width:760px){.plans-grid{grid-template-columns:repeat(2,1fr);}}
@media (max-width:500px){.plans-grid{grid-template-columns:1fr;}}

.plan-badge{font-size:10px;padding:2px 7px;border-radius:10px;font-weight:700;vertical-align:middle;}
.plan-badge-pro{background:#385D8D;color:#fff;}
.plan-badge-solo{background:#3b82f6;color:#fff;}

.settings-info-block{background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;padding:14px;margin:16px 0;font-size:13px;color:#14532d;}
.settings-warning-block{background:#fff7ed;border:1px solid #fed7aa;border-radius:8px;padding:14px;margin:16px 0;font-size:13px;color:#7c2d12;}
.settings-info-block p{margin:0;}

.chatbot-integration-block{background:var(--crm-bg-alt);border:1px solid var(--crm-border);border-radius:10px;padding:16px;margin-bottom:16px;color:var(--crm-text);}
.chatbot-share-link{display:flex;gap:8px;margin-top:8px;}
.chatbot-share-link input{flex:1;min-width:0;padding:8px 12px;border-radius:8px;border:1px solid var(--crm-border);background:var(--crm-bg-alt);color:var(--crm-text);font-size:12px;}
.chatbot-snippet{background:#1e293b;color:#e2e8f0;padding:14px;border-radius:8px;font-size:11px;line-height:1.6;overflow:auto;margin:12px 0;white-space:pre-wrap;word-break:break-all;}
.chatbot-q-item{display:flex;align-items:center;justify-content:space-between;background:var(--crm-bg-alt);border:1px solid var(--crm-border);border-radius:8px;padding:10px 14px;margin-bottom:8px;color:var(--crm-text);}
.chatbot-q-text{font-size:13px;}
.chatbot-q-actions{display:flex;gap:4px;align-items:center;flex-shrink:0;}
.chatbot-branch-badge{display:inline-block;margin-left:8px;font-size:10px;font-weight:700;background:#dbeafe;color:#1d4ed8;border-radius:10px;padding:2px 8px;vertical-align:middle;}
body.dark-mode .chatbot-branch-badge{background:#1e3a5f;color:#93c5fd;}
.chatbot-branch-rule{background:var(--crm-bg-alt);border:1px solid var(--crm-border);border-radius:8px;padding:14px;margin-bottom:12px;}

.chatbot-lead-card{background:var(--crm-bg);border:1px solid var(--crm-border);border-radius:10px;padding:14px;margin-bottom:12px;}
.chatbot-lead-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;}
.chatbot-lead-name{font-weight:700;font-size:14px;}
.chatbot-lead-date{font-size:11px;color:var(--crm-text-muted);}
.chatbot-lead-info{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px;}
.chatbot-lead-tag{font-size:11px;background:var(--crm-bg-alt);border:1px solid var(--crm-border);padding:2px 8px;border-radius:10px;color:var(--crm-text);}
.score-tag-chaud{background:#fee2e2;color:#991b1b;border-color:#fca5a5;}
.score-tag-tiede{background:#fef3c7;color:#92400e;border-color:#fcd34d;}
.score-tag-froid{background:#dbeafe;color:#1e40af;border-color:#93c5fd;}
.chatbot-lead-contacts{font-size:12px;color:var(--crm-text-muted);display:flex;gap:12px;flex-wrap:wrap;margin-bottom:10px;}
.chatbot-lead-actions{display:flex;gap:6px;flex-wrap:wrap;}

.toggle-label{display:flex;align-items:center;gap:10px;cursor:pointer;font-size:14px;}
.toggle-label input[type="checkbox"]{display:none;}
.toggle-slider{display:inline-block;flex-shrink:0;width:44px;height:24px;background:#cbd5e1;border-radius:12px;position:relative;transition:background .2s;}
.toggle-label input:checked~.toggle-slider{background:#385D8D;}
.toggle-slider::after{content:"";position:absolute;width:18px;height:18px;background:#fff;border-radius:50%;top:3px;left:3px;transition:left .2s;}
.toggle-label input:checked~.toggle-slider::after{left:23px;}

.help-download-block{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  background:var(--crm-bg-alt);
  border:1px solid var(--crm-border);
  border-radius:var(--crm-radius);
  padding:18px 20px;
  margin-bottom:20px;
  flex-wrap:wrap;
  color:var(--crm-text);
}
.help-download-text h3{margin:0 0 4px;font-size:15px;color:var(--crm-text);}
.help-download-text p{margin:0;font-size:13px;color:var(--crm-text-muted);}

.feature-help-trigger{
  background:var(--crm-bg-alt);
  border:1px solid var(--crm-border);
  border-radius:var(--crm-radius-sm);
  padding:8px 14px;
  font-size:13px;
  font-weight:600;
  color:var(--crm-primary);
  cursor:pointer;
  transition:background .2s;
}
.feature-help-trigger:hover{background:var(--crm-border);}
.feature-help-panel{
  background:var(--crm-bg-alt);
  border:1px solid var(--crm-border);
  border-radius:var(--crm-radius-sm);
  padding:14px 18px;
  margin-bottom:16px;
  font-size:13px;
  color:var(--crm-text);
  line-height:1.6;
}
.feature-help-panel h4{margin:0 0 6px;color:var(--crm-primary);font-size:14px;}
.feature-help-panel p{margin:0;}

.help-accordion{border:1px solid var(--crm-border);border-radius:8px;margin-bottom:8px;overflow:hidden;}
.help-accordion-btn{width:100%;text-align:left;padding:14px 16px;background:var(--crm-bg-alt);border:none;cursor:pointer;font-size:14px;font-weight:600;color:var(--crm-text);display:flex;justify-content:space-between;align-items:center;}
.help-accordion-btn:hover{background:var(--crm-border);}
.help-accordion-arrow{font-size:12px;transition:transform .2s;}
.help-accordion-body{padding:16px;font-size:13px;line-height:1.7;color:var(--crm-text);}
.help-accordion-body h4{margin:14px 0 6px;color:#385D8D;}
.help-accordion-body ul,.help-accordion-body ol{margin-left:20px;}
.help-accordion-body li{margin-bottom:4px;}
.help-accordion-body pre{background:#1e293b;color:#e2e8f0;padding:12px;border-radius:6px;font-size:11px;overflow:auto;margin:8px 0;}

#mentionsLegales{width:100%;font-size:12px;padding:8px;border-radius:6px;border:1px solid var(--crm-border);background:var(--crm-bg);color:var(--crm-text);resize:vertical;font-family:inherit;}

.mt-8{margin-top:8px;}.mt-16{margin-top:16px;}

.view-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;flex-wrap:wrap;gap:12px;}
.view-header-col{display:flex;flex-direction:column;gap:4px;}
.contacts-table-header{display:flex;align-items:center;justify-content:space-between;padding:20px;flex-wrap:wrap;gap:12px;}
.appointments-upcoming{margin-top:40px;}
.filter-select-half{flex:0.5;}
.filter-select-lg{width:180px;}
.flex-wrap{flex-wrap:wrap;}
.flex-1{flex:1;}
.team-invite-row{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:24px;}
.team-invite-input{flex:1;min-width:200px;}
.team-members-list{margin-top:12px;}
.team-upgrade-icon{font-size:32px;margin-bottom:12px;}
.modal-content-wide{max-width:800px;}
.modal-content-upgrade{max-width:480px;text-align:center;}
.upgrade-rocket{font-size:48px;margin-bottom:12px;}
.upgrade-modal-buttons{display:flex;gap:12px;justify-content:center;margin-top:24px;}
.input-readonly{background:var(--crm-bg);}
.timeline-title{margin-bottom:12px;}
.files-title{margin-bottom:8px;}
.wf-back-btn{display:none;}
.wf-save-btn{display:none;}
.text-sm{font-size:14px;margin-top:4px;}
.text-xs{font-size:11px;margin-top:4px;}
.mentions-textarea{width:100%;font-family:inherit;}
.catalog-list{max-height:360px;overflow-y:auto;}
.col-desc{min-width:200px;}
.col-qty{width:70px;}
.col-price{width:110px;}
.col-tva{width:80px;}
.col-remise{width:80px;}
.col-total{width:100px;}
.col-del{width:40px;}
.btn-link{background:none;border:none;color:var(--crm-purple);cursor:pointer;font-size:inherit;padding:0;text-decoration:underline;}

/* ── GMAIL CONNECTION ───────────────────────────────── */
.gmail-connected{display:flex;align-items:center;justify-content:space-between;gap:12px;background:rgba(16,185,129,0.06);border:1px solid #10b981;border-radius:10px;padding:14px 18px;color:var(--crm-text);}
@media (max-width:1080px){.plans-grid{grid-template-columns:repeat(3,1fr);}}
@media (max-width:760px){.plans-grid{grid-template-columns:repeat(2,1fr);}}
@media (max-width:500px){.plans-grid{grid-template-columns:1fr;}}

.plan-badge{font-size:10px;padding:2px 7px;border-radius:10px;font-weight:700;vertical-align:middle;}
.plan-badge-pro{background:#385D8D;color:#fff;}
.plan-badge-solo{background:#3b82f6;color:#fff;}

.settings-info-block{background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;padding:14px;margin:16px 0;font-size:13px;color:#14532d;}
.settings-warning-block{background:#fff7ed;border:1px solid #fed7aa;border-radius:8px;padding:14px;margin:16px 0;font-size:13px;color:#7c2d12;}
.settings-info-block p{margin:0;}

.chatbot-integration-block{background:var(--crm-bg-alt);border:1px solid var(--crm-border);border-radius:10px;padding:16px;margin-bottom:16px;color:var(--crm-text);}
.chatbot-snippet{background:#1e293b;color:#e2e8f0;padding:14px;border-radius:8px;font-size:11px;line-height:1.6;overflow:auto;margin:12px 0;white-space:pre-wrap;word-break:break-all;}
.chatbot-q-item{display:flex;align-items:center;justify-content:space-between;background:var(--crm-bg-alt);border:1px solid var(--crm-border);border-radius:8px;padding:10px 14px;margin-bottom:8px;color:var(--crm-text);}
.chatbot-q-text{font-size:13px;}
.chatbot-q-actions{display:flex;gap:4px;align-items:center;flex-shrink:0;}
.chatbot-branch-badge{display:inline-block;margin-left:8px;font-size:10px;font-weight:700;background:#dbeafe;color:#1d4ed8;border-radius:10px;padding:2px 8px;vertical-align:middle;}
body.dark-mode .chatbot-branch-badge{background:#1e3a5f;color:#93c5fd;}
.chatbot-branch-rule{background:var(--crm-bg-alt);border:1px solid var(--crm-border);border-radius:8px;padding:14px;margin-bottom:12px;}

.chatbot-lead-card{background:var(--crm-bg);border:1px solid var(--crm-border);border-radius:10px;padding:14px;margin-bottom:12px;}
.chatbot-lead-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;}
.chatbot-lead-name{font-weight:700;font-size:14px;}
.chatbot-lead-date{font-size:11px;color:var(--crm-text-muted);}
.chatbot-lead-info{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px;}
.chatbot-lead-tag{font-size:11px;background:var(--crm-bg-alt);border:1px solid var(--crm-border);padding:2px 8px;border-radius:10px;color:var(--crm-text);}
.score-tag-chaud{background:#fee2e2;color:#991b1b;border-color:#fca5a5;}
.score-tag-tiede{background:#fef3c7;color:#92400e;border-color:#fcd34d;}
.score-tag-froid{background:#dbeafe;color:#1e40af;border-color:#93c5fd;}
.chatbot-lead-contacts{font-size:12px;color:var(--crm-text-muted);display:flex;gap:12px;flex-wrap:wrap;margin-bottom:10px;}
.chatbot-lead-actions{display:flex;gap:6px;flex-wrap:wrap;}

.toggle-label{display:flex;align-items:center;gap:10px;cursor:pointer;font-size:14px;}
.toggle-label input[type="checkbox"]{display:none;}
.toggle-slider{display:inline-block;flex-shrink:0;width:44px;height:24px;background:#cbd5e1;border-radius:12px;position:relative;transition:background .2s;}
.toggle-label input:checked~.toggle-slider{background:#385D8D;}
.toggle-slider::after{content:"";position:absolute;width:18px;height:18px;background:#fff;border-radius:50%;top:3px;left:3px;transition:left .2s;}
.toggle-label input:checked~.toggle-slider::after{left:23px;}

.help-download-block{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  background:var(--crm-bg-alt);
  border:1px solid var(--crm-border);
  border-radius:var(--crm-radius);
  padding:18px 20px;
  margin-bottom:20px;
  flex-wrap:wrap;
  color:var(--crm-text);
}
.help-download-text h3{margin:0 0 4px;font-size:15px;color:var(--crm-text);}
.help-download-text p{margin:0;font-size:13px;color:var(--crm-text-muted);}

.feature-help-trigger{
  background:var(--crm-bg-alt);
  border:1px solid var(--crm-border);
  border-radius:var(--crm-radius-sm);
  padding:8px 14px;
  font-size:13px;
  font-weight:600;
  color:var(--crm-primary);
  cursor:pointer;
  transition:background .2s;
}
.feature-help-trigger:hover{background:var(--crm-border);}
.feature-help-panel{
  background:var(--crm-bg-alt);
  border:1px solid var(--crm-border);
  border-radius:var(--crm-radius-sm);
  padding:14px 18px;
  margin-bottom:16px;
  font-size:13px;
  color:var(--crm-text);
  line-height:1.6;
}
.feature-help-panel h4{margin:0 0 6px;color:var(--crm-primary);font-size:14px;}
.feature-help-panel p{margin:0;}

.help-accordion{border:1px solid var(--crm-border);border-radius:8px;margin-bottom:8px;overflow:hidden;}
.help-accordion-btn{width:100%;text-align:left;padding:14px 16px;background:var(--crm-bg-alt);border:none;cursor:pointer;font-size:14px;font-weight:600;color:var(--crm-text);display:flex;justify-content:space-between;align-items:center;}
.help-accordion-btn:hover{background:var(--crm-border);}
.help-accordion-arrow{font-size:12px;transition:transform .2s;}
.help-accordion-body{padding:16px;font-size:13px;line-height:1.7;color:var(--crm-text);}
.help-accordion-body h4{margin:14px 0 6px;color:#385D8D;}
.help-accordion-body ul,.help-accordion-body ol{margin-left:20px;}
.help-accordion-body li{margin-bottom:4px;}
.help-accordion-body pre{background:#1e293b;color:#e2e8f0;padding:12px;border-radius:6px;font-size:11px;overflow:auto;margin:8px 0;}

#mentionsLegales{width:100%;font-size:12px;padding:8px;border-radius:6px;border:1px solid var(--crm-border);background:var(--crm-bg);color:var(--crm-text);resize:vertical;font-family:inherit;}

.mt-8{margin-top:8px;}.mt-16{margin-top:16px;}

.view-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;flex-wrap:wrap;gap:12px;}
.view-header-col{display:flex;flex-direction:column;gap:4px;}
.contacts-table-header{display:flex;align-items:center;justify-content:space-between;padding:20px;flex-wrap:wrap;gap:12px;}
.appointments-upcoming{margin-top:40px;}
.filter-select-half{flex:0.5;}
.filter-select-lg{width:180px;}
.flex-wrap{flex-wrap:wrap;}
.flex-1{flex:1;}
.team-invite-row{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:24px;}
.team-invite-input{flex:1;min-width:200px;}
.team-members-list{margin-top:12px;}
.team-upgrade-icon{font-size:32px;margin-bottom:12px;}
.modal-content-wide{max-width:800px;}
.modal-content-upgrade{max-width:480px;text-align:center;}
.upgrade-rocket{font-size:48px;margin-bottom:12px;}
.upgrade-modal-buttons{display:flex;gap:12px;justify-content:center;margin-top:24px;}
.input-readonly{background:var(--crm-bg);}
.timeline-title{margin-bottom:12px;}
.files-title{margin-bottom:8px;}
.wf-back-btn{display:none;}
.wf-save-btn{display:none;}
.text-sm{font-size:14px;margin-top:4px;}
.text-xs{font-size:11px;margin-top:4px;}
.mentions-textarea{width:100%;font-family:inherit;}
.catalog-list{max-height:360px;overflow-y:auto;}
.col-desc{min-width:200px;}
.col-qty{width:70px;}
.col-price{width:110px;}
.col-tva{width:80px;}
.col-remise{width:80px;}
.col-total{width:100px;}
.col-del{width:40px;}
.btn-link{background:none;border:none;color:var(--crm-purple);cursor:pointer;font-size:inherit;padding:0;text-decoration:underline;}


/* ADDED — CSS classes replacing inline styles removed for a strict CSP
   (no unsafe-inline on style-src), same pass as the FR side. */

/* Toast notifications */
.toast-visible { display: block !important; }
.toast-error { background: #ef4444; }
.toast-success { background: #10b981; }
.toast-upgrade { background: #7c3aed; }
.toast-info { background: #1e293b; }

/* Loading overlay — dedicated class, not .hidden, since #loadingOverlay's
   default display:none comes from an ID selector without !important */
.loading-visible { display: flex !important; }

/* Workflow wizard buttons — explicit visible/hidden pair, since
   .wf-back-btn/.wf-save-btn hide by default (no !important) but
   .wfBtnNext has no such default rule */
.wf-btn-visible { display: inline-flex !important; }
.wf-btn-hidden { display: none !important; }

/* Progress bars (health score, onboarding) — fixed width classes,
   rounded to the nearest 5%, instead of a dynamic inline style */
.width-0 { width: 0%; }
.width-5 { width: 5%; }
.width-10 { width: 10%; }
.width-15 { width: 15%; }
.width-20 { width: 20%; }
.width-25 { width: 25%; }
.width-30 { width: 30%; }
.width-35 { width: 35%; }
.width-40 { width: 40%; }
.width-45 { width: 45%; }
.width-50 { width: 50%; }
.width-55 { width: 55%; }
.width-60 { width: 60%; }
.width-65 { width: 65%; }
.width-70 { width: 70%; }
.width-75 { width: 75%; }
.width-80 { width: 80%; }
.width-85 { width: 85%; }
.width-90 { width: 90%; }
.width-95 { width: 95%; }
.width-100 { width: 100%; }

/* Onboarding warning subtitle */
.ob-warning-note { color: #f59e0b; font-size: 12px; margin-top: 4px; }

/* Help panel footnote */
.help-note { margin-top: 12px; font-size: 12px; color: #64748b; }

/* Turnstile widget spacing */
.turnstile-widget { margin-top: 12px; }

/* Gmail/Outlook connection warning banners */
.info-banner-warning { background: #fef3c7; border: 1px solid #f59e0b; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; }
.info-banner-text { margin: 0; font-size: 13px; color: #92400e; }

/* OTP verification overlay */
.otp-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 10001; display: flex; align-items: center; justify-content: center; }
.otp-box { background: white; border-radius: 16px; padding: 40px; max-width: 400px; width: 90%; text-align: center; }
.otp-title { color: #6d28d9; margin-bottom: 8px; }
.otp-subtitle { color: #64748b; margin-bottom: 24px; }
.otp-input { width: 100%; text-align: center; font-size: 32px; letter-spacing: 8px; padding: 12px; border: 2px solid #6d28d9; border-radius: 8px; margin-bottom: 16px; box-sizing: border-box; }
.otp-btn-full { width: 100%; margin-bottom: 8px; }

/* ADDED — City/Industry columns collapse below 768px so the contacts
   table doesn't get overcrowded on mobile; still fully visible on web. */
@media (max-width: 768px) {
  .col-optional { display: none; }
}

/* ADDED — SMTP beta badge, contact merge bar/modal, bank transactions table */
.badge-beta{display:inline-block;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.03em;background:#fef3c7;color:#92400e;border-radius:6px;padding:2px 7px;vertical-align:middle;margin-left:6px;}
.merge-bar{display:flex;align-items:center;gap:12px;background:#fef3c7;border:1px solid #f59e0b;border-radius:10px;padding:10px 16px;margin-bottom:12px;}
.merge-bar.hidden{display:none;}
.merge-select-checkbox{width:16px;height:16px;cursor:pointer;}
.merge-options-row{display:flex;gap:16px;margin-top:12px;}
.merge-option-card{flex:1;border:1px solid var(--crm-border,#e4e7eb);border-radius:10px;padding:16px;text-align:center;}
.merge-option-content{margin-bottom:12px;line-height:1.6;text-align:left;}
.bank-tx-table{width:100%;border-collapse:collapse;margin-top:12px;font-size:13.5px;}
.bank-tx-table td{padding:8px;border-bottom:1px solid var(--crm-border,#e4e7eb);}
.tx-pos{color:#059669;font-weight:600;}
.tx-neg{color:#dc2626;font-weight:600;}

/* ADDED — deletion zone (account/data), matches btn-danger already defined above */
.danger-zone{border:1px solid var(--crm-danger);border-radius:var(--crm-radius-lg);}
.danger-zone h3{color:var(--crm-danger);}
.danger-zone-actions{display:flex;flex-direction:column;gap:16px;}
.danger-zone-item{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px;background:rgba(239,68,68,0.05);border-radius:var(--crm-radius);flex-wrap:wrap;}
.danger-zone-item .btn-danger{white-space:nowrap;}

/* ADDED — big full-screen notice after requesting account/data deletion */
.big-deletion-notice-overlay{position:fixed;inset:0;background:rgba(15,23,42,0.75);backdrop-filter:blur(4px);z-index:99999;display:flex;align-items:center;justify-content:center;padding:20px;}
.big-deletion-notice-card{background:#fff;border-radius:20px;box-shadow:0 20px 60px rgba(0,0,0,0.3);padding:40px 32px;max-width:420px;text-align:center;}
.big-deletion-notice-icon{font-size:56px;margin-bottom:16px;}
.big-deletion-notice-card h2{color:#dc2626;font-size:22px;margin-bottom:14px;}
.big-deletion-notice-card p{color:#374151;line-height:1.6;font-size:15px;margin-bottom:10px;}
.big-deletion-notice-sub{color:#6b7280;font-size:13px;margin-bottom:22px;}
.contact-pagination { display:flex; align-items:center; justify-content:center; gap:16px; padding:14px 0; }
.contact-pagination-label { font-size: 14px; color:var(--crm-text-muted); }
.contact-pagination button:disabled { opacity:0.4; cursor:not-allowed; }
.secret-configured-badge {
  display: block;
  font-size: 14px;
  color: #10b981;
  margin: -8px 0 12px;
}
.secret-configured-badge:empty { display: none; margin: 0; }
.active-sessions-widget { position: relative; }
.active-sessions-count {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--crm-primary);
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  padding: 0 3px;
}
.active-sessions-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 300;
}
.active-sessions-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--crm-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.active-sessions-panel-list { padding: 6px; }
.session-row {
  padding: 8px 10px;
  border-radius: var(--crm-radius-sm);
  font-size: 14px;
}
.session-row:hover { background: rgba(56,93,141,0.06); }
.session-row-main { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.session-row-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--crm-text-muted); margin-top: 2px; }
.searchable-select-wrapper { position: relative; }
.searchable-select-hidden { display: none; }
.searchable-select-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--crm-radius-sm);
  border: 1px solid var(--crm-border);
  background: var(--crm-bg-alt);
  color: var(--crm-text);
  font-size: 14px;
  box-sizing: border-box;
}
.searchable-select-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 200;
}
.searchable-select-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
}
.searchable-select-item:hover { background: rgba(56,93,141,0.08); }
.searchable-select-empty {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--crm-text-muted);
}
.global-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: 420px;
  overflow-y: auto;
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 400;
  padding: 6px;
}
.gsr-section-label {
  padding: 8px 10px 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted);
}
.gsr-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--crm-radius-sm);
  cursor: pointer;
}
.gsr-item:hover, .gsr-item.gsr-active { background: rgba(56,93,141,0.08); }
.gsr-item-main { min-width: 0; }
.gsr-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsr-meta { font-size: 13px; color: var(--crm-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsr-right { flex-shrink: 0; font-size: 13px; color: var(--crm-text-muted); text-align: right; }
.gsr-empty { padding: 16px; text-align: center; color: var(--crm-text-muted); font-size: 14px; }
.inv-card-flash { animation: gsrFlash 1.6s ease; }
@keyframes gsrFlash {
  0% { box-shadow: 0 0 0 3px rgba(56,93,141,0.45); }
  100% { box-shadow: none; }
}
body.dark-mode .global-search-results { background: #1e293b; border-color: #334155; }
body.dark-mode .gsr-item:hover, body.dark-mode .gsr-item.gsr-active { background: rgba(143,169,191,0.12); }
body.dark-mode .gsr-name { color: #f1f5f9; }
.siren-status { display: inline-block; margin-left: 8px; font-size: 14px; vertical-align: middle; }
.siren-spinner {
display: inline-block;
width: 13px;
height: 13px;
border: 2px solid var(--crm-border);
border-top-color: var(--crm-primary);
border-radius: 50%;
animation: sirenSpin 0.7s linear infinite;
vertical-align: middle;
}
@keyframes sirenSpin { to { transform: rotate(360deg); } }
