/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --sidebar-w: 240px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.07), 0 4px 6px rgba(0,0,0,.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ===== LAYOUT ===== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(to right, #18B8B9, #ffffff);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s;
}

.sidebar-logo {
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.sidebar-logo .logo-img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
  display: block;
}

.sidebar-logo h1 {
  color: #0a3535;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.2px;
}

.sidebar-logo p {
  color: rgba(0,0,0,.5);
  font-size: 11px;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section-title {
  color: rgba(0,0,0,.45);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 10px 16px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: rgba(0,0,0,.65);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all .15s;
  font-size: 13px;
  font-weight: 500;
}

.nav-item:hover {
  color: #0a3535;
  background: rgba(0,0,0,.07);
}

.nav-item.active {
  color: #fff;
  background: rgba(10,53,53,.55);
  border-left-color: #18B8B9;
}

.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(0,0,0,.08);
}

.version-badge {
  color: rgba(0,0,0,.4);
  font-size: 11px;
  text-align: center;
}

/* ===== MAIN ===== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-size: 17px; font-weight: 700; color: var(--gray-900); }
.topbar-subtitle { font-size: 12px; color: var(--gray-500); margin-top: 1px; }

.topbar-actions { display: flex; gap: 8px; align-items: center; }

.page-content { padding: 24px; flex: 1; }

/* ===== VIEWS ===== */
.view { display: none; }
.view.active { display: block; }

/* ===== CARDS ===== */
.card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.card-body { padding: 20px; }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-card .stat-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

.stat-card .stat-trend {
  font-size: 11px;
  margin-top: 6px;
  font-weight: 500;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-flat { color: var(--gray-400); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b45309; }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}
.btn-ghost:hover { background: var(--gray-100); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px; }

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-info    { background: var(--primary-light);  color: var(--primary); }
.badge-gray    { background: var(--gray-100); color: var(--gray-500); }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  font-size: 13px;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }

.td-actions { display: flex; gap: 6px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 7px;
  font-size: 13px;
  color: var(--gray-800);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

textarea { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #fff;
  border-radius: 14px;
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(.95) translateY(-8px);
  transition: transform .2s;
}

.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 16px; font-weight: 700; color: var(--gray-900); }

.modal-close {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: none;
  background: var(--gray-100);
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  transition: background .15s;
}

.modal-close:hover { background: var(--gray-200); }

.modal-body { padding: 20px 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ===== SEARCH & FILTERS ===== */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-box input {
  padding-left: 34px;
}

.search-box .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 14px;
  pointer-events: none;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .3s;
}

.progress-fill.green  { background: var(--success); }
.progress-fill.yellow { background: var(--warning); }
.progress-fill.red    { background: var(--danger); }

/* ===== STATION MAP / GRID ===== */
.stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.station-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .15s;
  cursor: default;
}

.station-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.station-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.station-id {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-400);
  letter-spacing: .5px;
  text-transform: uppercase;
}

.station-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  margin-top: 2px;
}

.station-location {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

.station-metrics { margin-top: 14px; }

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.metric-label { font-size: 12px; color: var(--gray-500); }
.metric-value { font-size: 13px; font-weight: 600; color: var(--gray-800); }

.station-actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-100);
}

/* ===== ALERT PANEL ===== */
.alert-list { display: flex; flex-direction: column; gap: 8px; }

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.alert-item.danger  { background: var(--danger-light);  border-color: #fecaca; }
.alert-item.warning { background: var(--warning-light); border-color: #fde68a; }
.alert-item.info    { background: var(--primary-light);  border-color: #bfdbfe; }
.alert-item.success { background: var(--success-light); border-color: #bbf7d0; }

.alert-icon { font-size: 16px; margin-top: 1px; }
.alert-title { font-size: 13px; font-weight: 600; }
.alert-desc  { font-size: 12px; color: var(--gray-600); margin-top: 2px; }
.alert-time  { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 0; bottom: 0;
  width: 2px;
  background: var(--gray-200);
}

.tl-item {
  position: relative;
  padding-bottom: 16px;
}

.tl-dot {
  position: absolute;
  left: -17px;
  top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--gray-300);
}

.tl-dot.green  { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.tl-dot.red    { background: var(--danger);  box-shadow: 0 0 0 2px var(--danger); }
.tl-dot.yellow { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }
.tl-dot.blue   { background: var(--primary); box-shadow: 0 0 0 2px var(--primary); }

.tl-content .tl-title { font-size: 13px; font-weight: 600; }
.tl-content .tl-meta  { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* ===== DASHBOARD DEUX COLONNES ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ===== CLIENT CARD ===== */
.client-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.client-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.client-info h3 { font-size: 14px; font-weight: 700; color: var(--gray-900); }
.client-info p  { font-size: 12px; color: var(--gray-500); margin-top: 1px; }

.client-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-100);
  font-size: 12px;
  color: var(--gray-500);
}

.client-meta span { display: flex; align-items: center; gap: 4px; }

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  background: transparent;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
}

.tab-btn:hover { color: var(--gray-800); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
}

.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--gray-900);
  color: #fff;
  border-radius: 9px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
  min-width: 250px;
  max-width: 360px;
}

