:root {
  --bg:       #07090f;
  --surface:  #0d1220;
  --surface2: #121929;
  --surface3: #192035;
  --border:   #1e2d45;
  --border2:  #253550;

  --text:       #d4def0;
  --text-muted: #5e7399;
  --text-dim:   #3a4f6e;

  --accent:      #4a7bff;
  --accent-light:#7ba0ff;
  --accent-glow: rgba(74,123,255,.14);

  --rouge:  #ff4444;
  --orange: #ff7c30;
  --jaune:  #ffc820;
  --vert:   #00d97e;

  --statut-nouveau:     #4a7bff;
  --statut-a_contacter: #8b5cf6;
  --statut-contacte:    #06b6d4;
  --statut-en_cours:    #f59e0b;
  --statut-vendu:       #00d97e;
  --statut-refuse:      #ff4444;
  --statut-injoignable: #5e7399;

  --font-display: 'Syne', sans-serif;
  --font-body:    'Figtree', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dot grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(74,123,255,.045) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

#login-screen, header, main { position: relative; z-index: 1; }

/* ── Custom scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ══════════════════════════════════════════
   LOGIN
══════════════════════════════════════════ */

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% -5%, rgba(74,123,255,.18) 0%, transparent 65%),
    radial-gradient(ellipse 45% 35% at 85% 100%, rgba(139,92,246,.1) 0%, transparent 55%);
  pointer-events: none;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 44px 40px;
  width: 400px;
  box-shadow: 0 32px 80px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.03);
  animation: fadeUp .4s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}

.logo-mark {
  font-size: 28px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border: 1px solid rgba(74,123,255,.22);
  border-radius: 14px;
  flex-shrink: 0;
}

.logo-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.logo-tagline {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 7px;
  letter-spacing: .03em;
}

.field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field input::placeholder { color: var(--text-dim); }

.login-error {
  color: #ff6b6b;
  font-size: 13px;
  margin-bottom: 14px;
  min-height: 18px;
}

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 4px 20px rgba(74,123,255,.32);
}

.btn-primary:hover {
  background: #3a6aee;
  box-shadow: 0 4px 28px rgba(74,123,255,.48);
}

.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-arrow { transition: transform .2s; }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

/* ══════════════════════════════════════════
   APP SHELL
══════════════════════════════════════════ */

#app { display: none; flex-direction: column; min-height: 100vh; }

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  background: rgba(7,9,15,.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.brand-emoji { font-size: 22px; }

.brand-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.brand-region {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(0,217,126,.07);
  border: 1px solid rgba(0,217,126,.16);
  border-radius: 99px;
  padding: 5px 13px;
  font-size: 12px;
  color: var(--vert);
  font-family: var(--font-mono);
  white-space: nowrap;
  flex-shrink: 0;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--vert);
  box-shadow: 0 0 8px var(--vert);
  animation: pulseDot 2.2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}

.icon-btn:hover { border-color: var(--border2); color: var(--text); }
.icon-btn.spinning svg { animation: spinIcon .7s linear infinite; }
@keyframes spinIcon { to { transform: rotate(360deg); } }

.logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}

.logout-btn:hover { border-color: var(--text-dim); color: var(--text); }

/* ── Main ── */
main {
  padding: 28px;
  flex: 1;
  max-width: 1700px;
  margin: 0 auto;
  width: 100%;
}

/* ══════════════════════════════════════════
   STATS
══════════════════════════════════════════ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 14px;
  padding: 20px 22px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  user-select: none;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,.3); }

.stat-card.rouge  { border-left-color: var(--rouge); }
.stat-card.orange { border-left-color: var(--orange); }
.stat-card.jaune  { border-left-color: var(--jaune); }
.stat-card.vert   { border-left-color: var(--vert); }

/* Active state when clicked */
.stat-card.active { box-shadow: 0 0 0 1.5px currentColor; }
.stat-card.rouge.active  { box-shadow: 0 0 0 1.5px var(--rouge); }
.stat-card.orange.active { box-shadow: 0 0 0 1.5px var(--orange); }
.stat-card.jaune.active  { box-shadow: 0 0 0 1.5px var(--jaune); }
.stat-card.vert.active   { box-shadow: 0 0 0 1.5px var(--vert); }

