:root {
  --crm-primary: #6d28d9;
  --crm-primary-light: #8b5cf6;
  --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: #6d28d9;
  --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%;
}
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, #6d28d9 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(109,40,217,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;
  }
  .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(109,40,217,0.08);
    color: var(--crm-primary);
  }
  .crm-nav-item.active {
    background: linear-gradient(90deg, rgba(109,40,217,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; }
  .keyboard-hint {
    font-size: 11px;
    color: var(--crm-text-light);
    padding: 16px 20px;
    line-height: 1.6;
    border-top: 1px solid var(--crm-border);
  }
  .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;
  }
  .crm-nav { padding: 8px 6px; flex: 1; }
  .crm-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 4px;
    margin-bottom: 4px;
    border-radius: var(--crm-radius-sm);
    color: var(--crm-text-muted);
    cursor: pointer;
    transition: all 0.15s;
  }
  .crm-nav-item:hover {
    background: rgba(109,40,217,0.08);
    color: var(--crm-primary);
  }
  .crm-nav-item.active {
    background: rgba(109,40,217,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;
  }
  .keyboard-hint { display: none; }
  .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(109,40,217,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); }
.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(109,40,217,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(109,40,217,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(109,40,217,0.12);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.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 18px;
  text-align: left;
  border-bottom: 1px solid var(--crm-border);
  font-size: 14px;
}
.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(109,40,217,0.03);
}
.contact-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.status-prospect { background: #fef3c7; color: #d97706; }
.status-contact { background: #dbeafe; color: #2563eb; }
.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;
}
.score-chaud { background: #fee2e2; color: #b91c1c; }
.score-tiede { background: #ffedd5; color: #b45309; }
.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(109,40,217,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(109,40,217,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: #6d28d9; color: #fff; }
.inv-btn-purple:hover { background: rgba(109,40,217,0.85); }
.inv-btn-blue { background: #2563eb; color: #fff; }
.inv-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.inv-status-devis { background: #f1f5f9; color: #64748b; }
.inv-status-envoye { background: #dbeafe; color: #1d4ed8; }
.inv-status-accepte { background: #d1fae5; color: #065f46; }
.inv-status-facture { background: #ede9fe; color: #5b21b6; }
.inv-status-paye { background: #d1fae5; color: #047857; }
.inv-status-echu { background: #fee2e2; color: #b91c1c; }
.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.rdv { background: var(--crm-primary); }
.timeline-dot.devis { 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(109,40,217,0.08);
  color: var(--crm-primary);
  border: 1px solid rgba(109,40,217,0.2);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ai-suggestion-chip:hover {
  background: rgba(109,40,217,0.16);
}
.ai-summary {
  background: linear-gradient(135deg, rgba(109,40,217,0.06), rgba(6,182,212,0.04));
  border: 1px solid rgba(109,40,217,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(109,40,217,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-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(109,40,217,0.04);
}
.wf-choice-card.selected {
  border-color: var(--crm-primary);
  background: rgba(109,40,217,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(109,40,217,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(109,40,217,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(109,40,217,0.06), rgba(6,182,212,0.04));
  border: 1px solid rgba(109,40,217,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(109,40,217,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(109,40,217,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(109,40,217,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;
}
.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(109,40,217,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;
}
.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;
}
.settings-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--crm-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-info-block { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 14px; margin: 16px 0; font-size: 13px; }
.settings-info-block p { margin: 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-commercial { background: #dbeafe; color: #1d4ed8; }
.role-viewer { background: #f1f5f9; color: #64748b; }
.team-upgrade-box {
  background: linear-gradient(135deg, rgba(109,40,217,0.08), rgba(6,182,212,0.05));
  border: 1px solid rgba(109,40,217,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: 9999;
  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-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);
  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(167,139,250,0.1); color: #a78bfa; }
body.dark-mode .crm-nav-item.active { background: rgba(167,139,250,0.15); color: #a78bfa; }
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(167,139,250,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(167,139,250,0.1); }
body.dark-mode .wf-info-block { background: #0f172a; }
body.dark-mode .wf-param-block { background: #0f172a; }
body.dark-mode .status-prospect { background: #78350f; color: #fcd34d; }
body.dark-mode .status-contact { background: #1e3a5f; color: #93c5fd; }
body.dark-mode .status-client { background: #064e3b; color: #6ee7b7; }
body.dark-mode .score-chaud { background: #7f1d1d; color: #fca5a5; }
body.dark-mode .score-tiede { background: #7c2d12; color: #fdba74; }
body.dark-mode .score-froid { background: #1e1b4b; color: #a5b4fc; }
body.dark-mode .calendar-day { color: #f1f5f9; }
body.dark-mode .calendar-day:hover { background: rgba(167,139,250,0.15); }
body.dark-mode .calendar-day.disabled { color: #475569; }
body.dark-mode .welcome-banner { background: rgba(167,139,250,0.1); border-color: rgba(167,139,250,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); }
@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; }
}
@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; }
.facturx-summary::-webkit-details-marker { display: none; }
.facturx-badge { background: #6d28d9; 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: #6d28d9; color: #fff; border-radius: 50%; font-size: 10px; font-weight: 700; cursor: help; margin-left: 4px; vertical-align: middle; }
.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; }
.upgrade-plan-recommended { border-color: #6d28d9; background: #faf5ff; }
.upgrade-plan-name { font-weight: 700; font-size: 14px; }
.upgrade-plan-badge { background: #6d28d9; 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; }
.btn-upgrade { background: #6d28d9; 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: #6d28d9; 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; }
.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; }
.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; }
.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 { width: 44px; height: 24px; background: #cbd5e1; border-radius: 12px; position: relative; transition: background .2s; }
.toggle-label input:checked~.toggle-slider { background: #6d28d9; }
.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-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: #6d28d9; }
.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); }
.shortcuts-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  justify-content: center;
  align-items: center;
}
.shortcuts-modal {
  background: var(--crm-card);
  border-radius: 20px;
  padding: 32px;
  width: 90%;
  max-width: 400px;
}
.shortcuts-title {
  margin-bottom: 20px;
  font-size: 18px;
  color: var(--crm-text);
}
.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.shortcuts-row {
  border-bottom: 1px solid var(--crm-border);
}
.shortcuts-row-last {
  border-bottom: none;
}
.shortcuts-key {
  padding: 10px 0;
  color: var(--crm-text-muted);
}
.shortcuts-desc {
  padding: 10px 0;
  color: var(--crm-text);
}
.shortcuts-close-btn {
  margin-top: 20px;
  width: 100%;
  padding: 12px;
  background: var(--crm-primary);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
.shortcuts-close-btn:hover {
  background: #5b21b6;
}
.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%);
}