/* Plateforme Bravis : feuille de style */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #0a0d10;
  --ink-2: #161c21;
  --ink-3: #252e35;
  --blue: #086cb4;
  --blue-deep: #05528a;
  --blue-tint: #e7f0f8;
  --blue-line: #b6d0e8;
  --paper: #f3f5f3;
  --surface: #ffffff;
  --line: #dee4e2;
  --line-strong: #c3cdca;
  --text: #10181e;
  --muted: #586771;
  --faint: #86949c;
  --success: #1d7650;
  --success-tint: #e3f2ea;
  --warning: #9a6211;
  --warning-tint: #fbf0dc;
  --danger: #b3261e;
  --danger-tint: #fbe7e5;
  --hot: #c2410c;
  --warm: #b7791f;
  --cold: #5b7f95;
  --r-control: 4px;
  --r-card: 8px;
  --r-sheet: 14px;
  --rail: 240px;
  --tabbar: 64px;
  --topbar: 56px;
  --shadow-pop: 0 18px 48px rgba(10, 13, 16, .18), 0 2px 8px rgba(10, 13, 16, .08);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--paper);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
}
body.noscroll { overflow: hidden; }
img { max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 28px; letter-spacing: -0.02em; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0 0 .75em; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.grow { flex: 1 1 auto; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* Icônes */
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.i.sm { width: 16px; height: 16px; }
.i.lg { width: 24px; height: 24px; }

/* ---------- Structure ---------- */
.shell { min-height: 100vh; }
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail); z-index: 30;
  background: var(--ink); color: #c9d3d8;
  display: flex; flex-direction: column; padding: 22px 14px 16px;
}
.brand { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px 22px; color: #fff; text-decoration: none !important; }
.brand .logo-img { height: 44px; width: auto; align-self: flex-start; filter: invert(1); }
.wordmark { font-weight: 800; letter-spacing: .32em; font-size: 19px; color: inherit; }
.wordmark-sub { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #8fa1ab; }
.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.rail-link {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px;
  border-radius: var(--r-control); color: #c9d3d8; font-weight: 600; font-size: 14.5px; position: relative;
}
.rail-link:hover { background: var(--ink-2); color: #fff; text-decoration: none; }
.rail-link.active { background: var(--ink-3); color: #fff; }
.rail-link.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; background: var(--blue); border-radius: 0 2px 2px 0; }
.rail-link .badge { margin-left: auto; }
.rail-sep { margin: 22px 12px 8px; font-size: 12.5px; font-weight: 700; color: #6f828c; }
.demo-flag { margin-top: auto; margin-bottom: 10px; padding: 6px 10px; border: 1px dashed #4a5a64; border-radius: 4px; font-size: 11.5px; font-weight: 700; color: #9fb0b9; text-align: center; }
.topbar .demo-flag { margin: 0 6px 0 0; padding: 3px 8px; }
.demo-flag + .rail-foot { margin-top: 0; }
.rail-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--ink-3); }
.me-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; color: #fff; border-radius: var(--r-control); cursor: pointer; text-align: left; }
.me-btn:hover { background: var(--ink-2); }
.me-btn .who { display: flex; flex-direction: column; min-width: 0; }
.me-btn .who b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-btn .who span { font-size: 12px; color: #8fa1ab; }

.topbar { display: none; }
.main { margin-left: var(--rail); padding: 32px 40px 64px; min-height: 100vh; outline: none; }
.view { max-width: 1180px; margin: 0 auto; }
.view.narrow { max-width: 820px; }
.tabbar { display: none; }

/* ---------- En-têtes de page ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .sub { color: var(--muted); margin: 6px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.back-link:hover { color: var(--text); }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: var(--r-control);
  font-weight: 650; font-size: 14px; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { border-color: var(--text); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-3); border-color: var(--ink-3); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(16, 24, 30, .06); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); background: var(--danger-tint); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #8f1d17; border-color: #8f1d17; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: var(--r-control); background: transparent; cursor: pointer; color: inherit; }
.icon-btn:hover { background: rgba(16, 24, 30, .07); }
.link-btn { border: 0; background: none; padding: 0; color: var(--blue); font-weight: 650; cursor: pointer; font-size: 14px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 17px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 16px 20px 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack > * + * { margin-top: 16px; }

/* ---------- Pastilles ---------- */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11.5px; font-weight: 700; }
.badge.red { background: var(--danger); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.chip.blue { background: var(--blue-tint); border-color: var(--blue-line); color: var(--blue-deep); }
.chip.green { background: var(--success-tint); border-color: #bfe0cd; color: var(--success); }
.chip.amber { background: var(--warning-tint); border-color: #efd7a8; color: var(--warning); }
.chip.red { background: var(--danger-tint); border-color: #f2c4bf; color: var(--danger); }
.chip.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; white-space: nowrap; color: var(--text); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st, var(--faint)); flex: none; }
.temp { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--tc, var(--muted)); }

/* Filtres en pastilles cliquables */
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin: 0 0 14px; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13.5px; font-weight: 650; color: var(--muted); cursor: pointer; }
.filter:hover { color: var(--text); border-color: var(--text); }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter .n { font-variant-numeric: tabular-nums; opacity: .7; font-weight: 600; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input[type=search] { padding-left: 40px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-control); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; min-height: 38px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field .lbl { font-size: 13px; font-weight: 650; color: var(--text); }
.field .req { color: var(--danger); font-style: normal; }
.field .hint { font-size: 12.5px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=url], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-control);
  background: var(--surface); color: var(--text); font: inherit; font-size: 15px; transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23586771' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(8, 108, 180, .18); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.fieldset-title { font-size: 13px; font-weight: 700; color: var(--muted); margin: 8px 0 12px; }
.fieldset-title:not(:first-child) { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--line-strong); position: relative; flex: none; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--blue); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch small { display: block; font-weight: 500; color: var(--muted); }
.form-error { background: var(--danger-tint); color: var(--danger); border-radius: var(--r-control); padding: 10px 12px; font-size: 14px; font-weight: 600; margin-bottom: 14px; }

/* ---------- Listes ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.list-group { padding: 10px 20px 6px; font-size: 13px; font-weight: 700; color: var(--muted); background: var(--paper); border-bottom: 1px solid var(--line); }
.item { display: flex; align-items: center; gap: 14px; padding: 12px 20px; min-height: 64px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none !important; position: relative; }
.item:last-child { border-bottom: 0; }
a.item:hover, .item.clickable:hover { background: #f7f9f8; cursor: pointer; }
.item-main { flex: 1 1 auto; min-width: 0; }
.item-title { display: block; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub { color: var(--muted); font-size: 13.5px; display: flex; gap: 6px 12px; flex-wrap: wrap; margin-top: 2px; }
.item-sub span { display: inline-flex; align-items: center; gap: 4px; }
.item-end { display: flex; align-items: center; gap: 10px; flex: none; text-align: right; }
.item-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.item-meta.late { color: var(--danger); font-weight: 700; }
.call-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; color: var(--blue); background: var(--surface); flex: none; }
.call-btn:hover { border-color: var(--blue); background: var(--blue-tint); }

.avatar { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--av, var(--blue)); color: #fff; font-weight: 750; font-size: 14px; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }

/* États vides et chargement */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty > .i { width: 32px; height: 32px; color: var(--faint); margin-bottom: 10px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty p { max-width: 420px; margin: 0 auto 16px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px 0; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tableau de bord ---------- */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.hello h1 { font-size: 30px; }
.hello .date { color: var(--muted); margin-top: 4px; }
.hello .date::first-letter { text-transform: uppercase; }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tool { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); color: var(--text); text-decoration: none !important; min-height: 64px; transition: border-color .12s; }
.tool:hover { border-color: var(--blue); }
.tool-ico { width: 40px; height: 40px; border-radius: var(--r-control); display: flex; align-items: center; justify-content: center; background: var(--ink); color: #fff; flex: none; }
.tool-name { display: block; font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.tool-desc { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.tools:not(.big) .tool-desc:not(.show) { display: none; }
.tool .ext { margin-left: auto; color: var(--faint); }
.tool.disabled { opacity: .6; }
.tools.big { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tools.big .tool { padding: 18px; min-height: 92px; }
.tools.big .tool-ico { width: 48px; height: 48px; }

.pipeline { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--paper); margin: 4px 0 14px; }
.pipeline span { display: block; height: 100%; background: var(--st); }
.pipeline span + span { box-shadow: inset 2px 0 0 #fff; }
.pipe-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pipe-legend a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-control); color: var(--text); text-decoration: none !important; }
.pipe-legend a:hover { border-color: var(--text); }
.pipe-legend b { font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pipe-legend .status { font-size: 12.5px; color: var(--muted); }

.task-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row .t-main { flex: 1 1 auto; min-width: 0; }
.task-row .t-title { font-weight: 650; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row .t-sub { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.task-row.done .t-title { text-decoration: line-through; color: var(--faint); }
.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; color: transparent; padding: 0; transition: background .12s, border-color .12s; }
.check:hover { border-color: var(--blue); color: var(--blue); }
.check.on { background: var(--success); border-color: var(--success); color: #fff; }
.check .i { width: 15px; height: 15px; stroke-width: 2.5; }
.prio-1 .t-title::after { content: "Priorité haute"; margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--danger); vertical-align: 1px; }

.news { padding: 14px 0; border-bottom: 1px solid var(--line); }
.news:first-of-type { padding-top: 0; }
.news:last-child { border-bottom: 0; padding-bottom: 0; }
.news h3 { font-size: 15.5px; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.news p { color: var(--muted); font-size: 14px; white-space: pre-line; margin: 0; }
.news time { font-size: 12px; color: var(--faint); }

/* ---------- Jauge « cote » (compteur d'heures) ---------- */
.cote { --p: 0; --c: var(--blue); }
.cote-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.cote-value { flex: none; white-space: nowrap; font-size: 34px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.cote-value small { font-size: 16px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.cote-label { font-size: 13px; color: var(--muted); font-weight: 600; text-align: right; }
.cote-rule { position: relative; height: 40px; margin-top: 6px; }
.cote-dim { position: absolute; left: 0; top: 4px; height: 0; width: calc(var(--p) * 100%); border-top: 1.5px solid var(--c); transition: width .9s cubic-bezier(.2, .7, .2, 1); }
.cote-dim::before, .cote-dim::after { content: ""; position: absolute; top: -7px; width: 1.5px; height: 13px; background: var(--c); transform: rotate(45deg); }
.cote-dim::before { left: 0; }
.cote-dim::after { right: 0; }
.cote-ticks { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; border-bottom: 1.5px solid var(--text); border-right: 1.5px solid var(--text);
  background:
    repeating-linear-gradient(to right, var(--text) 0 1.5px, transparent 1.5px calc(100% / var(--major, 3))) left bottom / 100% 100% no-repeat,
    repeating-linear-gradient(to right, var(--line-strong) 0 1px, transparent 1px calc(100% / var(--n, 42))) left bottom / 100% 45% no-repeat;
}
.cote-fill { position: absolute; left: 0; bottom: 0; height: 9px; width: calc(var(--p) * 100%); background: var(--c); transition: width .9s cubic-bezier(.2, .7, .2, 1); }
.cote-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; font-weight: 600; }
.cote.small .cote-value { font-size: 24px; }
.cote.small .cote-rule { height: 30px; }
.cote.small .cote-ticks { height: 16px; }
.cote.small .cote-fill { height: 7px; }
.cote.done { --c: var(--success); }
.cote.zero .cote-dim { display: none; }
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.theme { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-control); font-size: 13.5px; }
.theme b { display: block; font-size: 13.5px; }
.theme span { color: var(--muted); font-size: 12.5px; }
.theme .mark { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: var(--paper); color: var(--faint); border: 1.5px dashed var(--line-strong); }
.theme.ok .mark { background: var(--success); color: #fff; border: 0; }
.theme .mark .i { width: 14px; height: 14px; stroke-width: 2.5; }

/* ---------- Leads ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kcol { background: #eaeeec; border-radius: var(--r-card); padding: 10px; min-height: 140px; }
.kcol.drop { outline: 2px dashed var(--blue); outline-offset: -4px; background: var(--blue-tint); }
.kcol-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 10px; }
.kcol-head .n { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.kcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; color: var(--text); text-decoration: none !important; cursor: grab; }
.kcard:hover { border-color: var(--text); }
.kcard.dragging { opacity: .4; }
.kcard b { display: block; font-size: 14px; }
.kcard .k-sub { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.kcard .k-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }

.detail-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.detail-head h1 { font-size: 28px; }
.detail-head .chips { margin-top: 10px; }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.quick a, .quick span.off { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-card); font-size: 12.5px; font-weight: 700; color: var(--text); text-decoration: none !important; }
.quick a .i { color: var(--blue); }
.quick a:hover { border-color: var(--blue); }
.quick span.off { color: var(--faint); }
.stepper { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; }
.stepper::-webkit-scrollbar { display: none; }
.step { flex: 1 0 auto; min-width: 92px; border: 0; background: var(--surface); border: 1px solid var(--line); padding: 8px 10px; font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer; text-align: left; border-radius: 4px; position: relative; }
.step small { display: block; font-size: 11px; font-weight: 600; color: var(--faint); }
.step.past { background: var(--blue-tint); border-color: var(--blue-line); color: var(--blue-deep); }
.step.now { background: var(--blue); border-color: var(--blue); color: #fff; }
.step.now small { color: #cfe3f3; }
.step.lost.now { background: var(--danger); border-color: var(--danger); }
.step:hover:not(.now) { border-color: var(--text); color: var(--text); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.timeline .t-ico { width: 32px; height: 32px; border-radius: 50%; background: var(--paper); display: flex; align-items: center; justify-content: center; flex: none; color: var(--muted); }
.timeline .t-ico .i { width: 16px; height: 16px; }
.timeline .sys .t-ico { background: transparent; border: 1px dashed var(--line-strong); }
.timeline .t-body { flex: 1; min-width: 0; font-size: 14px; white-space: pre-line; word-break: break-word; }
.timeline .t-meta { font-size: 12px; color: var(--faint); margin-top: 2px; }
.timeline .sys .t-body { color: var(--muted); }
.note-form textarea { min-height: 72px; }
.note-kinds { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }

/* ---------- Tâches ---------- */
.quickadd { display: flex; gap: 8px; margin-bottom: 18px; }
.quickadd input[name=title] { flex: 1 1 auto; }
.quickadd select { width: auto; flex: none; }
.group-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.group-title.late { color: var(--danger); }
.group-title .n { letter-spacing: 0; font-variant-numeric: tabular-nums; }
.tasklist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 0 16px; }
.tasklist .task-row { cursor: pointer; }
.tasklist .task-row .t-link { color: var(--blue); font-weight: 650; }

/* ---------- Formation ---------- */
.f-hero { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-bottom: 26px; }
.f-hero .card { padding: 24px; }
.f-hero .card + .card { margin-top: 0; }
.f-catalog-note { color: var(--muted); font-size: 13.5px; margin-top: 14px; }
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.module { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; color: var(--text); text-decoration: none !important; position: relative; min-height: 210px; border-top: 3px solid var(--cat, var(--blue)); }
.module:hover { border-color: var(--text); border-top-color: var(--cat, var(--blue)); }
.module .cat { font-size: 12px; font-weight: 700; color: var(--cat, var(--blue)); margin-bottom: 6px; }
.module h3 { font-size: 16.5px; margin-bottom: 6px; }
.module p { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0 0 12px; }
.module .m-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.module .m-foot span { display: inline-flex; align-items: center; gap: 4px; }
.module.prep { background: #f8f9f8; border-style: dashed; border-top-style: solid; }
.module.prep h3 { color: var(--muted); }
.module .bar { height: 4px; background: var(--paper); border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.module .bar span { display: block; height: 100%; background: var(--blue); }
.module.complete .bar span { background: var(--success); }
.module .flag { position: absolute; top: 14px; right: 14px; }
.cat-block { margin-bottom: 30px; }
.cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.cat-head h2 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.cat-head h2::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--cat); }
.cat-head span { color: var(--muted); font-size: 13px; font-weight: 600; }

.m-hero { background: var(--ink); color: #fff; border-radius: var(--r-card); padding: 28px; margin-bottom: 16px; position: relative; overflow: hidden; }
.m-hero .cat { color: #9cc7ea; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.m-hero h1 { font-size: 30px; max-width: 760px; }
.m-hero p { color: #b9c6cd; max-width: 760px; margin: 12px 0 0; }
.m-hero .chips { margin-top: 16px; }
.m-hero .chip { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #e4ecef; }
.m-hero .actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.m-hero .btn:not(.btn-primary) { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.m-hero .btn:not(.btn-primary):hover { border-color: #fff; }
.lessons { list-style: none; margin: 0; padding: 0; counter-reset: l; }
.lesson-link { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none !important; }
.lessons li:last-child .lesson-link { border-bottom: 0; }
.lesson-link:hover .l-title { color: var(--blue); }
.lesson-link .l-n { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--muted); flex: none; }
.lesson-link.done .l-n { background: var(--success); border-color: var(--success); color: #fff; }
.lesson-link.started .l-n { border-color: var(--blue); color: var(--blue); }
.lesson-link .l-title { font-weight: 650; }
.lesson-link .l-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; }
.bullets { margin: 0; padding-left: 20px; }
.bullets li { margin-bottom: 6px; }

.player-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.player-top .grow { min-width: 0; }
.player-top .crumb { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dots { display: flex; gap: 4px; }
.dots span { width: 22px; height: 4px; border-radius: 999px; background: var(--line-strong); }
.dots span.done { background: var(--success); }
.dots span.cur { background: var(--blue); }
.lesson-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 34px 40px; }
.lesson-card > h1 { font-size: 26px; margin-bottom: 6px; }
.lesson-card > .meta { color: var(--muted); font-size: 13.5px; margin-bottom: 24px; display: flex; gap: 14px; flex-wrap: wrap; }
.prose { font-size: 16px; line-height: 1.7; max-width: 68ch; }
.prose h2 { font-size: 21px; margin: 32px 0 12px; }
.prose h3 { font-size: 17px; margin: 24px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose blockquote { margin: 18px 0; padding: 12px 18px; border-left: 3px solid var(--blue); background: var(--blue-tint); border-radius: 0 6px 6px 0; }
.prose .callout { margin: 18px 0; padding: 14px 18px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 0 6px 6px 0; background: #f8fafa; }
.prose .callout.warn { border-left-color: var(--warning); background: var(--warning-tint); }
.prose .callout.case { border-left-color: var(--ink); background: var(--paper); }
.prose .callout p:last-child, .prose blockquote p:last-child { margin-bottom: 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 16px; font-size: 14.5px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--paper); }
.video { position: relative; aspect-ratio: 16 / 9; background: var(--ink); border-radius: var(--r-card); overflow: hidden; margin-bottom: 20px; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.timer-note { font-size: 12.5px; color: var(--faint); display: inline-flex; align-items: center; gap: 6px; }

.quiz-q { font-size: 19px; font-weight: 700; line-height: 1.35; margin: 4px 0 6px; }
.quiz-help { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: 6px; cursor: pointer; background: var(--surface); font-size: 15px; line-height: 1.45; transition: border-color .1s, background .1s; }
.opt:hover { border-color: var(--text); }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt .box { width: 22px; height: 22px; border: 2px solid var(--line-strong); border-radius: 50%; flex: none; margin-top: 1px; display: flex; align-items: center; justify-content: center; }
.opt.multi .box { border-radius: 5px; }
.opt.sel { border-color: var(--blue); background: var(--blue-tint); }
.opt.sel .box { border-color: var(--blue); background: var(--blue); }
.opt.sel .box::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.opt.multi.sel .box::after { width: 10px; height: 6px; border-radius: 0; background: none; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.opt:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.qnav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; }
.qnav button { width: 30px; height: 30px; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer; }
.qnav button.answered { background: var(--blue-tint); border-color: var(--blue-line); color: var(--blue-deep); }
.qnav button.cur { background: var(--ink); border-color: var(--ink); color: #fff; }
.result { text-align: center; padding: 10px 0 18px; }
.result .score { font-size: 64px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.result.pass .score { color: var(--success); }
.result.fail .score { color: var(--danger); }
.result p { color: var(--muted); max-width: 480px; margin: 10px auto 0; }
.correction { border-top: 1px solid var(--line); padding: 14px 0; }
.correction .c-q { font-weight: 700; margin-bottom: 6px; display: flex; gap: 8px; }
.correction .c-a { font-size: 14px; }
.correction .c-a .good { color: var(--success); font-weight: 700; }
.correction .c-a .bad { color: var(--danger); font-weight: 700; text-decoration: line-through; }
.correction .c-x { font-size: 14px; color: var(--muted); margin-top: 6px; padding-left: 12px; border-left: 2px solid var(--line-strong); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 11px 12px; border-bottom: 1px solid var(--line); background: #fafbfa; white-space: nowrap; }
table.data td { padding: 12px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data .who { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
table.data .who small { display: block; color: var(--muted); font-size: 12.5px; }
table.data .themes-cell { font-size: 13px; line-height: 1.5; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.clickable:hover td { background: #f7f9f8; cursor: pointer; }
.mini-bar { width: 90px; height: 6px; border-radius: 999px; background: var(--paper); overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 8px; }
.mini-bar span { display: block; height: 100%; background: var(--blue); }
.mini-bar.ok span { background: var(--success); }
.yes { color: var(--success); font-weight: 700; }
.no { color: var(--danger); font-weight: 700; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; }
.stat b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat.alert b { color: var(--danger); }

/* Éditeur simple */
.editor { border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--surface); }
.editor-bar { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: #fafbfa; border-radius: var(--r-control) var(--r-control) 0 0; }
.editor-bar button { border: 0; background: none; min-width: 34px; height: 32px; border-radius: 4px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--text); padding: 0 8px; }
.editor-bar button:hover { background: var(--line); }
.editor-link { display: flex; gap: 8px; align-items: center; padding: 8px; border-bottom: 1px solid var(--line); background: var(--paper); }
.editor-link[hidden] { display: none; }
.editor-link input { flex: 1 1 auto; min-width: 0; }
.editor-area { min-height: 260px; max-height: 55vh; overflow-y: auto; padding: 14px 16px; outline: none; }
.editor-area:focus { box-shadow: inset 0 0 0 2px rgba(8, 108, 180, .25); }
.qedit { border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px; margin-bottom: 12px; background: #fafbfa; }
.qedit-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 700; font-size: 13px; color: var(--muted); }
.qopt { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.qopt input[type=text] { min-height: 38px; padding: 6px 10px; font-size: 14px; }
.qopt label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--muted); white-space: nowrap; cursor: pointer; }

.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; letter-spacing: .08em; background: var(--paper); border: 1px dashed var(--line-strong); border-radius: var(--r-control); padding: 12px 16px; text-align: center; margin: 8px 0 14px; user-select: all; }
.copy-box { width: 100%; min-height: 140px; font-size: 14px; }
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-card); background: var(--blue-tint); border: 1px solid var(--blue-line); color: var(--blue-deep); font-size: 14px; margin-bottom: 16px; }
.notice.warn { background: var(--warning-tint); border-color: #efd7a8; color: #6d4509; }
.notice .i { flex: none; margin-top: 1px; }
.notice p { margin: 0; }

/* ---------- Fenêtres (formulaires) ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(10, 13, 16, .48); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade .16s ease-out; }
.overlay.closing { animation: fade .16s ease-in reverse forwards; }
.sheet { background: var(--surface); border-radius: var(--r-sheet); width: min(640px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; box-shadow: var(--shadow-pop); animation: rise .2s cubic-bezier(.2, .8, .2, 1); }
.sheet.wide { width: min(880px, 100%); }
.sheet.small { width: min(440px, 100%); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px 22px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 18px; }
.sheet-body { padding: 18px 22px 8px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; align-items: center; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(14px); opacity: .6; } to { transform: none; opacity: 1; } }

.menu-list { list-style: none; margin: 0; padding: 6px 0; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 50px; padding: 0 22px; border: 0; background: none; color: var(--text); font-weight: 650; font-size: 15px; text-decoration: none !important; cursor: pointer; text-align: left; }
.menu-list a:hover, .menu-list button:hover { background: var(--paper); }
.menu-list .danger { color: var(--danger); }
.menu-list .sep { height: 1px; background: var(--line); margin: 6px 0; }

/* Notifications */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(520px, calc(100% - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-pop); display: flex; gap: 10px; align-items: center; animation: rise .2s ease-out; pointer-events: auto; }
.toast.error { background: var(--danger); }
.toast .i { flex: none; }

.fab { display: none; }

/* ---------- Connexion ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side .brand { padding: 0; }
.auth-side h1 { font-size: 40px; max-width: 460px; letter-spacing: -0.03em; line-height: 1.1; margin-top: 48px; }
.auth-side p { color: #a9b8c0; max-width: 420px; font-size: 16px; margin-top: 16px; }
.auth-plan { position: absolute; right: -60px; bottom: -40px; width: 420px; opacity: .14; pointer-events: none; }
.auth-foot { font-size: 12.5px; color: #6f828c; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.auth-form { width: min(400px, 100%); }
.auth-form h2 { font-size: 26px; margin-bottom: 6px; }
.auth-form .sub { color: var(--muted); margin-bottom: 26px; }
.demo-box { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.demo-box p { font-size: 13.5px; color: var(--muted); }

/* ---------- Attribution par la direction ---------- */
.assigned { color: var(--blue-deep); font-weight: 650; }
.assign-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 16px; border: 1px solid #efd7a8; background: var(--warning-tint); color: var(--warning); border-radius: var(--r-card); font-weight: 600; font-size: 14px; }
.assign-banner span { flex: 1 1 auto; }
.assign-card { margin-bottom: 18px; }
.assign-card .list { border: 0; }
.assign-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.assign-row:last-child { border-bottom: 0; }
.assign-row .item-main { color: inherit; text-decoration: none; }
.assign-row .item-main:hover .item-title { color: var(--blue); }

/* ---------- Bascule liste et agenda ---------- */
.seg { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.seg a { padding: 7px 16px; border-radius: 999px; font-weight: 650; font-size: 14px; color: var(--muted); text-decoration: none; }
.seg a:hover { color: var(--text); }
.seg a[aria-current="page"] { background: var(--ink); color: #fff; }

/* ---------- Agenda ---------- */
.ag-connect { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.ag-connect > div:first-child { width: 48px; height: 48px; border-radius: 50%; background: var(--blue-tint); color: var(--blue); display: flex; align-items: center; justify-content: center; flex: none; }
.ag-connect > div:nth-child(2) { flex: 1 1 auto; }
.ag-connect h2 { font-size: 17px; margin-bottom: 4px; }
.ag-connect p { margin: 0; }
.ag-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ag-nav { display: flex; align-items: center; gap: 4px; }
.ag-week { font-size: 18px; margin: 0; flex: 1 1 auto; }
.ag-week::first-letter { text-transform: uppercase; }
.ag-state { font-size: 13px; }
.ag-state .i { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.ag-days { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ag-row .t-title { white-space: normal; overflow: visible; }
.ag-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 18px 8px; }
.ag-day.today { border-color: var(--blue-line); box-shadow: inset 3px 0 0 var(--blue); }
.ag-day.past { opacity: .78; }
.ag-day h3 { font-size: 15px; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ag-day h3::first-letter { text-transform: uppercase; }
.ag-empty { color: var(--faint); font-size: 13.5px; margin: 0 0 8px; }
.ag-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ag-items .ag-row:last-child { border-bottom: 0; }
.ag-time { width: 56px; flex: none; font-weight: 750; font-size: 14px; font-variant-numeric: tabular-nums; }
.ag-time small { display: block; font-weight: 600; font-size: 12px; color: var(--faint); }
.ag-dot { width: 26px; height: 26px; flex: none; display: flex; align-items: center; justify-content: center; }
.ag-dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.ag-main { flex: 1 1 auto; min-width: 0; }
.ag-title { font-weight: 650; font-size: 14.5px; overflow-wrap: anywhere; }
.ag-sub { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ag-sub .i { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }
.ag-src { font-size: 11.5px; font-weight: 700; color: var(--blue-deep); background: var(--blue-tint); border-radius: 999px; padding: 2px 8px; flex: none; }
.ag-src.task { color: var(--muted); background: var(--paper); }
.ag-row.task-row.done .ag-title { text-decoration: line-through; color: var(--faint); }
.ag-today { margin: 0 0 12px; padding: 10px 12px 4px; border-radius: 6px; background: #f6f9fb; border: 1px solid var(--line); }
.ag-today-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.ag-today .ag-row { padding: 7px 0; }
.ag-today .ag-src { display: none; }
.ag-hint { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--muted); margin: 0 0 10px; }
.ag-hint .i { margin-top: 2px; flex: none; }
.ag-warn { font-size: 12.5px; color: var(--warning); margin: 6px 0; }
.cal-step + .cal-step { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.cal-step h3 { font-size: 16px; margin-bottom: 6px; }
.cal-step > p.muted { margin: 0 0 12px; font-size: 14px; }
.cal-status { font-size: 13.5px; margin: -6px 0 10px; }
.cal-status .i { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }
.cal-help { font-size: 13.5px; margin: 0 0 12px; }
.cal-help summary { cursor: pointer; font-weight: 650; color: var(--blue); }
.cal-help p { margin: 8px 0 0; }
.cal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.copy-field { display: flex; gap: 8px; margin-bottom: 10px; }
.copy-field input { flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--muted); }
.spinner.sm { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; margin-right: 6px; }

/* ---------- Estimation ---------- */
.est-lead { margin: -8px 0 14px; font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.est-form { margin-bottom: 16px; }
.est-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .7fr); gap: 14px; }
.est-more { margin: 2px 0 14px; }
.est-more summary { cursor: pointer; font-weight: 650; color: var(--blue); font-size: 14px; margin-bottom: 12px; }
.est-more .est-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.est-go { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.est-go .muted { font-size: 13.5px; color: var(--danger); }
.ac { position: relative; }
.ac input { width: 100%; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 25; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-control); box-shadow: var(--shadow-pop); max-height: 320px; overflow-y: auto; padding: 4px; }
.ac-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: 4px; font: inherit; font-size: 14.5px; color: var(--text); cursor: pointer; }
.ac-item .i { color: var(--faint); flex: none; }
.ac-item:hover, .ac-item.on { background: var(--blue-tint); }
.ac-empty { margin: 0; padding: 10px 12px; color: var(--muted); font-size: 14px; }
.est-loading { display: flex; gap: 14px; align-items: flex-start; }
.est-loading p { margin: 4px 0 0; font-size: 13.5px; }
.est-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: stretch; }
.est-hero { background: var(--ink); color: #fff; border-color: var(--ink); display: flex; flex-direction: column; }
.est-label { font-size: 13px; font-weight: 700; color: #9fc3d4; }
.est-value { font-size: clamp(34px, 4.6vw, 48px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin-top: 6px; font-variant-numeric: tabular-nums; }
.est-range { color: #b9c6cd; margin-top: 6px; font-size: 15px; }
.est-adjust { margin-top: 18px; }
.est-adjust label { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: #b9c6cd; font-weight: 600; }
.est-adjust output { color: #fff; font-weight: 800; font-variant-numeric: tabular-nums; }
.est-adjust input[type=range] { width: 100%; accent-color: var(--blue); margin-top: 6px; }
.est-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin: 20px 0 0; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .14); }
.est-facts dt { font-size: 12.5px; color: #9fb0b9; font-weight: 600; }
.est-facts dd { margin: 2px 0 0; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.est-note { font-size: 13px; color: #f3d28f; margin: 14px 0 0; display: flex; gap: 6px; align-items: flex-start; }
.est-note .i { flex: none; margin-top: 2px; }
.est-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 20px; }
.est-hero .btn:not(.btn-primary) { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.est-hero .btn:not(.btn-primary):hover { border-color: #fff; }
.est-stats h2 { font-size: 17px; margin-bottom: 16px; }
.est-box-track { position: relative; height: 34px; border-radius: 4px; background: repeating-linear-gradient(90deg, var(--paper) 0 calc(10% - 1px), var(--line) calc(10% - 1px) 10%); border: 1px solid var(--line); }
.est-box-iqr { position: absolute; top: 6px; bottom: 6px; background: var(--blue-tint); border: 1.5px solid var(--blue); border-radius: 3px; }
.est-box-med { position: absolute; top: 2px; bottom: 2px; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: 2px; }
.est-box-legend { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.est-box-legend span:nth-child(2) { text-align: center; color: var(--text); font-weight: 650; }
.est-years { display: grid; gap: 8px; }
.est-year { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.est-year .y { font-weight: 750; }
.est-year .bar { height: 10px; background: var(--paper); border-radius: 999px; overflow: hidden; }
.est-year .bar span { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.est-year .v { font-weight: 750; white-space: nowrap; }
.est-year .n { color: var(--faint); font-size: 12.5px; white-space: nowrap; min-width: 64px; text-align: right; }
.est-src { font-size: 12.5px; color: var(--faint); margin: 14px 0 0; }
.est-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.est-tools select { width: auto; }
.switch.sm { margin: 0; font-size: 13.5px; }
.est-sales td.r, .est-sales th.r { text-align: right; white-space: nowrap; }
.est-sales tr.sim td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
.est-sales .chip { height: 20px; font-size: 11px; padding: 0 6px; }
.est-place .card h2 { font-size: 17px; }
.est-kv { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px 16px; margin: 0; }
.est-kv dt { font-size: 13px; font-weight: 700; color: var(--muted); padding-top: 2px; }
.est-kv dd { margin: 0; font-size: 14px; }
.est-kv dd small { display: block; color: var(--muted); font-size: 12.5px; }
.est-kv dd a { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; margin-top: 4px; }
.est-kv .chips { gap: 6px; }
.est-dpe { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.est-dpe li { display: flex; gap: 10px; align-items: flex-start; }
.est-dpe li small { display: block; color: var(--muted); font-size: 12px; }
.dpe { width: 26px; height: 26px; border-radius: 4px; background: var(--dpe); color: #10181e; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 14px; }
.est-links { display: grid; gap: 8px; }
.est-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; color: inherit; text-decoration: none !important; }
.est-link:hover { border-color: var(--blue-line); background: #fafcfd; }
.est-link > span:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.est-link b { display: block; font-size: 14.5px; }
.est-link small { display: block; color: var(--muted); font-size: 12.5px; }
.est-link .tool-ico { width: 36px; height: 36px; }
.est-link > .i { color: var(--faint); }
.est-disclaimer { font-size: 12.5px; color: var(--faint); margin: 16px 0 0; text-align: center; }
.est-pre { white-space: pre-wrap; font: inherit; font-size: 13px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin: 0 0 14px; max-height: 220px; overflow: auto; }
.tools-title { font-size: 15px; color: var(--muted); margin: 0 0 10px; }
.tools + .tools-title { margin-top: 22px; }
.tools.inapp .tool { border-color: var(--blue-line); }
.tools.inapp .tool-ico { background: var(--blue); }
@media (max-width: 860px) {
  .seg { display: flex; }
  .seg a { flex: 1 1 0; text-align: center; padding: 8px 10px; }
  .ag-connect { flex-direction: column; align-items: flex-start; }
  .ag-bar { gap: 8px; }
  .ag-week { order: -1; flex-basis: 100%; font-size: 17px; }
  .ag-day { padding: 12px 14px 6px; }
  .ag-time { width: 46px; font-size: 13.5px; }
  .ag-src { display: none; }
  .est-row, .est-more .est-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .est-row .field:first-child { grid-column: 1 / -1; }
  .est-top { grid-template-columns: minmax(0, 1fr); }
  .est-kv { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .est-kv dd { margin-bottom: 12px; }
  .est-sales thead { display: none; }
  .est-sales tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .est-sales td { border: 0 !important; padding: 0 !important; text-align: left !important; }
  .est-sales td:nth-child(1) { grid-column: 1; color: var(--muted); font-size: 12.5px; }
  .est-sales td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; font-weight: 650; }
  .est-sales td.r { font-size: 13px; color: var(--text); }
  .est-sales td.r::before { content: attr(data-l) " "; color: var(--faint); }
  .est-sales td.r:empty { display: none; }
  .est-sales td.r b { color: var(--text); }
}

/* ---------- Filigrane du logo ---------- */
/* Le logo (assets/img/filigrane.svg, noir sur fond transparent) apparaît en filigrane :
   au fond de chaque page, dans les cartes marquantes, sur l'écran de connexion et sur les documents. */
/* Filigrane de page : posé au-dessus du contenu comme dans un papier filigrané, très léger,
   sans capter les clics ; masqué sur les pages qui portent déjà le leur (module, chapitre, document). */
.filigrane-page {
  position: fixed; z-index: 20; pointer-events: none;
  right: clamp(24px, 3.5vw, 56px); bottom: clamp(20px, 4vh, 48px);
  width: clamp(260px, 28vw, 480px); aspect-ratio: 1598 / 908;
  background: url("../img/filigrane.svg") center / contain no-repeat;
  opacity: .035;
}
.shell:has(.m-hero, .lesson-card, .doc, .f-hero) .filigrane-page { display: none; }
.wm { position: relative; isolation: isolate; }
.wm::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  right: var(--wm-x, 22px); bottom: var(--wm-y, 18px);
  width: var(--wm-w, 190px); aspect-ratio: 1598 / 908;
  background: url("../img/filigrane.svg") center / contain no-repeat;
  opacity: var(--wm-o, .055);
}
.wm-crop { overflow: hidden; --wm-x: -36px; --wm-y: -30px; --wm-w: 300px; }
.wm-light::after { filter: invert(1); --wm-o: .085; }
.wm-top::after { top: var(--wm-y, 26px); bottom: auto; }
.m-hero.wm { --wm-w: 440px; --wm-x: -60px; --wm-y: -64px; }
.lesson-card.wm { --wm-w: 170px; --wm-x: 32px; --wm-y: 30px; }
.lesson-card.wm > h1 { padding-right: 176px; }
.auth-side { isolation: isolate; }
.auth-side::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  right: -110px; top: 26%; width: 640px; aspect-ratio: 1598 / 908;
  background: url("../img/filigrane.svg") center / contain no-repeat;
  filter: invert(1); opacity: .06;
}
.doc { position: relative; isolation: isolate; }
.doc-wm { position: absolute; z-index: -1; left: 50%; top: 50%; width: 70%; max-width: 560px; height: auto; transform: translate(-50%, -50%); opacity: .05; pointer-events: none; user-select: none; }
@media (prefers-contrast: more), (forced-colors: active) {
  .filigrane-page, .doc-wm { display: none; }
  .wm::after, .auth-side::before { content: none; }
}

/* ---------- Impression (attestations, relevés) ---------- */
.doc { background: #fff; color: #111; max-width: 820px; margin: 0 auto; padding: 56px 64px; border: 1px solid var(--line); border-radius: 4px; font-size: 14px; line-height: 1.55; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; border-bottom: 2px solid #111; padding-bottom: 18px; margin-bottom: 28px; }
.doc-head .org b { display: block; font-size: 16px; }
.doc-head .org span { display: block; color: #444; font-size: 13px; }
.doc-head img { height: 44px; width: auto; }
.doc h1 { font-size: 22px; letter-spacing: .14em; text-transform: uppercase; text-align: center; margin: 8px 0 28px; }
.doc h2 { font-size: 14px; letter-spacing: .1em; text-transform: uppercase; margin: 22px 0 8px; }
.doc table.info { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.doc table.info td { padding: 6px 0; vertical-align: top; border-bottom: 1px solid #e5e5e5; }
.doc table.info td:first-child { width: 220px; color: #555; }
.doc table.lines { width: 100%; border-collapse: collapse; font-size: 13px; }
.doc table.lines th, .doc table.lines td { border: 1px solid #cfcfcf; padding: 6px 8px; text-align: left; }
.doc table.lines th { background: #f2f2f2; }
.doc table.sign { width: 100%; border-collapse: collapse; margin-top: 36px; }
.doc table.sign td { border: 1px solid #111; padding: 14px 16px; vertical-align: top; width: 50%; height: 120px; }
.doc .legal { font-size: 11.5px; color: #555; margin-top: 26px; }
.doc-actions { display: flex; gap: 8px; justify-content: center; margin: 0 auto 18px; flex-wrap: wrap; }

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .rail, .topbar, .tabbar, .fab, .doc-actions, .toasts, .back-link, .no-print { display: none !important; }
  .main { margin: 0; padding: 0; }
  .view { max-width: none; }
  .doc { border: 0; padding: 0; max-width: none; }
  .filigrane-page { display: none !important; }
  .doc-wm { position: fixed; }
}

/* ---------- Mobile ---------- */
@media (max-width: 1080px) {
  .grid-main, .f-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .filigrane-page { right: auto; left: 50%; transform: translateX(-50%); width: min(68vw, 340px); bottom: calc(var(--tabbar) + 28px + env(safe-area-inset-bottom)); }
  .m-hero.wm { --wm-w: 300px; --wm-x: -70px; --wm-y: -40px; }
  .lesson-card.wm { --wm-w: 130px; --wm-x: 18px; --wm-y: 18px; }
  .lesson-card.wm > h1 { padding-right: 0; }
  .lesson-card.wm::after { top: auto; bottom: var(--wm-y); }
  .auth-side::before { width: 420px; right: -120px; top: 8px; }
  body { font-size: 15px; background: var(--paper); }
  .rail { display: none; }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 40; height: calc(var(--topbar) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 6px 0 6px;
    background: var(--ink); color: #fff; align-items: center; gap: 4px;
  }
  .topbar .brand { padding: 0 8px; flex-direction: row; align-items: center; gap: 10px; }
  .topbar .logo-img { height: 26px; }
  .topbar .wordmark { font-size: 16px; }
  .topbar .wordmark-sub { display: none; }
  .topbar .icon-btn:hover { background: var(--ink-3); }
  .topbar .avatar { width: 34px; height: 34px; font-size: 12.5px; }
  .main { margin: 0; padding: 18px 16px calc(var(--tabbar) + 96px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 11px; font-weight: 700; text-decoration: none !important; position: relative; }
  .tab .i { width: 22px; height: 22px; }
  .tab.active { color: var(--blue); }
  .tab.active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2.5px; background: var(--blue); border-radius: 0 0 2px 2px; }
  .tab .badge { position: absolute; top: 6px; left: calc(50% + 6px); height: 17px; min-width: 17px; font-size: 10.5px; padding: 0 4px; }
  .fab {
    display: flex; position: fixed; right: 16px; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); z-index: 35;
    width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; align-items: center; justify-content: center;
    box-shadow: 0 10px 24px rgba(5, 82, 138, .35); cursor: pointer;
  }
  .fab .i { width: 26px; height: 26px; stroke-width: 2.2; }
  .page-head { margin-bottom: 16px; }
  .page-head .page-actions .btn-primary.desk { display: none; }
  .hello .page-actions { display: none; }
  h1, .hello h1 { font-size: 25px; }
  .detail-head h1 { font-size: 24px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .row3 { grid-template-columns: 1fr 1fr; }
  .card { padding: 16px; }
  .item { padding: 12px 14px; gap: 12px; }
  .list-group { padding: 8px 14px 4px; }
  .pipe-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools:not(.big) { display: flex; overflow-x: auto; gap: 8px; margin: 0 -16px 18px; padding: 0 16px 2px; scroll-snap-type: x proximity; scroll-padding-inline: 16px; scrollbar-width: none; }
  .tools:not(.big)::-webkit-scrollbar { display: none; }
  .tools:not(.big) .tool { flex: 0 0 auto; scroll-snap-align: start; gap: 10px; min-height: 0; padding: 8px 14px 8px 8px; }
  .tools:not(.big) .tool-ico { width: 36px; height: 36px; }
  .tools:not(.big) .tool-name { font-size: 14px; white-space: nowrap; }
  .tools:not(.big) .tool-desc.show { white-space: nowrap; }
  .tool .ext { display: none; }
  .tools.big .tool-desc { display: block; }
  .tools.big { grid-template-columns: minmax(0, 1fr); }
  .tools.big .tool { flex-direction: row; align-items: center; }
  .kv { grid-template-columns: 112px 1fr; }
  .lesson-card { padding: 22px 18px; }
  .prose { font-size: 16px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .m-hero { padding: 22px 18px; }
  .m-hero h1 { font-size: 24px; }
  .overlay { align-items: flex-end; padding: 0; }
  .sheet, .sheet.wide, .sheet.small { width: 100%; max-height: 94vh; border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding-bottom: env(safe-area-inset-bottom); animation: slideup .22s cubic-bezier(.2, .8, .2, 1); }
  .sheet-body { padding: 16px 18px 6px; }
  .sheet-foot { padding: 12px 18px; }
  .sheet-foot .btn { flex: 1 1 auto; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { padding: 28px 22px 30px; min-height: 0; }
  .auth-side h1 { font-size: 28px; margin-top: 26px; }
  .auth-side p { font-size: 15px; }
  .auth-side .auth-foot, .auth-plan { display: none; }
  .auth-main { align-items: flex-start; padding: 28px 22px 40px; }
  .toasts { bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); }
  .doc { padding: 28px 20px; }
  .doc table.info td:first-child { width: 130px; }
  .quick { gap: 6px; }
  table.data th, table.data td { padding: 10px; }
}
@keyframes slideup { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
@media (max-width: 520px) {
  .row2, .row3 { grid-template-columns: minmax(0, 1fr); }
  .themes { grid-template-columns: minmax(0, 1fr); }
  .quickadd { flex-wrap: wrap; }
  .quickadd input[name=title] { flex-basis: 100%; }
  .quickadd select, .quickadd button { flex: 1 1 auto; }
  .cote-value { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Version 1.2 : logiciels en onglets ---------- */
.rail { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; }
.rail-link.ext .ext-mark { margin-left: auto; width: 14px; height: 14px; opacity: .55; }
.rail-link.ext:hover .ext-mark { opacity: 1; }
.rail .rail-sep:first-of-type { margin-top: 18px; }
.est-tools-bar { display: flex; gap: 10px; flex-wrap: wrap; margin: -4px 0 16px; }
.est-tool { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); color: inherit; text-decoration: none !important; min-width: min(100%, 300px); }
.est-tool:hover { border-color: var(--blue-line); }
.est-tool b { display: block; font-size: 14.5px; }
.est-tool small { display: block; color: var(--muted); font-size: 12.5px; }
.est-tool .tool-ico { width: 36px; height: 36px; }
.est-tool > .i { margin-left: auto; color: var(--faint); }
.toolbar .seg { margin: 0; }
.toolbar-select { width: auto; min-height: 40px; }

/* Estimation : loyer de marché, fonds, avis de valeur */
.est-big { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 2px 0 6px; font-variant-numeric: tabular-nums; }
.est-big small { display: block; font-size: 13.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
[data-loyer] .est-facts { border-top-color: var(--line); margin-top: 14px; padding-top: 14px; }
[data-loyer] .est-facts dt { color: var(--muted); }
[data-loyer] .est-note { color: var(--warning); }
.est-note.warn { color: #6d4509 !important; background: var(--warning-tint); border-radius: 6px; padding: 8px 10px; }
.est-fonds { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.est-fonds li { display: grid; gap: 1px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.est-fonds li span { color: var(--muted); font-size: 12.5px; }
button.est-link { width: 100%; background: var(--surface); font: inherit; text-align: left; cursor: pointer; }
.doc .avis-value { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; border: 2px solid #111; border-radius: 4px; margin: 6px 0 4px; }
.doc .avis-value b { font-size: 26px; letter-spacing: -0.01em; }
.doc .avis-value span { color: #333; }
.doc .reg-meta { font-size: 12.5px; color: #444; margin: -14px 0 18px; text-align: center; }
.doc.landscape { max-width: 1120px; padding: 40px 44px; }
.doc table.lines.reg { font-size: 11.5px; }
.doc table.lines.reg td small { color: #555; }
.reg-check { max-width: 1120px; margin: 0 auto 16px; }
.reg-check.ok { background: var(--success-tint); border-color: #bfe0cd; color: var(--success); }
.reg-check.ko { background: var(--danger-tint); border-color: #f2c4bf; color: var(--danger); }

/* Agendas multiples */
.ag-dot::before { background: var(--cal, var(--blue)); }
.ag-src { color: var(--cal, var(--blue-deep)); background: color-mix(in srgb, var(--cal, #086cb4) 12%, #fff); }
.ag-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -6px 0 14px; font-size: 13px; color: var(--muted); font-weight: 600; }
.ag-legend:empty { display: none; }
.ag-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ag-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--cal, var(--blue)); }
.ag-legend i.task { border-radius: 3px; background: var(--faint); }
.cal-list { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-card); }
.cal-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.cal-list li + li { border-top: 1px solid var(--line); }
.cal-color { width: 12px; height: 12px; border-radius: 50%; background: var(--cal); flex: none; }
.cal-who { flex: 1 1 auto; min-width: 0; display: grid; }
.cal-who small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-who .cal-st .i { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.cal-add { border: 1px dashed var(--line-strong); border-radius: var(--r-card); padding: 12px 12px 4px; margin: 0 0 12px; }
.cal-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 10px 0 4px; }
.cal-tabs button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; font-weight: 650; color: var(--muted); cursor: pointer; }
.cal-tabs button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.cal-colors { border: 0; padding: 0; margin: 4px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }
.cal-colors legend { margin-bottom: 8px; }
.cal-colors label { cursor: pointer; }
.cal-colors input { position: absolute; opacity: 0; pointer-events: none; }
.cal-colors span { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--cal); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.cal-colors input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.cal-colors input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Entreprises */
.co-mini p { margin: 4px 0 0; font-size: 13.5px; display: flex; gap: 6px; align-items: flex-start; }
.co-mini p.muted { display: block; }
.co-mini p .i { flex: none; margin-top: 2px; color: var(--faint); }
.co-mini-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.co-pick { display: grid; gap: 6px; max-height: 46vh; overflow-y: auto; }
.co-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); font: inherit; color: inherit; cursor: pointer; }
.co-row:hover { border-color: var(--blue-line); background: #fafcfd; }
.co-row > span:first-child { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
.co-row b { font-size: 15px; }
.co-row small { color: var(--muted); font-size: 12.5px; }
.co-row > .i { color: var(--faint); flex: none; }
.co-list { display: grid; gap: 8px; border: 0; }
.co-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.co-head p { margin: 2px 0 0; }
.co-card .est-facts { border-top-color: var(--line); margin: 12px 0 18px; padding-top: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.co-card .est-facts dt { color: var(--muted); }
.co-dir { margin: 0; padding: 0 0 0 18px; }
.co-dir li { margin: 2px 0; }
.co-actions { margin: 16px 0 0; justify-content: flex-start; }
.co-links { margin-top: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.co-ann { list-style: none; margin: 0; padding: 0; }
.co-ann li { display: grid; grid-template-columns: 92px auto minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.co-ann li:first-child { border-top: 0; }
.co-ann-date { font-variant-numeric: tabular-nums; color: var(--muted); }
.co-ann .chip { height: 22px; font-size: 11.5px; }
.co-row2 { grid-template-columns: minmax(0, 1fr) 140px; }
.co-sales td.r, .co-sales th.r { text-align: right; white-space: nowrap; }

/* Simulateurs */
.simu { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.simu > .card { margin-top: 0; }
.sim-out .page-actions { margin-top: 14px; }
.sim-out { position: sticky; top: 16px; background: var(--ink); color: #fff; border-color: var(--ink); }
.sim-out .est-src { color: #9fb0b9; }
.sim-out .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.sim-list { margin: 18px 0 0; border-top: 1px solid rgba(255, 255, 255, .14); }
.sim-res { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); font-size: 14px; }
.sim-res span { color: #c6d2d8; }
.sim-res b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sim-res.no b { color: #ffb4a8; }
.sim-res.yes b { color: #9fe0bc; }
.sim-check { display: flex; align-items: flex-end; }
.sim-check .switch { margin: 0 0 6px; }

/* Registre Tracfin et fiches de vigilance */
.kv dd small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; }
.fiche-no { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); text-decoration: none; }
.item .fiche-no { min-width: 58px; }
.chips .fiche-no { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12.5px; }
table.tracfin tbody tr { cursor: pointer; }
table.tracfin tbody tr:hover td { background: #fafcfd; }
table.tracfin td small, .tf-forma-t td small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.tf-forma { margin-top: 16px; }
.tf-decision { border-color: #e7c9cf; }
.histo { list-style: none; margin: 0; padding: 0; }
.histo li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; padding: 0 0 16px; position: relative; }
.histo li::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.histo li:last-child::before { display: none; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--blue); background: var(--surface); margin-top: 3px; }
.histo b { font-size: 14px; }
.tl-meta { display: block; color: var(--muted); font-size: 12.5px; }
.histo p { margin: 4px 0 4px; font-size: 13.5px; overflow-wrap: anywhere; }
.histo code { font-size: 11px; color: var(--faint); background: var(--paper); border-radius: 4px; padding: 1px 6px; }
.seg-radio { border: 0; padding: 0; margin: 0 0 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.seg-radio legend { margin-bottom: 8px; }
.seg-radio label { cursor: pointer; }
.seg-radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg-radio span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; font-weight: 650; font-size: 14px; color: var(--muted); }
.seg-radio input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg-radio input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.vig-risk { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-card); margin: 0 0 16px; font-size: 14px; position: sticky; top: -18px; z-index: 2; }
.vig-risk .i { flex: none; margin-top: 1px; }
.vig-risk.faible { background: var(--success-tint); color: var(--success); }
.vig-risk.moyen { background: var(--warning-tint); color: #6d4509; }
.vig-risk.eleve { background: var(--danger-tint); color: var(--danger); }
.vig-crit { display: grid; gap: 8px; margin-bottom: 6px; }
.cbx { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.cbx input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--ink); }
.vig-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.vig-file { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; max-width: 100%; }
.vig-file a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.vig-file .icon-btn { width: 26px; height: 26px; }
a.vig-file { margin: 0 6px 6px 0; padding-right: 12px; }
.vig-upload { cursor: pointer; }
.vig-alert { margin-top: 18px; padding: 12px 14px 4px; border: 1px solid #f2c4bf; background: #fffafa; border-radius: var(--r-card); }
.vig-alert-card { border-color: #f2c4bf; background: #fffafa; }
.mail-log { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.mail-log li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.mail-log li > span:last-child { display: grid; min-width: 0; }
.mail-log small { color: var(--muted); overflow-wrap: anywhere; }

@media print {
  @page landscape { size: A4 landscape; margin: 10mm; }
  .doc.landscape { page: landscape; max-width: none; padding: 0; }
  [data-est-page][hidden], .reg-check { display: none !important; }
}
@media (max-width: 860px) {
  .simu { grid-template-columns: minmax(0, 1fr); }
  .sim-out { position: static; }
  .co-card .est-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .co-ann li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .co-row2 { grid-template-columns: minmax(0, 1fr); }
  .est-tool { min-width: 0; flex: 1 1 100%; }
  .vig-risk { top: -14px; }
  .toolbar .seg { width: 100%; justify-content: space-between; }
}
/* Cartes côte à côte dans une grille : pas de décalage vertical hérité de .card + .card */
.grid-2 > .card + .card, .est-top > .card + .card { margin-top: 0; }

/* Téléphone : registre Tracfin et ventes de fonds présentés en fiches plutôt qu'en tableau */
@media (max-width: 860px) {
  .co-fonds-form .est-row { grid-template-columns: minmax(0, 1fr); }
  table.tracfin thead, .co-sales thead { display: none; }
  table.tracfin, table.tracfin tbody, .co-sales, .co-sales tbody { display: block; }
  table.tracfin tr, .co-sales tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.tracfin tr:last-child, .co-sales tr:last-child { border-bottom: 0; }
  table.tracfin td, .co-sales td { border: 0 !important; padding: 0 !important; text-align: left !important; }
  table.tracfin td:first-child { grid-column: 1; grid-row: 1; }
  table.tracfin td[data-l="Situation"] { grid-column: 2; grid-row: 1; justify-self: end; }
  table.tracfin td[data-l="Client"] { grid-column: 1 / -1; order: 1; }
  table.tracfin td[data-l="Opération"] { grid-column: 1 / -1; order: 2; color: var(--muted); font-size: 13.5px; }
  table.tracfin td[data-l="Risque"] { order: 3; }
  table.tracfin td[data-l="Fiche"] { order: 4; justify-self: end; }
  table.tracfin td[data-l="Inscrite le"] { order: 5; font-size: 13px; }
  table.tracfin td[data-l="Conseiller"] { order: 6; font-size: 13px; justify-self: end; }
  table.tracfin td[data-l="Inscrite le"]::before { content: "Inscrite le "; color: var(--faint); }
  table.tracfin td:empty { display: none; }
  .tf-forma-t thead { display: none; }
  .tf-forma-t, .tf-forma-t tbody { display: block; }
  .tf-forma-t tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tf-forma-t td { border: 0 !important; padding: 0 !important; }
  .tf-forma-t td[data-l="Arrivée"]::before { content: "Arrivée le "; color: var(--faint); }
  .tf-forma-t td[data-l="Formation"] { grid-column: 1 / -1; }
  .tf-forma-t td:empty { display: none; }
  .co-sales td:first-child { grid-column: 1; grid-row: 1; color: var(--muted); font-size: 12.5px; }
  .co-sales td[data-l="Prix"] { grid-column: 2; grid-row: 1; }
  .co-sales td[data-l="Activité"] { grid-column: 1 / -1; font-weight: 650; }
  .co-sales td[data-l="Adresse"] { grid-column: 1 / -1; font-size: 13.5px; }
  .co-sales td[data-l="Acquéreur"], .co-sales td[data-l="Cédant"] { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
  .co-sales td[data-l="Acquéreur"]::before, .co-sales td[data-l="Cédant"]::before { content: attr(data-l) " : "; color: var(--faint); }
  .co-sales td:empty { display: none; }
}

/* Ventes : graphique, indicateurs, échéances de cotisations, historique */
table.data td.r, table.data th.r { text-align: right; white-space: nowrap; }
table.data td small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }
table.data tfoot td { border-top: 1px solid var(--line-strong); border-bottom: 0; background: #fafbfa; }
table.ventes-t tbody tr, table.v-years tbody tr { cursor: pointer; }
table.ventes-t tbody tr:hover td, table.v-years tbody tr:hover td { background: #fafcfd; }
table.v-due tr.passee td { color: var(--muted); }
table.v-due tr.a_declarer td { background: #fffaf0; }
.v-rk { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--paper); font-size: 12px; font-weight: 800; color: var(--muted); }
tr:first-child .v-rk { background: var(--ink); color: #fff; }
.v-chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; align-items: end; height: 190px; padding-top: 4px; }
.v-col { display: grid; grid-template-rows: 18px minmax(0, 1fr) 20px; height: 100%; text-align: center; min-width: 0; }
.v-val { font-size: 10.5px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; }
.v-bar { position: relative; background: var(--paper); border-radius: 4px; overflow: hidden; }
.v-bar span { position: absolute; left: 0; right: 0; bottom: 0; background: var(--blue); border-radius: 4px 4px 0 0; min-height: 0; }
.v-col.cur .v-bar span { background: var(--ink); }
.v-lab { font-size: 11.5px; color: var(--muted); padding-top: 4px; white-space: nowrap; overflow: hidden; }
.v-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 4px; }
.v-kv div { background: var(--paper); border-radius: var(--r-control); padding: 10px 12px; }
.v-kv dt { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.v-kv dd { margin: 2px 0 0; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.v-next-line { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; font-size: 13.5px; color: var(--muted); }
.v-next-line b { color: var(--text); }
.v-next { display: grid; gap: 4px; margin: 0 0 12px; }
.v-next > b { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.v-next span { font-size: 14px; color: var(--muted); }
.v-next span b { color: var(--text); }
.v-rates { display: grid; gap: 0; margin: 16px 0 0; }
.v-rates div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.v-rates dt { color: var(--muted); }
.v-rates dd { margin: 0; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.v-rates dd small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.v-sim .field { margin-bottom: 0; }
.v-gauge + .v-gauge { margin-top: 18px; }
.v-gauge-h { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 6px; flex-wrap: wrap; }
.v-gauge-h span { color: var(--muted); font-variant-numeric: tabular-nums; }
.v-gauge-t { height: 10px; border-radius: 999px; background: var(--paper); overflow: hidden; }
.v-gauge-t span { display: block; height: 100%; background: var(--success); border-radius: 999px; }
.v-gauge.near .v-gauge-t span { background: var(--warning); }
.v-gauge.over .v-gauge-t span { background: var(--danger); }
.v-gauge p { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.v-filters { display: flex; flex-wrap: wrap; gap: 8px; }
button.item.v-item { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; font: inherit; cursor: pointer; padding: 10px 0; min-height: 0; }
button.item.v-item:last-child { border-bottom: 0; }
.card .list:has(.v-item) { border: 0; }

@media (max-width: 860px) {
  .v-chart { height: 160px; gap: 3px; }
  .v-col { grid-template-rows: minmax(0, 1fr) 18px; }
  .v-val { display: none; }
  .v-lab { font-size: 10px; }
  .v-kv dd { font-size: 16px; }
  table.ventes-t thead, table.v-due thead, table.v-years thead, table.v-rank thead, table.v-app thead { display: none; }
  table.ventes-t, table.ventes-t tbody, table.v-due, table.v-due tbody, table.v-due tfoot, table.v-years, table.v-years tbody, table.v-rank, table.v-rank tbody, table.v-app, table.v-app tbody { display: block; }
  table.ventes-t tr, table.v-due tr, table.v-years tr, table.v-rank tr, table.v-app tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.ventes-t tr:last-child, table.v-due tbody tr:last-child, table.v-years tr:last-child, table.v-rank tr:last-child, table.v-app tr:last-child { border-bottom: 0; }
  table.ventes-t td, table.v-due td, table.v-years td, table.v-rank td, table.v-app td { border: 0 !important; padding: 0 !important; text-align: left !important; background: none !important; }
  table.ventes-t td[data-l="Bien"] { grid-column: 1; grid-row: 1; }
  table.ventes-t td[data-l="Situation"] { grid-column: 2; grid-row: 1; justify-self: end; }
  table.ventes-t td[data-l="Date"] { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
  table.ventes-t td[data-l="Date"] small { display: inline; margin-left: 6px; }
  table.ventes-t td[data-l="Client"] { grid-column: 1 / -1; font-size: 13.5px; }
  table.ventes-t td[data-l="Client"] small { display: inline; margin-left: 8px; }
  table.ventes-t td.r, table.v-due td.r, table.v-years td.r, table.v-rank td.r, table.v-app td.r { font-size: 13px; }
  table.ventes-t td.r::before, table.v-due td.r::before, table.v-years td.r::before, table.v-rank td.r::before, table.v-app td.r::before { content: attr(data-l) " "; color: var(--faint); }
  table.ventes-t td[data-l="Conseiller"] { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
  table.v-due td[data-l="Période"] { grid-column: 1; }
  table.v-due td[data-l="État"] { grid-column: 2; grid-row: 1; justify-self: end; }
  table.v-due td[data-l="Date limite"]::before { content: "Date limite "; color: var(--faint); }
  table.v-due td:empty { display: none; }
  table.v-due tfoot tr { background: #fafbfa; }
  table.v-due tfoot td:empty { display: none; }
  table.v-years td[data-l="Année"], table.v-rank td[data-l="Conseiller"], table.v-app td[data-l="Apporteur"] { grid-column: 1 / -1; }
}

/* ---------- Recherche de biens par IA et rapprochement (1.5.0) ---------- */
.card .rp-list { border: 0; border-radius: 0; }
.rp-list .item.rp-item { padding: 10px 0; min-height: 0; gap: 10px; align-items: flex-start; }
.rp-list .item.rp-item:last-child { border-bottom: 0; }
.rp-item .item-title { font-size: 14.5px; }
.rp-item:hover .item-title { color: var(--blue); }
.rp-item .item-end { padding-top: 1px; }
.rp-warn { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 12.5px; font-weight: 650; color: var(--warning); }
.rp-count { margin: 14px 0 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.rp-empty { display: flex; gap: 8px; margin: 14px 0 0; padding: 12px 14px; border-radius: var(--r-card); background: var(--paper); color: var(--muted); font-size: 14px; }
.rp-empty .i { flex: none; margin-top: 2px; }
.sheet [data-rp-results] .rp-list .item.rp-item { padding: 10px 14px; }
.ia-status { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }
.ia-status.run { padding: 10px 12px; border-radius: var(--r-card); background: var(--blue-tint); color: var(--blue-deep); border: 1px solid var(--blue-line); }
.ia-status.run .spinner { flex: none; margin-top: 2px; }
.ia-list { display: grid; }
.ia-bien { padding: 12px 0; border-top: 1px solid var(--line); }
.ia-list > .ia-bien:first-child { border-top: 0; padding-top: 2px; }
.ia-bien.retenu { box-shadow: inset 3px 0 0 var(--success); padding-left: 12px; }
.ia-bien.ecarte .ia-b-title { color: var(--muted); }
.ia-b-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ia-b-title { font-weight: 700; font-size: 14.5px; color: var(--text); display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.ia-b-title .i { color: var(--blue); flex: none; }
.ia-b-title:hover { color: var(--blue); }
.ia-bien .item-sub { margin-top: 4px; }
.ia-src { color: var(--faint); }
.ia-b-why { margin: 6px 0 0; font-size: 13.5px; }
.ia-b-match { margin-top: 8px; font-size: 13.5px; }
.ia-b-match summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--blue); }
.ia-b-match .rp-list { margin-top: 4px; padding-left: 12px; border-left: 2px solid var(--blue-line); }
.ia-b-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ia-dropped { margin-top: 10px; font-size: 13.5px; }
.ia-dropped > summary { cursor: pointer; font-weight: 650; color: var(--muted); }
.ia-legal { display: flex; gap: 8px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.ia-legal .i { flex: none; margin-top: 1px; }
.ia-usage { margin: 4px 0 14px; padding: 12px 14px; border-radius: var(--r-card); background: var(--paper); font-size: 13.5px; }
.ia-usage p { margin: 0 0 6px; }
.ia-usage p.muted { font-size: 12.5px; }
.ia-usage .cal-help { margin: 8px 0 0; }
@media (max-width: 860px) {
  .ia-b-actions .btn { flex: 1 1 auto; justify-content: center; }
  .rp-item .item-end .chip { height: 24px; padding: 0 8px; font-size: 12px; }
}

/* ---------- Version 1.6.0 : navigation pensée d'abord pour le téléphone ---------- */
[hidden] { display: none !important; }
select { max-width: 100%; }
a, button, .tab, .nm-tile, .nm-row, .nm-r { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.badge.amber { background: var(--warning); }
.mob-only { display: none !important; }

/* Recherche dans la barre latérale (ordinateur) */
.rail-search {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; margin: 0 0 14px; padding: 0 10px 0 12px;
  border: 1px solid var(--ink-3); border-radius: var(--r-control); background: var(--ink-2); color: #9fb0b9; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left;
}
.rail-search:hover { color: #fff; border-color: #3a4650; }
.rail-search span { flex: 1 1 auto; }
.rail-search kbd { font: inherit; font-size: 11.5px; font-weight: 700; color: #7f919b; border: 1px solid var(--ink-3); border-radius: 4px; padding: 1px 6px; }

/* Barre d'outils des leads : les filtres restent en ligne sur ordinateur */
.toolbar-filters { display: contents; }

/* Recherche et menu complet */
.nm-search { position: relative; display: block; margin: 0 0 12px; }
.nm-search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.nm-search input[type=search] { min-height: 48px; padding-left: 44px; border-radius: 10px; background: var(--paper); border-color: var(--line); font-size: 16px; }
.nm-search input[type=search]:focus { background: var(--surface); }
.nm-hint { margin: 2px 2px 8px; color: var(--muted); font-size: 13.5px; }
.nm-none { display: flex; align-items: center; gap: 10px; margin: 8px 2px; padding: 12px 14px; border-radius: var(--r-card); background: var(--paper); color: var(--muted); font-size: 14px; }
.nm-none .i { flex: none; }
.nm-group { margin: 4px 0 12px; }
.nm-group h3, .nm-sec h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 6px; font-size: 12.5px; font-weight: 750; color: var(--muted); }
.nm-group h3 span { font-weight: 600; color: var(--faint); }
.nm-results-list, .nm-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.nm-results-list li + li, .nm-list li + li { border-top: 1px solid var(--line); }
.nm-r { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 12px; border: 0; background: none; color: var(--text); text-align: left; text-decoration: none !important; cursor: pointer; font: inherit; }
.nm-r:active, .nm-row:active, .nm-tile:active, .nm-c:active, .nm-ctx:active { background: var(--paper); }
.nm-r-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; background: var(--blue-tint); color: var(--blue-deep); }
.nm-r-ico .i { width: 18px; height: 18px; }
.nm-r-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.nm-r-main b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm-r-main small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm-r-end { flex: none; }
.nm-sec { margin: 14px 0 0; }
.nm-sec:first-child { margin-top: 2px; }
.nm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.nm-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 82px; padding: 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none !important; cursor: pointer; font: inherit; text-align: left;
}
.nm-tile:hover { border-color: var(--blue-line); }
.nm-tile.on { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.nm-tile-ico { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: var(--paper); color: var(--ink); }
.nm-tile.on .nm-tile-ico { background: var(--blue); color: #fff; }
.nm-tile-ico .i { width: 19px; height: 19px; }
.nm-tile-l { font-size: 13.5px; font-weight: 700; line-height: 1.25; }
.nm-tile > .badge { position: absolute; top: 10px; right: 10px; }
.nm-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 0 14px; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; font-weight: 650; text-decoration: none !important; cursor: pointer; text-align: left; }
.nm-row > span { flex: 1 1 auto; min-width: 0; }
.nm-row:hover { background: var(--paper); }
.nm-row.danger { color: var(--danger); }
.nm-row .nm-ext { flex: none; color: var(--faint); }
.nm-me { min-height: 62px; }
.nm-me span { display: flex; flex-direction: column; }
.nm-me small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.nm-version { margin: 16px 2px 4px; color: var(--faint); font-size: 12px; text-align: center; }
.nm-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.sheet.menu { width: min(640px, 100%); }
.sheet.menu .sheet-body { padding-top: 14px; padding-bottom: 18px; background: var(--paper); }
.sheet.menu .nm-search input[type=search] { background: var(--surface); }

/* Création rapide */
.nm-ctx { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; margin: 0 0 10px; padding: 10px 14px; border: 1px solid var(--blue-line); border-radius: 10px; background: var(--blue-tint); color: var(--blue-deep); font: inherit; text-align: left; cursor: pointer; }
.nm-ctx .nm-tile-ico { background: var(--blue); color: #fff; }
.nm-ctx span:last-child { display: flex; flex-direction: column; }
.nm-ctx b { font-size: 15.5px; }
.nm-ctx small { font-size: 12.5px; font-weight: 600; }
.nm-create { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.nm-c { display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.nm-c:hover { border-color: var(--blue-line); }
.nm-c > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.nm-c b { font-size: 14.5px; }
.nm-c small { color: var(--muted); font-size: 12px; line-height: 1.3; }

/* Dictée du journal */
.note-actions { margin-top: 8px; justify-content: flex-end; align-items: center; }
.btn.dictate { margin-right: auto; }
.btn.dictate.on { color: var(--danger); background: var(--danger-tint); }
.btn.dictate.on .i { animation: nm-pulse 1.2s ease-in-out infinite; }
@keyframes nm-pulse { 50% { opacity: .35; } }

@media (max-width: 860px) {
  .mob-only { display: inline-flex !important; }
  .desk-only { display: none !important; }
  .fab { display: none !important; }
  /* Les champs à 16 px évitent le zoom automatique de l'iPhone pendant la saisie */
  input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=url], input[type=search], select, textarea { font-size: 16px; }
  .page-head .sub { display: none; }
  .page-head { margin-bottom: 14px; }

  .topbar .icon-btn { width: 44px; height: 44px; }

  /* Barre du bas : translucide, création au centre */
  .tabbar {
    background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
    border-top: 1px solid rgba(16, 24, 30, .08);
  }
  .tab { border: 0; background: none; font: inherit; font-size: 11px; font-weight: 700; color: var(--faint); cursor: pointer; padding: 0; min-height: var(--tabbar); }
  .tab:active .i { transform: scale(.9); }
  .tab .i { transition: transform .12s ease-out; }
  .tab-create { color: var(--blue); }
  .tab-plus { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 32px; border-radius: 10px; background: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(5, 82, 138, .28); }
  .tab-create .tab-plus .i { width: 22px; height: 22px; stroke-width: 2.4; }
  .tab-create:active .tab-plus { transform: scale(.94); }
  .tab .badge { top: 5px; left: calc(50% + 5px); }

  /* Menu et feuilles : plein écran sur le téléphone, sortie par le même chemin que l'entrée */
  .sheet.menu { height: calc(100dvh - 24px - env(safe-area-inset-top)); max-height: none; }
  .sheet.menu .sheet-body { flex: 1 1 auto; padding: 12px 14px calc(18px + env(safe-area-inset-bottom)); }
  .sheet.menu .nm-search { position: sticky; top: -12px; z-index: 2; margin: -12px -14px 12px; padding: 12px 14px 10px; background: var(--paper); }
  .sheet.create .sheet-body { padding-bottom: 18px; }
  .overlay.closing .sheet { animation: slidedown .18s cubic-bezier(.4, 0, 1, 1) forwards; }

  /* Leads : recherche et bouton Filtres sur une ligne, filtres repliés */
  .toolbar-m { gap: 8px; }
  .toolbar-m .search { flex: 1 1 0; max-width: none; min-width: 0; }
  .toolbar-m .filters-toggle { flex: none; min-height: 44px; gap: 6px; }
  .toolbar-m .filters-toggle .badge { height: 18px; min-width: 18px; font-size: 11px; padding: 0 5px; }
  .toolbar-m .toolbar-filters { display: none; }
  .toolbar-m.show-filters .toolbar-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; flex-basis: 100%; order: 3; }
  .toolbar-m .toolbar-filters select { width: 100% !important; }
  .toolbar-m > .grow { display: none; }
  .toolbar-m .seg { order: 4; flex-basis: 100%; }
  .toolbar-m .seg button { flex: 1 1 0; justify-content: center; min-height: 40px; }
  .nm-grid { gap: 8px; }
}
@keyframes slidedown { from { transform: none; } to { transform: translateY(60%); opacity: 0; } }
@media (max-width: 860px) and (prefers-reduced-transparency: reduce) {
  .tabbar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (max-width: 380px) {
  .nm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nm-create { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .overlay.closing .sheet { animation: none; }
  .btn.dictate.on .i { animation: none; }
}
