/* ===== Atelier CRM — thème sombre orange (inspiré Signd) ===== */
:root {
  --bg: #0c111c;
  --bg-panel: #10192a;
  --bg-card: #161f31;
  --bg-card-hover: #1b2539;
  --bg-input: #1a2438;
  --border: #223049;
  --border-soft: #1b2740;
  --text: #e8edf5;
  --text-dim: #8b97ab;
  --text-faint: #5d6a80;
  --accent: #e8722a;
  --accent-soft: rgba(232, 114, 42, 0.14);
  --danger: #e05252;
  --radius: 12px;
  --sidebar-w: 220px;
}

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

[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; min-height: 100dvh; }

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-panel);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #f08c3a, #e05e1e);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; color: #fff;
  flex-shrink: 0;
}
.brand-logo.small { width: 28px; height: 28px; font-size: 14px; border-radius: 7px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 14px; }
.brand-text span { font-size: 9px; letter-spacing: 0.8px; color: var(--text-faint); }

.nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: none; border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 17px; height: 17px; fill: currentColor; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-card); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }

.sidebar-footer { margin-top: auto; padding: 14px 16px; border-top: 1px solid var(--border-soft); }

.storage-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
  padding: 4px 9px; border-radius: 20px;
  background: var(--bg-card); color: var(--text-dim);
  text-transform: uppercase;
}
.storage-badge.cloud { background: rgba(76, 175, 80, 0.15); color: #6fce74; }

/* ===== Mobile bars ===== */
.mobile-bar { display: none; }
.bottom-nav { display: none; }

/* ===== Main ===== */
.main { flex: 1; padding: 28px 32px; min-width: 0; }

.page-title {
  font-size: 22px; font-weight: 700;
  padding-left: 12px; margin-bottom: 20px;
  position: relative;
}
.page-title::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 4px; border-radius: 3px; background: var(--accent);
}

.muted { color: var(--text-faint); }

/* ===== Pipeline ===== */
.pipeline-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pipeline-tools { display: flex; gap: 10px; margin-bottom: 20px; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 12px; min-width: 220px;
}
.search-box svg { width: 15px; height: 15px; color: var(--text-faint); }
.search-box input {
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 13px; width: 100%;
}
.search-box input::placeholder { color: var(--text-faint); }

.sync-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent-soft);
  border: 1px solid rgba(232, 114, 42, 0.35);
  border-radius: 9px;
  color: var(--accent);
  font-size: 13px; font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.sync-btn:hover { background: rgba(232, 114, 42, 0.22); }
.sync-btn:disabled { opacity: 0.6; cursor: wait; }
.sync-btn svg { width: 15px; height: 15px; }

.board {
  display: flex; gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  align-items: flex-start;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--border) transparent;
}
.board::-webkit-scrollbar { height: 8px; }
.board::-webkit-scrollbar-track { background: transparent; }
.board::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.column-body::-webkit-scrollbar { width: 6px; }
.column-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

.column {
  background: rgba(16, 25, 42, 0.6);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  min-width: 260px; width: 260px;
  flex-shrink: 0;
  display: flex; flex-direction: column;
  max-height: calc(100dvh - 190px);
}
.column.drop-target { border-color: var(--accent); background: var(--accent-soft); }

.column-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  color: var(--text-dim); text-transform: uppercase;
}
.column-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.column-count {
  margin-left: auto;
  background: var(--bg-card); border-radius: 20px;
  min-width: 22px; height: 20px; padding: 0 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-dim);
}

.column-body {
  padding: 4px 8px 10px;
  display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto;
  min-height: 60px;
}

/* ===== Lead card ===== */
.lead-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  padding: 12px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.lead-card:hover { background: var(--bg-card-hover); border-color: var(--border); }
.lead-card.dragging-source { opacity: 0.35; }

