:root {
  --navy-black: #070c1c;
  --navy-deep: #0f172d;
  --navy: #1d2744;
  --navy-2: #2a3558;
  --gold: #d9a347;
  --gold-deep: #a16a15;
  --gold-soft: #fbf3e4;
  --ink: #0f172d;
  --muted: #4e5565;
  --muted-2: #8a91a1;
  --line: #e0e3e8;
  --line-2: #eef0f3;
  --bg: #f5f6f8;
  --card: #ffffff;
  --ok: #16a34a;
  --ok-soft: #e8f6ee;
  --err: #dc2626;
  --err-soft: #fdecec;
  --blue: #3b82f6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 45, .05), 0 4px 16px -6px rgba(15, 23, 45, .08);
  --shadow-lg: 0 24px 60px -20px rgba(7, 12, 28, .45);
  --font: 'Schibsted Grotesk', 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Sora', 'Golos Text', var(--font);
  --font-mono: 'Azeret Mono', ui-monospace, 'SF Mono', monospace;
  --sidebar: 240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; }
h2 { font-size: 16px; }
h3 { font-size: 16px; }
.i { width: 18px; height: 18px; flex: none; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; background: var(--navy-deep); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: .04em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--gold); color: var(--navy-deep); display: grid; place-items: center; font-size: 16px; }
.brand small { display: block; font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: .14em; color: var(--gold); margin-top: 1px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; text-decoration: none;
  color: #aeb4c3; font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: rgba(217, 163, 71, .14); color: var(--gold); }
.nav .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 14px; display: flex; align-items: center; gap: 10px; }
.sidebar-foot .who { flex: 1; min-width: 0; }
.sidebar-foot .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who span { font-size: 11px; color: #aeb4c3; }
.sidebar .icon-btn { color: #aeb4c3; }
.sidebar .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.lang-switch { display: flex; gap: 4px; padding: 0 10px 12px; }
.lang-switch button { background: transparent; border: 1px solid rgba(255, 255, 255, .14); color: #aeb4c3; border-radius: 6px; padding: 2px 8px; font-size: 11px; font-family: var(--font-mono); cursor: pointer; }
.lang-switch button.on { background: var(--gold); border-color: var(--gold); color: var(--navy-deep); }

.main { flex: 1; min-width: 0; padding: 28px 32px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.mobile-bar { display: none; }

/* ---------- Composants ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px 0; }
.card-head h2 { font-size: 14px; }
.card-body { padding: 14px 20px 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 9px; border: 1px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; text-decoration: none;
  white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--gold); border-color: var(--gold); color: var(--navy-deep); }
.btn-primary:hover { background: #cf9636; }
.btn-dark { background: var(--navy-deep); border-color: var(--navy-deep); color: #fff; }
.btn-dark:hover { background: var(--navy); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--line-2); }
.btn-danger { color: var(--err); }
.btn-danger:hover { background: var(--err-soft); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #15803d; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }

.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.select { padding-right: 30px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234e5565' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 163, 71, .2); }
.select-sm, .input-sm { height: 32px; font-size: 13px; border-radius: 8px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--muted-2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--gold-deep); }

.search-box { position: relative; }
.search-box .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-2); width: 16px; height: 16px; }
.search-box .input { padding-left: 34px; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.badge-gold { background: var(--gold); color: var(--navy-deep); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-err { background: var(--err-soft); color: var(--err); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }

.presence { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.presence-none { color: var(--ok); }
.presence-social_only { color: #7c3aed; }
.presence-website { color: var(--muted-2); }

.score { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; }
.score-bar { width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.score-bar i { display: block; height: 100%; background: var(--gold); border-radius: 3px; }

.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.sidebar .avatar { width: 32px; height: 32px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 12px; border: none; background: none; cursor: pointer; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs .on { color: var(--ink); border-color: var(--gold); }

.seg { display: inline-flex; background: var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty > .i { width: 36px; height: 36px; color: var(--muted-2); margin-bottom: 8px; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--gold-deep); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 60px; text-align: center; color: var(--muted); }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--gold-soft); color: #6b4a10; font-size: 13px; }
.notice .i { color: var(--gold-deep); margin-top: 1px; }
.notice-blue { background: #eef4ff; color: #1e3a8a; }
.notice-blue .i { color: var(--blue); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfc; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: #fafbfc; }
.table tbody tr.sel { background: var(--gold-soft); }
.table tr:last-child td { border-bottom: none; }
.table .cb { width: 36px; }
.lead-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.lead-name .emoji { font-size: 16px; }
.lead-sub { font-size: 12px; color: var(--muted); }
.tel { font-family: var(--font-mono); font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.tel:hover { color: var(--gold-deep); }
.due-late { color: var(--err); font-weight: 600; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar .search-box { flex: 1; min-width: 200px; }
.toolbar .select { width: auto; min-width: 130px; }
.bulkbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 16px; background: var(--navy-deep); color: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.bulkbar .select { width: auto; background-color: var(--navy); color: #fff; border-color: var(--navy-2); }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* Cartes leads (mobile) */
.lead-cards { display: none; }
.lead-card { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); align-items: center; }
.lead-card .grow { min-width: 0; }
.lead-card .lead-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.call-fab { width: 40px; height: 40px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; flex: none; }

/* ---------- Tableau de bord ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .value { font-family: var(--font-mono); font-size: 26px; font-weight: 600; margin-top: 6px; letter-spacing: -.02em; }
.kpi .sub { font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.kpi-hero { background: var(--navy-deep); border-color: var(--navy-deep); color: #fff; }
.kpi-hero .label { color: #aeb4c3; }
.kpi-hero .value { color: var(--gold); }
.kpi-hero .sub { color: #aeb4c3; }
a.kpi { text-decoration: none; transition: border-color .15s; }
a.kpi:hover { border-color: var(--gold); }
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.dash-grid > .span-2 { grid-column: span 2; }
.funnel-row { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
.funnel-bar { height: 22px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.funnel-bar i { display: block; height: 100%; border-radius: 6px; min-width: 2px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .bar i { width: 100%; max-width: 26px; background: var(--gold); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .bar span { font-size: 10px; color: var(--muted-2); font-family: var(--font-mono); }
.bars .bar b { font-size: 10px; font-family: var(--font-mono); color: var(--muted); font-weight: 500; }
.task { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.task:last-child { border-bottom: none; }
.task .grow { min-width: 0; cursor: pointer; }
.task b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-item { display: flex; gap: 10px; padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--line-2); }
.feed-item:last-child { border-bottom: none; }
.feed-item .ico { width: 28px; height: 28px; border-radius: 8px; background: var(--line-2); display: grid; place-items: center; flex: none; font-size: 13px; }
.feed-item a { font-weight: 600; text-decoration: none; cursor: pointer; }
.rank { font-family: var(--font-mono); color: var(--muted-2); width: 22px; }
.rank-1 { color: var(--gold-deep); font-weight: 700; }

/* ---------- Pipeline ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; min-height: 60vh; }
.col { flex: 0 0 272px; background: #eceef2; border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 180px); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 700; font-size: 13px; }
.col-head .count { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); font-weight: 500; }
.col-body { padding: 0 8px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 60px; flex: 1; }
.col.drop { outline: 2px dashed var(--gold); outline-offset: -2px; background: var(--gold-soft); }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: grab; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.kcard:hover { border-color: #c9ced8; }
.kcard.dragging { opacity: .4; }
.kcard b { display: block; font-size: 13px; margin-bottom: 3px; }
.kcard .meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.kcard .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 6px; }
.kcard .avatar { width: 22px; height: 22px; font-size: 9px; }

/* ---------- Carte ---------- */
#map { height: calc(100vh - 200px); min-height: 420px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.leaflet-popup-content { font-family: var(--font); font-size: 13px; }
.leaflet-popup-content b { display: block; font-size: 14px; margin-bottom: 2px; }

/* ---------- Générateur ---------- */
.gen-grid { display: grid; grid-template-columns: minmax(340px, 460px) 1fr; gap: 16px; align-items: start; }
.source-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.source-opt { border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: block; }
.source-opt input { display: none; }
.source-opt b { display: block; font-size: 13px; }
.source-opt span { font-size: 11.5px; color: var(--muted); }
.source-opt:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.source-opt.disabled { opacity: .5; cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 12.5px; font-weight: 500; user-select: none; background: #fff; }
.chip input { display: none; }
.chip:has(input:checked) { background: var(--navy-deep); color: #fff; border-color: var(--navy-deep); }
.status-cell { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; }

/* ---------- Campagnes ---------- */
.camp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.camp { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.camp-top { display: flex; align-items: flex-start; gap: 10px; }
.camp-top h3 { font-size: 15px; }
.progress { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--gold); }
.camp-stats { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.camp-stats b { color: var(--ink); font-family: var(--font-mono); }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }

/* ---------- Tiroir lead ---------- */
.drawer-wrap { position: fixed; inset: 0; background: rgba(7, 12, 28, .35); z-index: 50; display: flex; justify-content: flex-end; animation: fade .15s; }
.drawer { width: min(640px, 100%); height: 100%; background: #fff; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: .6; } }
.drawer-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 20px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 40px; }
.status-steps { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 14px; }
.status-steps button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.status-steps button:hover { border-color: #c9ced8; }
.status-steps button.on { color: #fff; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.quick .btn { height: 34px; }
.info-list { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: 13px; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; word-break: break-word; }
.timeline { display: flex; flex-direction: column; margin-top: 18px; }
.tl { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.tl::before { content: ''; position: absolute; left: 14px; top: 30px; bottom: 0; width: 1px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl .ico { width: 29px; height: 29px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; font-size: 13px; flex: none; z-index: 1; }
.tl .body { flex: 1; min-width: 0; padding-top: 4px; }
.tl .head { font-size: 12px; color: var(--muted); }
.tl .head b { color: var(--ink); }
.tl .content { margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.act-types { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.act-types label { cursor: pointer; }
.act-types input { display: none; }
.act-types span { display: inline-block; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.act-types input:checked + span { background: var(--navy-deep); border-color: var(--navy-deep); color: #fff; }
.log-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fafbfc; }
.plan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plan-card { border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: block; background: #fff; }
.plan-card input { display: none; }
.plan-card b { display: block; font-family: var(--font-mono); font-size: 18px; }
.plan-card span { font-size: 12px; color: var(--muted); }
.plan-card:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.script h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-deep); margin: 18px 0 6px; font-family: var(--font); }
.script h4:first-child { margin-top: 0; }
.script p { margin: 0; font-size: 14.5px; line-height: 1.6; }
.objection { padding: 10px 12px; border-radius: 10px; background: var(--line-2); margin-bottom: 8px; }
.objection b { display: block; margin-bottom: 3px; }

/* ---------- Modales & toasts ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(7, 12, 28, .45); z-index: 80; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: #fff; border-radius: 16px; width: min(480px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal-wide { width: min(720px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 4px; }
.modal-body { padding: 14px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-body:empty { display: none; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--navy-deep); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; transition: opacity .3s, transform .3s; }
.toast-error { background: var(--err); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- Connexion ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 80% -10%, #2a3558 0%, transparent 60%), var(--navy-black); }
.auth-card { width: min(400px, 100%); background: #fff; border-radius: 18px; padding: 30px 28px; box-shadow: var(--shadow-lg); }
.auth-card .brand { color: var(--ink); padding: 0 0 18px; }
.auth-card h1 { font-size: 22px; }
.auth-card p { color: var(--muted); margin: 4px 0 20px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card .btn { margin-top: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .dash-grid, .gen-grid { grid-template-columns: 1fr; }
  .dash-grid > .span-2 { grid-column: auto; }
}
@media (max-width: 820px) {
  .sidebar { display: none; }
  .main { padding: 16px 16px 90px; }
  .mobile-bar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--navy-deep);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around;
  }
  .mobile-bar a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #aeb4c3; text-decoration: none; font-size: 10px; font-weight: 600; padding: 4px 6px; border-radius: 8px; flex: 1; }
  .mobile-bar a.active { color: var(--gold); }
  .mobile-top { display: flex !important; }
  .table-leads { display: none; }
  .lead-cards { display: block; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .info-list { grid-template-columns: 1fr; gap: 2px; }
  .info-list dd { margin-bottom: 8px; }
  .toolbar .search-box { flex-basis: 100%; }
  .toolbar .select { flex: 1 1 40%; min-width: 0; }
  h1 { font-size: 20px; }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
  .funnel-row { grid-template-columns: 100px 1fr 36px; }
  .col { flex-basis: 250px; }
  .source-opts, .plan-cards { grid-template-columns: 1fr; }
  /* Carte sur téléphone : filtres compacts, carte qui tient au-dessus de la barre du bas */
  .map-filters { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .map-filters .select { width: 100% !important; min-width: 0; }
  .map-filters .select:last-child:nth-child(odd) { grid-column: span 2; }
  #map { height: calc(100dvh - 330px); min-height: 300px; }
}
.mobile-top { display: none; align-items: center; justify-content: space-between; margin: -4px 0 14px; }
.mobile-top .brand { color: var(--ink); padding: 0; font-size: 15px; }
.cap::first-letter { text-transform: uppercase; }
