:root {
  --bg: #0f1117;
  --surface: #181c27;
  --surface2: #1e2333;
  --border: #2a3050;
  --accent: #4f7bff;
  --accent2: #38d9a9;
  --accent3: #ffa94d;
  --danger: #ff6b6b;
  --text: #e8eaf0;
  --text2: #8891aa;
  --text3: #5a6280;
  --radius: 10px;
  --mono: 'DM Mono', monospace;
  --sans: 'Sora', sans-serif;

  /* Statuts pipeline */
  --s0: #5a6280; /* à contacter */
  --s1: #4f7bff; /* contacté */
  --s2: #ffa94d; /* en discussion */
  --s3: #38d9a9; /* gagné */
  --s4: #ff6b6b; /* perdu */
}

:root[data-theme="light"] {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface2: #eef0f5;
  --border: #dde1ec;
  --accent: #3d68e8;
  --accent2: #17a589;
  --accent3: #e08e3a;
  --danger: #e5484d;
  --text: #1c2030;
  --text2: #565f7a;
  --text3: #8891aa;

  --s0: #6b7280;
  --s1: #3d68e8;
  --s2: #e08e3a;
  --s3: #17a589;
  --s4: #e5484d;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ─── TOPBAR ─── */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.5px;
}
.logo span { color: var(--text2); }

.nav-tabs {
  display: flex;
  gap: 2px;
  margin-left: 24px;
}

.nav-tab {
  padding: 6px 16px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text2);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: all .15s;
}
.nav-tab:hover { background: var(--surface2); color: var(--text); }
.nav-tab.active { background: var(--surface2); color: var(--text); font-weight: 500; }

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

/* ─── BOUTON GOOGLE COMPACT ─── */
.btn-google-compact {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: #fff; border: 1px solid #dadce0; border-radius: var(--radius);
  color: #3c4043; font-family: var(--sans); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: box-shadow .15s; white-space: nowrap;
}
.btn-google-compact:hover { box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.google-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 20px;
  cursor: pointer; transition: border-color .15s; white-space: nowrap;
}
.google-chip:hover { border-color: var(--accent); }
.google-chip-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.google-chip-name { font-size: 12px; color: var(--text2); font-family: var(--mono); }
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text3);
  flex-shrink: 0;
}
.dot.connected { background: var(--accent2); box-shadow: 0 0 6px var(--accent2); }
.dot.syncing { background: var(--accent3); animation: pulse 1s ease-in-out infinite; }
.dot.error { background: var(--danger); }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #3d68e8; border-color: #3d68e8; color: #fff; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn svg { width: 14px; height: 14px; }

/* ─── LAYOUT ─── */
.page { display: none; flex: 1; flex-direction: column; min-height: 0; overflow: hidden; }
.page.active { display: flex; }
#shared-filters { flex-shrink: 0; }

