:root {
  --navy: #0b2545; --teal: #13807a; --orange: #e07a1f; --green: #1e9e57; --gold: #f2c14e; --red: #c0392b;
  --bg: #f4f6f9; --card: #ffffff; --text: #1f2933; --muted: #5b6b7f; --line: #dde3ea; --chip: #eef2f6;
  --radius: 12px; --shadow: 0 1px 2px rgba(11, 37, 69, .06), 0 4px 16px rgba(11, 37, 69, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }
h1 { font-size: 24px; margin: 0 0 4px; color: var(--navy); }
h2 { font-size: 17px; margin: 0 0 12px; color: var(--navy); }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 13px; }
.error { color: var(--red); min-height: 1.2em; margin: 8px 0 0; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { display: block; color: var(--navy); line-height: 1.1; }
.brand small { color: var(--muted); }
.logo { width: 36px; height: 36px; border-radius: 9px; background: var(--navy); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 14px; }

.btn { border: 1px solid transparent; border-radius: 9px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: #12346a; }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--navy); }
.btn.orange { background: var(--orange); color: #fff; }
.btn.green { background: var(--green); color: #fff; }
.btn.link { background: none; color: var(--muted); padding: 6px 0; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input, textarea, select { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text); }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(19, 128, 122, .35); border-color: var(--teal); }
label { display: block; font-weight: 600; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
label input, label textarea, label select { margin-top: 6px; font-weight: 400; }
textarea { resize: vertical; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(160deg, var(--navy), #13807a); }
.login-card { background: #fff; border-radius: 16px; padding: 28px; width: 100%; max-width: 380px; box-shadow: var(--shadow); }
.login-card .brand { margin-bottom: 22px; }
.login-card .btn { width: 100%; justify-content: center; }

.top { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 10px 24px; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.tabs a { padding: 8px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; }
.tabs a.on { background: var(--chip); color: var(--navy); }
main { max-width: 1200px; margin: 0 auto; padding: 24px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

.offer h3 { margin: 0 0 6px; color: var(--navy); font-size: 16px; }
.offer pre { white-space: pre-wrap; font: inherit; font-size: 13px; color: var(--muted); max-height: 140px; overflow: hidden; margin: 0 0 14px; mask-image: linear-gradient(#000 70%, transparent); }
.stats { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.stats b { color: var(--navy); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px; }
.kpi small { color: var(--muted); font-weight: 600; font-size: 12px; }
.kpi div { font-size: 26px; font-weight: 700; color: var(--navy); }

.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.filters, .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--muted); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.notice { background: #e8f6f4; border: 1px solid #bfe4df; color: #0d5c57; padding: 10px 14px; border-radius: 9px; }

.lead { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; border-left: 5px solid var(--line); }
.lead.pA { border-left-color: var(--green); } .lead.pB { border-left-color: var(--gold); } .lead.pC { border-left-color: #9aa5b1; }
.lead-head { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 14px 18px; cursor: pointer; }
.lead-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lead-title strong { color: var(--navy); font-size: 16px; }
.prio { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 7px; color: #fff; background: #9aa5b1; }
.prio.A { background: var(--green); } .prio.B { background: var(--gold); color: #1f2933; }
.tag { font-size: 12px; border-radius: 6px; padding: 2px 8px; background: var(--chip); color: var(--muted); }
.tag.st-approuve { background: #e3effd; color: #174ea6; } .tag.st-envoye { background: #e3f6ea; color: #0b6b36; }
.tag.st-repondu, .tag.st-gagne { background: #fff3d6; color: #7a5300; } .tag.st-ecarte { background: #fbe3e1; color: #8a1c1c; }
.lead-why { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.lead-meta { font-size: 13px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.lead-meta a { color: var(--teal); }
.lead-body { border-top: 1px solid var(--line); padding: 16px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lead-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; justify-content: flex-start; padding-top: 10px; border-top: 1px dashed var(--line, #e3e8ef); }
.err { color: var(--red); font-size: 13px; }

.run { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 10px; }
.run-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.run pre { white-space: pre-wrap; font: inherit; font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; background: #9aa5b1; }
.dot.running { background: var(--orange); animation: pulse 1.2s infinite; } .dot.done { background: var(--green); } .dot.error { background: var(--red); }
@keyframes pulse { 50% { opacity: .3; } }

dialog { position: fixed; border: 0; border-radius: 16px; padding: 24px; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(11, 37, 69, .45); }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 10px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }

@media (max-width: 760px) {
  .top { flex-wrap: wrap; padding: 10px 16px; }
  .tabs { order: 3; width: 100%; flex-basis: 100%; }
  main { padding: 16px; }
  .lead-body { grid-template-columns: 1fr; }
  .lead-head { grid-template-columns: 1fr; }
  .lead-actions { justify-content: flex-start; }
}

.translation { background: #f1f8f7; border: 1px solid #cfe7e3; border-radius: 9px; padding: 10px 12px; white-space: pre-wrap; font-size: 14px; margin-top: 10px; }
.thread { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 14px; }
.thread h3 { margin: 0 0 10px; font-size: 15px; color: var(--navy); }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.msg.mine { background: #f7f9fc; }
.msg.theirs { border-left: 4px solid var(--teal); }
.msg-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.msg-head strong { color: var(--navy); }
.msg pre { white-space: pre-wrap; font: inherit; font-size: 14px; margin: 8px 0 0; }
.inbox { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 16px; align-items: start; }
.inbox-item { background: #fff; border-radius: 10px; box-shadow: var(--shadow); padding: 10px 14px; margin-bottom: 8px; cursor: pointer; border-left: 4px solid transparent; }
.inbox-item.on { border-left-color: var(--navy); }
.inbox-item.unread .ii-subject { font-weight: 700; }
.ii-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.ii-top strong { color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ii-subject { margin: 2px 0; font-size: 14px; }
.ii-snippet { font-size: 13px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#inbox-thread { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }
@media (max-width: 760px) {
  .inbox { grid-template-columns: 1fr; }
  #inbox-thread { position: static; max-height: none; }
}

.client-card { cursor: pointer; display: flex; flex-direction: column; gap: 8px; border-top: 4px solid var(--line); transition: transform .1s; }
.client-card:hover { transform: translateY(-1px); }
.client-card.replied { border-top-color: var(--orange); }
.client-card.won { border-top-color: var(--green); }
.client-card.sent { border-top-color: #4a7bd0; }
.cc-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.cc-top strong { color: var(--navy); font-size: 16px; }
.cc-offer { font-size: 13px; border-top: 1px dashed var(--line); padding-top: 8px; }
.cc-offer b { color: var(--navy); }
.cc-line { color: var(--muted); font-size: 13px; }
dialog.wide { width: min(900px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
.timeline { border-left: 2px solid var(--line); margin: 10px 0 18px 6px; padding-left: 16px; }
.tl-offer { margin: 18px 0 6px; color: var(--navy); }

label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
label.check input { width: auto; margin: 0; }
.fu-box { grid-column: 1 / -1; background: #fff8ef; border: 1px solid #f3d9b5; border-radius: 10px; padding: 14px; }
.fu-box h3 { margin: 0 0 8px; font-size: 15px; color: #8a4b0f; }
.tag.fu { background: #fff1de; color: #8a4b0f; }

.fu-panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border-top: 4px solid var(--orange); padding: 18px; margin-bottom: 18px; }
.fu-panel h2 { display: flex; align-items: center; gap: 8px; }
.badge { background: var(--orange); color: #fff; border-radius: 999px; font-size: 13px; padding: 1px 9px; }
.fu-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-top: 12px; }
.fu-item-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.fu-item-head strong { color: var(--navy); }
.steps { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.step { border-radius: 10px; padding: 12px; font-size: 14px; background: #f7f9fc; border: 1px solid var(--line); }
.step small { display: block; font-weight: 700; color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .04em; margin-bottom: 6px; }
.step.wait { background: #fffaf2; border-color: #f3d9b5; display: grid; place-items: center; text-align: center; color: #8a4b0f; }
.step.fu { background: #fff8ef; border-color: #f3d9b5; }
.step pre { white-space: pre-wrap; font: inherit; font-size: 13px; margin: 0; max-height: 220px; overflow: auto; }
.demo-note { background: #eef4fd; border: 1px solid #c9daf6; color: #174ea6; border-radius: 9px; padding: 10px 14px; font-size: 14px; }
.client-card.fu-due { box-shadow: 0 0 0 2px var(--orange), var(--shadow); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.client-card.example { background: repeating-linear-gradient(135deg, #fff, #fff 14px, #fffaf2 14px, #fffaf2 28px); }
.mail-frame { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-height: 60px; height: 120px; display: block; margin-top: 8px; }
.hist { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 13px; }
.tag.known { background: #e3f6ea; color: #0b6b36; font-weight: 600; }
.tag.first { background: #eef2f6; color: #5b6b7f; }
.tag.wait-us { background: #fde7d3; color: #9a4a00; font-weight: 600; }
.tag.wait-them { background: #e3effd; color: #174ea6; }
.hist-threads { grid-column: 1 / -1; background: #f3faf6; border: 1px solid #cfe9da; border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.hist-threads a { color: var(--teal); }
.triage-panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border-top: 4px solid var(--orange); padding: 16px 18px; margin-bottom: 18px; }
.triage-panel h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tr-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 10px; border-left: 5px solid #9aa5b1; }
.tr-item.hot { border-left-color: #d9480f; background: #fff6f0; }
.tr-item.qualify { border-left-color: #f2c14e; }
.tr-item.not_interested { border-left-color: #c0392b; opacity: .85; }
.tr-item.auto { border-left-color: #9aa5b1; opacity: .75; }
.tr-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tr-head strong { color: var(--navy); }
.tr-sum { margin: 6px 0 2px; font-size: 14px; }
.tr-act { font-size: 13px; color: var(--teal); font-weight: 600; }
.tr-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.tr-side select { width: auto; padding: 5px 8px; font-size: 13px; }
.tag.cat-hot { background: #d9480f; color: #fff; font-weight: 700; }
.tag.cat-qualify { background: #fff1c2; color: #7a5300; }
.tag.cat-not_interested { background: #fbe3e1; color: #8a1c1c; }
.tag.cat-auto { background: #eef2f6; color: #5b6b7f; }
@media (max-width: 760px) { .tr-item { grid-template-columns: 1fr; } .tr-side { align-items: flex-start; flex-direction: row; flex-wrap: wrap; } }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.thumb { position: relative; width: 92px; height: 92px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #f3f5f8; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 3px; right: 3px; border: 0; border-radius: 50%; width: 22px; height: 22px; background: rgba(11,37,69,.8); color: #fff; cursor: pointer; font-size: 13px; line-height: 22px; padding: 0; }
.thumb.new { outline: 2px dashed var(--teal); }
.offer .thumbs { margin: 0 0 12px; }
.offer .thumb { width: 64px; height: 64px; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stats-table th, .stats-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.stats-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.bar { display: inline-block; width: 70px; height: 8px; background: var(--chip); border-radius: 4px; margin-right: 8px; vertical-align: middle; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--teal); }
.help-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 16px; }
.card.help { position: relative; padding-top: 26px; margin: 0; }
.help-n { position: absolute; top: -12px; left: 18px; width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 700; display: grid; place-items: center; }
.card.help p { margin: 0; font-size: 14px; color: var(--text); }
.help-list li { margin-bottom: 8px; }

/* ---------- Mobile : toute l'app ---------- */
.bottom-nav, .more-sheet, .inbox-back { display: none; }
@media (max-width: 760px) {
  body { font-size: 15px; -webkit-text-size-adjust: 100%; }
  .top { position: sticky; top: 0; padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); gap: 10px; }
  .top .tabs, #logout { display: none; }
  .brand small { display: none; }
  main { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); }
  h1 { font-size: 21px; }
  .head { align-items: stretch; margin-bottom: 14px; }
  .head > .row, .head > div > .row { width: 100%; }
  .head select, .head .btn { flex: 1; }
  .btn { min-height: 42px; justify-content: center; }
  .btn.small { min-height: 36px; }
  .btn.link { min-height: 32px; }
  input, textarea, select { font-size: 16px; } /* évite le zoom automatique d'iOS */
  .card { padding: 16px; border-radius: 12px; }
  .grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .kpi { padding: 10px; } .kpi div { font-size: 20px; } .kpi small { font-size: 11px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar > .row { display: grid; grid-template-columns: 1fr 1fr; }
  .filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .chip { white-space: nowrap; padding: 7px 12px; }
  .lead-head { padding: 12px 14px; }
  .lead-actions .btn { flex: 1 1 calc(50% - 8px); }
  .lead-body { padding: 14px; }
  .steps { grid-template-columns: 1fr; }
  .fu-item .row.end .btn { flex: 1; }
  .tr-item { grid-template-columns: 1fr; }
  .tr-side { flex-direction: row; flex-wrap: wrap; align-items: stretch; }
  .tr-side .btn, .tr-side select { flex: 1; }
  dialog { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 16px 16px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  dialog.wide { width: 100vw; }
  dialog .row { flex-direction: column; align-items: stretch; }
  dialog .row.end { flex-direction: row; }
  dialog .row.end .btn { flex: 1; }
  #toast { bottom: calc(90px + env(safe-area-inset-bottom)); }
  /* Boîte : liste OU conversation, avec retour */
  .inbox { grid-template-columns: 1fr; }
  .inbox.reading #inbox-list { display: none; }
  .inbox.reading .inbox-back { display: inline-flex; }
  .inbox:not(.reading) #inbox-thread { display: none; }
  #inbox-thread { position: static; max-height: none; }
  .stats-table { font-size: 13px; }
  .help-steps { grid-template-columns: 1fr; }
  /* Barre du bas */
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 12px rgba(11,37,69,.08); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font: inherit; font-size: 11px;
    color: var(--muted); text-decoration: none; background: none; border: 0; position: relative; }
  .bottom-nav span { font-size: 20px; line-height: 1; }
  .bottom-nav a.on, .bottom-nav button.on { color: var(--navy); font-weight: 700; }
  .nav-badge { position: absolute; top: 4px; right: calc(50% - 22px); background: var(--orange); color: #fff; font-size: 10px; border-radius: 999px; padding: 1px 6px; }
  .more-sheet:not([hidden]) { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 19;
    background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(11,37,69,.18); padding: 8px 0; }
  .more-sheet a, .more-sheet button { padding: 15px 22px; font: inherit; font-size: 16px; color: var(--text); text-decoration: none; background: none; border: 0; text-align: left; border-bottom: 1px solid var(--line); }
  .more-sheet button:last-child { border-bottom: 0; color: var(--muted); }
}
.cpick { margin: 6px 0 14px; }
.cpick .chips { margin-bottom: 8px; }
.cpick .chip.on::after { content: " ×"; }
#radar-settings summary { cursor: pointer; }
.help-cmds { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; font-size: 14px; }
.help-cmds > div { background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }

/* ---------- Acheteurs : cartes carrées + fenêtre détaillée ---------- */
.lead-tools { margin: 0 0 14px; gap: 10px; }
.lead-tools label.inline { display: flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.lead-tools label.inline select { margin: 0; width: auto; }
.lead-tools input[type=search] { flex: 1; min-width: 180px; }
.lead-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.lead-grid > .empty { grid-column: 1 / -1; }
.lcard { aspect-ratio: 1 / 1; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 7px;
  cursor: pointer; border-top: 5px solid #9aa5b1; transition: transform .12s, box-shadow .12s; overflow: hidden; position: relative; }
.lcard:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(11,37,69,.13); }
.lcard.pA { border-top-color: var(--green); } .lcard.pB { border-top-color: var(--gold); }
.lcard.hot { box-shadow: 0 0 0 2px #d9480f, var(--shadow); }
.lc-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.lc-flag { font-size: 20px; line-height: 1; margin-right: 6px; vertical-align: -3px; }
.lc-name { font-size: 16px; font-weight: 700; color: var(--navy); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.lc-pills .tag { font-size: 11.5px; padding: 2px 7px; }
.lc-icons { display: flex; gap: 10px; font-size: 13px; color: var(--muted); }
.lc-icons .off { opacity: .25; }
.lc-last { font-size: 12.5px; color: var(--text); }
.lc-last.never { color: var(--muted); font-style: italic; }
.lc-heat { height: 6px; background: var(--chip); border-radius: 4px; overflow: hidden; }
.lc-heat span { display: block; height: 100%; background: linear-gradient(90deg, #f2c14e, #e07a1f, #d9480f); }
.lc-foot { margin-top: auto; display: flex; gap: 6px; }
.lc-foot .btn { flex: 1; min-height: 34px; padding: 6px 8px; font-size: 13px; }
.modal-x { position: absolute; top: 10px; right: 12px; border: 0; background: var(--chip); width: 34px; height: 34px; border-radius: 50%; font-size: 20px; cursor: pointer; color: var(--navy); z-index: 2; }
#lead-modal { padding: 0; }
#lead-modal-body .lead { box-shadow: none; margin: 0; border-left-width: 6px; }
#lead-modal-body .lead-head { cursor: default; padding-right: 56px; }
@media (max-width: 760px) {
  .lead-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .lcard { aspect-ratio: auto; min-height: 210px; padding: 11px; }
  .lc-name { font-size: 14.5px; }
  .lc-sub { display: none; }
  .lead-tools { flex-direction: column; align-items: stretch; }
  #lead-modal { max-height: 94vh; }
}

/* ---------- Aujourd'hui ---------- */
.health { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.health span { font-size: 13px; background: #fff; border-radius: 999px; padding: 5px 12px; box-shadow: var(--shadow); }
.health .bad { background: #fbe3e1; color: #8a1c1c; }
.today-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.tblock { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 16px; }
.tblock h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.trow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); cursor: pointer; }
.trow:first-of-type { border-top: 0; }
.trow b { color: var(--navy); }
.trow .small { color: var(--muted); }
.tbig { font-size: 30px; font-weight: 800; color: var(--navy); }
.late { color: var(--red); font-weight: 700; }
/* ---------- Pipeline ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: #e9edf3; border-radius: 12px; padding: 10px; min-height: 140px; }
.col.drag { outline: 2px dashed var(--teal); }
.col h3 { margin: 2px 4px 10px; font-size: 14px; color: var(--navy); display: flex; justify-content: space-between; }
.pcard { background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(11,37,69,.1); cursor: pointer; border-left: 4px solid #9aa5b1; }
.pcard.pA { border-left-color: var(--green); } .pcard.pB { border-left-color: var(--gold); }
.pcard.hot { box-shadow: 0 0 0 2px #d9480f; }
.pcard b { color: var(--navy); display: block; font-size: 14px; }
.pcard .small { color: var(--muted); font-size: 12px; }
.pcard .na { font-size: 12.5px; margin-top: 6px; }
/* ---------- Fiche client ---------- */
.crm { padding: 18px 20px 6px; border-bottom: 1px solid var(--line); }
.crm-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 10px; }
.crm-row label { margin: 0; flex: 1; min-width: 160px; }
.stages { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.stages button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.stages button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.tl { list-style: none; padding: 0; margin: 8px 0 14px; max-height: 260px; overflow: auto; }
.tl li { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.tl li .when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.outcome-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.ob { margin: 0; } .ob input { display: none; }
.ob span { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; font-weight: 600; color: var(--text); cursor: pointer; }
.ob input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
@media (max-width: 760px) {
  .today-grid { grid-template-columns: 1fr; }
  .board { grid-auto-columns: 82vw; }
}
.bulkbar { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; }
.bulkbar .btn.ghost { background: #fff; } .bulkbar .btn.link { color: #fff; }
.lc-sel { position: absolute; top: 10px; left: 10px; width: 22px; height: 22px; margin: 0; accent-color: var(--navy); opacity: .35; }
.lcard:hover .lc-sel, .lc-sel:checked { opacity: 1; }
.lcard.selected { box-shadow: 0 0 0 3px var(--teal); }
.lcard .lc-top { padding-left: 26px; }
.lc-size { font-size: 12px; color: #5b2a9a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel { display: grid; gap: 4px; margin: 10px 0 12px; font-size: 12.5px; }
.funnel > div { display: grid; grid-template-columns: 110px 1fr 36px; align-items: center; gap: 8px; }
.funnel .fb { height: 8px; background: var(--chip); border-radius: 4px; overflow: hidden; }
.funnel .fb i { display: block; height: 100%; background: var(--teal); }
.funnel b { text-align: right; color: var(--navy); }
.offer.dim { opacity: .65; }
.ctx { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #f3faf6; border: 1px solid #cfe9da; border-radius: 10px; padding: 10px 12px; margin: 6px 0 12px; }
.ctx b { color: var(--navy); }
.age { font-size: 13px; font-weight: 700; color: var(--orange); }

dialog > form > h2:first-child, dialog > h2:first-child { padding-right: 40px; }
.lang-switch .btn { display: inline; width: auto; padding: 4px 6px; }
.lang-switch { margin-top: 14px; text-align: center; font-size: 13px; color: var(--muted, #5b6b7f); }
.btn.wa { background: #25d366; color: #fff; border-color: #25d366; }
.btn.wa:hover { background: #1ebe5a; }
.tag.wa { background: #e3f9eb; color: #128c4a; }
.wa-panel { margin: 10px 16px 6px; padding: 12px; border: 1px solid #bfeccf; border-radius: 12px; background: #f4fdf7; }
.wa-panel .row { flex-wrap: wrap; gap: 8px; align-items: center; }
/* ---------- Approvisionnement ---------- */
.card.warn { border-left: 4px solid var(--orange, #e07a1f); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.ab-thread { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }
#as-regions { margin: 4px 0 12px; }
@media (max-width: 760px) { .ab-thread { position: static; max-height: none; } }
.mat-head { font-size: 16px; color: var(--navy); margin: 18px 0 10px; }
.mat-head:first-child { margin-top: 4px; }
.autosave { position: absolute; top: 14px; right: 58px; font-size: 12px; color: var(--green, #1e9e57); opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 3; }
.autosave.show { opacity: 1; }
dialog { position: fixed; }
.learn-rule { background: #f4f8fd; border-left: 4px solid var(--navy); padding: 10px 12px; border-radius: 8px; }
.update-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 84px; z-index: 50; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; }
.hide-panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 14px; margin: 0 0 12px; }
.hide-panel summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.hide-opts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; }
.hide-opts .check { margin: 0; }
/* ---------- Mode accompagné ---------- */
.turbo-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 14px; margin: 0 0 10px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--navy); cursor: pointer; margin: 0; }
.switch input { width: 18px; height: 18px; }
.turbo-head { display: flex; justify-content: space-between; align-items: baseline; padding-right: 44px; margin-bottom: 8px; }
.turbo-progress { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-bottom: 14px; }
.turbo-progress span { display: block; height: 100%; background: var(--teal, #13807a); transition: width .3s; }
.turbo-card .tkind { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.turbo-card .treport { font-size: 15px; line-height: 1.5; margin: 0 0 8px; }
.turbo-card .tprop { background: #f4f8fd; border-left: 4px solid var(--navy); padding: 10px 12px; border-radius: 8px; }
.turbo-card .tdetail { margin: 12px 0; }
.turbo-actions { flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag.bx { background: #e8eefc; color: #2b4ea2; }
.bx-line { color: #2b4ea2; margin: 4px 0; }
/* Statut des offres : visible d'un coup d'œil */
.ost { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; vertical-align: middle; margin-right: 6px; }
.ost-active { background: #e3f6ea; color: #1e7a45; }
.ost-paused { background: #eef0f3; color: #6b7785; }
.ost-sold { background: #fff1e0; color: #a35a12; }
.card.offer.ost-card-active { border-left: 5px solid #1e9e57; }
.card.offer.ost-card-paused { border-left: 5px solid #c4cad3; opacity: .78; }
.card.offer.ost-card-sold { border-left: 5px solid #e07a1f; opacity: .85; }
.offer-tools { flex-wrap: wrap; gap: 10px; margin-bottom: 12px; align-items: center; }
.offer-tools input { max-width: 280px; }
/* Compteur des emails approuvés à envoyer (bouton Acheteurs + onglet). */
.btn.primary .send-n { background: #fff; color: var(--navy); font-weight: 700; margin-left: 6px; }
.btn.primary:disabled .send-n { opacity: .6; }
.nav-send-n { font-size: 11px; padding: 0 7px; margin-left: 4px; vertical-align: 2px; }
/* Offres présentées dans l'email d'un acheteur. */
.offers-pick { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line, #e3e6ec); border-radius: 10px; }
.offers-pick .offer-chip { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 14px; }
.offers-pick .offer-chip.sug span:first-of-type { font-weight: 600; }
.offers-pick details { margin: 6px 0; max-height: 260px; overflow: auto; }
.offers-pick p { margin: 8px 0 4px; }
/* Planning d'envoi. */
.sched-day { margin: 18px 0 6px; text-transform: capitalize; font-size: 16px; }
.sched-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line, #e3e6ec); }
.sched-time b { display: block; font-size: 16px; }
.sched-time small { color: var(--muted, #6b7280); }
.sched-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .sched-row { grid-template-columns: 80px 1fr; } .sched-actions { grid-column: 1 / -1; justify-content: flex-start; } }
/* Admin : utilisateurs. */
.admin-add { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.admin-user.off { opacity: .55; }
.admin-user .row { margin-top: 8px; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-user .grow { flex: 1; }
/* Reporting journalier. */
.report-text { white-space: pre-wrap; font: inherit; font-size: 14px; background: var(--soft, #f5f7fa); padding: 12px; border-radius: 8px; max-height: 60vh; overflow: auto; }
/* Jours travaillés (Aujourd'hui). */
.workdays { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -4px 0 14px; }
.workdays .wd { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line, #d7dce4); background: transparent; font-weight: 600; cursor: pointer; color: inherit; }
.workdays .wd.on { background: var(--navy, #0f2a55); border-color: var(--navy, #0f2a55); color: #fff; }
.workdays .rest { color: var(--orange, #d9480f); font-weight: 600; }
/* Où chercher : Mes marchés, pays d'une offre, suggestions de l'IA, retour d'absence. */
.markets-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; margin: 0 0 14px; border: 1px solid var(--line, #e3e6ec); border-radius: 10px; background: var(--soft, #f5f7fa); }
.markets-bar .chip { cursor: default; }
.offer-countries { margin: 6px 0 8px; }
.cadd { margin-top: 6px; gap: 6px; }
.cadd input { flex: 1; min-width: 160px; }
.sug { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--line, #d7dce4); border-radius: 10px; }
.sug-item { display: flex; gap: 8px; align-items: baseline; margin: 6px 0; }
.sug-item .chip { flex: none; }
.welcome { border-left: 5px solid var(--orange, #d9480f); margin-bottom: 14px; }
.welcome-list { margin: 0; padding-left: 18px; }
.welcome-list li { margin: 2px 0; }