.toast.show { transform: translateX(0); }
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); }

/* ===== CONFIRM DIALOG ===== */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}

.confirm-overlay.open { opacity: 1; pointer-events: all; }

.confirm-box {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 360px;
  box-shadow: var(--shadow-lg);
}

.confirm-box h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.confirm-box p  { font-size: 13px; color: var(--gray-600); margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .two-col, .three-col { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ===== DIVERS ===== */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--gray-500); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--gray-100); margin: 16px 0; }

/* ===== KANBAN PIPELINE ===== */
.kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: flex-start;
}

.kanban-col {
  min-width: 190px;
  max-width: 210px;
  flex-shrink: 0;
  background: var(--gray-50);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid var(--gray-200);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.kanban-col-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 5px;
}

.kanban-count {
  background: var(--gray-200);
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

.kanban-card {
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.kanban-card-selected {
  border: 2px solid var(--primary);
  background: #f0fdfb;
}

.kanban-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.kanban-card-meta {
  font-size: 11px;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.kanban-card-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-100);
}

.kanban-empty {
  text-align: center;
  padding: 16px 8px;
  color: var(--gray-400);
  font-size: 12px;
}

/* ===== RECHERCHE OSM / PROSPECT CARDS ===== */
.prospect-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.prospect-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s;
}

.prospect-card:hover { box-shadow: var(--shadow-md); }

.prospect-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.prospect-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.3;
}

.prospect-card-meta {
  font-size: 12px;
  color: var(--gray-500);
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
}

.prospect-already {
  opacity: .55;
  pointer-events: none;
}

/* ===== SCORE BADGE ===== */
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.score-high   { background: #f0fdf4; color: #16a34a; }
.score-medium { background: #fffbeb; color: #d97706; }
.score-low    { background: #fef2f2; color: #dc2626; }

/* ===== ENTONNOIR / FUNNEL ===== */
.funnel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}

.funnel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.funnel-bar-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
}

.funnel-bar {
  height: 34px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  transition: width .4s;
  min-width: 40px;
}

.funnel-label {
  font-size: 12px;
  color: var(--gray-600);
  width: 110px;
  text-align: right;
  white-space: nowrap;
}

.funnel-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-800);
  width: 28px;
  text-align: center;
}

.funnel-arrow {
  text-align: center;
  color: var(--gray-400);
  font-size: 11px;
  padding: 2px 0;
}

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px;
  color: var(--gray-500);
  font-size: 13px;
}

/* ===== PROSPECTION AUTO 38/07/26 ===== */
.auto-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #18B8B9 0%, #0ea5b6 100%);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
}
.auto-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 280px;
}
.auto-banner-icon {
  font-size: 32px;
  line-height: 1;
}
.auto-banner-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 4px;
}
.auto-banner-sub {
  font-size: 12.5px;
  opacity: .92;
  line-height: 1.45;
}
.auto-banner .btn-primary {
  background: #fff;
  color: #0e8a8b;
  border: none;
  font-weight: 700;
}
.auto-banner .btn-primary:hover {
  background: #f0fdfa;
  color: #075b5c;
}

.auto-intro {
  background: var(--gray-50);
  border: 1px dashed var(--gray-200);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.auto-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.auto-cat-pill {
  font-size: 11px;
  background: #fff;
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
}

.auto-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.auto-kpi {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  padding: 10px 12px;
}
.auto-kpi-icon { font-size: 18px; }
.auto-kpi-val {
  font-size: 17px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
}
.auto-kpi-label {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 3px;
}

.auto-progress-wrap {
  background: var(--gray-100);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 6px;
}
.auto-progress-bar {
  background: linear-gradient(to right, #18B8B9, var(--success));
  height: 100%;
  border-radius: 999px;
  transition: width .35s ease;
}
.auto-progress-label {
  font-size: 12.5px;
  color: var(--gray-700);
  margin-bottom: 14px;
}

.auto-log-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 8px 0 6px;
}
.auto-log {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: #fff;
}
.auto-log-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 12.5px;
}
.auto-log-row:last-child { border-bottom: none; }
.auto-log-error { background: var(--danger-light); }
.auto-log-summary {
  background: #f0fdfa;
  font-weight: 600;
}
.auto-log-icon { font-size: 14px; flex-shrink: 0; }
.auto-log-name {
  flex: 1;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auto-log-meta {
  color: var(--gray-500);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

.auto-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-100);
}