/* ─── AUTOCOMPLETE VILLE ─── */
.ville-suggestions {
  position: absolute;
  top: calc(100% + 3px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  z-index: 500;
  overflow: hidden;
}
.ville-sug-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background .1s;
}
.ville-sug-item:hover { background: var(--surface2); }
.ville-sug-item.active { background: var(--accent); }
.ville-sug-item.active .ville-sug-name,
.ville-sug-item.active .ville-sug-meta { color: #fff; }
.ville-sug-name { font-size: 13px; color: var(--text); }
.ville-sug-meta { font-size: 11px; color: var(--text3); font-family: var(--mono); white-space: nowrap; flex-shrink: 0; }

/* ─── FILTRE RAYON ─── */
.filter-radius-group { min-width: 160px; align-self: stretch; }
.filter-radius-group input[type="range"] { margin-top: auto; margin-bottom: auto; }
.filter-radius-group .filter-label { white-space: nowrap; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 4px rgba(79,123,255,.5);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

/* ─── CARTE ─── */
.carte-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.carte-list-panel {
  width: 35%;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.carte-list-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}
.carte-max-input {
  width: 54px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 11px;
  font-family: var(--mono);
  padding: 2px 5px;
  text-align: right;
}
.carte-max-input:focus { outline: none; border-color: var(--accent); }
.carte-list-items {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}
.map-list-item {
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .12s;
  margin-bottom: 3px;
}
.map-list-item:hover { background: var(--surface2); border-color: var(--border); }
.map-list-item.selected { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.mli-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mli-meta { font-size: 11px; color: var(--text3); margin-top: 2px; font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mli-activity { font-size: 11px; color: var(--text2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mli-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.mli-pip { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: color-mix(in srgb, var(--accent2) 15%, transparent); color: var(--accent2); font-weight: 500; }
.map-list-item.in-pipeline { border-color: var(--accent2); background: color-mix(in srgb, var(--accent2) 6%, var(--surface)); }
.map-list-item.in-pipeline:hover { border-color: var(--accent2); }
.mli-btn { font-size: 11px; padding: 2px 8px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface2); color: var(--text2); cursor: pointer; font-family: var(--sans); transition: all .15s; text-decoration: none; display: inline-flex; align-items: center; }
.mli-btn:hover { border-color: var(--accent); color: var(--accent); }
.mli-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.mli-btn.primary:hover { background: #3d68e8; border-color: #3d68e8; color: #fff; }
.reminder-split { display: flex; align-items: center; gap: 10px; }
.reminder-split input { flex: 1; min-width: 0; }
#atcb-container { flex-shrink: 0; }
.field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-bottom: 12px; }
.field-col { min-width: 0; }
.field-col label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 4px; font-weight: 500; }
.field-col .full { width: 100%; box-sizing: border-box; }
.carte-map-panel {
  flex: 1;
  position: relative;
}
#map-container {
  width: 100%;
  height: 100%;
}
.map-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  border-radius: inherit;
}
.map-loading-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14px;
  color: var(--text2);
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
/* Override Leaflet popup style */
.leaflet-popup-content-wrapper {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  font-family: var(--sans);
}
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; min-width: 180px; }
.map-popup-name { font-weight: 600; margin-bottom: 4px; }
.map-popup-meta { font-size: 11px; color: var(--text3); margin-bottom: 8px; font-family: var(--mono); }
.map-popup-btn { display: inline-block; padding: 4px 10px; background: var(--accent); color: #fff; border: none; border-radius: 6px; font-size: 12px; cursor: pointer; font-family: var(--sans); }
.map-popup-btn:hover { background: #3d68e8; }
.map-popup-in-pipe { font-size: 11px; color: var(--accent2); }
.map-popup-actions { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.map-popup-maps-btn { display: inline-flex; align-items: center; justify-content: center; padding: 3px; border-radius: 5px; transition: opacity .15s; }
.map-popup-maps-btn:hover { opacity: .75; }
/* Bouton icône Maps (tuiles + modal) */
.maps-icon-btn { display: inline-flex !important; align-items: center; justify-content: center; padding: 3px 6px !important; line-height: 1; }
.maps-icon-btn img { display: block; }


/* ─── PROSPECTION ─── */
.filters-bar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 20px 24px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.filter-group { display: flex; flex-direction: column; gap: 4px; position: relative; }
.filter-label { font-size: 11px; color: var(--text3); font-family: var(--mono); text-transform: uppercase; letter-spacing: .5px; }

select, input[type="text"], input[type="tel"], input[type="date"] {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  padding: 7px 12px;
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}
select:focus, input[type="text"]:focus, input[type="tel"]:focus, input[type="date"]:focus { border-color: var(--accent); }
select option { background: var(--surface2); }

/* ─── MULTI-SELECT DÉPARTEMENT ─── */
.filter-dept-group { min-width: 220px; max-width: 320px; }
.dept-multiselect {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 8px;
  transition: border-color .15s;
}
.dept-multiselect:focus-within { border-color: var(--accent); }
.dept-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.dept-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 4px 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.dept-chip-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  opacity: .7;
}
.dept-chip-remove:hover { opacity: 1; }
.dept-multiselect input[type="text"] {
  flex: 1;
  min-width: 60px;
  border: none;
  background: none;
  padding: 3px 2px;
}
.dept-multiselect input[type="text"]:focus { border: none; }

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px 10px;
  border-bottom: 1px solid var(--border);
}
.results-count { font-family: var(--mono); font-size: 12px; color: var(--text3); }
.results-count strong { color: var(--accent); }

.companies-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
  align-content: start;
}

.company-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s, transform .1s;
  cursor: default;
}
.company-card:hover { border-color: #3a4570; transform: translateY(-1px); }
.company-card.in-pipeline { border-color: var(--accent); opacity: .7; }

.company-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.company-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.company-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
  font-family: var(--mono);
}
.company-row svg { color: var(--text3); flex-shrink: 0; }

.naf-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  background: rgba(79,123,255,.12);
  border: 1px solid rgba(79,123,255,.25);
  border-radius: 20px;
  font-size: 11px;
  color: #7fa4ff;
  width: fit-content;
}
.naf-code { font-family: var(--mono); }
.naf-sep  { opacity: .35; }
.naf-label{ font-family: var(--sans); opacity: .85; }

.card-actions { display: flex; gap: 8px; margin-top: 4px; align-items: center; }