/* Ambient glow on hover */
.stat-glow {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  filter: blur(35px);
  opacity: 0;
  bottom: -25px;
  right: -20px;
  pointer-events: none;
  transition: opacity .3s;
}
.stat-card:hover .stat-glow { opacity: .35; }
.stat-glow.rouge  { background: var(--rouge); }
.stat-glow.orange { background: var(--orange); }
.stat-glow.jaune  { background: var(--jaune); }
.stat-glow.vert   { background: var(--vert); }

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.stat-emoji { font-size: 17px; }

.stat-num {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.stat-card.rouge  .stat-num { color: var(--rouge); }
.stat-card.orange .stat-num { color: var(--orange); }
.stat-card.jaune  .stat-num { color: var(--jaune); }
.stat-card.vert   .stat-num { color: var(--vert); }

.stat-sub {
  font-size: 11px;
  color: var(--text-dim);
}

/* ══════════════════════════════════════════
   FILTERS
══════════════════════════════════════════ */

.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Search */
.search-box { position: relative; flex-shrink: 0; }

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

#filter-search {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 38px 9px 38px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  width: 260px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

#filter-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#filter-search::placeholder { color: var(--text-dim); }

.search-box kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface3);
  border: 1px solid var(--border2);
  border-radius: 5px;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  pointer-events: none;
}

/* Selects */
.filters select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 30px 9px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235e7399' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.filters select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.filters select option { background: var(--surface2); color: var(--text); }

.btn-reset {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.btn-reset:hover { border-color: var(--rouge); color: var(--rouge); }

.filter-end {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.count-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px 13px;
  white-space: nowrap;
}

.btn-export {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.btn-export:hover { border-color: var(--accent); color: var(--accent); }

.btn-import {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.btn-import:hover { border-color: var(--vert); color: var(--vert); }
.btn-import:disabled { opacity: .45; cursor: not-allowed; }
.btn-import.spinning svg { animation: spinIcon .7s linear infinite; }

/* ══════════════════════════════════════════
   TABLE
══════════════════════════════════════════ */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: auto;
  min-height: 320px;
}

/* Skeleton */
.skeleton-header-row {
  height: 44px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  border-radius: 14px 14px 0 0;
  animation: shimmer 1.6s ease-in-out infinite;
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 400% 100%;
}

.skeleton-row {
  height: 58px;
  border-bottom: 1px solid var(--border);
  animation: shimmer 1.6s var(--d, 0s) ease-in-out infinite;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.015) 50%, transparent 100%);
  background-size: 400% 100%;
}

.skeleton-row:last-child { border-bottom: none; }

@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 10px;
}

.empty-icon { font-size: 42px; opacity: .35; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-muted); }
.empty-sub { font-size: 13px; color: var(--text-dim); }

/* Table core */
table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--surface2);
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
  cursor: default;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--border);
  transition: color .15s;
}

thead th[data-key] { cursor: pointer; }
thead th[data-key]:hover { color: var(--text); }
thead th.sorted-asc::after  { content: " ↑"; color: var(--accent); }
thead th.sorted-desc::after { content: " ↓"; color: var(--accent); }

/* Rows */
tbody tr {
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  transition: background .12s, border-left-color .12s;
  animation: rowIn .28s ease both;
}

@keyframes rowIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

tbody tr[data-priorite="rouge"]  { border-left-color: var(--rouge); }
tbody tr[data-priorite="orange"] { border-left-color: var(--orange); }
tbody tr[data-priorite="jaune"]  { border-left-color: var(--jaune); }