/* ===== ONGLETS AVEC COMPTEUR ===== */
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  background: var(--gray-100);
  color: var(--gray-700);
  border-radius: 999px;
}
.tab-btn.active .tab-count {
  background: var(--primary);
  color: #fff;
}

/* ===== EN-TÊTE DE LISTE (À prospecter / Réserve) ===== */
.liste-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.liste-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
  margin: 0 0 4px;
}
.liste-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin: 0;
  max-width: 600px;
}
.liste-stats {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== MODAL DOUBLONS ===== */
.doublons-summary {
  background: var(--warning-light);
  border: 1px solid var(--warning);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--gray-800);
}
.doublons-summary p { margin: 0; }
.doublons-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}
.doublons-group {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}
.doublons-group-title {
  background: var(--gray-50);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
}
.doublons-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
}
.doublons-card:last-child { border-bottom: none; }
.doublons-keep {
  background: #f0fdf4;
}
.doublons-remove {
  background: #fef2f2;
  opacity: 0.85;
}
.doublons-badge {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 4px;
}
.doublons-keep .doublons-badge {
  background: var(--success);
  color: #fff;
}
.doublons-remove .doublons-badge {
  background: var(--danger);
  color: #fff;
}
.doublons-card-body { flex: 1; min-width: 0; }
.doublons-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}
.doublons-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-600);
}

/* ===== KANBAN TOOLBAR ===== */
.kanban-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  flex-wrap: wrap;
}

/* ===== SUIVI TOOLBAR ===== */
.suivi-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  flex-wrap: wrap;
}
.suivi-toolbar-info {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.suivi-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.kanban-toolbar-info {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.kanban-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== NAV BADGE (notifications) ===== */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  margin-left: auto;
  line-height: 1;
}

/* ===== CA & LOCATIONS — Section API ===== */
.ca-section {
  margin-bottom: 20px;
}
.ca-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.ca-section-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-800);
}
.api-status-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.api-status-badge.api-on {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}
.api-status-badge.api-off {
  background: #fef9c3;
  color: #92400e;
  border-color: #fde68a;
}
/* Stat card en mode API non connectée */
.stat-card-api {
  opacity: .75;
}
.stat-card-api .stat-value {
  font-size: 22px;
  letter-spacing: .1em;
}

/* ===== RDV DU JOUR — Dashboard banner ===== */
.rdv-banner {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.rdv-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}
.rdv-banner-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-800);
}
.rdv-banner-empty {
  color: var(--gray-400);
  font-size: 13px;
  padding: 6px 0;
}
.rdv-banner-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.rdv-banner-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 9px;
  padding: 10px 14px;
  border: 1px solid var(--gray-100);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.rdv-banner-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37,99,235,.08);
}
.rdv-banner-time {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  min-width: 46px;
  flex-shrink: 0;
}
.rdv-banner-icon { font-size: 18px; flex-shrink: 0; }
.rdv-banner-info { flex: 1; min-width: 0; }
.rdv-banner-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--gray-800);
}
.rdv-banner-sub {
  font-size: 11px;
  color: var(--gray-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.rdv-banner-item.rdv-done { opacity: .6; }
.rdv-banner-item.rdv-done .rdv-banner-name { text-decoration: line-through; }
@media (max-width: 768px) {
  .rdv-banner { padding: 14px 16px; }
}

/* ===== SEARCHABLE SELECT ===== */
.ss-wrap {
  position: relative;
  width: 100%;
}
.ss-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 13.5px;
  background: #fff;
  transition: border-color .15s;
  outline: none;
}
.ss-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24,184,185,.12);
}
.ss-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 9999;
}
.ss-dropdown.open { display: block; }
.ss-option {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--gray-800);
  transition: background .1s;
}
.ss-option:hover { background: var(--gray-50); }

/* ===== AGENTS ===== */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.agent-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .15s;
}
.agent-card:hover { box-shadow: var(--shadow-md); }

.agent-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.agent-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -.5px;
}

.agent-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-card-actions {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
  margin-left: auto;
}