.lead-top { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.lead-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #3a2a1c, #4d3016);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.lead-name { font-weight: 600; font-size: 13.5px; word-break: break-word; }
.lead-sub { font-size: 11.5px; color: var(--text-faint); }

.lead-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; }
.chip {
  font-size: 10.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 20px;
  background: var(--bg-input); color: var(--text-dim);
  white-space: nowrap;
}
.chip.etat-green { background: rgba(76, 175, 80, 0.16); color: #6fce74; }
.chip.etat-orange { background: rgba(232, 114, 42, 0.16); color: #f0924d; }
.chip.etat-red { background: rgba(224, 82, 82, 0.16); color: #ee7a7a; }
.chip.etat-blue { background: rgba(77, 163, 255, 0.16); color: #7db8f5; }
.chip.etat-gray { background: rgba(139, 151, 171, 0.12); color: var(--text-dim); }

.lead-note {
  font-size: 12px; color: var(--text-dim);
  line-height: 1.4;
  margin-bottom: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lead-links { display: flex; gap: 10px; align-items: center; }
.lead-links a {
  font-size: 11.5px; color: var(--accent); text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.lead-links a:hover { text-decoration: underline; }

/* Ghost qui suit le doigt / la souris */
.drag-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  width: 244px;
  transform: rotate(2deg) scale(1.03);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  opacity: 0.95;
}

/* ===== Formulaires ===== */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 560px;
}
.paste-card { margin-bottom: 16px; }

.field-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.hint { font-size: 11.5px; color: var(--text-faint); margin-bottom: 10px; line-height: 1.5; }

input[type="text"], input[type="tel"], input[type="search"], textarea, select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; }
select { appearance: none; -webkit-appearance: none; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

.input-with-btn { display: flex; gap: 6px; }
.input-with-btn input { flex: 1; min-width: 0; }
.field-btn {
  flex-shrink: 0;
  background: var(--accent-soft);
  border: 1px solid rgba(232, 114, 42, 0.35);
  border-radius: 9px;
  color: var(--accent);
  font-size: 12px; font-weight: 600;
  padding: 0 11px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex; align-items: center;
  text-decoration: none;
}
.field-btn:hover { background: rgba(232, 114, 42, 0.22); }
.field-btn.is-off { opacity: 0.45; }
.field.span2, .span2 { grid-column: span 2; }

.btn-primary {
  margin-top: 18px;
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #ef8434, #dd5f1c);
  border: none; border-radius: 10px;
  color: #fff; font-size: 14px; font-weight: 600;
  padding: 12px;
  cursor: pointer;
  transition: filter 0.15s;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary svg { width: 16px; height: 16px; fill: currentColor; }

.btn-danger {
  background: rgba(224, 82, 82, 0.12);
  border: 1px solid rgba(224, 82, 82, 0.3);
  color: #ee7a7a;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
}
.btn-danger:hover { background: rgba(224, 82, 82, 0.2); }

/* Aperçu multi-lignes collées */
.multi-preview { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.multi-preview .preview-row {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 12.5px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.multi-preview .preview-row strong { color: var(--text); }
.multi-preview .preview-row span { color: var(--text-faint); }

/* ===== Dashboard ===== */
.dash-section {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
  max-width: 860px;
}
.dash-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.count-pill {
  background: var(--bg-card);
  border-radius: 20px;
  min-width: 22px; height: 19px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px;
}

.objectif-card { text-align: center; }
.objectif-card .dash-section-title { justify-content: center; }
.rings { display: flex; justify-content: center; gap: 46px; padding: 8px 0 4px; flex-wrap: wrap; }
.ring { position: relative; width: 110px; }
.ring svg { width: 76px; height: 76px; }
.ring-num {
  position: absolute; top: 24px; left: 50%; transform: translateX(-50%);
  text-align: center; font-size: 20px; font-weight: 700;
  pointer-events: none;
}
.ring-label { font-size: 11px; color: var(--text-dim); margin-top: 6px; line-height: 1.35; }
.objectif-note { font-size: 11.5px; color: var(--text-faint); margin-top: 10px; }

.alert-banner {
  display: flex; align-items: center; gap: 13px;
  background: rgba(224, 82, 82, 0.1);
  border: 1px solid rgba(224, 82, 82, 0.28);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 14px;
  max-width: 860px;
}
.alert-banner strong { color: #f08a8a; font-size: 13.5px; }
.alert-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.alert-icon { font-size: 20px; }

.dash-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  padding: 11px 13px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.dash-row:hover { background: var(--bg-card-hover); }
.dash-row:last-child { margin-bottom: 0; }
.dash-row-info { flex: 1; min-width: 0; }
.dash-row-name { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-row-name .late { font-size: 11px; font-weight: 600; color: #ee7a7a; }
.dash-row-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--text-faint);
  margin-top: 4px;
}
.dash-row-meta a { color: var(--accent); text-decoration: none; }
.dash-row-meta .chip { font-size: 10px; padding: 2px 7px; }

.row-action {
  display: inline-flex; align-items: center; gap: 5px;
  background: linear-gradient(135deg, #ef8434, #dd5f1c);
  border: none; border-radius: 20px;
  color: #fff; font-size: 12px; font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.row-action:hover { filter: brightness(1.1); }

.empty-row {
  text-align: center;
  color: var(--text-faint);
  font-size: 12.5px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 11px;
}

.funnel-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.funnel-label { width: 90px; font-size: 12px; color: var(--text-dim); text-align: right; flex-shrink: 0; }
.funnel-track { flex: 1; background: var(--bg-input); border-radius: 20px; height: 18px; overflow: hidden; }
.funnel-bar {
  height: 100%;
  background: linear-gradient(90deg, #b35318, #ef8434);
  border-radius: 20px;
  display: flex; align-items: center;
  padding-left: 9px;
  font-size: 10.5px; font-weight: 700; color: #fff;
  min-width: 22px;
  transition: width 0.4s;
}
.funnel-pct { width: 40px; font-size: 11px; color: var(--text-faint); flex-shrink: 0; }
.funnel-note {
  margin-top: 12px;
  background: var(--bg-card);
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 12px; color: var(--text-dim);
  line-height: 1.5;
}
.funnel-note strong { color: var(--accent); }

/* ===== Dashboard stats ===== */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
}
.stat-card .stat-value { font-size: 26px; font-weight: 700; }
.stat-card .stat-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.7px; margin-top: 4px; }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(5, 8, 14, 0.72);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  z-index: 500;
}
.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  width: 100%; max-width: 520px;
  max-height: 90dvh;
  overflow-y: auto;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { font-size: 17px; }
.icon-btn {
  background: var(--bg-card); border: none; border-radius: 8px;
  color: var(--text-dim); width: 30px; height: 30px;
  cursor: pointer; font-size: 13px;
}
.icon-btn:hover { color: var(--text); }
.modal-actions { display: flex; gap: 10px; justify-content: space-between; margin-top: 6px; }
.modal-actions .btn-primary { margin-top: 0; width: auto; flex: 1; }

/* ===== Agenda ===== */
.agenda-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.agenda-nav { display: flex; gap: 6px; margin-bottom: 20px; }
.agenda-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  min-width: 34px; height: 34px;
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.agenda-btn:hover { border-color: var(--accent); }
.agenda-today-btn { font-size: 12.5px; font-weight: 600; padding: 0 13px; color: var(--accent); }

.agenda-grid-head {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  margin-bottom: 6px;
  max-width: 980px;
}
.agenda-grid-head div {
  text-align: center;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.8px;
  color: var(--text-faint); text-transform: uppercase;
  padding: 4px 0;
}

.agenda-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  max-width: 980px;
  margin-bottom: 16px;
}
.agenda-cell {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  min-height: 86px;
  padding: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
}
.agenda-cell:hover { border-color: var(--border); background: var(--bg-card); }
.agenda-cell.out { background: transparent; border-color: transparent; cursor: default; }
.agenda-cell.selected { border-color: var(--accent); }
.agenda-cell.today .agenda-daynum {
  background: var(--accent); color: #fff;
}
.agenda-daynum {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 11.5px; font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.agenda-cell-events { display: flex; flex-direction: column; gap: 3px; }
.agenda-chip {
  font-size: 9.5px; font-weight: 600;
  padding: 2px 6px; border-radius: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agenda-chip.rdv { background: var(--accent-soft); color: var(--accent); }
.agenda-chip.relance { background: rgba(224, 82, 82, 0.14); color: #ee7a7a; }
.agenda-more { font-size: 9.5px; color: var(--text-faint); padding-left: 4px; }

.agenda-day-panel .dash-section { max-width: 980px; }
.agenda-time {
  min-width: 52px;
  text-align: center;
  font-size: 13px; font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.agenda-time.relance { color: #ee7a7a; }

/* ===== Historique d'activité (modale) ===== */
.modal-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.history-section {
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
  margin-top: 8px;
}
.history-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.history-add { display: flex; gap: 8px; margin-bottom: 12px; }
.history-add input { flex: 1; }
.history-send {
  background: linear-gradient(135deg, #ef8434, #dd5f1c);
  border: none; border-radius: 9px;
  color: #fff; width: 40px;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}
.history-send:hover { filter: brightness(1.1); }
.history-list { display: flex; flex-direction: column; gap: 9px; max-height: 250px; overflow-y: auto; }
.history-item { display: flex; gap: 10px; align-items: flex-start; }
.history-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.history-text { font-size: 12.5px; line-height: 1.4; }
.history-date { font-size: 10.5px; color: var(--text-faint); margin-top: 2px; }

.auto-tag {
  font-size: 10px; font-weight: 700;
  color: #6fce74;
  margin-left: 6px;
}

/* ===== Tâches ===== */
.task-add-card { margin-bottom: 16px; }
.task-add-row { display: flex; gap: 10px; }
.task-add-row input { flex: 1; }
.task-add-btn { margin-top: 0; width: auto; padding: 10px 20px; flex-shrink: 0; }
/* Sélecteur de lead (recherche) */
.lead-picker { position: relative; margin-top: 10px; }
.lead-picker-input {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0 10px;
}
.lead-picker-input svg { width: 15px; height: 15px; color: var(--text-faint); flex-shrink: 0; }
.lead-picker-input input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 13.5px; padding: 10px 0;
}
.lead-picker-input input::placeholder { color: var(--text-faint); }
.lead-picker-clear {
  background: none; border: none; color: var(--text-faint);
  cursor: pointer; font-size: 13px; padding: 4px; flex-shrink: 0;
}
.lead-picker-clear:hover { color: var(--text); }

.lead-picker-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px;
  z-index: 50;
  max-height: 288px; overflow-y: auto;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.lead-picker-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: none; border: none; border-radius: 8px;
  padding: 8px 9px; cursor: pointer;
}
.lead-picker-item:hover { background: var(--bg-card-hover); }
.lead-picker-item-info { display: flex; flex-direction: column; min-width: 0; }
.lead-picker-item-name { font-size: 13px; font-weight: 600; color: var(--text); }
.lead-picker-item-sub { font-size: 11.5px; color: var(--text-faint); }
.lead-picker-empty { padding: 12px; text-align: center; font-size: 12.5px; color: var(--text-faint); }

#tasksOpen .dash-section, #tasksDone .dash-section { max-width: 640px; }

.task-row {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  padding: 11px 13px;
  margin-bottom: 8px;
}
.task-check {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: #fff; font-size: 13px; line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.task-check:hover { border-color: var(--accent); }
.task-row.done .task-check { background: #4caf50; border-color: #4caf50; }
.task-body { flex: 1; min-width: 0; }
.task-text { font-size: 13.5px; line-height: 1.45; word-break: break-word; }
.task-row.done .task-text { text-decoration: line-through; color: var(--text-faint); }
.task-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 4px;
  font-size: 11px; color: var(--text-faint);
}
.task-lead-chip { cursor: pointer; }
.task-lead-chip:hover { color: var(--accent); }
.task-del {
  background: none; border: none;
  color: var(--text-faint); font-size: 13px;
  cursor: pointer; flex-shrink: 0;
  padding: 4px;
}
.task-del:hover { color: #ee7a7a; }
.task-list .task-row { background: var(--bg-input); }

/* ===== Cold Call ===== */
.cold-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cold-head-actions { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.cold-search { min-width: 200px; }

.cold-crumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cold-back {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-dim); font-size: 12.5px; padding: 6px 12px; cursor: pointer;
}
.cold-back:hover { color: var(--text); border-color: var(--accent); }
.cold-crumb-cur { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.cold-del-list {
  margin-left: auto; background: rgba(224, 82, 82, 0.1);
  border: 1px solid rgba(224, 82, 82, 0.28); border-radius: 8px;
  color: #ee7a7a; font-size: 12px; padding: 6px 12px; cursor: pointer;
}

.cold-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; max-width: 900px; }
.cold-card {
  display: flex; flex-direction: column; gap: 5px; text-align: left;
  background: var(--bg-panel); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 16px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.cold-card:hover { border-color: var(--accent); background: var(--bg-card); }
.cold-card-title { font-size: 15px; font-weight: 700; color: var(--text); text-transform: capitalize; }
.cold-card-sub { font-size: 11.5px; color: var(--text-faint); }

.cold-stats { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--text-faint); margin-bottom: 12px; flex-wrap: wrap; }
.cold-table-wrap { max-width: 100%; }
/* Bascule Cartes / Tableau — utile seulement sur petit écran */
.cold-viewtoggle { display: none; margin-left: auto; gap: 4px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.cold-viewtoggle button {
  background: transparent; border: none; border-radius: 7px;
  color: var(--text-dim); font-size: 12px; font-weight: 600;
  padding: 6px 12px; cursor: pointer;
}
.cold-viewtoggle button.on { background: var(--accent-soft); color: var(--accent); }
.cold-stat-rdv { color: #6fce74; font-weight: 600; }

.cold-table {
  background: var(--bg-panel); border: 1px solid var(--border-soft);
  border-radius: var(--radius); overflow: hidden;
}
.cold-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.7fr) .85fr .9fr 125px 30px 138px minmax(120px, 1.4fr) 108px;
  gap: 10px; align-items: center;
  padding: 9px 13px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.8px;
}
.cold-row:last-child { border-bottom: none; }
.cold-row:not(.cold-header):hover { background: var(--bg-card); }
.cold-header {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.7px;
  text-transform: uppercase; color: var(--text-faint);
  background: rgba(16, 25, 42, 0.6);
}
.c-ent { font-weight: 600; word-break: break-word; }
.c-prenom { display: block; margin-top: 2px; font-weight: 500; font-size: 12px; color: var(--accent, #f97316); }
.c-ville, .c-act { color: var(--text-dim); min-width: 0; }
.c-act .chip { display: inline-block; white-space: normal; word-break: break-word; line-height: 1.3; }
.c-tel { display: flex; align-items: center; gap: 5px; }
.c-tel a { color: var(--accent); text-decoration: none; white-space: nowrap; }
.c-link a { font-size: 15px; text-decoration: none; }
.c-mini {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-dim); font-size: 11px; padding: 3px 6px; cursor: pointer; white-space: nowrap;
}
.c-mini:hover { border-color: var(--accent); color: var(--accent); }
.c-tocrm { color: var(--accent); border-color: rgba(232, 114, 42, 0.35); background: var(--accent-soft); }
.c-del:hover { color: #ee7a7a; border-color: rgba(224, 82, 82, 0.4); }
.c-incrm { font-size: 11px; font-weight: 600; color: #6fce74; white-space: nowrap; }
.c-actions { display: flex; gap: 5px; align-items: center; justify-content: flex-end; }
.c-note input {
  padding: 5px 8px; font-size: 12px; border-radius: 7px;
  background: transparent; border: 1px solid transparent;
}
.c-note input:hover { border-color: var(--border); }
.c-note input:focus { background: var(--bg-input); border-color: var(--accent); }

.cold-select {
  padding: 4px 6px; font-size: 11.5px; font-weight: 600;
  border-radius: 20px; border: none; cursor: pointer;
  background: var(--bg-input); color: var(--text-dim);
  width: 100%; max-width: 138px;
}
.cold-select.etat-green { background: rgba(76, 175, 80, 0.16); color: #6fce74; }
.cold-select.etat-orange { background: rgba(232, 114, 42, 0.16); color: #f0924d; }
.cold-select.etat-red { background: rgba(224, 82, 82, 0.16); color: #ee7a7a; }
.cold-select.etat-blue { background: rgba(77, 163, 255, 0.16); color: #7db8f5; }
.cold-select.etat-purple { background: rgba(176, 124, 247, 0.16); color: #c09cf9; }
.cold-select option { background: var(--bg-panel); color: var(--text); }
.chip.etat-purple { background: rgba(176, 124, 247, 0.16); color: #c09cf9; }

/* ===== Écran de verrouillage ===== */
.lock-backdrop { z-index: 800; }
.lock-modal { max-width: 340px; text-align: center; }
.lock-icon { font-size: 34px; margin-bottom: 10px; }
.lock-modal h2 { font-size: 18px; margin-bottom: 8px; }
.lock-modal .hint { margin-bottom: 14px; }
.lock-modal input { text-align: center; font-size: 15px; letter-spacing: 2px; }
.lock-error { color: #ee7a7a; font-size: 12.5px; margin-top: 9px; }
.lock-modal .btn-primary { margin-top: 14px; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 900;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ===== Mobile ===== */
@media (max-width: 760px) {
  .sidebar { display: none; }

  .mobile-bar {
    display: flex; align-items: center; gap: 10px;
    position: fixed; top: 0; left: 0; right: 0;
    height: 52px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-soft);
    padding: 0 14px;
    z-index: 100;
  }
  .mobile-bar .storage-badge { margin-left: auto; }

  .bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-soft);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    z-index: 100;
  }
  .bottom-nav .nav-item {
    flex: 1;
    flex-direction: column; gap: 3px;
    font-size: 10.5px;
    padding: 7px 4px;
    align-items: center;
  }
  .bottom-nav .nav-item svg { width: 19px; height: 19px; }

  .main { padding: 68px 14px 88px; }

  .column { min-width: 240px; width: 240px; max-height: none; }
  .column-body { max-height: calc(100dvh - 300px); }

  .card { max-width: none; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span2, .span2 { grid-column: span 1; }
  .modal-actions { grid-column: span 1; }

  .cold-table:not(.as-table) .cold-row.cold-header { display: none; }
  .cold-table:not(.as-table) { background: transparent; border: none; overflow: visible; }
  .cold-table:not(.as-table) .cold-row {
    display: block;
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    padding: 12px;
    margin-bottom: 9px;
  }
  .cold-table:not(.as-table) .cold-row > div { margin-bottom: 7px; }
  .cold-table:not(.as-table) .cold-row > div:empty { display: none; margin: 0; }
  .cold-table:not(.as-table) .c-ent { font-size: 14px; }
  .cold-table:not(.as-table) .c-ville, .cold-table:not(.as-table) .c-act { display: inline-block; margin-right: 8px; font-size: 12px; }
  .cold-table:not(.as-table) .c-tel { font-size: 13.5px; }
  .c-tel a { font-weight: 600; }
  .cold-table:not(.as-table) .c-link { display: inline-block; }
  .cold-table:not(.as-table) .cold-select { max-width: none; width: auto; padding: 6px 12px; font-size: 12.5px; }
  .cold-table:not(.as-table) .c-note input { width: 100%; background: var(--bg-input); border-color: var(--border); padding: 8px 10px; font-size: 13px; }
  .cold-table:not(.as-table) .c-actions { justify-content: flex-start; margin-bottom: 0; }
  /* Mode tableau : on garde la grille du bureau et on fait défiler horizontalement */
  .cold-viewtoggle { display: flex; }
  .cold-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
  .c-mini { padding: 7px 12px; font-size: 12.5px; }

  /* Mode Tableau : colonnes assez larges pour que rien ne se chevauche ni
     ne soit tronqué — on fait défiler de gauche à droite comme dans Notion. */
  /* max-content : le tableau prend exactement la largeur de ses colonnes,
     sinon la dernière (boutons CRM / supprimer) se fait rogner. */
  .cold-table.as-table { min-width: max-content; }
  .cold-table.as-table .cold-row {
    grid-template-columns: 190px 130px 170px 160px 38px 150px 180px 122px;
    padding: 10px 13px;
  }
  .cold-table.as-table .c-note input { width: 100%; }
  .cold-table.as-table .c-mini { padding: 5px 8px; font-size: 12px; }
  .cold-table.as-table .c-tel { flex-wrap: nowrap; }
  .cold-head-actions { width: 100%; }
  .cold-search { flex: 1; }
  .cold-grid { grid-template-columns: 1fr 1fr; }

  .agenda-cell { min-height: 58px; padding: 4px; border-radius: 8px; }
  .agenda-chip { font-size: 0; padding: 0; width: 6px; height: 6px; border-radius: 50%; align-self: flex-start; margin-left: 3px; }
  .agenda-chip.rdv { background: var(--accent); }
  .agenda-chip.relance { background: #ee7a7a; }
  .agenda-cell-events { flex-direction: row; flex-wrap: wrap; gap: 3px; }
  .agenda-more { font-size: 8.5px; }
  .agenda-daynum { width: 20px; height: 20px; font-size: 11px; }
}