tbody td { padding: 12px 16px; vertical-align: top; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge.rouge  { background: rgba(255,68,68,.1);  color: var(--rouge);  border: 1px solid rgba(255,68,68,.2); }
.badge.orange { background: rgba(255,124,48,.1); color: var(--orange); border: 1px solid rgba(255,124,48,.22); }
.badge.jaune  { background: rgba(255,200,32,.1); color: var(--jaune);  border: 1px solid rgba(255,200,32,.22); }
.badge.none   { color: var(--text-dim); border: 1px solid var(--border); }

/* Company cell */
.cell-company strong { font-size: 13px; font-weight: 600; color: var(--text); }
.cell-company small  { display: block; font-size: 11px; color: var(--text-dim); margin-top: 2px; font-family: var(--font-mono); }

/* URL */
.url-link {
  color: var(--accent-light);
  text-decoration: none;
  font-size: 12px;
  word-break: break-all;
  transition: color .15s;
}
.url-link:hover { color: var(--accent); text-decoration: underline; }
.no-url { font-size: 11px; color: var(--text-dim); font-style: italic; }

/* Phone */
.cell-phone { font-family: var(--font-mono); font-size: 12px; white-space: nowrap; color: var(--text-muted); }

/* Score */
.score-bar { display: flex; gap: 3px; align-items: center; }
.score-dot { width: 8px; height: 8px; border-radius: 3px; background: var(--border2); }
.score-dot.filled { background: var(--accent); }

/* Resume / Analyse IA */
.resume-text {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 210px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: default;
  transition: color .15s;
}
.resume-text:hover { -webkit-line-clamp: unset; color: var(--text); }

/* Date */
.cell-date { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); white-space: nowrap; }

/* ══════════════════════════════════════════
   TAB BAR
══════════════════════════════════════════ */

.tab-bar {
  display: flex;
  gap: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}

.tab-btn {
  padding: 13px 20px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent-light); border-bottom-color: var(--accent); }

/* ══════════════════════════════════════════
   AGENDA LAYOUT
══════════════════════════════════════════ */

#view-agenda { padding: 0; }

.agenda-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 140px);
}

/* ── Calendar column ── */
.cal-container {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.cal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cal-month-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-transform: capitalize;
}

.cal-nav-btns { display: flex; gap: 8px; align-items: center; }

.cal-nav-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  padding: 5px 12px;
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.cal-nav-btn:hover { color: var(--text); border-color: var(--border2); }
.cal-nav-btn.today-btn { color: var(--accent-light); border-color: var(--accent); }

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

.cal-dow {
  text-align: center;
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 600;
  padding: 4px 0 10px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px 4px;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .12s, border-color .12s;
}
.cal-day:hover { background: var(--surface2); }
.cal-day.other-month .day-num { color: var(--text-dim); }
.cal-day.today { background: rgba(74,123,255,.08); }
.cal-day.today .day-num { color: var(--accent-light); font-weight: 700; }
.cal-day.selected { border-color: var(--accent); background: rgba(74,123,255,.1); }

.day-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  line-height: 1;
}

.day-dots {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: center;
}

.day-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }

/* Dot colors by prospect status */
.dot-rdv_pris    { background: var(--accent); }
.dot-a_contacter { background: var(--statut-a_contacter); }
.dot-en_cours    { background: var(--statut-en_cours); }
.dot-nouveau     { background: var(--rouge); }
.dot-vendu       { background: var(--vert); }
.dot-contacte    { background: var(--statut-contacte); }
.dot-refuse      { background: var(--rouge); }
.dot-injoignable { background: var(--text-dim); }

/* Calendar legend */
.cal-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Side panel ── */
.agenda-panel {
  width: 280px;
  min-width: 280px;
  border-left: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.panel-placeholder {
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
  padding: 40px 8px;
  line-height: 1.7;
}

.panel-date-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-light);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  text-transform: capitalize;
  line-height: 1.4;
}

.panel-prospect-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color .15s;
}
.panel-prospect-card:hover { border-color: var(--border2); }

.ppc-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.ppc-statut {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  background: var(--surface3);
  color: var(--text-muted);
  white-space: nowrap;
}

.ppc-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.ppc-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}
.ppc-remove {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 6px;
  cursor: pointer;
  display: inline-block;
  transition: color .12s;
}
.ppc-remove:hover { color: var(--rouge); }