.agent-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.agent-info-row {
  font-size: 13px;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-rib-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 7px;
  padding: 6px 10px;
}
.agent-rib-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  white-space: nowrap;
}
.agent-rib {
  font-family: monospace;
  font-size: 12px;
  color: var(--gray-700);
  flex: 1;
  letter-spacing: 1px;
  filter: blur(5px);
  user-select: none;
  transition: filter .25s;
  word-break: break-all;
}

.agent-stats {
  display: flex;
  gap: 6px;
}
.agent-stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  padding: 8px 4px;
  background: var(--gray-50);
  border-radius: 8px;
}
.agent-stat-highlighted {
  background: var(--danger-light) !important;
}
.agent-stat-value {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-800);
  line-height: 1.2;
}
.agent-stat-label {
  font-size: 11px;
  color: var(--gray-500);
  line-height: 1.3;
}

/* Modal stations agent */
.agent-station-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: 8px;
  margin-bottom: 8px;
}

.agent-comm-summary {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--gray-50);
  border-radius: 10px;
}
.agent-comm-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  padding: 8px 6px;
  background: #fff;
  border-radius: 7px;
  border: 1px solid var(--gray-100);
}
.agent-comm-value {
  font-weight: 700;
  font-size: 15px;
  color: var(--gray-800);
}
.agent-comm-label {
  font-size: 11px;
  color: var(--gray-500);
}

/* ===== AGENDA ===== */
.agenda-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  align-items: start;
}

.agenda-cal-wrap {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  overflow: hidden;
}

.cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}
.cal-header-day {
  padding: 10px 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-day {
  min-height: 100px;
  padding: 6px;
  border-right: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background .1s;
  overflow: hidden;
}
.cal-day:hover { background: var(--gray-50); }
.cal-day:nth-child(7n) { border-right: none; }

.cal-other {
  background: #fafafa;
}
.cal-other .cal-day-num { color: var(--gray-300); }

.cal-today {
  background: #eff6ff !important;
}

.cal-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 3px;
  border-radius: 50%;
}
.cal-day-num-today {
  background: var(--primary);
  color: #fff !important;
  font-weight: 700;
}

.cal-pill {
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  line-height: 1.5;
  transition: opacity .1s;
}
.cal-pill:hover { opacity: .8; }

.cal-more {
  font-size: 10px;
  color: var(--gray-400);
  font-weight: 600;
  padding: 1px 4px;
  margin-top: 1px;
}

/* Sidebar agenda */
.agenda-sidebar {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  max-height: 680px;
  overflow-y: auto;
  position: sticky;
  top: 16px;
}

.agenda-rdv-card {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--gray-100);
  cursor: pointer;
  transition: box-shadow .12s, border-color .12s;
}
.agenda-rdv-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
}
.agenda-rdv-today {
  border-left: 3px solid var(--primary);
  background: #f8faff;
}
.agenda-rdv-done {
  opacity: .6;
  background: var(--gray-50);
}

.agenda-rdv-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.agenda-rdv-title {
  font-weight: 600;
  font-size: 13px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agenda-rdv-meta {
  font-size: 12px;
  color: var(--gray-500);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-300);
  border-radius: 999px;
  transition: background .2s;
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ===== NOTIFICATION RULES MODAL ===== */
.notif-rule-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1.5px solid var(--gray-100);
  background: #fff;
  margin-bottom: 8px;
  transition: opacity .2s, border-color .2s;
}
.notif-rule-row.notif-rule-off {
  opacity: .5;
  background: var(--gray-50);
}
.notif-rule-info {
  flex: 1;
  min-width: 0;
}
.notif-rule-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-900);
}
.notif-rule-desc {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 2px;
}
.notif-rule-seuil { flex-shrink: 0; }
.notif-seuil-input {
  padding: 5px 8px;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
}
.notif-seuil-input:focus {
  border-color: var(--primary);
  outline: none;
}
.notif-rule-canal { flex-shrink: 0; min-width: 130px; }
.notif-canal-select {
  width: 100%;
  padding: 5px 8px;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  font-size: 12px;
}
.notif-add-form {
  background: var(--gray-50);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 16px;
  border: 1px solid var(--gray-100);
}
@media (max-width: 540px) {
  .notif-rule-row { flex-wrap: wrap; }
  .notif-rule-canal { min-width: 100%; }
}

/* ===== CA MODAL — Stats & formulaire ===== */
.ca-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 540px) {
  .ca-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
.ca-add-form {
  background: var(--gray-50);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--gray-100);
}

