/* Pilote Entreprise — feuille de style
   Palette : encre, pétrole (actions), safran (sélection / édition), brume (fond). */
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-display: swap; src: url("/static/fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 500; font-display: swap; src: url("/static/fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-display: swap; src: url("/static/fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 700; font-display: swap; src: url("/static/fonts/instrument-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  --ink: #12262b; --ink-2: #33494e; --muted: #5e7275; --faint: #8a9b9d;
  --bg: #f2f5f4; --surface: #ffffff; --sunk: #f7f9f8; --line: #dde5e3; --line-2: #e9eeed;
  --petrol: #0f5e63; --petrol-2: #0b4a4e; --petrol-soft: #e3efee; --petrol-ink: #0a4447;
  --saffron: #e0a526; --saffron-soft: #fbf1db; --saffron-ink: #7a560a;
  --ok: #1d7a4f; --ok-soft: #e2f2e9; --warn: #a96a07; --warn-soft: #fbefd9; --bad: #b4382c; --bad-soft: #fae7e4;
  --violet: #5b4bc4; --violet-soft: #eeebfb;
  --r-lg: 11px; --r: 7px; --r-sm: 5.5px;
  --font: "Instrument Sans", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --side: 223px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 13px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1; }
a { color: var(--petrol); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 23.5px; line-height: 1.2; margin: 0; font-weight: 600; letter-spacing: -.015em; }
h2 { font-size: 14px; margin: 0 0 11px; font-weight: 600; letter-spacing: -.005em; }
h3 { font-size: 11.5px; margin: 0; font-weight: 600; color: var(--muted); }
small, .muted { color: var(--muted); }
.small { font-size: 11px; }
code { background: var(--sunk); border: 1px solid var(--line-2); padding: 0 4.5px; border-radius: 3.5px; font-size: 11px; }
:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }

/* ---------- structure */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--side); flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 9px; padding: 18px 18px 16px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.logo { display: inline-grid; place-items: center; height: 27px; padding: 0 7px; border-radius: 6.5px; background: var(--petrol); color: #fff; font-weight: 700; font-size: 11.5px; letter-spacing: .06em; }
.brand-name { font-weight: 600; font-size: 15.5px; letter-spacing: -.01em; }
.brand.dark { padding: 0 0 3.5px; }
.sidebar nav { display: flex; flex-direction: column; padding: 0 11px 11px; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; color: var(--ink-2); padding: 6.5px 9px; border-radius: var(--r); margin: 1px 0; font-weight: 500; position: relative; }
.sidebar nav a .ico { color: var(--faint); }
.sidebar nav a:hover { background: var(--sunk); text-decoration: none; color: var(--ink); }
.sidebar nav a.active { background: var(--petrol-soft); color: var(--petrol-ink); font-weight: 600; }
.sidebar nav a.active .ico { color: var(--petrol); }
.sidebar nav a.active::before { content: ""; position: absolute; left: -12px; top: 6.5px; bottom: 6.5px; width: 3px; border-radius: 0 3px 3px 0; background: var(--saffron); }
.sidebar nav a.ai-link .ico { color: var(--violet); }
.nav-title { font-size: 11px; color: var(--faint); margin: 16px 9px 3.5px; font-weight: 500; }
.me { border-top: 1px solid var(--line); padding: 11px 12.5px; display: flex; align-items: center; gap: 7px; }
.me-id { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; color: var(--ink); }
.me-id:hover { text-decoration: none; }
.me-id strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-id small { display: block; font-size: 11px; }
.avatar { width: 29px; height: 29px; border-radius: 50%; background: var(--saffron-soft); color: var(--saffron-ink); display: grid; place-items: center; font-weight: 700; font-size: 11px; flex: none; }
.logout { color: var(--faint); padding: 5.5px; border-radius: var(--r-sm); }
.logout:hover { color: var(--bad); background: var(--bad-soft); }
.content { flex: 1; min-width: 0; padding: 25px 32.5px 65px; }
.menu-btn { display: none; }

/* ---------- blocs */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14.5px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 5.5px 0 0; }
.actions { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.crumb { display: inline-block; font-size: 11.5px; color: var(--muted); margin-bottom: 3.5px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; margin-bottom: 16px; }
.card.alert { border-color: #efd39b; background: var(--saffron-soft); }
.card.info dl { margin: 0; display: grid; grid-template-columns: 153px 1fr; gap: 7px 14.5px; }
.card.info dt { color: var(--muted); } .card.info dd { margin: 0; white-space: pre-line; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 9px; margin-bottom: 11px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.span-2 { grid-column: span 2; }
.note { background: var(--petrol-soft); color: var(--petrol-ink); border-radius: var(--r); padding: 11px 12.5px; }
.count { display: inline-block; background: var(--line-2); color: var(--muted); border-radius: 18px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; vertical-align: 3.5px; }
.empty { color: var(--muted); text-align: center; padding: 20px !important; }

/* ---------- indicateurs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(162px, 1fr)); gap: 0; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.kpi { padding: 14.5px 18px; display: flex; flex-direction: column; border-right: 1px solid var(--line-2); }
.kpi:last-child { border-right: 0; }
.kpi span { color: var(--muted); font-size: 11.5px; }
.kpi strong { font-size: 21.5px; font-weight: 600; letter-spacing: -.02em; margin: 2px 0; white-space: nowrap; }
.kpi small { font-size: 11px; }

/* ---------- boutons et formulaires */
.btn { display: inline-flex; align-items: center; gap: 6.5px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 6.5px 12.5px; border-radius: var(--r); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; line-height: 1.35; }
.btn:hover { background: var(--sunk); border-color: #cbd6d4; text-decoration: none; }
.btn .ico { width: 14.5px; height: 14.5px; vertical-align: 0; }
.btn.primary { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.btn.primary:hover { background: var(--petrol-2); }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: #eec3bd; }
.btn.small { padding: 3px 9px; font-size: 11.5px; }
.btn.full { width: 100%; justify-content: center; padding: 9px; }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--line); border-radius: var(--r); padding: 6.5px 9px; background: var(--surface); width: 100%; }
input:hover, select:hover, textarea:hover { border-color: #c6d2d0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--petrol); box-shadow: 0 0 0 3px rgba(15, 94, 99, .14); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--petrol); }
input[readonly] { background: var(--sunk); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(234px, 1fr)); gap: 14.5px 18px; }
.form-grid label { display: flex; flex-direction: column; gap: 4.5px; }
.form-grid label span { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.form-grid label.check { flex-direction: row; align-items: center; gap: 7px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid .roles label { display: inline-flex; flex-direction: row; align-items: center; gap: 5.5px; margin: 5.5px 16px 0 0; }
.form-actions { display: flex; gap: 7px; }
.filters { display: flex; gap: 7px; margin-bottom: 12.5px; max-width: 576px; }
.inline { display: inline-flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.inline input, .inline select { width: auto; min-width: 180px; }
.danger-zone { margin-top: 7px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.sticky-save { position: sticky; bottom: 0; background: rgba(242, 245, 244, .94); backdrop-filter: blur(3.5px); padding: 11px 0; border-top: 1px solid var(--line); }
.field-code { font-weight: 600; color: var(--petrol-ink); }

/* ---------- messages */
.flash { padding: 9px 12.5px; border-radius: var(--r); margin-bottom: 12.5px; background: var(--ok-soft); color: #135437; border: 1px solid #bfe1cc; }
.flash.error { background: var(--bad-soft); color: #842a20; border-color: #efc4bd; }
.flash.warn { background: var(--warn-soft); color: #74490a; border-color: #efd39b; }
.toast { position: fixed; left: 50%; bottom: 25px; transform: translate(-50%, 18px); background: var(--ink); color: #fff; padding: 8px 14.5px; border-radius: var(--r); font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); }

/* ---------- tableaux */
.table-wrap { overflow-x: auto; }
.card.table-wrap, .grid-card { padding: 0; overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 500; padding: 9px 12.5px; border-bottom: 1px solid var(--line); background: var(--sunk); white-space: nowrap; }
.table td { padding: 9px 12.5px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table.compact td { padding: 6.5px 9px; }
.table .num, .num { text-align: right; white-space: nowrap; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td, .table.grid tbody tr:hover td { background: #fafcfb; }
.table.lines input, .table.lines select { padding: 4.5px 6.5px; min-width: 57.5px; }
.table.lines td { padding: 5.5px; }
.table.lines textarea { min-width: 198px; resize: vertical; }
.table tfoot td { font-weight: 600; background: var(--sunk); border-top: 1px solid var(--line); }

/* tableau de travail */
.grid-toolbar { display: flex; gap: 9px; align-items: center; margin-bottom: 11px; flex-wrap: wrap; }
.grid-toolbar form { margin: 0; }
.grid-toolbar select { width: auto; }
.grid-toolbar .search { position: relative; flex: 0 1 324px; }
.grid-toolbar .search .ico { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 14.5px; height: 14.5px; }
.grid-toolbar .search input { padding-left: 30.5px; }
.grid-hint { font-size: 11.5px; margin-left: auto; }
.table.grid th.sortable { cursor: pointer; user-select: none; }
.table.grid th.sortable:hover { color: var(--ink); }
.table.grid th .sort { margin-left: 3.5px; color: var(--petrol); }
.table.grid td, .table.grid th { padding: 8px 11px; }
.table.grid .g-open { width: 30.5px; padding-right: 0; }
.table.grid .g-open a { color: var(--faint); display: inline-flex; padding: 3px; border-radius: 4.5px; }
.table.grid .g-open a:hover { color: var(--petrol); background: var(--petrol-soft); }
.table.grid .g-open .ico { width: 13.5px; height: 13.5px; vertical-align: 0; }
.table.grid td.base { font-weight: 500; color: var(--ink); }
.table.grid td.editable { cursor: text; position: relative; }
.table.grid td.editable:hover { box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }
.table.grid td.editable:focus { outline: none; box-shadow: inset 0 0 0 2px var(--saffron); }
.table.grid td.is-editing { padding: 3px 3.5px; box-shadow: inset 0 0 0 2px var(--saffron); background: var(--saffron-soft); }
.table.grid td.is-editing input, .table.grid td.is-editing select { padding: 4.5px 7px; border-color: transparent; background: var(--surface); box-shadow: none; min-width: 108px; }
.table.grid td.is-saving { opacity: .5; }
.table.grid td.flash-ok { animation: okflash 1.2s ease-out; }
@keyframes okflash { from { background: var(--ok-soft); } to { background: transparent; } }
.chk { display: inline-block; width: 16px; height: 16px; border: 1.5px solid #b9c7c5; border-radius: 4.5px; vertical-align: middle; position: relative; }
.chk.on { background: var(--petrol); border-color: var(--petrol); }
.chk.on::after { content: ""; position: absolute; left: 4.5px; top: 1px; width: 4.5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.stage-pill { display: inline-block; padding: 1px 8px; border-radius: 18px; background: var(--petrol-soft); color: var(--petrol-ink); font-size: 11.5px; font-weight: 500; }
.colpick { position: relative; }
.colpick-menu { position: absolute; right: 0; top: calc(100% + 5.5px); z-index: 30; width: 270px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 11px 29px rgba(18, 38, 43, .14); padding: 11px; }
.colpick-menu p { margin: 0 0 7px; font-size: 11.5px; }
.colpick-menu ul { list-style: none; margin: 0; padding: 0; max-height: 324px; overflow-y: auto; }
.colpick-menu li { display: flex; align-items: center; gap: 7px; padding: 4.5px 5.5px; border-radius: var(--r-sm); }
.colpick-menu li:hover { background: var(--sunk); }
.colpick-menu li.dragging { opacity: .4; }
.colpick-menu li label { flex: 1; display: flex; gap: 7px; align-items: center; cursor: pointer; }
.colpick-menu .grip { color: var(--faint); cursor: grab; }
.colpick-foot { border-top: 1px solid var(--line-2); margin-top: 7px; padding-top: 7px; text-align: right; }

/* ---------- pastilles */
.badge { display: inline-block; padding: 1px 8px; border-radius: var(--r-sm); font-size: 11px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.q-brouillon { background: var(--line-2); color: var(--ink-2); }
.badge.q-en_validation { background: var(--warn-soft); color: var(--warn); }
.badge.q-envoye { background: var(--petrol-soft); color: var(--petrol-ink); }
.badge.q-accepte { background: var(--ok-soft); color: var(--ok); }
.badge.q-refuse { background: var(--bad-soft); color: var(--bad); }
.badge.q-expire, .badge.q-remplace { background: #f0f0f0; color: #7d8888; }
.tag { display: inline-block; background: var(--petrol-soft); color: var(--petrol-ink); border-radius: 3.5px; padding: 0 5.5px; font-size: 11px; margin-right: 3px; }
.token { word-break: break-all; }

/* ---------- barres et étapes */
.bar-row { display: grid; grid-template-columns: 135px 1fr 108px; gap: 11px; align-items: center; padding: 5.5px 0; color: inherit; }
.bar-row:hover { text-decoration: none; }
.bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: var(--line-2); border-radius: 3px; height: 9px; overflow: hidden; }
.bar { display: block; height: 100%; background: var(--c, var(--petrol)); border-radius: 3px; min-width: 2px; }
.bar-value { text-align: right; }
.mini-bar { display: inline-block; height: 7px; background: var(--petrol); border-radius: 3px; vertical-align: middle; }
.stage-path { display: flex; gap: 3.5px; margin-bottom: 16px; flex-wrap: wrap; }
.stage-path span { flex: 1; text-align: center; padding: 7px 9px; background: var(--line-2); color: var(--muted); font-weight: 600; font-size: 11.5px; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%); }
.stage-path span.current { background: var(--c, var(--petrol)); color: #fff; }

/* ---------- kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: var(--kw, 210px); gap: 8px; overflow-x: auto; padding-bottom: 11px; justify-content: start; }
.kcol { background: #e9eeed; border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 288px; }
.kcol.over { outline: 2px dashed var(--saffron); outline-offset: -2px; background: var(--saffron-soft); }
.khead { padding: 11px 12.5px 9px; border-top: 3px solid var(--c); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.khead .ktotal { display: block; color: var(--muted); font-size: 11.5px; }
.kbody { padding: 0 7px 7px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 11px; display: flex; flex-direction: column; gap: 3px; cursor: grab; }
.kcard:hover { border-color: #c3d0ce; }
.kcard.dragging { opacity: .5; }
.kmeta { display: flex; justify-content: space-between; font-size: 11.5px; }
.late { color: var(--bad); }

/* ---------- activités et historique */
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li { display: flex; gap: 11px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.activity-list li:last-child { border-bottom: 0; }
.activity-list li small { display: block; }
.activity-list li.late small { color: var(--bad); }
.activity-list form { margin: 0; }
.tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #b9c7c5; background: var(--surface); cursor: pointer; color: transparent; padding: 0; margin-top: 1px; }
.tick:hover { color: var(--ok); border-color: var(--ok); }
.quick-note { display: grid; grid-template-columns: 126px 1fr 144px auto; gap: 7px; margin-bottom: 14.5px; }
.quick-note textarea { grid-column: 1 / -1; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12.5px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.timeline li.done { opacity: .78; }
.timeline p { margin: 3.5px 0; white-space: pre-line; }
.t-type { flex: none; width: 68.5px; font-size: 11px; font-weight: 600; color: var(--muted); padding-top: 1px; }
.t-appel .t-type { color: var(--petrol); } .t-email .t-type { color: var(--violet); } .t-reunion .t-type { color: var(--ok); } .t-tache .t-type { color: var(--warn); }

/* ---------- devis */
.quote-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.quote-actions form { margin: 0; }
.versions { margin: -6px 0 12.5px; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; color: var(--muted); }
.versions a { padding: 2px 7px; border-radius: var(--r-sm); background: var(--line-2); }
.versions a.current { background: var(--petrol); color: #fff; }
.totals { margin-left: auto; max-width: 360px; margin-top: 12.5px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .grand { border-top: 2px solid var(--ink); margin-top: 5.5px; padding-top: 7px; font-weight: 700; font-size: 15.5px; }
.totals .words { font-size: 11px; color: var(--muted); font-style: italic; display: block; text-align: right; }

/* ---------- connexion */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(324px, 414px); background: var(--surface); }
.login-wrap::before { content: ""; background:
    linear-gradient(135deg, rgba(15, 94, 99, .86), rgba(11, 74, 78, .93)),
    repeating-conic-gradient(from 45deg, rgba(224, 165, 38, .32) 0 25%, transparent 0 50%) 0 0 / 50.5px 50.5px; }
.login { width: 100%; max-width: 342px; margin: auto; padding: 29px; display: flex; flex-direction: column; gap: 12.5px; border: 0; }
.login label { display: flex; flex-direction: column; gap: 4.5px; font-weight: 500; font-size: 12px; }
.login .brand { padding: 0 0 5.5px; }

/* ---------- assistant IA */
.ai-page { display: grid; grid-template-columns: 234px 1fr; gap: 16px; height: calc(100vh - 153px); min-height: 432px; }
.ai-convs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 9px; overflow-y: auto; }
.ai-convs .nav-title { margin: 3.5px 7px 7px !important; }
.ai-convs a { display: block; padding: 6.5px 9px; border-radius: var(--r); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-convs a.current { background: var(--petrol-soft); font-weight: 600; }
.ai-convs a:hover { background: var(--sunk); text-decoration: none; }
.chat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 11px; }
.msg { max-width: 80%; padding: 9px 12.5px; border-radius: 12.5px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--petrol); color: #fff; border-bottom-right-radius: 3.5px; }
.msg.assistant { align-self: flex-start; background: var(--sunk); border: 1px solid var(--line-2); border-bottom-left-radius: 3.5px; }
.msg.assistant a { color: var(--petrol); text-decoration: underline; }
.msg.error { align-self: stretch; background: var(--bad-soft); color: #842a20; max-width: none; }
.msg.action { align-self: flex-start; background: var(--violet-soft); font-size: 11.5px; color: #43379a; padding: 5.5px 10px; border-radius: var(--r); }
.msg.action.failed { background: var(--bad-soft); color: #842a20; }
.msg.pending { align-self: stretch; max-width: none; background: var(--saffron-soft); border: 1px solid #efd39b; white-space: normal; border-radius: var(--r); }
.msg.pending ul { margin: 5.5px 0 9px; padding-left: 16px; }
.msg.thinking { align-self: flex-start; color: var(--muted); background: none; padding: 3.5px 0; }
.chat-form { border-top: 1px solid var(--line); padding: 11px; display: flex; gap: 7px; align-items: flex-end; }
.chat-form textarea { resize: none; min-height: 38px; max-height: 144px; }
.chat-suggest { display: flex; gap: 5.5px; flex-wrap: wrap; padding: 0 18px 11px; }
.chat-suggest button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 14.5px; padding: 4.5px 11px; font: inherit; font-size: 11.5px; cursor: pointer; }
.chat-suggest button:hover { border-color: var(--petrol); color: var(--petrol); }
.ai-fab { position: fixed; right: 21.5px; bottom: 21.5px; z-index: 40; display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 23.5px; padding: 10px 16px; background: var(--ink); color: #fff; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 7px 21.5px rgba(18, 38, 43, .24); }
.ai-fab .ico { color: var(--saffron); }
.ai-fab:hover { background: var(--petrol-2); }
.ai-panel { position: fixed; right: 21.5px; bottom: 74px; z-index: 41; width: 378px; max-width: calc(100vw - 29px); height: 504px; max-height: calc(100vh - 99px); display: none; }
.ai-panel.open { display: flex; }
.ai-panel .chat { width: 100%; box-shadow: 0 14.5px 36px rgba(18, 38, 43, .18); }
.ai-panel .chat-head { display: flex; justify-content: space-between; align-items: center; padding: 9px 12.5px; border-bottom: 1px solid var(--line); }
.ai-panel .chat-head strong { display: inline-flex; gap: 5.5px; align-items: center; }
.ai-panel .chat-head .ico { color: var(--violet); }
.ai-panel .chat-head span { display: inline-flex; gap: 9px; align-items: center; }
.ai-panel .chat-head a { font-size: 11.5px; }
.ai-panel .chat-head button { border: 0; background: none; font-size: 18px; line-height: 1; cursor: pointer; color: var(--muted); }
.ai-status { display: inline-flex; align-items: center; gap: 5.5px; font-size: 11.5px; color: var(--muted); }
.ai-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #aaa; }
.ai-status.on::before { background: var(--ok); }
.ai-status.off::before { background: var(--bad); }
.test-result { margin-top: 9px; }

/* ---------- générateur et consultation de rapports */
.title-input { font: inherit; font-size: 23.5px; font-weight: 600; letter-spacing: -.015em; border: 1px solid transparent; background: transparent; padding: 2px 5.5px; margin-left: -7px; width: min(540px, 80vw); }
.title-input:hover, .title-input:focus { border-color: var(--line); background: var(--surface); }
.rb { display: grid; grid-template-columns: 324px 1fr; gap: 16px; align-items: start; }
.rb.panel-hidden { grid-template-columns: 1fr; }
.rb.panel-hidden .rb-panel { display: none; }
.rb-panel { position: sticky; top: 12.5px; max-height: calc(100vh - 25px); overflow-y: auto; padding: 12.5px 14.5px; }
.rb-panel section { padding: 11px 0; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6.5px; }
.rb-panel section:last-child { border-bottom: 0; }
.rb-panel h3 { display: flex; align-items: center; gap: 5.5px; }
.rb-panel .check { display: flex; gap: 7px; align-items: center; font-size: 12px; }
.rb-panel select, .rb-panel input, .rb-panel textarea { padding: 4.5px 7px; font-size: 12px; }
.rb-panel .mini, .rb-panel h3 .mini { width: auto; flex: none; font-weight: 400; color: var(--ink); }
.rb-row { display: flex; gap: 3.5px; align-items: flex-start; flex-wrap: wrap; background: var(--sunk); border: 1px solid var(--line-2); border-radius: var(--r); padding: 5.5px; }
.rb-row select, .rb-row input { flex: 1 1 108px; min-width: 0; }
.rb-row select[multiple] { flex-basis: 100%; }
.rb-row .btn.danger { flex: none; }
.row2 { display: flex; gap: 5.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 4.5px; }
.chip { display: inline-flex; align-items: center; gap: 3.5px; background: var(--petrol-soft); color: var(--petrol-ink); border-radius: 12.5px; padding: 2px 3.5px 2px 9px; font-size: 11.5px; cursor: grab; }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 13.5px; padding: 0 3.5px; }
.report-table tr.grp td { background: #f4f7f6; border-top: 1px solid var(--line); }
.report-table tr.grp-1 td { background: #f8faf9; }
.report-table tr.grp-2 td { background: #fbfcfc; }
.report-table tr.grp { cursor: pointer; }
.report-table tr.grp:hover td { background: var(--petrol-soft); }
.report-table th.sortable { cursor: pointer; user-select: none; }
.report-table th.sortable:hover { color: var(--ink); }
.report-table .caret { display: inline-block; width: 11px; color: var(--muted); }
.report-table tfoot td { font-weight: 700; border-top: 2px solid var(--ink); padding: 10px 12.5px; }
.rv-bar { display: flex; gap: 12.5px; align-items: flex-end; flex-wrap: wrap; padding: 12.5px 16px; }
.rv-bar label { display: flex; flex-direction: column; gap: 3.5px; font-size: 11.5px; color: var(--muted); font-weight: 500; min-width: 180px; }
.rv-bar label.grow { flex: 1; }
.rv-tools { display: flex; gap: 5.5px; }
.rv-act { white-space: nowrap; }
.rv-act select { width: auto; padding: 3px 5.5px; font-size: 11.5px; }
.rv-bar-row { cursor: pointer; border-radius: var(--r-sm); padding: 5.5px 7px; }
.rv-bar-row:hover { background: var(--sunk); }
.rv-bar-row.focus { background: var(--saffron-soft); }
.widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(342px, 1fr)); gap: 16px; }
.widget-total { margin-bottom: 7px; }
.widget-total strong { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.stages-table .handle { cursor: grab; color: var(--faint); font-size: 14.5px; width: 21.5px; }
.stages-table input, .stages-table select { min-width: 0; }
.stages-table tr.deleting td { background: var(--bad-soft); }

/* ---------- adaptatif */
@media (max-width: 990px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .ai-page { grid-template-columns: 1fr; height: auto; }
  .ai-convs { max-height: 144px; }
  .chat { height: 70vh; }
  .rb { grid-template-columns: 1fr; }
  .rb-panel { position: static; max-height: none; }
}
@media (max-width: 738px) {
  .sidebar { position: fixed; left: calc(-1 * var(--side) - 9px); z-index: 50; transition: left .2s; box-shadow: 0 0 36px rgba(18, 38, 43, .2); }
  .sidebar.open { left: 0; }
  .menu-btn { display: inline-flex; align-items: center; gap: 5.5px; margin-bottom: 12.5px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 5.5px 11px; font: inherit; }
  .content { padding: 14.5px; }
  h1 { font-size: 20px; }
  .quick-note { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 90px 1fr 81px; }
  .card.info dl { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-wrap::before { display: none; }
  .grid-hint { display: none; }
  .kpi { border-right: 0; border-bottom: 1px solid var(--line-2); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .sidebar, .menu-btn, .actions, .ai-fab, .ai-panel, .rv-bar, .rv-act, .rb-panel, .grid-toolbar { display: none !important; }
  .content { padding: 0; }
  .rb { grid-template-columns: 1fr; }
}

/* kanban : colonnes masquables */
.khead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.khead .ktotal { flex-basis: 100%; }
.khead .khide { margin-left: auto; border: 0; background: none; color: var(--faint); cursor: pointer; padding: 2px 4px; border-radius: 5px; line-height: 1; }
.khead .khide:hover { color: var(--ink); background: rgba(255, 255, 255, .7); }
.khead .khide .ico { width: 15px; height: 15px; vertical-align: -2px; }
.kanban-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 11px; }
.kanban-bar .hidden-list { display: flex; gap: 6px; flex-wrap: wrap; }
.kanban-bar .hidden-list button { border: 1px dashed #b9c7c5; background: var(--surface); color: var(--ink-2); border-radius: 14px; padding: 2px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.kanban-bar .hidden-list button:hover { border-color: var(--petrol); color: var(--petrol); }
.kcol.hidden { display: none; }

/* kanban : disposition ajustable */
.kanban.fit { grid-auto-flow: row; grid-template-columns: repeat(var(--kn, 5), minmax(118px, 1fr)); grid-auto-columns: auto; justify-content: stretch; }
.kanban.fit .kcard strong, .kanban.fit .kcard > span { overflow-wrap: anywhere; }
.kanban.fit .kmeta { flex-wrap: wrap; gap: 2px 6px; }
.kanban.compact .kbody { gap: 5px; }
.kanban.compact .kcard { padding: 6px 8px; gap: 1px; font-size: 12px; }
.kanban.compact .kcard > small { display: none; }
.kanban.compact .kcard > span { font-size: 11.5px; color: var(--faint); }
.kanban.compact .ktotal { font-size: 11px; }
.k-layout { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.k-layout .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.k-layout .seg button { border: 0; background: none; font: inherit; padding: 4px 10px; cursor: pointer; color: var(--ink-2); }
.k-layout .seg button + button { border-left: 1px solid var(--line); }
.k-layout .seg button[aria-pressed="true"] { background: var(--petrol); color: #fff; }
.k-layout label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.k-layout label[hidden] { display: none; }
.k-layout input[type=range] { width: 110px; accent-color: var(--petrol); padding: 0; }
.k-layout input[type=checkbox] { width: auto; accent-color: var(--petrol); }
.k-layout output { min-width: 44px; color: var(--faint); font-variant-numeric: tabular-nums; }
.kanban.fit { grid-template-columns: repeat(var(--kn, 5), minmax(100px, 1fr)); gap: 6px; }
.kanban.fit .khead { flex-wrap: nowrap; padding: 9px 9px 7px; position: relative; }
.kanban.fit .khead strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban.fit .khead .ktotal { position: absolute; left: 9px; right: 9px; top: 100%; margin-top: -4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban.fit .khead { margin-bottom: 16px; }
.kanban.fit .kbody { padding: 0 5px 5px; }
.kanban.fit .kcard { padding: 8px 9px; }

/* ---------- fiche modifiable sur place */
.record { margin-bottom: 14px; }
.record-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.record-head h2 { margin: 0; }
.record-actions { display: flex; gap: 6px; }
.record-actions [data-record-cancel], .record-actions [data-record-save] { display: none; }
.record.editing .record-actions [data-record-cancel], .record.editing .record-actions [data-record-save] { display: inline-flex; }
.record.editing .record-actions [data-record-edit] { display: none; }
.record-grid { display: grid; grid-template-columns: 1fr; gap: 2px 18px; }
.record.cols-2 .record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.record.cols-3 .record-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .record.cols-2 .record-grid, .record.cols-3 .record-grid { grid-template-columns: 1fr; } }
.rf { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.rf.wide { grid-column: 1 / -1; }
.rl { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.rl .req { color: var(--bad); font-weight: 600; }
.rv { min-height: 19px; overflow-wrap: anywhere; }
.rv:empty::before { content: "—"; color: var(--faint); }
.rv .pre { white-space: pre-wrap; }
.rv .tag { margin-right: 4px; }
.record .ri { display: none; }
.record.editing .ri { display: block; }
.record.editing .rv { display: none; }
.record.editing .rf { border-bottom-color: transparent; padding: 4px 0; }
.record.editing .rf-check .rl { display: none; }
.record.editing { box-shadow: 0 0 0 2px var(--petrol) inset, var(--shadow, none); }
.record .ri input, .record .ri select, .record .ri textarea { width: 100%; }
.record .ri label.check { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.record .ri label.check input { width: auto; }
.record:not(.editing) .rl .req { display: none; }
.record-errors { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-size: 13px; }
.record-errors[hidden] { display: none; }
[data-record-edit][hidden] { display: none !important; }

.model-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.model-chips .chip { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; color: var(--ink-2); }
.model-chips .chip:hover, .model-chips .chip.on { border-color: var(--petrol); color: var(--petrol); }
.model-chips .chip.on { background: var(--petrol); color: #fff; }
.model-chips .chip.no-tools { opacity: .7; }

.web-fill { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; margin-bottom: 12px; border-left: 3px solid var(--saffron); }
.web-fill p { margin: 3px 0 0; font-size: 12.5px; }
.web-fill .wide { grid-column: 1 / -1; }
.web-fill-out:empty { display: none; }
.web-fill-out .model-chips > div { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-size: 12.5px; }
.web-fill-out details { margin-top: 6px; font-size: 12.5px; }
input.filled, textarea.filled { background: var(--saffron-soft); }

/* ---------- kanban des activités */
.act-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 800px) { .act-board { grid-template-columns: 1fr; } }
.acol { background: #e9eeed; border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 160px; }
.acol.over { outline: 2px dashed var(--saffron); outline-offset: -2px; background: var(--saffron-soft); }
.ahead { padding: 9px 11px 7px; border-top: 3px solid var(--c); border-radius: var(--r-lg) var(--r-lg) 0 0; display: flex; gap: 6px; align-items: baseline; }
.abody { padding: 0 7px 7px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.acard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; cursor: grab; font-size: 13px; }
.acard.dragging { opacity: .5; }
.acard.late { border-left: 3px solid var(--bad); }
.acard p { margin: 0; color: var(--ink-2); font-size: 12px; white-space: pre-line; }
.acard-top { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; }
.acard .t-type { font-size: 11px; color: var(--petrol); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.acard.late .adue { color: var(--bad); font-weight: 600; }
.amove { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; opacity: 0; transition: opacity .12s; }
.acard:hover .amove, .acard:focus-within .amove { opacity: 1; }
@media (hover: none) { .amove { opacity: 1; } }
.amove button { border: 1px solid var(--line); background: var(--mist); border-radius: 10px; font: inherit; font-size: 11px; padding: 1px 7px; cursor: pointer; color: var(--ink-2); }
.amove button:hover { border-color: var(--petrol); color: var(--petrol); }
.aempty { display: none; text-align: center; color: var(--faint); font-size: 12px; padding: 14px 6px; border: 1px dashed #c9d4d2; border-radius: var(--r); }
.abody:not(:has(.acard)) .aempty { display: block; }
.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.view-switch button { border: 0; background: none; font: inherit; font-size: 12.5px; padding: 4px 11px; cursor: pointer; color: var(--ink-2); }
.view-switch button + button { border-left: 1px solid var(--line); }
.view-switch button[aria-pressed="true"] { background: var(--petrol); color: #fff; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
[data-view][hidden] { display: none !important; }
.badge.info { background: #e3eefa; color: #2b6cb0; }
.view-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; font-size: 12.5px; }
.board-wrap { margin-bottom: 14px; }
.stage-path button { flex: 1; text-align: center; padding: 7px 9px; border: 0; font: inherit; background: var(--line-2); color: var(--muted); font-weight: 600; font-size: 11.5px; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%); cursor: pointer; transition: filter .12s, background .12s; }
.stage-path button.passed { background: color-mix(in srgb, var(--c, var(--petrol)) 22%, var(--line-2)); color: var(--ink-2); }
.stage-path button.current { background: var(--c, var(--petrol)); color: #fff; cursor: default; }
.stage-path button:not(.current):hover { background: color-mix(in srgb, var(--c, var(--petrol)) 55%, #fff); color: #fff; }
.stage-path button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.stage-path.busy { opacity: .6; pointer-events: none; }

/* ---------- éditeur de lignes de devis */
.table.lines th.ln, .table.lines td.ln { width: 26px; text-align: center; color: var(--faint); font-size: 11.5px; }
.table.lines textarea { resize: none; overflow: hidden; min-height: 30px; line-height: 1.35; }
.table.lines tr.new-line td { background: #fbfcfc; }
.table.lines tr.new-line textarea { border-style: dashed; }
.table.lines tr.new-line input, .table.lines tr.new-line select { opacity: .55; }
.table.lines td.lact { white-space: nowrap; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; width: 24px; height: 24px; font-size: 12px; cursor: pointer; color: var(--ink-2); padding: 0; margin-left: 3px; }
.icon-btn:hover { border-color: var(--petrol); color: var(--petrol); }
.icon-btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.lines-help { font-size: 12px; margin: 8px 0 0; }
kbd { font: 11px ui-monospace, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--surface); }
.ac-pop { position: absolute; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(18, 38, 43, .14); overflow: hidden; font-size: 13px; }
.ac-pop[hidden] { display: none; }
.ac-item { padding: 6px 10px; cursor: pointer; display: flex; gap: 8px; align-items: baseline; }
.ac-item b { color: var(--petrol); font-weight: 600; font-size: 12px; }
.ac-item span { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.ac-item.on, .ac-item:hover { background: var(--mist); }
.ac-foot { padding: 4px 10px; font-size: 11px; color: var(--faint); border-top: 1px solid var(--line-2); }

/* ---------- graphiques des rapports */
.ch-title { font-weight: 600; margin-bottom: 8px; }
.ch-svg { width: 100%; height: auto; display: block; }
.ch-svg .ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-svg .ch-ax { fill: var(--muted); font-size: 11px; }
.ch-svg .ch-val { fill: var(--ink-2); font-size: 10.5px; font-weight: 600; }
.ch-svg .ch-center { fill: var(--ink); font-size: 17px; font-weight: 700; }
.ch-svg .ch-tm { fill: #fff; font-size: 12px; font-weight: 600; }
.ch-svg .ch-tm.v { font-weight: 400; opacity: .9; }
.ch-svg .ch-click:hover, .ch-pie .ch-click:hover { opacity: .82; }
.ch-dim { opacity: .3; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; margin-top: 6px; color: var(--ink-2); }
.ch-legend i, .ch-li i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.ch-pie { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.ch-pie svg { flex: none; }
.ch-list { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 3px; }
.ch-li { display: grid; grid-template-columns: 16px 1fr auto 52px; gap: 6px; align-items: baseline; font-size: 12.5px; padding: 2px 4px; border-radius: 5px; }
.ch-li:hover { background: var(--mist); }
.ch-li b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ch-li small { color: var(--muted); text-align: right; }
.ch-funnel { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ch-fn { width: 100%; display: flex; flex-direction: column; align-items: center; }
.ch-fbar { height: 30px; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 12.5px; min-width: 60px; }
.ch-fn small { color: var(--muted); font-size: 11.5px; margin: 1px 0 3px; }
.ch-kpis { margin: 0; }
.ch-kpis .kpi small { display: block; }
.ch-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ch-tools select { width: auto; }
.widget .ch-title { display: none; }

.rb .lbl { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); margin: 6px 0; }

/* ---------- assistant : choix cliquables */
.chat-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chat-choices button { border: 1px solid var(--petrol); color: var(--petrol); background: var(--surface); border-radius: 14px; padding: 4px 11px; font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; }
.chat-choices button:hover:not(:disabled) { background: var(--petrol); color: #fff; }
.chat-choices button:disabled { opacity: .45; cursor: default; border-color: var(--line); color: var(--muted); }
.chat-choices button.picked { opacity: 1; background: var(--petrol); color: #fff; border-color: var(--petrol); }
.msg .li { padding-left: 4px; }

/* ---------- indicateurs personnalisables */
.ib-board { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 40px; gap: 10px; grid-auto-flow: row dense; }
@media (max-width: 900px) { .ib-board { grid-template-columns: 1fr; } .ib-w { grid-column: 1 / -1 !important; } }
.ib-w { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; margin: 0; padding: 10px 12px; }
.ib-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; min-height: 24px; }
.ib-head h2 { margin: 0; font-size: 13.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-grip { display: none; cursor: grab; color: var(--faint); font-size: 15px; line-height: 1; padding: 0 2px; user-select: none; }
.ib-open { color: var(--faint); text-decoration: none; font-size: 13px; }
.ib-open:hover { color: var(--petrol); }
.ib-tools { display: none; align-items: center; gap: 4px; }
.ib-tools select { width: auto; font-size: 11.5px; padding: 2px 4px; height: 24px; }
.ib-size { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.ib-size button { border: 0; background: var(--surface); font: inherit; font-size: 11px; width: 22px; height: 22px; cursor: pointer; color: var(--ink-2); }
.ib-size button + button { border-left: 1px solid var(--line); }
.ib-size button.on { background: var(--petrol); color: #fff; }
.ib-del { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; width: 24px; height: 24px; cursor: pointer; color: var(--muted); }
.ib-del:hover { color: var(--bad); border-color: var(--bad); }
.ib-body { flex: 1; overflow: auto; min-height: 0; }
.ib-body .kpis { margin: 0; }
.ib-body .table { margin: 0; }
.ib-chart { margin-bottom: 6px; }
.ib-chart .ch-svg { max-height: 100%; }
.ib-resize { display: none; position: absolute; right: 2px; bottom: 0; cursor: nwse-resize; color: var(--petrol); font-size: 13px; padding: 2px; user-select: none; touch-action: none; }
.ib-board.editing .ib-w { outline: 1px dashed #9fb5b2; outline-offset: -1px; }
.ib-board.editing .ib-grip, .ib-board.editing .ib-resize { display: block; }
.ib-board.editing .ib-tools { display: inline-flex; }
.ib-w.dragging { opacity: .45; }
.ib-w.drop { outline: 2px solid var(--saffron) !important; }
.ib-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; padding: 10px 12px; border-left: 3px solid var(--saffron); }
.ib-add[hidden] { display: none; }
.ib-add select { width: auto; }
.ib-add .muted { font-size: 12px; flex: 1; }
@media print { .ib-head .ib-tools, .ib-grip, .ib-resize, .ib-add { display: none !important; } }

.ib-addto { position: relative; display: inline-block; }
.ib-addto-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(18,38,43,.14); display: flex; flex-direction: column; min-width: 170px; overflow: hidden; }
.ib-addto-menu[hidden] { display: none; }
.ib-addto-menu button { border: 0; background: none; font: inherit; font-size: 13px; text-align: left; padding: 7px 12px; cursor: pointer; }
.ib-addto-menu button:hover { background: var(--mist); }

/* =====================================================================
   Densité « commerciale » : plus d'informations par écran,
   séparateurs et indentations plus marqués (lisibilité).
   ===================================================================== */
:root { --line: #d3dddb; --line-2: #e1e8e6; --sep: #c3d0cd; --head: #eaf0ef; }
body { line-height: 1.42; }
.content { padding: 16px 22px 48px; }
.page-head { margin-bottom: 12px; gap: 10px; }
.page-head p { margin-top: 3px; }
h1 { font-size: 20.5px; }
h2 { margin-bottom: 7px; }
.card { padding: 12px 14px; margin-bottom: 10px; border-color: var(--line); }
.card > h2, .card-head h2, .record-head h2 { font-size: 13px; text-transform: none; }
.card > h2 { padding-bottom: 6px; margin-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.card-head { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.grid-2, .grid-3 { gap: 10px; }
.kpis { margin-bottom: 10px; }
.kpi { padding: 9px 13px; border-right-color: var(--line); }
.kpi strong { font-size: 18.5px; margin: 1px 0; }
.btn { padding: 5px 10px; }
.btn.small { padding: 2px 7px; }
input, select, textarea { padding: 5px 8px; }
.form-grid { gap: 9px 12px; }
.form-grid label { gap: 3px; }
.sidebar nav a { padding: 5px 9px; margin: 0; }
.nav-title { margin: 11px 9px 2px; }
.brand { padding: 13px 16px 11px; }
.flash { padding: 7px 11px; margin-bottom: 8px; }
.note { padding: 8px 10px; }

/* tableaux : en-tête marqué, lignes séparées, zébrage léger */
.table th { padding: 6px 9px; background: var(--head); color: var(--ink-2); font-weight: 600; border-bottom: 1.5px solid var(--sep); }
.table td { padding: 5.5px 9px; border-bottom: 1px solid var(--line-2); }
.table.compact td { padding: 4px 8px; }
.table tbody tr:nth-child(even) td { background: #fafcfb; }
.table tbody tr:hover td { background: #f1f6f5; }
.table.grid td, .table.grid th { padding: 5px 9px; }
.table.grid th + th, .table.grid td + td { border-left: 1px solid var(--line-2); }
.table tfoot td { border-top: 1.5px solid var(--sep); background: var(--head); }
.grid-card, .card.table-wrap { border-color: var(--sep); }
.grid-toolbar { margin-bottom: 7px; gap: 7px; }
.table.lines td { padding: 3px 4px; }
.table.lines tbody tr:nth-child(even) td { background: transparent; }

/* rapports : niveaux de regroupement bien distincts */
.report-table td, .report-table th { padding: 5px 9px; }
.report-table tr.grp td { border-top: 1.5px solid var(--sep); font-weight: 600; }
.report-table tr.grp-0 td { background: #e4ecea; color: var(--ink); }
.report-table tr.grp-0 td:first-child { box-shadow: inset 4px 0 0 var(--petrol); }
.report-table tr.grp-1 td { background: #eff4f3; border-top-width: 1px; }
.report-table tr.grp-1 td:first-child { box-shadow: inset 4px 0 0 var(--saffron); }
.report-table tr.grp-2 td { background: #f6f9f8; border-top: 1px dashed var(--line); font-weight: 500; }
.report-table tr.grp-2 td:first-child { box-shadow: inset 4px 0 0 #9fb5b2; }
.report-table tbody tr:not(.grp) td:first-child { padding-left: 26px; }
.report-table tfoot td { border-top: 2px solid var(--ink); padding: 7px 9px; }

/* blocs d'information (fiches) : libellé à gauche, valeur à droite, lignes séparées */
.record-grid { gap: 0 16px; }
.rf { padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.record:not(.editing) .rf { display: grid; grid-template-columns: minmax(96px, 38%) 1fr; gap: 8px; align-items: baseline; }
.record:not(.editing) .rf.wide { grid-template-columns: minmax(96px, 18%) 1fr; }
.record.cols-3:not(.editing) .rf { grid-template-columns: minmax(90px, 42%) 1fr; }
.record:not(.editing) .rl { font-size: 11.5px; color: var(--muted); }
.record:not(.editing) .rv { font-weight: 500; }
.record.editing .rf { padding: 3px 0; }
.card.info dl { gap: 0 12px; }
.card.info dt, .card.info dd { padding: 4px 0; border-bottom: 1px solid var(--line-2); }

/* kanbans et chronologie plus serrés */
.kbody, .abody { gap: 5px; }
.kcard, .acard { padding: 6px 8px; }
.khead, .ahead { padding: 7px 9px 5px; }
.timeline li { padding: 6px 0; gap: 9px; border-bottom-color: var(--line); }
.quick-note { margin-bottom: 8px; gap: 5px; }
.stage-path { margin-bottom: 10px; }
.stage-path button { padding: 5px 8px; }
.ib-board { grid-auto-rows: 36px; gap: 8px; }

/* ---------- modifications de l'assistant mises en évidence */
@keyframes livepulse { 0% { background-color: #ffe08a; box-shadow: 0 0 0 3px #f2c14e; } 100% { background-color: var(--saffron-soft); box-shadow: 0 0 0 2px var(--saffron); } }
.live-changed, .live-changed td { animation: livepulse 1.6s ease-out 2 alternate; background-color: var(--saffron-soft) !important; box-shadow: 0 0 0 2px var(--saffron); border-radius: 4px; transition: background-color 1s, box-shadow 1s; }
tr.live-changed { box-shadow: none; }
.live-toast { position: fixed; left: 50%; top: 14px; transform: translate(-50%, -20px); background: var(--violet); color: #fff; padding: 8px 14px; border-radius: 20px; font-weight: 500; font-size: 13px; box-shadow: 0 8px 24px rgba(18,38,43,.2); opacity: 0; transition: opacity .25s, transform .25s; z-index: 80; display: flex; gap: 7px; align-items: center; }
.live-toast.show { opacity: 1; transform: translate(-50%, 0); }
.live-toast .ico { stroke: #fff; }

.chat-ctx { font-size: 11.5px; color: var(--ink-2); background: var(--violet-soft); padding: 4px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-ctx span { color: var(--violet); font-weight: 600; }
.ch-svg { max-height: 330px; }
.ib-chart .ch-svg { max-height: none; }
.ib-board.editing .ib-head h2 { min-width: 60px; }
.ib-kpis .kpi { padding: 6px 10px; }

.table.lines textarea { white-space: pre-wrap; }
.table.lines td { vertical-align: top; }
.table.lines td.num[data-total] { padding-top: 9px; }
/* rapports : cellules modifiables */
.report-table td.rv-edit { cursor: text; position: relative; }
.report-table td.rv-edit:hover { box-shadow: inset 0 0 0 1px var(--sep); background: var(--surface) !important; }
.report-table td.rv-edit:hover::after { content: "✎"; position: absolute; right: 3px; top: 2px; font-size: 10px; color: var(--faint); }
.report-table td.rv-edit:focus { outline: none; box-shadow: inset 0 0 0 2px var(--saffron); }
.report-table td.is-editing { padding: 2px 3px; box-shadow: inset 0 0 0 2px var(--saffron); background: var(--saffron-soft) !important; }
.report-table td.is-editing input, .report-table td.is-editing select { padding: 3px 6px; min-width: 110px; }
.report-table td.is-saving { opacity: .5; }
.report-table th.sortsum { cursor: pointer; user-select: none; }
.report-table th.sortsum:hover, .report-table th.sortable:hover { color: var(--petrol); }


/* ---------- v3 : facturation, administration */
.brand-img { height: 27px; max-width: 120px; object-fit: contain; }
.rf-section, .form-section { grid-column: 1 / -1; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line-2); }
.rf-section h3, h3.form-section { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kpis-billing { margin-top: -6px; }
a.kpi { color: inherit; text-decoration: none; }
a.kpi:hover { border-color: var(--petrol); }
.kpi-bad strong { color: var(--bad); }
.card.alert.ok-alert { border-left-color: var(--ok); background: var(--ok-soft); }
.bad { color: var(--bad); }
.ok { color: var(--ok); }
dialog.dlg { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; width: min(620px, 94vw); box-shadow: 0 20px 50px rgba(15, 40, 45, .25); }
dialog.dlg::backdrop { background: rgba(18, 38, 43, .35); }
dialog.dlg h2 { margin-top: 0; }
.doc-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 18px; }
.doc-head dt { font-size: 11.5px; color: var(--muted); }
.doc-head dd { margin: 0 0 4px; font-weight: 550; }
.problems { background: var(--warn-soft); color: var(--warn); border-radius: var(--r); padding: 9px 12px; margin: 0 0 12px; }
.problems li { margin-left: 16px; }
.stack > * + * { margin-top: 14px; }
.aging { display: grid; gap: 8px; }
.aging .bar-row { grid-template-columns: 140px 1fr 130px; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.admin-card { display: flex; gap: 12px; align-items: flex-start; padding: 15px 16px; color: inherit; }
.admin-card:hover { border-color: var(--petrol); text-decoration: none; }
.admin-card .ico { width: 22px; height: 22px; color: var(--petrol); flex: none; margin-top: 2px; }
.admin-card strong { display: block; margin-bottom: 2px; }
.admin-card small { line-height: 1.4; display: block; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 7px 12px; border-radius: var(--r) var(--r) 0 0; color: var(--ink-2); font-weight: 500; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.tabs a.active { background: var(--surface); border-color: var(--line); color: var(--petrol-ink); font-weight: 600; }
.param { display: grid; grid-template-columns: minmax(220px, 34%) 1fr; gap: 6px 18px; padding: 10px 0; border-top: 1px solid var(--line-2); align-items: start; }
.param:first-of-type { border-top: 0; }
.param .pl { font-weight: 550; }
.param .pl small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; }
.param .pc input[type=text], .param .pc input:not([type]), .param .pc input[type=number], .param .pc input[type=email], .param .pc input[type=password], .param .pc select, .param .pc textarea { width: 100%; max-width: 560px; }
.param .pc textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.param .custom { font-size: 11px; color: var(--saffron-ink); background: var(--saffron-soft); border-radius: 4px; padding: 0 5px; margin-left: 6px; }
.param .reset { background: none; border: 0; color: var(--muted); font-size: 11.5px; padding: 0; cursor: pointer; text-decoration: underline; }
.logo-preview { max-height: 48px; max-width: 200px; display: block; margin-bottom: 6px; border: 1px solid var(--line-2); border-radius: 4px; padding: 3px; background: #fff; }
.matrix { border-collapse: collapse; width: 100%; }
.matrix th, .matrix td { border-bottom: 1px solid var(--line-2); padding: 6px 8px; text-align: center; font-size: 12.5px; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix thead th { position: sticky; top: 0; background: var(--surface); vertical-align: bottom; }
.matrix thead input { width: 110px; font-weight: 600; }
.matrix tr.mod td { background: var(--sunk); font-weight: 600; text-align: left; }
.list-editor td input[type=text], .list-editor td input:not([type]) { width: 100%; }
.list-editor td.drag { cursor: grab; color: var(--faint); width: 22px; }
.list-editor tr.dragging { opacity: .4; }
.list-editor textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; }
.diff { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; white-space: pre-wrap; color: var(--ink-2); max-width: 560px; }
.statement td.num, .statement th.num { white-space: nowrap; }
@media print { .sidebar, .menu-btn, .ai-fab, .no-print, .flash { display: none !important; } .content { padding: 0 !important; } .card { box-shadow: none; border: 0; } }

.sched { min-width: 470px; }
.sched .srow { display: flex; gap: 5px; align-items: center; margin-bottom: 4px; font-size: 12px; white-space: nowrap; }
.sched .srow input[data-s=pct] { width: 62px; }
.sched .srow input[data-s=label] { width: 150px; }
.sched .srow input[data-s=due_days] { width: 52px; }
.list-editor td input[data-k=label] { min-width: 190px; }
.sched .srow select { width: 135px; }
.pv-progress { display: flex; height: 10px; border-radius: 5px; background: var(--line-2); overflow: hidden; margin: 4px 0 8px; }
.pv-progress .v { background: var(--ok); }
.pv-progress .d { background: var(--warn); opacity: .7; }
.purge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 22px; }
.purge-grid ul { margin: 4px 0 10px 16px; padding: 0; }
.purge-grid h3 { margin-top: 8px; }

/* ---------- v3.3 : ressources humaines */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; }
.dot.big { width: 14px; height: 14px; }
.strike td { text-decoration: line-through; text-decoration-color: var(--bad); }
.wf { list-style: none; margin: 4px 0 8px; padding: 0; }
.wf li { display: flex; gap: 10px; padding: 7px 0; position: relative; }
.wf li:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 22px; bottom: -6px; width: 2px; background: var(--line); }
.wf-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); flex: none; margin-top: 3px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.wf-pending .wf-dot { background: var(--warn); }
.wf-approved .wf-dot { background: var(--ok); }
.wf-rejected .wf-dot, .wf-returned .wf-dot { background: var(--bad); }
.wf-cancelled, .wf-skipped { opacity: .55; }
.wf-comment { font-style: italic; color: var(--ink-2); margin-top: 2px; }
.wf-decide { border-top: 1px solid var(--line-2); padding-top: 10px; display: grid; gap: 8px; }
.wf-decide textarea { width: 100%; }
.wf-editor { display: grid; gap: 6px; }
.wf-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--sunk); border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px 8px; }
.wf-row input[data-k=label] { min-width: 220px; }
.wf-row label { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; }
.lv-calc { background: var(--petrol-soft); color: var(--petrol-ink); border-radius: var(--r); padding: 8px 11px; min-height: 18px; }
.lv-calc:empty { display: none; }
.exp-add { border-top: 1px solid var(--line-2); margin-top: 12px; padding-top: 6px; }
.hcal { border-collapse: collapse; font-size: 11.5px; width: 100%; }
.hcal th, .hcal td { border: 1px solid var(--line-2); text-align: center; padding: 0; height: 30px; min-width: 24px; }
.hcal th { font-weight: 600; color: var(--muted); padding: 3px 0; }
.hcal .who { text-align: left; padding: 3px 8px; min-width: 150px; white-space: nowrap; position: sticky; left: 0; background: var(--surface); }
.hcal .off { background: repeating-linear-gradient(45deg, var(--sunk), var(--sunk) 3px, var(--line-2) 3px, var(--line-2) 5px); }
.hcal .now { box-shadow: inset 0 0 0 2px var(--saffron); }
.hc { display: block; height: 22px; margin: 3px 2px; border-radius: 4px; background: var(--c); }
.hc.half { width: 50%; }
.hc.pending { background: repeating-linear-gradient(45deg, var(--c), var(--c) 4px, transparent 4px, transparent 7px); border: 1px solid var(--c); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.legend .pending-sample { background: repeating-linear-gradient(45deg, #2563eb, #2563eb 3px, transparent 3px, transparent 6px); border: 1px solid #2563eb; }
.legend .off-sample { background: repeating-linear-gradient(45deg, var(--sunk), var(--sunk) 3px, var(--line-2) 3px, var(--line-2) 5px); }

/* ---------- menu pliable */
.sidebar nav .nav-title { cursor: pointer; user-select: none; display: flex; align-items: center; justify-content: space-between; border-radius: var(--r-sm); padding: 2px 4px 2px 0; }
.sidebar nav .nav-title:hover { color: var(--ink-2); }
.sidebar nav .nav-title::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: 0 4px 3px 0; transition: transform .15s; }
.sidebar nav .nav-title.collapsed::after { transform: rotate(-45deg); margin-bottom: 0; }
.sidebar nav .nav-hidden { display: none !important; }
.nav-toggle-all { margin: 14px 9px 4px; background: none; border: 0; color: var(--faint); font: inherit; font-size: 11px; cursor: pointer; padding: 0; text-decoration: underline; }
.nav-toggle-all:hover { color: var(--ink-2); }

/* v3.4.2 : date d'émission et date de paiement */
.issue-form { display: inline-flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.inline-label { display: inline-flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--muted, #667); }
.inline-label input { font-size: 13px; }
details.inline-edit { display: inline-block; margin-left: 8px; }
details.inline-edit summary { cursor: pointer; color: var(--accent, #0b5f5a); font-size: 12px; list-style: none; }
details.inline-edit summary::-webkit-details-marker { display: none; }
details.inline-edit[open] form { display: inline-flex; gap: 6px; margin-top: 4px; }

/* v3.5 : filtres (panneau latéral droit pliable) et vues enregistrées des opportunités */
.vf-bar { padding: 8px 12px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 7px; }
.vf-views { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.vf-tab { padding: 4px 11px; border-radius: 999px; font-size: 12.5px; color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.vf-tab:hover { background: var(--sunk, #f1f4f4); }
.vf-tab.on { background: var(--petrol, #0b5f5a); color: #fff; }
.vf-tab .ico, #vf-toggle .ico { width: 13px; height: 13px; }
.vf-spacer { flex: 1; }
.vf-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-top: 1px solid var(--line); padding-top: 7px; }
.chip { background: var(--sunk, #eef3f3); border-radius: 999px; padding: 2px 9px; font-size: 11.5px; }
.vf-total { margin: -2px 0 6px; }
.vf-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 330px; max-width: 92vw; z-index: 60; background: var(--surface, #fff);
  border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgba(0,0,0,.10); display: flex; }
.vf-drawer[hidden] { display: none; }
body.vf-open .main, body.vf-open main { padding-right: 340px; }
.vf-form { display: flex; flex-direction: column; width: 100%; height: 100%; }
.vf-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.vf-head h2 { margin: 0; font-size: 15px; }
.vf-body { flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.vf-body > label, .vf-2 label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.vf-body .search { position: relative; }
.vf-body .search .ico { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--faint); }
.vf-body .search input { padding-left: 29px; }
.vf-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vf-set { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 0; }
.vf-set legend { font-size: 11.5px; color: var(--muted); padding: 0 4px; }
.vf-checks { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.vf-checks label[hidden] { display: none; }
.vf-scroll { max-height: 210px; overflow: auto; margin-top: 6px; }
.vf-mode { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 12px; }
.vf-mode label { padding: 3px 9px; display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.vf-mode label + label { border-left: 1px solid var(--line); }
.vf-mode label:has(input:checked) { background: var(--petrol, #0b5f5a); color: #fff; }
.vf-mode input { width: auto; margin: 0; }
.vf-acc-search { margin-top: 6px; font-size: 12.5px; }
.vf-custom { display: flex; gap: 4px; align-items: center; }
.vf-custom[hidden] { display: none; }
.vf-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
@media (max-width: 1100px) { body.vf-open .main, body.vf-open main { padding-right: 0; } }

/* v3.6 : prospection (tableau modifiable comme un tableur) */
.pr-status { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.pr-status .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 2px; }
.pr-status b { font-weight: 600; opacity: .7; margin-left: 3px; }
.pr-wrap { padding: 0; overflow: auto; max-height: calc(100vh - 260px); }
.pr-sheet { border-collapse: collapse; table-layout: fixed; font-size: 12.5px; }
.pr-sheet td:nth-child(2) .pr-in { font-weight: 600; }
.pr-sheet td:nth-child(2), .pr-sheet th:nth-child(2) { position: sticky; left: 52px; z-index: 1; background: var(--surface, #fff); }
.pr-sheet th:nth-child(2) { z-index: 3; background: var(--sunk, #eef2f2); }
.pr-sheet td:first-child, .pr-sheet th:first-child { position: sticky; left: 0; z-index: 1; }
.pr-sheet th:first-child { z-index: 3; }
.pr-sheet th { position: sticky; top: 0; z-index: 2; background: var(--sunk, #eef2f2); text-align: left; font-weight: 600; font-size: 11.5px;
  padding: 6px 6px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-sheet td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; height: 30px; position: relative; }
.pr-sheet .pr-num { text-align: center; color: var(--faint); font-size: 11px; background: var(--sunk, #f6f8f8); white-space: nowrap; }
.pr-sheet .pr-num input { width: auto; margin: 0 3px 0 0; vertical-align: middle; }
.pr-sheet .pr-in { width: 100%; height: 30px; border: 0; border-radius: 0; background: transparent; padding: 3px 6px; font-size: 12.5px; box-shadow: none; }
.pr-sheet .pr-in:focus { outline: 2px solid var(--petrol, #0b5f5a); outline-offset: -2px; background: #fff; box-shadow: none; }
.pr-sheet select.pr-in { padding-right: 2px; cursor: pointer; }
.pr-sheet select.pr-st { color: var(--st, inherit); font-weight: 600; }
.pr-sheet tr:hover td:not(.pr-num) { background: rgba(15, 94, 99, .035); }
.pr-sheet tr.pr-new td { background: #fbfcf6; }
.pr-sheet tr.pr-new .pr-in::placeholder { color: var(--petrol, #0b5f5a); opacity: .75; }
.pr-sheet td.is-saving { background: #fffbe6 !important; }
.pr-sheet td.is-saved { background: #ecfdf3 !important; transition: background .6s; }
.pr-sheet td.is-error { background: #fef2f2 !important; }
.pr-sheet .pr-act { text-align: center; padding: 0 4px; }
.pr-msg.bad { color: var(--danger, #b91c1c); }
.pr-kanban { grid-auto-columns: minmax(185px, 1fr); }
.pr-card strong { color: var(--petrol, #0b5f5a); }
.pr-card .bad { color: var(--danger, #b91c1c); font-weight: 600; }
.pr-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 3px; gap: 6px; }
.pr-sheet tr.pr-flash td { background: #fff7d6 !important; transition: background .4s; }
#pr-kanban[hidden], #pr-list[hidden] { display: none !important; }
.pr-cols summary .ico { width: 13px; height: 13px; vertical-align: -2px; }
.pr-cols-act { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
.pr-cols { position: relative; }
.pr-cols summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; background: var(--surface); }
.pr-cols summary::-webkit-details-marker { display: none; }
.pr-cols[open] summary { border-color: var(--petrol, #0b5f5a); }
.pr-cols .vf-pop { position: absolute; z-index: 40; top: calc(100% + 4px); right: 0; background: var(--surface, #fff); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; min-width: 210px; font-size: 12.5px; }
.pr-sheet button.pr-pop { text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.pr-sheet button.pr-pop:hover { background: rgba(15, 94, 99, .06); }
.pr-add { color: var(--faint); font-size: 12px; }
.pr-more { color: var(--muted); font-size: 11.5px; }
.pr-sheet td.pr-ro { padding: 0 6px; }
.badge.pr-life { background: color-mix(in srgb, var(--lc) 14%, transparent); color: var(--lc); text-decoration: none; }
.pr-dlg { width: min(640px, 94vw); }
.pr-dlg textarea { min-height: 220px; resize: vertical; font-family: inherit; }
.pr-ct-dlg { width: min(980px, 96vw); }
.pr-ct td { padding: 2px 3px; }
.pr-ct input { font-size: 12.5px; padding: 4px 6px; }
.pr-ct tr.is-error td { background: #fef2f2; }
.pr-li-cell { position: relative; }
.pr-li-cell input { padding-right: 26px; }
.pr-li { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: #0a66c2; color: #fff; font-weight: 700; font-size: 10px; border-radius: 3px; padding: 1px 4px; text-decoration: none; }
.pr-dlg-body { display: flex; flex-direction: column; gap: 10px; }
.pr-dlg-body h2 { margin: 0; }
.pr-dlg-body .form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.pr-ct { width: 100%; table-layout: fixed; }
.pr-ct th:nth-child(1) { width: 24%; } .pr-ct th:nth-child(2) { width: 16%; } .pr-ct th:nth-child(3) { width: 15%; }
.pr-ct th:nth-child(4) { width: 20%; } .pr-ct th:nth-child(5) { width: 20%; } .pr-ct th:nth-child(6) { width: 44px; }
/* v3.8 : fiche lead, doublons */
.lead-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; }
.lead-fields label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.lead-fields .saved { background: #ecfdf3; transition: background .6s; }
.lead-grid textarea { width: 100%; font-family: inherit; }
.dup-card { border-left: 4px solid #d97706; background: #fffbeb; }
.dup-card ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.pr-dup { color: #d97706; font-weight: 700; margin-left: 4px; cursor: help; }
#ld-msg.bad { color: var(--danger, #b91c1c); }
.pr-sheet th.pr-th { cursor: pointer; user-select: none; position: sticky; padding-right: 10px; }
.pr-sheet th.pr-th:hover { background: #e3eaea; }
.pr-th-l { display: block; overflow: hidden; text-overflow: ellipsis; }
.pr-rs { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 4; }
.pr-rs:hover, body.pr-resizing .pr-rs { background: rgba(15, 94, 99, .25); }
body.pr-resizing, body.pr-resizing * { cursor: col-resize !important; user-select: none; }
.pr-sheet .pr-open { color: var(--petrol, #0b5f5a); text-decoration: none; font-size: 13px; padding: 0 2px; }
.pr-sheet td[data-k="name"] .pr-dup { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); text-decoration: none; }
.pr-card { cursor: pointer; }
.pr-kind-b { font-size: 11.5px; border-radius: 999px; padding: 1px 8px; background: #e8f1f1; color: var(--petrol, #0b5f5a); }
.pr-kind-b.contact { background: #f3e8ff; color: #7c3aed; }

/* v3.10 : colonnes ajustables sur tous les tableaux */
th.col-resizable { position: relative; }
.col-rs { position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: col-resize; z-index: 3; }
.col-rs:hover, body.col-resizing .col-rs { background: rgba(37, 99, 235, .22); }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none !important; }
table.col-fixed { table-layout: fixed; max-width: none; }
table.col-fixed th, table.col-fixed td { overflow: hidden; text-overflow: ellipsis; }
.card:has(> table.col-fixed), .table-wrap { overflow-x: auto; }
.merge-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; border-width: 2px; }
.merge-card.on { border-color: var(--petrol); box-shadow: 0 0 0 3px color-mix(in srgb, var(--petrol) 15%, transparent); }
.merge-card:hover { text-decoration: none; border-color: var(--petrol); }
.merge-card h2 { margin: 0; }
.merge-tag { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.merge-card.on .merge-tag { color: var(--petrol); }
.merge-counts { margin: 4px 0; padding-left: 18px; }
.nowrap { white-space: nowrap; }
.merge-card .btn { align-self: flex-start; }

/* ---------- barre du haut (recherche globale, création rapide, densité) */
:root { --cpy: 16px; --cpx: 22px; }
.content { padding: var(--cpy) var(--cpx) 48px; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; margin: calc(-1 * var(--cpy)) calc(-1 * var(--cpx)) 18px; padding: 10px var(--cpx);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.tb-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: var(--r); cursor: pointer; flex: none; }
.tb-btn:hover { background: var(--sunk); color: var(--ink); }
.tb-btn .ico { width: 18px; height: 18px; vertical-align: 0; }
.tb-search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px 0 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); border-radius: var(--r); font: inherit; font-size: 14px; cursor: text; text-align: left; }
.tb-search:hover { border-color: var(--petrol); }
.tb-search span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { font: 600 11px/1 var(--font); color: var(--muted); background: var(--sunk); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 3px 6px; margin: 0 1px; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tb-new { position: relative; }
.tb-new summary { list-style: none; min-height: 38px; }
.tb-new summary::-webkit-details-marker { display: none; }
.tb-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: 0 12px 32px rgba(16, 24, 40, .16); padding: 6px; z-index: 40; }
.tb-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink); font-weight: 500; }
.tb-menu a:hover { background: var(--petrol-soft); color: var(--petrol-ink); text-decoration: none; }
.tb-menu .ico { color: var(--muted); }

/* ---------- palette de recherche (Ctrl+K) */
.cmdk { position: fixed; inset: 0; z-index: 90; background: rgba(15, 22, 38, .45); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.cmdk[hidden] { display: none !important; }
.cmdk-box { width: min(640px, 100%); background: var(--surface); border-radius: 14px; box-shadow: 0 24px 64px rgba(16, 24, 40, .35); overflow: hidden; display: flex; flex-direction: column; max-height: 72vh; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cmdk-in .ico { width: 20px; height: 20px; color: var(--muted); vertical-align: 0; }
.cmdk-in input { border: 0; box-shadow: none !important; padding: 4px 0; font-size: 16px; }
.cmdk-list { overflow-y: auto; padding: 6px; }
.cmdk-group { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 10px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; color: var(--ink); cursor: pointer; }
.cmdk-item:hover { text-decoration: none; }
.cmdk-item.on { background: var(--petrol-soft); color: var(--petrol-ink); }
.cmdk-item b { font-weight: 600; }
.cmdk-item small { color: var(--muted); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.cmdk-tag { flex: none; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); min-width: 78px; text-align: center; }
.cmdk-empty { padding: 22px; text-align: center; color: var(--muted); }
.cmdk-foot { display: flex; gap: 18px; padding: 9px 16px; border-top: 1px solid var(--line); background: var(--sunk); font-size: 12px; color: var(--muted); flex-wrap: wrap; }

/* ---------- menu réduit aux icônes */
body.side-mini { --side: 72px; }
body.side-mini .sidebar .brand-name, body.side-mini .sidebar nav a span, body.side-mini .sidebar nav .nav-title,
body.side-mini .nav-toggle-all, body.side-mini .me-id > span:not(.avatar) { display: none !important; }
body.side-mini .sidebar nav .nav-hidden { display: flex !important; }
body.side-mini .sidebar nav a { justify-content: center; padding: 10px 0; }
body.side-mini .sidebar nav a + .nav-title + a, body.side-mini .sidebar nav .nav-title + a { margin-top: 10px; }
body.side-mini .brand { justify-content: center; padding-left: 0; padding-right: 0; }
body.side-mini .me { flex-direction: column; padding: 10px 6px; }

/* ---------- densité compacte */
body.dense .table td { padding-top: 6px; padding-bottom: 6px; font-size: 13.5px; }
body.dense .table th { padding-top: 7px; padding-bottom: 7px; }
body.dense .card { padding: 14px 16px; margin-bottom: 10px; }
body.dense .kpi { padding: 10px 14px; }
body.dense { --cpy: 14px; }
#tb-density[aria-pressed="true"] { background: var(--petrol-soft); color: var(--petrol-ink); border-color: var(--petrol); }

/* ---------- retour en haut */
.to-top { position: fixed; right: 22px; bottom: 84px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); box-shadow: 0 6px 18px rgba(16, 24, 40, .14); cursor: pointer; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 35; }
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top .ico { width: 18px; height: 18px; vertical-align: 0; }

@media (max-width: 738px) {
  body, body.dense { --cpy: 14px; --cpx: 14px; }
  .topbar { padding: 8px var(--cpx); }
  .menu-btn { margin-bottom: 0; }
  .tb-side, .tb-search span, .tb-search kbd { display: none; }
  .tb-search { flex: 0 0 38px; width: 38px; padding: 0; justify-content: center; }
  .tb-search .ico { vertical-align: 0; }
}
@media print { .topbar, .to-top, .cmdk { display: none !important; } }

/* ---------- Opportunités : bascule Kanban / Liste */
.opp-mode { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.opp-mode a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.opp-mode a + a { border-left: 1px solid var(--line); }
.opp-mode a:hover { text-decoration: none; background: var(--sunk); }
.opp-mode a.on { background: var(--petrol); color: #fff; }
.opp-mode .ico { width: 15px; height: 15px; vertical-align: 0; }

/* ---------- Objectifs annuels */
.obj-bar { display: inline-block; width: 110px; height: 8px; border-radius: 99px; background: var(--line-2); vertical-align: middle; overflow: hidden; }
.obj-bar i { display: block; height: 100%; background: var(--petrol); border-radius: 99px; }
.kpi .obj-bar { width: 100%; margin-top: 6px; }
.obj-steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; counter-reset: st; }
.obj-steps li { counter-increment: st; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px 5px 8px; }
.obj-steps li::before { content: counter(st); display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; margin-right: 6px;
  background: var(--line-2); color: var(--ink-2); font-size: 11px; }
.obj-steps li.done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.obj-steps li.done::before { content: "✓"; background: var(--ok-soft); color: var(--ok); }
.obj-steps li.on { color: #fff; background: var(--petrol); border-color: var(--petrol); }
.obj-steps li.on::before { background: rgba(255, 255, 255, .25); color: #fff; }
.obj-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.obj-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; }
.obj-card { padding: 16px 18px; }
.obj-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.obj-top h3 { margin: 0; font-size: 16px; flex: 1; }
.obj-num { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--petrol-soft); color: var(--petrol-ink); font-weight: 700; }
.obj-title-in { flex: 1; font-weight: 600; font-size: 15px; }
.obj-w-ro { font-weight: 700; color: var(--ink-2); background: var(--sunk); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.obj-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.obj-dl { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; margin: 0 0 10px 38px; }
.obj-dl dt { color: var(--muted); font-size: 13px; }
.obj-dl dd { margin: 0; white-space: pre-line; }
.obj-track { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-left: 38px; padding: 10px 0; border-top: 1px solid var(--line-2); align-items: end; }
.obj-track label > span, .obj-side .lbl, .lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.obj-range { display: flex; align-items: center; gap: 10px; }
.obj-range input { flex: 1; accent-color: var(--petrol); padding: 0; border: 0; box-shadow: none !important; }
.obj-range output { min-width: 44px; font-weight: 700; }
.obj-eval { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-left: 38px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.obj-side select { margin-bottom: 6px; }
.obj-side p { margin: 6px 0 0; white-space: pre-line; }
.obj-actions { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 12px 140px 12px 0;
  background: linear-gradient(to top, var(--bg) 70%, transparent); }
p.ro { margin: 2px 0 0; white-space: pre-line; }
.obj-mini { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--ink); }
.obj-mini:hover { text-decoration: none; }
.obj-new { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.obj-new select { max-width: 320px; }
@media (max-width: 738px) {
  .obj-actions { padding-right: 0; padding-bottom: 64px; }
  .obj-grid, .obj-track, .obj-eval { grid-template-columns: 1fr; }
  .obj-dl, .obj-track, .obj-eval { margin-left: 0; }
}
@media print {
  .obj-actions, .obj-del, #add-obj, .obj-head .actions, .page-head .actions, .crumb { display: none !important; }
  .obj-card { break-inside: avoid; }
}

/* ---------- En-tête compact (toutes pages, tous thèmes) */
html body { --cpy: 12px; }
html body .topbar { padding-top: 6px; padding-bottom: 6px; margin-bottom: 12px; gap: 8px; }
html body .tb-btn, html body .tb-search { height: 34px; }
html body .tb-btn { width: 34px; }
html body .tb-new summary { min-height: 34px; padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; }
html body .page-head { margin-bottom: 12px; gap: 10px; align-items: center; }
html body .page-head h1 { font-size: 21px; line-height: 1.2; }
html body .page-head p { margin-top: 2px; font-size: 13px; line-height: 1.4; }
html body .page-head .crumb { margin-bottom: 1px; font-size: 12px; }
html body .page-head .actions .btn { min-height: 32px; padding-top: 5px; padding-bottom: 5px; }
html body .vf-bar { padding: 6px 10px; margin-bottom: 8px; gap: 5px; }
html body .view-bar { margin-bottom: 8px; }
html body .obj-steps { margin-bottom: 10px; }
html body .obj-steps li { padding-top: 3px; padding-bottom: 3px; }
@media (max-width: 738px) {
  html body { --cpy: 8px; }
  html body .page-head h1 { font-size: 19px; }
}
html body .kanban-bar { margin-bottom: 8px; }
.obj-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; margin: 10px 0 14px; }
.obj-people .obj-all { grid-column: 1 / -1; }
.obj-new label { display: flex; flex-direction: column; }
.obj-new { align-items: flex-end; }
.obj-src-sel { max-width: 260px; height: 30px; padding: 2px 8px; font-size: 13px; }
.tb-trail { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; min-width: 0; }
.tb-trail b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.tb-trail:empty { display: none; }
.ph-ico { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--petrol-soft); color: var(--petrol); }
.ph-ico .ico { width: 17px; height: 17px; vertical-align: 0; }
.page-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 1100px) { .tb-trail { display: none; } }
/* numéros de documents et dates : jamais coupés sur plusieurs lignes */
.table td[data-k="number"], .table td[data-k="code"], .table td[data-k="customer_code"], .table td[data-k$="_date"],
.table td[data-k="date"], .table td[data-k="issue_date"], .table td[data-k="due_date"] { white-space: nowrap; }
/* rôles et permissions : en-têtes de colonnes lisibles */
.matrix thead th { min-width: 150px; vertical-align: bottom; }
.matrix thead th input[data-k="label"] { width: 100%; font-weight: 600; }
.matrix thead th select { width: 100%; margin-top: 4px; }
/* rôles : en-têtes alignés (même structure, lignes de hauteur fixe) */
.matrix thead th.rh { vertical-align: top; width: 168px; min-width: 168px; max-width: 168px; padding: 10px 8px; }
.matrix thead th.rh-perm { vertical-align: bottom; }
.rh-box { display: grid; grid-template-rows: 36px 20px 36px 30px; gap: 6px; align-items: center; }
.rh-box input, .rh-box select { width: 100%; height: 36px; margin: 0; }
.rh-box input[data-k="label"] { font-weight: 600; text-overflow: ellipsis; }
.rh-meta { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 12px; text-align: center; }
.rh-meta code { font-size: 11.5px; background: none; padding: 0; }
.rh-box .btn, .rh-lock { justify-self: center; }
.rh-lock { font-size: 12px; color: var(--faint); }
.brand-mark { width: 30px; height: 30px; flex: none; border-radius: 8px; }
body.side-mini .brand-mark { width: 34px; height: 34px; }
.sidebar .brand-mark { box-shadow: 0 0 0 1px rgba(255, 255, 255, .22); width: 32px; height: 32px; }
/* tableau de bord personnalisable : blocs « nus » (chiffres clés) et blocs d'alerte */
.ib-w.ib-bare { padding: 0; background: transparent; border: 0; box-shadow: none; }
.ib-w.ib-bare > .ib-head { display: none; }
.ib-board.editing .ib-w.ib-bare { padding: 8px; border: 1px dashed var(--line); background: var(--surface); }
.ib-board.editing .ib-w.ib-bare > .ib-head { display: flex; }
.ib-bare .ib-body { overflow: visible; }
.ib-bare .kpis { height: 100%; }
.ib-w.ib-alert { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.ib-w.ib-alert-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.ib-links { display: flex; justify-content: flex-end; margin: -2px 0 4px; font-size: 12.5px; }
.db-board .ib-body .activity-list { margin: 0; }