.panel-assign-btn {
  width: 100%;
  background: var(--surface2);
  border: 1px dashed var(--border2);
  border-radius: 10px;
  padding: 10px;
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--font-body);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  margin-top: 4px;
}
.panel-assign-btn:hover { border-color: var(--accent); color: var(--accent-light); }

.panel-assign-select {
  width: 100%;
  background: var(--surface3);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 6px 8px;
  display: none;
}
.panel-assign-select.visible { display: block; }

/* ── Date input in prospects table ── */
.date-action-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 6px;
  cursor: pointer;
  width: 100%;
  min-width: 110px;
  transition: border-color .15s;
}
.date-action-input:hover,
.date-action-input:focus {
  border-color: var(--border2);
  outline: none;
}
.date-action-input::-webkit-calendar-picker-indicator {
  filter: invert(0.5) brightness(1.2);
  cursor: pointer;
  opacity: .6;
}
.date-action-input::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* Statut select */
.statut-select {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 28px 5px 10px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235e7399' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  color: var(--text);
}

.statut-select:focus { border-color: var(--accent); }
.statut-select option { background: var(--surface2); }

.statut-select.nouveau     { color: var(--statut-nouveau); }
.statut-select.a_contacter { color: var(--statut-a_contacter); }
.statut-select.contacte    { color: var(--statut-contacte); }
.statut-select.en_cours    { color: var(--statut-en_cours); }
.statut-select.vendu       { color: var(--statut-vendu); }
.statut-select.refuse      { color: var(--statut-refuse); }
.statut-select.injoignable { color: var(--statut-injoignable); }

/* Notes */
.notes-cell { min-width: 170px; max-width: 250px; }

.notes-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 5px 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
  resize: none;
  outline: none;
  line-height: 1.5;
  transition: border-color .15s, background .15s;
}

.notes-input::placeholder { color: var(--text-dim); }
.notes-input:hover { border-color: var(--border); background: var(--surface2); }
.notes-input:focus { border-color: var(--accent); background: var(--surface2); box-shadow: 0 0 0 2px var(--accent-glow); }

/* ══════════════════════════════════════════
   TOASTS
══════════════════════════════════════════ */

#toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
  animation: toastIn .25s cubic-bezier(.34,1.56,.64,1) both;
  transition: opacity .25s, transform .25s;
}

.toast.out { opacity: 0; transform: translateX(16px); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

.toast-icon { font-size: 15px; flex-shrink: 0; }

.toast.ok   { border-color: rgba(0,217,126,.22); color: var(--vert); }
.toast.err  { border-color: rgba(255,68,68,.22);  color: var(--rouge); }
.toast.info { border-color: rgba(74,123,255,.22); color: var(--accent-light); }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */

@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  header { padding: 0 16px; }
  main { padding: 16px; }
  .brand-region { display: none; }
  .live-badge { display: none; }
  #filter-search { width: 180px; }
}

/* ══════════════════════════════════════════
   ACTIVITÉ
══════════════════════════════════════════ */

.activity-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.activity-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 860px;
}

.activity-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color .15s;
}

.activity-entry:hover { border-color: var(--border2); }

.activity-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-body {
  flex: 1;
  min-width: 0;
}

.activity-main {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.activity-user {
  font-weight: 600;
  color: var(--accent-light);
}

.activity-action {
  color: var(--text-muted);
  margin: 0 4px;
}

.activity-prospect {
  font-weight: 500;
}

.activity-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  background: var(--bg);
  border-radius: 6px;
  padding: 4px 8px;
  display: inline-block;
}

.activity-time {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}

.activity-loading,
.activity-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 32px 0;
  text-align: center;
}

/* Utilisateur connecté — header */
.current-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.user-menu {
  position: relative;
}

.current-user {
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 6px;
  transition: background .15s;
}

.current-user:hover { background: var(--surface); }

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 100;
  min-width: 140px;
}

.user-menu.open .user-dropdown { display: block; }

.dropdown-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 10px;
}

.dropdown-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dropdown-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-email {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Modifié par — sous la date dans le tableau */
.modified-by {
  font-size: 10px;
  color: var(--text-dim);
  display: block;
  margin-top: 2px;
}