/* ===== RÉCAP COMMERÇANTS — Notifications WhatsApp/Email ===== */
.recap-veille {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.recap-veille-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.recap-veille-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-800);
}
.recap-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recap-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  background: var(--gray-50);
  border-radius: 9px;
  border: 1px solid var(--gray-100);
  flex-wrap: wrap;
}
.recap-station {
  flex: 1.2;
  min-width: 140px;
}
.recap-station-ref {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.recap-station-nom {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recap-client {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recap-chiffres {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.recap-ca {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 80px;
}
.recap-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.recap-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--gray-900);
}
.recap-val.recap-vide { color: var(--gray-300); }
.recap-val.recap-com  { color: #059669; }
.recap-estime {
  font-size: 10px;
  color: #d97706;
  font-weight: 600;
}
.recap-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}
.recap-row-off {
  opacity: .55;
  background: var(--gray-50);
  border-color: var(--gray-100);
}
.recap-row-off .recap-station-nom { text-decoration: line-through; color: var(--gray-400); }
.recap-btn-wa {
  background: #25d366;
  color: #fff;
  border-color: #25d366;
}
.recap-btn-wa:hover {
  background: #1da851;
  border-color: #1da851;
  color: #fff;
}
@media (max-width: 768px) {
  .recap-row { flex-direction: column; align-items: flex-start; }
  .recap-actions { margin-left: 0; }
}

/* ===== ALERTE DÉBRANCHEMENT >48h ===== */
.alerte-debranche {
  background: #fff;
  border: 1.5px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.alerte-debranche-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.alerte-debranche-titre {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-900);
}
.alerte-debranche-duree {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  background: #fef2f2;
  color: #dc2626;
  border-radius: 999px;
  flex-shrink: 0;
}
.alerte-debranche-contact {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.9;
}
.alerte-debranche-contact a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.alerte-debranche-contact a:hover { text-decoration: underline; }
.alerte-debranche-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Badge critique dans le dashboard alert-list */
.alert-item.alerte-crit {
  border-left: 3px solid #dc2626;
  background: #fff5f5;
}
.alerte-crit-contact {
  font-size: 11px;
  color: var(--gray-600);
  margin-top: 3px;
}

/* Google Calendar sync */
.btn.gcal-synced {
  border-color: #34a853;
  color: #34a853;
  background: #f0fdf4;
}
.btn.gcal-synced:hover {
  background: #dcfce7;
}

/* ===== CARTE LEAFLET ===== */
.carte-legende {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--gray-600);
  align-items: center;
}
.carte-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  border: 1.5px solid rgba(0,0,0,.15);
  vertical-align: middle;
}
/* Surcharge Leaflet pour s'intégrer au design */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-md) !important;
  padding: 0 !important;
}
.leaflet-popup-content {
  margin: 12px 14px !important;
}
.leaflet-popup-tip-container { display: none; }

@media (max-width: 768px) {
  .auto-kpis { grid-template-columns: repeat(2, 1fr); }
  .auto-banner { flex-direction: column; align-items: stretch; }
  .auto-banner-left { min-width: 0; }
  .kanban-toolbar { flex-direction: column; align-items: stretch; }
  .agents-grid { grid-template-columns: 1fr; }
  .agent-stats { flex-wrap: wrap; }
  .agenda-layout { grid-template-columns: 1fr; }
  .agenda-sidebar { position: static; max-height: none; }
  .cal-day { min-height: 70px; }
}

