/* CRM (leads, clients) et pilotage des projets — complète style.css */
.side { overflow-y: auto; }
.side .sect.next { margin-top: 26px; }
.side .sect:first-of-type { margin-top: 36px; }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--green-ink); text-decoration: underline; }
.tag.info { background: var(--green-soft); color: var(--green-ink); }
.tag.danger { background: #fdecea; color: var(--danger); }
.tag.line { background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-weight: 500; }
a.tag { text-decoration: none; align-self: flex-start; }
.code { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.kpi .val.danger { color: var(--danger); }

/* Jauge budget / consommé */
.gauge { min-width: 170px; }
.gauge .top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 7px; font-variant-numeric: tabular-nums; }
.gauge .top b { font-weight: 700; }
.gauge .track { height: 8px; }
.track.warn > i { background: #d08a00; }
.track.over > i { background: var(--danger); }
.hbar .top .over { color: var(--danger); font-weight: 700; }


dl.kv { display: grid; grid-template-columns: minmax(0, 140px) minmax(0, 1fr); gap: 12px 16px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Pipeline */
.board { display: grid; grid-template-columns: repeat(5, minmax(240px, 1fr)); gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.lane { background: var(--line-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.lane .lh { display: flex; align-items: baseline; gap: 8px; padding: 4px 4px 6px; }
.lane .lh b { font-size: 14.5px; }
.lane .lh .s { margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.opp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.opp .t { font-weight: 600; font-size: 14px; line-height: 1.35; }
.opp .r { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.opp .r b { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.opp .r .late { color: var(--danger); font-weight: 600; }
.opp .avatar { width: 28px; height: 28px; font-size: 10.5px; }
.opp button, .opp .btn { align-self: flex-start; padding: 7px 12px; font-size: 13px; }


dialog { background: #fff; }
dialog .hint { font-size: 13px; color: var(--ink-2); background: var(--green-soft-2); border: 1px solid var(--green-line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0; }
dialog .hint[hidden] { display: none; }
@media (max-width: 860px) {
  .filters input { width: 100% !important; }
  dialog .grid { grid-template-columns: 1fr; }
  dl.kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } dl.kv dd { margin-bottom: 10px; }
}

/* ---------- Kanban leads (v3) ---------- */
.board { grid-template-columns: repeat(6, minmax(230px, 1fr)); }
.opp { font: inherit; color: var(--ink); text-align: left; width: 100%; cursor: pointer; white-space: normal; align-items: stretch; }
.opp:hover { border-color: var(--c2); background: #fff; }
.opp .t { display: block; }
.opp .r { width: 100%; }
.opp .r .cl { font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; }
.opp .com { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.opp .go { align-self: flex-start; padding: 7px 12px; font-size: 13px; }
.lane .add { justify-content: center; color: var(--muted); font-weight: 500; }
.lane.gagne { background: #eaf6ef; border-color: #cfe8da; }
.lane.perdu { background: #f3f5f6; }
.lane.perdu .opp { opacity: .75; }
dialog.wide { width: min(760px, calc(100vw - 32px)); }
dialog .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
fieldset.ct { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px 16px; margin: 0; }
fieldset.ct legend { font-size: 13px; font-weight: 700; color: var(--ink); padding: 0 6px; }
table.data.mini th:first-child, table.data.mini td:first-child { padding-left: 12px; }
table.data.mini th:last-child, table.data.mini td:last-child { padding-right: 12px; }
table.data.mini td { font-size: 13px; padding: 9px 12px; }
@media (max-width: 860px) { dialog .grid3 { grid-template-columns: 1fr; } }


/* ---------- Kanban projets + checklists (v4) ---------- */
.pboard { grid-template-columns: repeat(var(--lanes, 5), minmax(240px, 1fr)); }
a.opp.proj { text-decoration: none; }
.opp.proj .code { display: block; }
.opp.proj .gauge { min-width: 0; width: 100%; }
.opp .who { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.ck { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--line-2); border-radius: 20px; padding: 3px 8px 3px 6px; white-space: nowrap; }
.ck svg.ic.sm { width: 14px; height: 14px; }
.ck.done { background: #e3f4ea; color: #1f6b47; }
.tag.bill { background: #f1ecfb; color: #5b3fb3; }
.cl-block { padding: 4px 0 16px; border-bottom: 1px solid var(--line-2); margin-bottom: 14px; }
.cl-h { display: flex; align-items: center; gap: 10px; }
.cl-h b { font-size: 15px; font-weight: 600; flex: 1; }
.cl-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cl-items label.check { padding: 6px 4px; font-size: 14px; border-radius: 6px; width: 100%; }
.cl-items label.check:hover { background: var(--green-soft-2); }
.cl-items label.check.done { color: var(--muted); text-decoration: line-through; }
.cl-items input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--c3); }
.cl-add, .cl-new { display: flex; gap: 6px; margin-top: 8px; }
.cl-add input, .cl-new input { flex: 1; padding: 8px 10px; font-size: 13.5px; }
.cl-add button { padding: 6px 10px; }


/* ---------- Kanban : cartes mises en valeur, glisser-déposer, commentaires (v5) ---------- */
.board, .pboard { gap: 14px; align-items: start; }
.pboard { grid-template-columns: repeat(var(--lanes, 5), minmax(210px, 1fr)); }
.lane { --st: var(--c3); padding: 0; gap: 0; border: 1px solid color-mix(in srgb, var(--st) 30%, #fff); background: color-mix(in srgb, var(--st) 9%, #fff); overflow: hidden; transition: box-shadow .15s, background .15s; }
.lane .lh { background: var(--st); color: #fff; padding: 12px 14px; margin: 0; align-items: center; }
.lane .lh b { font-size: 14px; }
.lane .lh .n { background: rgba(255,255,255,.22); border-radius: 20px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.lane .lh .s { color: rgba(255,255,255,.9); }
.lane .cards { display: flex; flex-direction: column; gap: 10px; padding: 12px; min-height: 70px; }
.lane .add { margin: 0 12px 12px; color: color-mix(in srgb, var(--st) 80%, #000); }
.lane.over { box-shadow: 0 0 0 3px color-mix(in srgb, var(--st) 45%, #fff); background: color-mix(in srgb, var(--st) 18%, #fff); }
.opp { background: #fff; border: 1px solid color-mix(in srgb, var(--st) 35%, #fff); box-shadow: 0 1px 2px rgba(1,33,40,.06), 0 6px 14px -8px rgba(1,33,40,.28); cursor: grab; transition: transform .12s, box-shadow .12s, border-color .12s; }
.opp:hover { transform: translateY(-1px); border-color: var(--st); box-shadow: 0 2px 4px rgba(1,33,40,.08), 0 10px 20px -10px rgba(1,33,40,.35); }
.opp.dragging { opacity: .45; transform: rotate(1.5deg); }
.opp button.t { all: unset; font-weight: 600; font-size: 14px; line-height: 1.35; cursor: pointer; display: block; }
.opp button.t:focus-visible { outline: 2px solid #32BFF2; border-radius: 4px; }
.opp .code { color: color-mix(in srgb, var(--st) 75%, #000); }
.opp .com { font-size: 12.5px; color: var(--ink-2); background: color-mix(in srgb, var(--st) 7%, #fff); border-radius: 6px; padding: 7px 9px; -webkit-line-clamp: 3; }
.opp .com b { font-weight: 600; color: var(--muted); font-size: 11.5px; margin-right: 2px; }
.opp .com i { font-style: normal; font-weight: 600; color: var(--muted); font-size: 11.5px; }
.opp .go { padding: 7px 12px; font-size: 13px; }
.empty-lane { margin: 0; padding: 18px 8px; text-align: center; font-size: 12.5px; color: var(--muted); border: 1.5px dashed color-mix(in srgb, var(--st) 30%, #fff); border-radius: var(--radius-sm); }
.lane.perdu .opp, .lane.p-clos .opp { opacity: 1; }

/* Commentaires et historique */
.field-block { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px 16px; }
.field-block .fb-h { font-size: 13px; font-weight: 700; }
.coms { display: flex; flex-direction: column; gap: 10px; }
.com-last { background: var(--green-soft-2); border: 1px solid var(--green-line); border-radius: var(--radius-sm); padding: 10px 12px; }
.com-item .when { font-size: 12px; color: var(--muted); }
.com-item p { margin: 3px 0 0; font-size: 14px; color: var(--ink); }
details.more-coms, details.hist { border-radius: var(--radius-sm); }
details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--green-ink); padding: 6px 0; }
details.more-coms .com-item { padding: 8px 12px; border-left: 2px solid var(--line); margin: 6px 0 0 4px; }
.com-add { display: flex; gap: 8px; align-items: flex-end; }
.com-add textarea { flex: 1; resize: vertical; }
details.hist { border: 1px solid var(--line); padding: 4px 14px; }
details.hist ol { list-style: none; margin: 4px 0 10px; padding: 0; }
details.hist li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line-2); font-size: 13.5px; }
details.hist li .when { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; font-size: 12.5px; }
details.hist li svg.ic.sm { width: 13px; height: 13px; vertical-align: -2px; color: var(--muted); }
.card .bd details.hist { margin-top: 14px; }

/* Lignes de budget */
.bl-head, .bl-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 110px 34px; gap: 8px; align-items: center; }
.bl-head { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bl-row + .bl-row { margin-top: 8px; }
.bl-name { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bl-row select, .bl-row input { padding: 8px 10px; font-size: 13.5px; width: 100%; }
.bl-unit button { padding: 8px 10px; font-size: 13px; flex: 1; }
.bl-unit { width: 100%; }
.bl-tot { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; background: var(--line-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.bl-tot div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bl-tot span { font-size: 12px; color: var(--muted); }
.bl-tot b { font-size: 17px; font-variant-numeric: tabular-nums; }
.bl-tot small { font-size: 11px; color: var(--muted); }
.bl-tot .neg b { color: var(--danger); }
@media (max-width: 860px) {
  .bl-head { display: none; }
  .bl-row { grid-template-columns: minmax(0, 1fr) 90px 34px; }
  .bl-row .bl-name { grid-column: 1 / -1; }
  .bl-tot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  details.hist li { grid-template-columns: 1fr; gap: 2px; }
  .com-add { flex-direction: column; align-items: stretch; }
}
.opp .com { padding: 0 9px; border-block: 7px solid transparent; }
.lane .lh { flex-wrap: wrap; row-gap: 2px; }
.lane .lh .s { white-space: nowrap; }
.pboard { grid-template-columns: repeat(var(--lanes, 5), minmax(190px, 1fr)); }


.cl-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.cl-links li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cl-links .code { font-size: 12px; }
.cl-items li { display: flex; align-items: center; gap: 4px; }
.cl-items li .icon { opacity: 0; } .cl-items li:hover .icon, .cl-items li .icon:focus-visible { opacity: 1; }
@media (hover: none) { .cl-items li .icon { opacity: 1; } }
.arch-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 16px; }
.arch-row > span:first-child { flex: 1 1 260px; min-width: 0; }
.arch-row.on { background: #fff6e0; border: 1px solid #f0d9a0; border-radius: var(--radius-sm); padding: 12px 14px; }
.arch-row .btns { display: flex; gap: 8px; flex-wrap: wrap; }
button.danger { color: var(--danger); border-color: #f0c8c4; }
button.primary.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.primary.danger:disabled { opacity: .45; cursor: not-allowed; }
.page-head .actions { flex-wrap: wrap; }
.grid-2 > *, .stack > * { min-width: 0; }
.seg { overflow-x: auto; max-width: 100%; }
.opp:focus-visible { outline: 2px solid #32BFF2; outline-offset: 2px; }
.board:not(.pboard) { grid-template-columns: repeat(6, minmax(170px, 1fr)); }
@media (max-width: 860px) { .app { grid-template-columns: minmax(0, 1fr); } }

/* Menu « Mon compte » et profil */
.acct-wrap { position: relative; }
button.acct { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; }
.avatar.xs { width: 28px; height: 28px; font-size: 10.5px; }
.avatar.xl { width: 96px; height: 96px; font-size: 26px; }
img.avatar { object-fit: cover; padding: 0; background: var(--surface); }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(1, 33, 40, .14); padding: 6px; z-index: 30; }
.acct-menu .acct-hd { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.acct-menu .acct-hd > div { min-width: 0; }
.acct-menu .acct-hd b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-menu .acct-hd span { font-size: 12px; color: var(--muted); }
.acct-menu button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: transparent; padding: 10px; border-radius: 8px; text-align: left; justify-content: flex-start; }
.acct-menu button:hover, .acct-menu button:focus-visible { background: var(--green-soft-2); }
.acct-menu button.out { color: #b42318; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; }
.prof { display: flex; align-items: center; gap: 20px; margin: 4px 0 12px; }
.prof-acts { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.prof-acts .btn { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 560px) { button.acct span { display: none; } .acct-menu { width: min(280px, calc(100vw - 32px)); } .prof { flex-direction: column; align-items: flex-start; } }
.prof-info { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 4px 0 10px; font-size: 14px; }
.prof-info dt { color: var(--muted); } .prof-info dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* Cartes de lead : rien ne dépasse dans une colonne étroite */
.opp { min-width: 0; }
.opp .t { overflow-wrap: anywhere; hyphens: auto; }
.opp .r { flex-wrap: wrap; row-gap: 4px; }
.opp .r .cl { min-width: 0; }
.opp .r b { margin-left: auto; }
.opp .r .nd { margin-left: auto; font-size: 12px; color: var(--muted); font-style: italic; }
.opp .r.dates { flex-direction: column; align-items: flex-start; gap: 2px; }
.about .logo img { height: 40px; }
.about-v { font-size: 16px; margin: 14px 0 10px; }
.tip { max-width: 360px; overflow-wrap: anywhere; }
.tip i { font-style: normal; opacity: .75; }
.opp .com { cursor: help; }
/* Kanban Projets : les 5 colonnes tiennent sur un écran de portable ; glisser-déposer plus fiable (Safari) */
.pboard { grid-template-columns: repeat(var(--lanes, 5), minmax(170px, 1fr)); }
.opp[draggable="true"] { -webkit-user-drag: element; user-select: none; -webkit-user-select: none; }
.lane.over { outline: 2px dashed var(--st, #32BFF2); outline-offset: -4px; }
.acct-menu .acct-hd span { display: block; overflow-wrap: anywhere; }
/* Fenêtre « Enregistrer les modifications ? » */
dialog.ask { width: min(500px, calc(100vw - 32px)); }
dialog.ask .ask-bd { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
dialog.ask h2 { font-size: 18px; }
dialog.ask .acts { flex-wrap: wrap; }

/* Champs de recherche : croix d'effacement */
.srch { position: relative; display: inline-flex; align-items: center; max-width: 100%; }
.srch input { padding-right: 40px !important; max-width: 100%; }
.srch-x { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); box-sizing: border-box; width: 24px; height: 24px; min-width: 0; padding: 0; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; gap: 0; background: #EAF5F9; color: #3E5E66; cursor: pointer; }
.srch-x svg { display: block; flex: none; }
.srch-x:hover { background: #D3E4EA; color: #012128; }
.srch input:placeholder-shown + .srch-x { display: none; }

/* Page de connexion : numéro de version discret */
.auth-ver { margin-top: 18px; text-align: right; font-size: 11px; letter-spacing: .04em; color: #3E5E66; opacity: .6; }

/* Double authentification */
.mfa-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; }
.mfa-steps li { display: flex; flex-direction: column; gap: 8px; }
.mfa-qr { align-self: flex-start; padding: 6px; border: 1px solid #D3E4EA; border-radius: 10px; background: #fff; line-height: 0; }
.mfa-qr svg { display: block; max-width: 100%; height: auto; }
.mfa-key { align-self: flex-start; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 14px; letter-spacing: .04em; background: #EAF5F9; padding: 6px 10px; border-radius: 6px; overflow-wrap: anywhere; }
input.mfa-code { font-size: 22px; letter-spacing: .25em; text-align: center; max-width: 220px; font-variant-numeric: tabular-nums; }
.mfa-codes ol { margin: 0; padding: 12px 16px 12px 36px; columns: 2; column-gap: 28px; background: #EAF5F9; border-radius: 10px; }
.mfa-codes code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 15px; }
.acct-menu .tag { margin-left: auto; font-size: 11px; }
/* ---------- Menu de gauche compact (2.3.0) : tient sur un écran d'ordinateur portable ---------- */
.app { grid-template-columns: 260px minmax(0, 1fr); background: linear-gradient(90deg, #fff 0 259px, var(--line) 259px 260px, transparent 260px); }
.side { padding: 22px 14px 14px; }
.side .logo img { width: 176px; }
.side .sect, .side .sect.next { font-size: 11px; margin: 18px 0 6px 14px; }
.side .sect:first-of-type { margin-top: 24px; }
.side nav { gap: 2px; }
.side nav a { gap: 12px; padding: 9px 14px; font-size: 15px; }
.side nav a .badge { font-size: 11.5px; padding: 2px 7px; }
.side .foot { gap: 10px; }
@media (max-height: 760px) and (min-width: 861px) {
  .side { padding-top: 16px; }
  .side .sect, .side .sect.next { margin-top: 12px; margin-bottom: 4px; }
  .side nav a { padding: 7px 14px; }
}
@media (max-width: 860px) { .app { grid-template-columns: minmax(0, 1fr); background: none; } .side { width: 270px; } }