/* ─── PIPELINE ─── */
.pipeline-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.pipeline-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  min-width: 120px;
}
.stat-val {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}
.stat-label { font-size: 11px; color: var(--text3); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

.kanban {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.kanban-col {
  min-width: 240px;
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.kanban-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kanban-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  background: var(--surface2);
  border-radius: 20px;
  padding: 1px 7px;
}

.kanban-cards {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 60px;
  flex: 1;
  min-height: 120px;
}

.pipeline-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: border-color .15s;
}
.pipeline-card:hover { border-color: var(--accent); }
.pipeline-card-name { font-size: 13px; font-weight: 500; line-height: 1.3; }
.pipeline-card-meta { font-size: 11px; color: var(--text3); font-family: var(--mono); }
.pipeline-card-note {
  font-size: 11px;
  color: var(--text2);
  background: rgba(255,255,255,.03);
  border-left: 2px solid var(--border);
  padding: 4px 8px;
  border-radius: 0 4px 4px 0;
  white-space: pre-wrap;
  line-height: 1.4;
}
.pipeline-card-date {
  font-size: 10px;
  color: var(--text3);
  font-family: var(--mono);
}

/* ─── DRAG & DROP KANBAN ─── */
.pipeline-card { cursor: grab; user-select: none; }
.pipeline-card:active { cursor: grabbing; }
.pipeline-card.dragging {
  opacity: 0.3;
  transform: scale(0.97);
  pointer-events: none;
}
.kanban-col.drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.kanban-col.drag-over .kanban-cards {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  border-radius: 0 0 10px 10px;
}
.drop-hint {
  text-align: center;
  padding: 20px 0;
  font-size: 12px;
  color: var(--text3);
  pointer-events: none;
  transition: color .15s;
}
.kanban-col.drag-over .drop-hint { color: var(--accent); }

/* ─── FICHE CONTACT (modal) ─── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 1200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.modal-title { font-size: 16px; font-weight: 600; line-height: 1.3; }
.modal-subtitle { font-size: 12px; color: var(--text3); font-family: var(--mono); margin-top: 2px; }
.modal-close {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text2);
  cursor: pointer;
  font-size: 16px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: color .15s;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 16px; }

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.info-item { display: flex; flex-direction: column; gap: 3px; }
.info-item label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; font-family: var(--mono); }
.info-item span { font-size: 13px; font-family: var(--mono); }

.field-row { display: flex; flex-direction: column; gap: 6px; }
.field-row label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; font-family: var(--mono); }

select.full, textarea.full {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  resize: vertical;
  transition: border-color .15s;
}
select.full:focus, textarea.full:focus { border-color: var(--accent); }

.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  display: flex;
  gap: 10px;
  font-size: 12px;
}
.history-date { color: var(--text3); font-family: var(--mono); white-space: nowrap; min-width: 80px; }
.history-note { color: var(--text2); line-height: 1.5; }

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

/* ─── LOADING / EMPTY ─── */
.loading, .empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  color: var(--text3);
}
.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-icon { font-size: 32px; opacity: .5; }
.empty-text { font-size: 14px; text-align: center; line-height: 1.5; }

/* ─── RAPPELS ─── */
.reminders-page { flex: 1; overflow-y: auto; padding: 20px 24px; }
.reminder-list { display: flex; flex-direction: column; gap: 10px; }
.reminder-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.reminder-item.overdue { border-left: 3px solid var(--danger); }
.reminder-item.today { border-left: 3px solid var(--accent3); }
.reminder-info { flex: 1; }
.reminder-company { font-size: 13px; font-weight: 500; }
.reminder-when { font-size: 11px; color: var(--text3); font-family: var(--mono); margin-top: 2px; }
.tag {
  font-size: 10px;
  font-family: var(--mono);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
}
.tag.overdue { background: rgba(255,107,107,.15); color: #ff9999; border: 1px solid rgba(255,107,107,.3); }
.tag.today { background: rgba(255,169,77,.15); color: #ffc57d; border: 1px solid rgba(255,169,77,.3); }
.tag.soon { background: rgba(79,123,255,.12); color: #7fa4ff; border: 1px solid rgba(79,123,255,.25); }

/* ─── SCROLLBARS ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a4570; }

/* ─── NOTIFICATION ─── */
.notif {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1300;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  transform: translateY(60px);
  opacity: 0;
  transition: all .25s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.notif.show { transform: translateY(0); opacity: 1; }
.notif.success { border-left: 3px solid var(--accent2); }
.notif.error { border-left: 3px solid var(--danger); }
.notif.info { border-left: 3px solid var(--accent); }

/* ─── OVERRIDES THÈME CLAIR (couleurs codées en dur, non couvertes par les variables) ─── */
[data-theme="light"] .company-card:hover { border-color: #b9c2e0; }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #b9c2e0; }
[data-theme="light"] .naf-badge { color: #2f56c9; }
[data-theme="light"] .tag.overdue { color: #c23b3b; }
[data-theme="light"] .tag.today { color: #b8641a; }
[data-theme="light"] .tag.soon { color: #2f56c9; }

/* ─── BOUTON BASCULE THÈME ─── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }

/* ─── MENU PROFIL ─── */
.profile-menu-wrap { position: relative; }
.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  padding: 12px;
  z-index: 500;
}
[data-theme="light"] .profile-dropdown { box-shadow: 0 8px 24px rgba(30,40,70,.18); }
.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.profile-dropdown-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.profile-dropdown-avatar.initial {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600;
}
.profile-dropdown-name { font-size: 13px; font-weight: 500; color: var(--text); }
.profile-dropdown-email { font-size: 11px; color: var(--text3); font-family: var(--mono); word-break: break-all; }
.profile-dropdown-info { min-width: 0; }
.profile-dropdown .btn { width: 100%; justify-content: center; }

/* ─── PASTILLE PIPELINE D'UN COLLÈGUE ─── */
.team-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--surface2);
  color: var(--text2);
  font-weight: 500;
  white-space: nowrap;
}