/* ===== PWA OFFLINE BANNER ===== */
.offline-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1e293b;
  color: #f8fafc;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  z-index: 9999;
  display: none;
  animation: slideUp .3s ease;
}
.offline-banner.visible { display: block; }
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ===== RECHERCHE GLOBALE ===== */
.topbar { display: flex; align-items: center; gap: 12px; }
.topbar-search { flex: 1; max-width: 380px; }
.search-global-wrap { position: relative; }
.search-global-input {
  width: 100%; padding: 7px 36px 7px 14px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius);
  font-size: 13px; background: var(--gray-50); color: var(--gray-800);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.search-global-input:focus {
  border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.search-global-icon {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 13px; pointer-events: none; opacity: .5;
}
.search-global-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 2000; overflow: hidden; max-height: 360px; overflow-y: auto;
}
.search-global-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; cursor: pointer; transition: background .1s;
}
.search-global-item:hover, .search-global-active { background: var(--gray-50); }
.search-global-item-icon { font-size: 15px; flex-shrink: 0; }
.search-global-item-body { flex: 1; min-width: 0; }
.search-global-item-label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-global-item-sub   { display: block; font-size: 11px; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-global-item-type  { font-size: 10px; color: var(--gray-400); text-transform: uppercase; flex-shrink: 0; }
.search-global-empty      { padding: 14px; font-size: 13px; color: var(--gray-500); text-align: center; }
.search-global-more       { padding: 8px 14px; font-size: 11px; color: var(--gray-500); text-align: center; border-top: 1px solid var(--gray-100); }

/* ===== IMPORT CSV ===== */
.csv-dropzone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  background: var(--gray-50);
  transition: border-color .2s, background .2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--gray-600);
  font-size: 14px;
}
.csv-dropzone:hover { border-color: var(--primary); background: #f0f9ff; }
.csv-dropzone-active { border-color: var(--primary); background: #e0f2fe !important; }
.csv-drop-icon { font-size: 40px; line-height: 1; }
.csv-format-hint {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 14px;
  margin-top: 16px;
}
.csv-format-hint p { margin: 0 0 6px; font-size: 12px; }
.csv-format-hint code { font-size: 11px; }
.stat-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid currentColor;
}
.stat-mini span { font-size: 22px; font-weight: 800; display: block; line-height: 1; }
.stat-mini.stat-success { color: var(--success); background: var(--success-light); border-color: var(--success); }
.stat-mini.stat-warning { color: #d97706; background: var(--warning-light); border-color: #d97706; }
.stat-mini.stat-danger  { color: var(--danger); background: var(--danger-light); border-color: var(--danger); }
.stat-mini.stat-info    { color: var(--primary); background: #eff6ff; border-color: var(--primary); }

/* ===== HISTORIQUE DES RELANCES ===== */
.relance-section { margin-top: 4px; }
.relance-section-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.relance-section-title { font-size: 13px; font-weight: 700; color: var(--gray-700); }
.relance-log-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: 8px; margin-bottom: 4px;
  background: var(--gray-50); transition: background .1s;
}
.relance-log-row:hover { background: #f1f5f9; }
.relance-log-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.relance-log-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.relance-log-type { font-size: 12px; font-weight: 700; }
.relance-log-date { font-size: 11px; color: var(--gray-500); }
.relance-log-note { font-size: 12px; color: var(--gray-700); width: 100%; }
.relance-log-del { background: none; border: none; cursor: pointer; font-size: 13px; opacity: .45; padding: 2px 4px; flex-shrink: 0; line-height: 1; }
.relance-log-del:hover { opacity: 1; }
.relance-add-form {
  display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center;
}
.relance-add-type  { flex-shrink: 0; font-size: 12px; padding: 5px 8px; border: 1.5px solid var(--gray-200); border-radius: 6px; background: #fff; }
.relance-add-date  { flex-shrink: 0; font-size: 12px; padding: 5px 8px; border: 1.5px solid var(--gray-200); border-radius: 6px; }
.relance-add-note  { flex: 1; min-width: 120px; font-size: 12px; padding: 5px 10px; border: 1.5px solid var(--gray-200); border-radius: 6px; }

/* ===== NOTIFICATION PUSH BANNER ===== */
.notif-prompt-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1.5px solid #7dd3fc;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #0369a1;
  font-weight: 500;
}
@media (max-width: 768px) {
  .notif-prompt-banner { flex-direction: column; align-items: stretch; text-align: center; }
}

/* ===== MODULE CONTRATS ===== */
.contrats-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.contrats-table th { background: var(--gray-50); padding: 8px 12px; text-align: left; font-weight: 600; color: var(--gray-600); border-bottom: 2px solid var(--gray-200); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.contrats-table td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.contrats-table tr:hover td { background: var(--gray-50); }
.contrat-badge { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:999px; font-size:11px; font-weight:600; }
.contrat-actif { background:#dcfce7; color:#16a34a; }
.contrat-expire { background:#fee2e2; color:#dc2626; }
.contrat-resilie { background:#f3f4f6; color:#6b7280; }
.contrat-en_attente { background:#fef3c7; color:#d97706; }
.contrat-type-badge { background:var(--primary-light); color:var(--primary-dark); padding:2px 8px; border-radius:999px; font-size:11px; font-weight:600; }
.contrat-section { background: var(--gray-50); border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; }
.contrat-section-title { font-size: 12px; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.contrat-section-empty { font-size: 12px; color: var(--gray-400); font-style: italic; }
.contrat-mini-row { display:flex; justify-content:space-between; align-items:center; padding: 6px 0; border-bottom: 1px solid var(--gray-200); font-size: 12px; }
.contrat-mini-row:last-child { border-bottom: none; }
.contrat-expiry-warn { color: var(--warning); font-weight: 600; }
.contrat-expiry-crit { color: var(--danger); font-weight: 700; }

/* ===== TICKETS SAV ===== */
.ticket-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.ticket-item { background: #fff; border-radius: 8px; padding: 12px 14px; border: 1.5px solid var(--gray-200); }
.ticket-item.ticket-ouvert { border-left: 3px solid var(--danger); }
.ticket-item.ticket-resolu { border-left: 3px solid var(--success); opacity: .75; }
.ticket-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.ticket-titre { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.ticket-date  { font-size: 11px; color: var(--gray-500); flex-shrink: 0; }
.ticket-desc  { font-size: 12px; color: var(--gray-600); }
.ticket-actions { display: flex; gap: 6px; margin-top: 8px; }
.ticket-add-form { display: flex; flex-direction: column; gap: 8px; background: var(--gray-50); border-radius: 8px; padding: 12px; margin-top: 10px; }
.ticket-add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ticket-add-input { flex: 1; min-width: 150px; font-size: 12px; padding: 6px 10px; border: 1.5px solid var(--gray-200); border-radius: 6px; background: #fff; }
.ticket-add-textarea { width: 100%; font-size: 12px; padding: 6px 10px; border: 1.5px solid var(--gray-200); border-radius: 6px; background: #fff; resize: vertical; min-height: 60px; font-family: inherit; }

/* ===== ONBOARDING WIZARD ===== */
.wizard-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 20px; }
.wizard-modal { background: #fff; border-radius: 16px; max-width: 560px; width: 100%; padding: 32px 32px 24px; box-shadow: var(--shadow-lg); }
.wizard-logo { text-align: center; margin-bottom: 16px; }
.wizard-logo img { width: 72px; height: 72px; object-fit: cover; border-radius: 16px; }
.wizard-steps { display: flex; justify-content: center; gap: 8px; margin-bottom: 24px; }
.wizard-step-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gray-200); transition: background .2s; }
.wizard-step-dot.active { background: var(--primary); }
.wizard-step-dot.done   { background: var(--success); }
.wizard-title { font-size: 20px; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; text-align: center; }
.wizard-subtitle { font-size: 13px; color: var(--gray-500); text-align: center; margin-bottom: 20px; }
.wizard-content { font-size: 13px; color: var(--gray-700); line-height: 1.7; }
.wizard-feature-list { list-style: none; padding: 0; margin: 12px 0; }
.wizard-feature-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.wizard-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--gray-100); }

/* ===== CAMPAGNE EMAIL ===== */
.campagne-select-list { max-height: 260px; overflow-y: auto; border: 1.5px solid var(--gray-200); border-radius: 8px; }
.campagne-client-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--gray-100); cursor: pointer; font-size: 13px; }
.campagne-client-item:last-child { border-bottom: none; }
.campagne-client-item:hover { background: var(--gray-50); }
.campagne-client-item input[type=checkbox] { flex-shrink: 0; accent-color: var(--primary); width: 16px; height: 16px; }
.campagne-client-nom { font-weight: 600; color: var(--gray-800); flex: 1; }
.campagne-client-email { font-size: 11px; color: var(--gray-500); }
.campagne-select-all { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--primary-dark); cursor: pointer; border-bottom: 2px solid var(--gray-200); background: var(--primary-light); border-radius: 8px 8px 0 0; }
.campagne-compose { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.campagne-compose input, .campagne-compose textarea { font-size: 13px; padding: 8px 12px; border: 1.5px solid var(--gray-200); border-radius: 8px; font-family: inherit; }
.campagne-compose textarea { min-height: 80px; resize: vertical; }
.campagne-preview { background: var(--gray-50); border-radius: 8px; padding: 12px; font-size: 12px; color: var(--gray-600); margin-top: 8px; }
.campagne-preview strong { color: var(--gray-800); }

/* ===== PRÉVISION CA GLOBAL (dashboard KPI) ===== */
.prevision-detail { font-size: 11px; color: var(--gray-500); margin-top: 4px; }

/* ===== RESPONSIVE MOBILE ===== */
.sidebar-toggle {
  display: none;
  position: fixed; top: 12px; left: 12px; z-index: 400;
  background: #18B8B9; color: #fff; border: none;
  border-radius: 8px; width: 40px; height: 40px;
  align-items: center; justify-content: center;
  font-size: 20px; cursor: pointer; box-shadow: var(--shadow-md);
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 199;
}
@media (max-width: 768px) {
  .sidebar-toggle { display: flex; }
  .sidebar { transform: translateX(-100%); z-index: 200; transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.15); }
  .sidebar.open ~ .sidebar-overlay { display: block; }
  .main-content { margin-left: 0 !important; }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .topbar-search { order: 3; width: 100%; max-width: 100%; }
  .topbar-actions .btn-ghost { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .two-col { grid-template-columns: 1fr; }
  .contrats-table th:nth-child(4),
  .contrats-table td:nth-child(4) { display: none; }
  .modal { max-width: 100% !important; border-radius: 14px 14px 0 0; }
}

/* ===== MODE SOMBRE ===== */
[data-theme="dark"] {
  --gray-50:  #111827;
  --gray-100: #1f2937;
  --gray-200: #374151;
  --gray-300: #4b5563;
  --gray-400: #6b7280;
  --gray-500: #9ca3af;
  --gray-600: #d1d5db;
  --gray-700: #e5e7eb;
  --gray-800: #f3f4f6;
  --gray-900: #f9fafb;
  --primary-light:  #1e3a5f;
  --success-light:  #052e16;
  --warning-light:  #451a03;
  --danger-light:   #450a0a;
  --shadow:    0 1px 3px rgba(0,0,0,.5);
  --shadow-md: 0 4px 6px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.4);
}
[data-theme="dark"] body        { background: #111827; color: #e5e7eb; }
[data-theme="dark"] .main-content { background: #111827; }
[data-theme="dark"] .card       { background: #1f2937; border-color: #374151; }
[data-theme="dark"] .card-header { border-color: #374151; }
[data-theme="dark"] .topbar     { background: #1f2937; border-color: #374151; }
[data-theme="dark"] .sidebar    { background: linear-gradient(to right, #0c5e5f, #1f2937); }
[data-theme="dark"] .sidebar-logo h1 { color: #e5e7eb; }
[data-theme="dark"] .sidebar-logo p  { color: rgba(255,255,255,.5); }
[data-theme="dark"] .nav-item   { color: #d1d5db; }
[data-theme="dark"] .nav-item:hover, [data-theme="dark"] .nav-item.active { background: rgba(255,255,255,.1); color: #fff; }
[data-theme="dark"] .nav-section-title { color: rgba(255,255,255,.4); }
[data-theme="dark"] .sidebar-footer .version-badge { color: rgba(255,255,255,.35); }
[data-theme="dark"] .modal      { background: #1f2937; border-color: #374151; }
[data-theme="dark"] .modal-header, [data-theme="dark"] .modal-footer { border-color: #374151; }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background: #111827; color: #e5e7eb; border-color: #374151;
}
[data-theme="dark"] input::placeholder, [data-theme="dark"] textarea::placeholder { color: #4b5563; }
[data-theme="dark"] .btn-ghost  { background: #1f2937; color: #d1d5db; border-color: #374151; }
[data-theme="dark"] .btn-ghost:hover { background: #374151; }
[data-theme="dark"] table       { color: #e5e7eb; }
[data-theme="dark"] th          { background: #1f2937; color: #9ca3af; border-color: #374151; }
[data-theme="dark"] td          { border-color: #374151; }
[data-theme="dark"] tr:hover td { background: #252f3e !important; }
[data-theme="dark"] .tabs       { background: #1f2937; border-color: #374151; }
[data-theme="dark"] .tab-btn    { color: #9ca3af; }
[data-theme="dark"] .tab-btn.active { background: #111827; color: var(--primary); }
[data-theme="dark"] .toolbar    { background: #1a2335; border-color: #374151; }
[data-theme="dark"] .search-box { background: #111827; border-color: #374151; }
[data-theme="dark"] .stat-card  { background: #1f2937; }
[data-theme="dark"] .progress-bar { background: #374151; }
[data-theme="dark"] .kanban-col  { background: #1a2335; }
[data-theme="dark"] .kanban-card { background: #1f2937; }
[data-theme="dark"] .confirm-box { background: #1f2937; }
[data-theme="dark"] .confirm-overlay { background: rgba(0,0,0,.7); }
[data-theme="dark"] .toast      { background: #1f2937; color: #e5e7eb; }
[data-theme="dark"] .timeline-item { border-color: #374151; }
[data-theme="dark"] .page-content { background: #111827; }
[data-theme="dark"] .offline-banner { background: #1e3a5f; }
[data-theme="dark"] .dark-toggle-btn { color: #fbbf24; }

