/* =====================================================================
   HEPHIR · Suivi de chantier
   Style sobre et professionnel : papier chaud, encre graphite, un seul
   accent (orange HEPHIR), bordures fines, pas d’ombres décoratives.
   ===================================================================== */
@font-face { font-family: "Manrope"; src: url("/vitrine/fonts/manrope-latin.woff2") format("woff2"); font-weight: 500 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/vitrine/fonts/inter-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
::selection { background: #a7422b; color: #fff; }
html { scrollbar-color: #d9cdbd #faf8f4; }
:root {
  /* Charte hephir.com : bleu nuit, terracotta, papier, sable ; Manrope + Inter */
  --ink: #172b3a; --ink-2: #0f1f2b; --ink-3: #2c4152;
  --text: #172b3a; --muted: #52616a; --faint: #8a959b;
  --bg: #faf8f4; --surface: #ffffff; --surface-2: #f6f2ec; --surface-3: #efe8de;
  --line: #e9e0d4; --line-2: #d9cdbd;
  --accent: #a7422b; --accent-2: #8c3522; --accent-soft: #f3e2db;
  --ok: #2f7a52; --ok-soft: #e3f0e8; --bad: #b3261e; --bad-soft: #f8e1de;
  --warn: #8a5a00; --warn-soft: #f6ecd6; --info: #2b4f7e; --info-soft: #e4ebf3;
  --radius: 8px; --radius-lg: 14px;
  --nav-h: 60px; --top-h: 60px; --side-w: 240px; --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Manrope", "Inter", -apple-system, sans-serif;
  --orange: var(--accent); --orange-d: var(--accent-2); --green: var(--ok); --amber: var(--warn); --gray-l: var(--surface-2); --navy: var(--ink);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.02em; color: var(--ink); }
h1 { font-weight: 600; }
h1 { font-size: 1.4rem; font-weight: 600; }
h2 { font-size: 1.02rem; font-weight: 600; }
h3 { font-size: .95rem; font-weight: 600; }
small, .muted { color: var(--muted); }
.meta { color: var(--muted); font-size: .86rem; }
.meta .i, small .i { color: var(--faint); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
b, strong { font-weight: 600; }
.splash { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.pre { white-space: pre-line; }
.grow { flex: 1; min-width: 0; }
.hide-mobile { display: none; }
@media (min-width: 900px) { .hide-mobile { display: initial; } }
code { background: var(--surface-3); padding: 1px 4px; border-radius: 4px; font-size: .85em; }

/* ---------- Icônes (traits SVG, couleur = couleur du texte) ---------- */
.i { display: inline-block; width: 1.1em; height: 1.1em; flex: none; vertical-align: -.18em; margin-right: .3em; background-color: currentColor;
  -webkit-mask: var(--i) no-repeat center / contain; mask: var(--i) no-repeat center / contain; }
.btn .i, .chip .i, .nav .i, .fab .i, .tl-ico .i, .evt-ico .i, .lb-close .i, .actions-sheet .i, .pk-add .i, .quality .big .i, .tick .i, .hidden-badge .i, .st .i, .signed .i { margin-right: 0; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 38px; padding: .45rem .9rem; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .9rem; white-space: nowrap; color: var(--ink);
  text-decoration: none; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: var(--ink-3); border-color: var(--ink-3); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.small { min-height: 32px; padding: .25rem .65rem; font-size: .84rem; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.ghost-dark { background: transparent; color: #d8dade; border-color: var(--ink-3); }
.btn.ghost-dark:hover { background: var(--ink-2); color: #fff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Structure ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  height: var(--top-h); padding: 0 16px; padding-top: env(safe-area-inset-top, 0); background: var(--ink); color: #fff; }
.brand { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; }
.logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 5px; background: var(--accent); color: #fff; font-weight: 600; font-size: .95rem; }
.wordmark { font-family: var(--display); font-weight: 600; letter-spacing: .08em; font-size: .95rem; }
.userbox { display: flex; align-items: center; gap: .75rem; font-size: .88rem; min-width: 0; }
.userbox .who { text-align: right; line-height: 1.2; min-width: 0; color: #fff; }
.userbox .who span { display: block; color: #a9adb4; font-size: .76rem; }
@media (max-width: 520px) { .userbox .who { display: none; } }

.nav { position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; background: var(--surface); border-top: 1px solid var(--line); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: .68rem; font-weight: 600;
  text-decoration: none; position: relative; min-width: 0; }
.nav a .i { width: 20px; height: 20px; }
.nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nav a.active { color: var(--ink); }
.nav a.active::before { content: ""; position: absolute; top: -1px; left: 22%; right: 22%; height: 2px; background: var(--accent); }
main { padding: 20px 16px; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 88px); max-width: 1240px; margin: 0 auto; }

@media (min-width: 900px) {
  .nav { top: var(--top-h); bottom: 0; right: auto; width: var(--side-w); height: auto; flex-direction: column; justify-content: flex-start;
    padding: 20px 12px; border-top: 0; border-right: 1px solid var(--line); gap: 2px; background: var(--surface-2); }
  .nav a { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: .7rem; padding: .6rem .75rem; border-radius: var(--radius); font-size: .9rem; color: var(--ink-3); }
  .nav a .i { width: 18px; height: 18px; color: var(--muted); }
  .nav a:hover { background: var(--surface-3); }
  .nav a.active { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
  .nav a.active .i { color: var(--accent); }
  .nav a.active::before { display: none; }
  main { margin-left: var(--side-w); padding: 28px 36px 56px; }
  h1 { font-size: 1.6rem; }
}

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.card + .card, .stack > * + * { margin-top: 12px; }
.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.grid.kpis { grid-template-columns: repeat(2, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
@media (min-width: 900px) { .grid.kpis { grid-template-columns: repeat(4, 1fr); } }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 28px 0 12px; flex-wrap: wrap; }
.section-title h2 { margin: 0; font-size: .82rem; color: var(--muted); font-weight: 600; }
.section-title a { font-size: .86rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: .15rem 0 0; }

.kpi { padding: 16px 20px; display: flex; flex-direction: column-reverse; justify-content: flex-end; color: inherit; text-decoration: none;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.kpi span { display: block; color: var(--muted); font-size: .82rem; font-weight: 600; }
.kpi b { display: block; font-family: var(--display); font-size: 1.9rem; line-height: 1.1; font-weight: 600; letter-spacing: -.03em; color: var(--ink); margin-top: 6px; }
a.kpi:hover { background: var(--surface-2); }
.kpi.alert b { color: var(--bad); } .kpi.warn b { color: var(--warn); } .kpi.ok b { color: var(--ink); }

.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .45rem; border-radius: 4px; font-size: .74rem; font-weight: 600; background: var(--surface-3); color: var(--ink-3); white-space: nowrap; line-height: 1.5; }
.chip .i { width: .95em; height: .95em; }
.chip.green { background: var(--ok-soft); color: var(--ok); } .chip.red { background: var(--bad-soft); color: var(--bad); }
.chip.blue { background: var(--info-soft); color: var(--info); } .chip.amber { background: var(--warn-soft); color: var(--warn); }
.chip.orange { background: var(--accent-soft); color: var(--accent-2); } .chip.dark { background: var(--ink); color: #fff; }

.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); }
.progress.green > i { background: var(--ok); }

.chantier-card { display: flex; flex-direction: column; gap: 12px; color: inherit; padding: 0; overflow: hidden; text-decoration: none; transition: border-color .12s; }
.chantier-card:hover { border-color: var(--line-2); }
.chantier-card .cover { height: 128px; background: var(--surface-3) center/cover; position: relative; border-bottom: 1px solid var(--line); }
.chantier-card .cover .chip { position: absolute; top: 10px; left: 10px; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.chantier-card .cover .chip:not(.green):not(.red):not(.blue):not(.amber):not(.orange):not(.dark) { background: var(--surface); }
.chantier-card .body { padding: 2px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.chantier-card h3 { margin: 0; font-size: 1rem; }
.row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

.alert-list { list-style: none; margin: -6px 0; padding: 0; }
.alert-list li a { display: flex; gap: .75rem; align-items: flex-start; padding: 12px 2px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.alert-list li a:hover b { text-decoration: underline; }
.alert-list li:last-child a { border-bottom: 0; }
.alert-list b { font-weight: 600; }
.alert-list .lvl { width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; flex: none; }
.lvl.haute { background: var(--bad); } .lvl.moyenne { background: #c98a12; } .lvl.info { background: var(--faint); }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; font-size: .92rem; }

/* ---------- Fiche chantier ---------- */
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 20px; padding: 0 16px; border-bottom: 1px solid var(--line); position: sticky; top: var(--top-h); background: var(--bg); z-index: 10; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: .75rem .75rem; color: var(--muted); font-weight: 600; font-size: .9rem; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-color: var(--ink); }
.tabs a .chip { margin-left: .35rem; }
@media (min-width: 900px) { .tabs { margin: 0 0 20px; padding: 0; } }

.ring { --p: 0; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; flex: none; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring > div { width: 92px; height: 92px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; line-height: 1.05; }
.ring b { font-family: var(--display); font-size: 1.6rem; font-weight: 600; } .ring small { font-size: .82rem; }
.synth { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 20px; flex: 1; min-width: 220px; }
.facts div span { display: block; font-size: .82rem; color: var(--muted); font-weight: 600; }
.facts div b { font-weight: 600; }

/* Planning */
.gantt-row { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.gantt-row.clickable { cursor: pointer; }
.gantt-row.clickable:hover { background: var(--surface-2); }
.gantt-row:last-child { border-bottom: 0; }
.g-label { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.dot { width: 9px; height: 9px; border-radius: 2px; flex: none; display: inline-block; margin-right: 6px; vertical-align: middle; }
.g-label .dot { margin-right: 0; }
.g-track { position: relative; height: 16px; background: repeating-linear-gradient(90deg, transparent 0 calc(100%/12 - 1px), var(--line) calc(100%/12 - 1px) calc(100%/12)); background-color: var(--surface-2); border-radius: 3px; }
.g-bar { position: absolute; top: 3px; bottom: 3px; background: var(--line-2); border-radius: 2px; overflow: hidden; min-width: 4px; }
.g-bar > i { display: block; height: 100%; background: var(--ink-3); }
.g-bar.en_retard { background: var(--bad-soft); box-shadow: inset 0 0 0 1px var(--bad); } .g-bar.en_retard > i { background: var(--bad); }
.g-bar.terminee > i { background: var(--ok); }
.g-today { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--accent); }
.g-meta { display: flex; justify-content: space-between; gap: .5rem; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
@media (min-width: 900px) { .gantt-row { grid-template-columns: 300px 1fr 160px; align-items: center; gap: 16px; padding: 12px 6px; } .g-meta { flex-direction: column; align-items: flex-end; gap: 0; } }

/* Journal et photos */
.day { border-color: var(--line-2); }
.day-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 8px; }
.day-head h3 { margin: 0; }
.day-head h3::first-letter, .date-long::first-letter { text-transform: uppercase; }
.effectifs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 12px; }
.thumbs.big { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 4/3; border-radius: 4px; overflow: hidden; background: var(--surface-3); cursor: zoom-in; border: 0; padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.thumb .hidden-badge { position: absolute; top: 5px; right: 5px; background: rgba(22,24,27,.82); color: #fff; font-size: .68rem; padding: 2px 6px; border-radius: 3px; display: inline-flex; gap: 4px; align-items: center; }
.date-sep { margin: 24px 0 8px; font-weight: 600; display: flex; gap: .5rem; align-items: baseline; }

/* Contrôles */
.ctrl summary { list-style: none; cursor: pointer; }
.ctrl summary::-webkit-details-marker { display: none; }
.ctrl summary .row { justify-content: space-between; }
.point { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.point .lib { display: flex; gap: .5rem; align-items: flex-start; }
.point .lib b { font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: var(--surface); padding: .4rem .7rem; min-height: 36px; cursor: pointer; font-weight: 600; font-size: .82rem; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button:hover { background: var(--surface-2); }
.seg button.on.conforme { background: var(--ok); color: #fff; }
.seg button.on.non_conforme { background: var(--bad); color: #fff; }
.seg button.on.na { background: var(--ink-3); color: #fff; }
.point .comment { font-size: .86rem; color: var(--ink-3); background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 6px 12px; }
@media (min-width: 900px) { .point { grid-template-columns: 1fr auto; align-items: center; } .point .comment, .point .extra { grid-column: 1 / -1; } }

/* Réserves, événements */
.item { display: flex; gap: 16px; align-items: flex-start; }
.item .pic { width: 84px; height: 64px; border-radius: 4px; overflow: hidden; flex: none; background: var(--surface-3); }
.item .pic img { width: 100%; height: 100%; object-fit: cover; }
.evt-ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-3); flex: none; }
.filters { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.filters button { border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--radius); padding: .3rem .75rem; cursor: pointer; font-weight: 600; font-size: .84rem; color: var(--ink-3); }
.filters button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Espace client ---------- */
.hero { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: 24px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.hero h1 { color: #fff; }
.hero .ring { background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255,255,255,.14) 0); }
.hero .ring > div { background: var(--ink); color: #fff; }
.hero .meta, .hero small { color: #b5b9bf; }
.hero .contact { margin-top: 12px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero .contact a { color: #fff; border: 1px solid rgba(255,255,255,.28); padding: .35rem .8rem; border-radius: var(--radius); font-weight: 600; text-decoration: none; display: inline-flex; gap: .4rem; align-items: center; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.steps li:last-child { border: 0; }
.steps .st { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: .78rem; font-weight: 600; background: var(--surface-3); color: var(--muted); }
.steps .st.terminee { background: var(--ok); color: #fff; }
.steps .st.en_cours, .steps .st.en_retard { background: var(--ink); color: #fff; }
.banner { background: var(--warn-soft); color: #5c3d00; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; display: flex; justify-content: space-between; gap: .75rem; align-items: center; flex-wrap: wrap; border: 1px solid #e6d3a8; font-size: .92rem; }
.quality { display: flex; gap: 16px; align-items: center; }
.quality .big { width: 44px; height: 44px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; flex: none; }
.quality .big .i { width: 22px; height: 22px; }

/* ---------- Formulaires ---------- */
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 4px; color: var(--ink-3); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], input[type=search], select, textarea {
  width: 100%; min-height: 40px; padding: .5rem .65rem; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); transition: border-color .12s; }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22,24,27,.08); }
input[type=range] { width: 100%; accent-color: var(--ink); }
.check { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: 12px; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); margin-top: 2px; flex: none; }
.form-grid { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.eff-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.eff-table td, .eff-table th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; font-size: .88rem; }
.eff-table th { font-size: .82rem; color: var(--muted); }
.eff-table input { min-height: 36px; width: 70px; }
.error { color: var(--bad); font-weight: 600; margin: 0 0 12px; }

/* ---------- Fenêtres ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(16,18,21,.45); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--surface); width: 100%; max-height: 92vh; overflow: auto; border-radius: 12px 12px 0 0; padding: 20px 16px calc(20px + var(--safe-b)); animation: up .16s ease-out; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.05rem; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; position: sticky; bottom: calc(-20px - var(--safe-b)); background: var(--surface); padding: 12px 0; border-top: 1px solid var(--line); }
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (min-width: 700px) { .modal-back { align-items: center; } .modal { width: 620px; border-radius: var(--radius-lg); padding: 24px; } }
.actions-sheet { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.actions-sheet button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 8px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; cursor: pointer; }
.actions-sheet button:hover { background: var(--surface-2); }
.actions-sheet .i { width: 24px; height: 24px; color: var(--accent); }

.fab { position: fixed; right: 16px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 25; width: 54px; height: 54px; border-radius: 50%; border: 0;
  background: var(--ink); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(16,18,21,.28); }
.fab .i { width: 24px; height: 24px; }
@media (min-width: 900px) { .fab { bottom: 28px; right: 36px; } }

.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(10,11,13,.94); display: flex; flex-direction: column; color: #fff; }
.lightbox .lb-img { flex: 1; display: grid; place-items: center; padding: 12px; min-height: 0; }
.lightbox img { max-height: 100%; max-width: 100%; object-fit: contain; }
.lightbox .lb-bar { padding: 12px 16px calc(12px + var(--safe-b)); display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.1); }
.lightbox .lb-bar .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.lightbox .lb-close { position: absolute; top: 10px; right: 12px; background: rgba(255,255,255,.1); border: 0; color: #fff; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.lightbox .lb-nav { position: absolute; top: 45%; background: rgba(255,255,255,.1); border: 0; color: #fff; font-size: 1.6rem; width: 42px; height: 56px; cursor: pointer; border-radius: 4px; }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 20px); z-index: 70; background: var(--ink); color: #fff; padding: .65rem 1rem; border-radius: var(--radius); font-weight: 600; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; }
#toast.err { background: var(--bad); }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: var(--bg); }
.login-side { display: none; }
.login-main { display: grid; place-items: center; padding: 32px 20px; }
.login-box { width: 100%; max-width: 400px; }
.login-box h1 { font-size: 1.6rem; margin-top: 20px; }
.login-box > .muted { margin: 0 0 20px; }
.login-brand-mobile { color: var(--ink); }
@media (min-width: 900px) {
  .login { grid-template-columns: minmax(380px, 44%) 1fr; }
  .login-side { display: flex; flex-direction: column; justify-content: space-between; background: var(--ink); color: #fff; padding: 40px 48px; }
  .login-side small { color: #8d929a; }
  .login-pitch h2 { color: #fff; font-size: 2rem; line-height: 1.15; font-weight: 600; max-width: 14ch; margin-bottom: 16px; }
  .login-pitch p { color: #b5b9bf; max-width: 42ch; margin: 0; }
  .login-brand-mobile { display: none; }
  .login-box h1 { margin-top: 0; }
}
.demo-accounts { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 16px; }
.demo-accounts p { margin: 0 0 8px; font-size: .8rem; color: var(--muted); }
.demo-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; padding: 8px 2px; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; text-align: left; font-weight: 600; font-size: .9rem; }
.demo-row small { font-weight: 400; font-size: .8rem; }
.demo-row:hover span { text-decoration: underline; }

/* ================= CRM ================= */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
@media (min-width: 900px) { .kanban { margin: 0; padding-left: 0; padding-right: 0; } }
.kcol { flex: 0 0 82%; max-width: 290px; background: var(--surface-3); border-radius: var(--radius-lg); padding: 12px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 2px; min-height: 140px; }
@media (min-width: 900px) { .kcol { flex: 0 0 248px; } }
.kcol.over { outline: 2px dashed var(--accent); background: var(--accent-soft); }
.khead { display: flex; justify-content: space-between; align-items: center; }
.khead b { font-size: .8rem; }
.kbody { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; flex: 1; }
.deal { display: flex; flex-direction: column; gap: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px; color: inherit; cursor: grab; text-decoration: none; }
.deal:hover { border-color: var(--line-2); }
.deal.dragging { opacity: .5; }
.deal .amount { font-size: .92rem; }
.stepper { display: flex; overflow-x: auto; scrollbar-width: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stepper::-webkit-scrollbar { display: none; }
.stepper button { flex: 1 0 auto; border: 0; border-right: 1px solid var(--line); background: transparent; padding: .55rem .8rem; font-size: .78rem; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.stepper button:last-child { border-right: 0; }
.stepper button:hover { background: var(--surface-2); }
.stepper button.done { color: var(--ink-3); }
.stepper button.current { background: var(--ink); color: #fff; }
.task { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; flex: none; }
.tick:hover { border-color: var(--ok); background: var(--ok-soft); }
.timeline .tl { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline .tl:last-child { border-bottom: 0; }
.tl-ico { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); color: var(--ink-3); display: grid; place-items: center; flex: none; }
.version { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.version:last-child { border-bottom: 0; }
.version:hover { background: var(--surface-2); }

/* ================= Chiffrage ================= */
.docs-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.totals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; }
@media (min-width: 900px) { .totals { grid-template-columns: repeat(6, 1fr); } }
.totals div span { display: block; font-size: .82rem; color: var(--muted); font-weight: 600; }
.totals div b { font-family: var(--display); font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; }
.totals .hl b { color: var(--ok); }
.totals .hl2 b { color: var(--ink); font-size: 1.2rem; }
.lot-block { margin-top: 12px; }
.lot-head { padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.ligne { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-areas: "des des des" "u q pu" "tot tot tot" "bas bas bas"; gap: 6px 8px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.ligne:last-child { border-bottom: 0; }
.ligne input, .ligne select { min-height: 36px; padding: .35rem .5rem; }
.ligne .l-des { grid-area: des; } .ligne .l-u { grid-area: u; } .ligne .l-q { grid-area: q; } .ligne .l-pu { grid-area: pu; }
.ligne .l-tot { grid-area: tot; text-align: right; } .ligne .l-bas { grid-area: bas; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; justify-content: space-between; min-width: 0; } .ligne .l-sub { color: var(--muted); }
.ligne.lh { display: none; }
.ligne label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ligne label small { font-size: .7rem; color: var(--muted); font-weight: 600; }
.ligne label input, .ligne label select { width: 100%; }
.ligne.opt { background: #fbf6ea; }
.ligne input:disabled, .ligne select:disabled { background: transparent; border-color: transparent; color: var(--text); opacity: 1; }
@media (min-width: 900px) {
  .ligne { grid-template-columns: 1fr 80px 90px 110px 120px; grid-template-areas: "des u q pu tot" "bas bas bas bas bas"; padding: 8px 0; align-items: start; }
  .ligne.lh { display: grid; grid-template-areas: none; font-size: .82rem; color: var(--muted); font-weight: 600; }
  .ligne.lh span:nth-child(n+3) { text-align: right; }
  .ligne .l-q input, .ligne .l-pu input { text-align: right; }
  .ligne label small { display: none; }
  .ligne .l-sub { font-size: .78rem; }
  .ligne .l-tot { padding-top: 8px; }
}
.l-des { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.l-des textarea { flex: 1; min-width: 0; min-height: 36px; padding: .4rem .5rem; resize: none; overflow: hidden; line-height: 1.35; }
.ligne textarea:disabled { background: transparent; border-color: transparent; color: var(--text); opacity: 1; }
.ligne .l-check { width: 20px; height: 20px; min-height: 0; margin: 8px 0 0; padding: 0; flex: none; accent-color: var(--ink); }
.l-actions { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }
.l-actions .btn { min-height: 36px; padding-inline: 8px; font-size: .8rem; }
.l-actions .btn:disabled { opacity: .3; }
.l-actions .l-suppr { color: var(--bad); }
.lot-pied { margin-top: 12px; }
.l-groupe { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 8px); z-index: 20; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-top: 16px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(15, 31, 43, .18); }
.l-groupe[hidden] { display: none; }
.corbeille { margin-top: 12px; }
.corbeille .row { padding: 10px 0; border-bottom: 1px solid var(--line); gap: 12px; }
.corbeille .btn { flex: none; }
#toast.agir.show { pointer-events: auto; }
#toast button { margin-left: 10px; padding: 4px 10px; border: 1px solid #fff; border-radius: 6px; background: none; color: #fff; font: inherit; cursor: pointer; }
.pk-list { display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow: auto; margin-top: 8px; }
.pk { display: flex; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 8px 12px; cursor: pointer; }
.pk:hover { border-color: var(--line-2); background: var(--surface-2); }
.pk-price { white-space: nowrap; font-weight: 600; }
.pk-add { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; flex: none; color: var(--ink); font-weight: 600; }
.pk.added { border-color: var(--ok); background: var(--ok-soft); }
.pk.added .pk-add { background: var(--ok); color: #fff; border-color: var(--ok); }
.bib-row { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 12px 2px; cursor: pointer; }
.bib-row:hover { background: var(--surface-2); }
.bib-row b { white-space: nowrap; }

/* ================= Artisans, consultation, signature ================= */
.artisan-card { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; }
.artisan-card:hover { border-color: var(--line-2); }
.piece { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.piece:last-child { border-bottom: 0; }
.piece .grow { min-width: 180px; }
.pick-art { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow: auto; margin-bottom: 8px; }
.pa { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; cursor: pointer; }
.pa input { width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.pa:has(input:checked) { border-color: var(--ink); background: var(--surface-2); }
.pa.off { opacity: .55; cursor: not-allowed; }
.signed { margin-top: 12px; background: var(--ok-soft); color: #1d4a2f; border-radius: var(--radius); padding: 12px 16px; }
.consult.todo { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.steps-line { list-style: none; display: flex; padding: 0; margin: 16px 0 0; counter-reset: s; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.steps-line li { flex: 1; text-align: center; padding: 8px 4px; color: var(--muted); font-weight: 600; font-size: .82rem; counter-increment: s; border-right: 1px solid var(--line); }
.steps-line li:last-child { border-right: 0; }
.steps-line li::before { content: counter(s) " · "; }
.steps-line li.done { color: var(--ok); }
.steps-line li.current { background: var(--ink); color: #fff; }
.poste { padding: 8px 0; border-bottom: 1px solid var(--line); gap: 12px; }
.poste span { flex: 1; }
.poste.total { border-bottom: 0; font-size: 1.08rem; }
.how p { margin: 6px 0; color: var(--ink-3); }
.art-choice { display: flex; flex-direction: column; gap: 6px; }
.art-choice.chosen { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.art-choice p { margin: 4px 0; }
.quote { color: var(--ink-3); background: var(--surface-2); border-radius: 4px; padding: 6px 12px; }
.garanties { list-style: none; padding: 0; margin: 4px 0 8px; font-size: .86rem; }
.garanties li { padding: 2px 0; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.garanties li .i { color: var(--ok); margin: 0; }
.signed-card { border-color: var(--ok); background: var(--ok-soft); margin-top: 12px; }

/* ================= Assistant de chiffrage ================= */
.ia-resume { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px; margin-bottom: 12px; }
.ia-list { margin: 6px 0 12px; padding-left: 20px; }
.ia-list li { margin: 3px 0; }
.ia-lot { margin: 16px 0 4px; font-size: .82rem; color: var(--muted); }
.ia-ligne { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ia-ligne input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.ia-mt { white-space: nowrap; }
.ia-ligne:has(input:not(:checked)) { opacity: .45; }
details > summary { cursor: pointer; }

/* ================= Documents A4 ================= */
.doc-toolbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 16px; background: var(--ink); }
.doc-toolbar .btn:not(.primary):not(.dark) { background: transparent; color: #e4e6e9; border-color: var(--ink-3); }
.doc-toolbar .btn.dark { background: #fff; color: var(--ink); border-color: #fff; }
.doc-toolbar .btn.primary { background: var(--accent); border-color: var(--accent); }
.doc { background: #fff; max-width: 210mm; margin: 18px auto 40px; padding: 14mm 12mm; border: 1px solid var(--line); font-size: 12.5px; color: #111; }
@media (max-width: 700px) { .doc { margin: 0; padding: 16px; border: 0; } }
.doc-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 12px; }
.doc-brand { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; margin-bottom: 6px; letter-spacing: .08em; }
.doc-id { text-align: right; }
.doc-id h1 { font-size: 1.1rem; color: var(--ink); }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.doc-parties > div { border: 1px solid #ddd; border-radius: 4px; padding: 10px; display: flex; flex-direction: column; }
.doc-parties small { color: #666; text-transform: uppercase; font-size: .66rem; letter-spacing: .05em; }
.doc h2 { font-size: .95rem; margin: 18px 0 6px; color: var(--ink); border-bottom: 1px solid #ddd; padding-bottom: 4px; }
.doc h3 { font-size: .9rem; margin: 12px 0 4px; }
.doc p { margin: 4px 0 8px; }
.doc .small { font-size: 11px; color: #333; }
.dt { width: 100%; border-collapse: collapse; margin-top: 8px; }
.dt th { background: var(--ink); color: #fff; text-align: left; padding: 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.dt td { padding: 5px 6px; border-bottom: 1px solid #e6e6e6; vertical-align: top; }
.dt .n { width: 44px; color: #555; } .dt .c { text-align: center; width: 40px; } .dt .r { text-align: right; white-space: nowrap; }
.dt tr.lot td { background: #f2f1ed; font-weight: 700; padding-top: 8px; }
.dt tr.st td { font-weight: 700; text-align: right; border-bottom: 1.5px solid #bbb; }
.dt tr.opt td { color: #7a4c00; }
.tt { margin: 12px 0 0 auto; border-collapse: collapse; min-width: 60%; }
.tt td { padding: 5px 8px; border-bottom: 1px solid #e6e6e6; }
.tt .r { text-align: right; white-space: nowrap; }
.tt tr.ttc td { background: var(--ink); color: #fff; font-weight: 800; font-size: 1.05em; }
.sign { display: grid; gap: 12px; margin-top: 18px; }
.sign.two { grid-template-columns: 1fr 1fr; }
.sign > div { border: 1px solid #bbb; border-radius: 4px; min-height: 90px; padding: 8px; font-size: 11px; color: #444; }
.doc-foot { margin-top: 24px; padding-top: 8px; border-top: 1px solid #ddd; font-size: 10px; color: #666; text-align: center; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .doc-toolbar, #toast { display: none !important; }
  .doc { border: 0; margin: 0; padding: 0; max-width: none; }
  .dt thead { display: table-header-group; }
  .dt tr, .sign { break-inside: avoid; }
}

/* ---------- Jeu d'icônes (SVG en masque, dessin au trait) ---------- */
.i-plus { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.i-x { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E"); }
.i-check { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.i-check-circle { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8.5 12.5 2.5 2.5 4.5-5'/%3E%3C/svg%3E"); }
.i-pin { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.2-7-11.5a7 7 0 0 1 14 0C19 14.8 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E"); }
.i-phone { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h3.5l1.5 4.5-2.2 1.4a11 11 0 0 0 6.3 6.3l1.4-2.2L20 15.5V19a1.5 1.5 0 0 1-1.6 1.5C10.6 20 4 13.4 3.5 5.6A1.5 1.5 0 0 1 5 4z'/%3E%3C/svg%3E"); }
.i-mail { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3.5 7 8.5 6 8.5-6'/%3E%3C/svg%3E"); }
.i-calendar { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='2'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
.i-home { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10.5 12 4l8 6.5V20h-5.5v-5.5h-5V20H4z'/%3E%3C/svg%3E"); }
.i-grid { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='3.5' width='7' height='7' rx='1'/%3E%3Crect x='13.5' y='3.5' width='7' height='7' rx='1'/%3E%3Crect x='3.5' y='13.5' width='7' height='7' rx='1'/%3E%3Crect x='13.5' y='13.5' width='7' height='7' rx='1'/%3E%3C/svg%3E"); }
.i-briefcase { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='13' rx='2'/%3E%3Cpath d='M8.5 7V5.5A1.5 1.5 0 0 1 10 4h4a1.5 1.5 0 0 1 1.5 1.5V7M3 12.5h18'/%3E%3C/svg%3E"); }
.i-building { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 21V8l8-4 8 4v13M2.5 21h19M9 21v-5h6v5M8.5 10.5h1M14.5 10.5h1M8.5 13.5h1M14.5 13.5h1'/%3E%3C/svg%3E"); }
.i-hammer { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m13 7 4-4 4 4-4 4M13 7l-9.5 9.5a2 2 0 0 0 0 2.8l.2.2a2 2 0 0 0 2.8 0L16 10M13 7l3 3'/%3E%3C/svg%3E"); }
.i-users { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 7M18 14a6.5 6.5 0 0 1 3.5 6'/%3E%3C/svg%3E"); }
.i-user { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4.5 20.5a7.5 7.5 0 0 1 15 0'/%3E%3C/svg%3E"); }
.i-book { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5.5A2.5 2.5 0 0 1 6.5 3H20v15H6.5A2.5 2.5 0 0 0 4 20.5zM4 20.5A2.5 2.5 0 0 0 6.5 23H20v-5'/%3E%3C/svg%3E"); }
.i-settings { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h9M17 6h3M4 12h3M11 12h9M4 18h11M19 18h1'/%3E%3Ccircle cx='15' cy='6' r='2'/%3E%3Ccircle cx='9' cy='12' r='2'/%3E%3Ccircle cx='17' cy='18' r='2'/%3E%3C/svg%3E"); }
.i-eye { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.i-eye-off { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 3 18 18M10.6 5.6A9.5 9.5 0 0 1 12 5.5c6 0 9.5 6.5 9.5 6.5a16 16 0 0 1-2.8 3.6M6.6 6.6C3.9 8.4 2.5 12 2.5 12S6 18.5 12 18.5a9 9 0 0 0 4.4-1.1M9.9 9.9a3 3 0 0 0 4.2 4.2'/%3E%3C/svg%3E"); }
.i-trash { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5h16M9 6.5V4.5h6v2M6.5 6.5l1 13.5h9l1-13.5M10 10.5v6M14 10.5v6'/%3E%3C/svg%3E"); }
.i-edit { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15.5 4.5a2.1 2.1 0 0 1 3 3L8 18l-4 1 1-4z'/%3E%3C/svg%3E"); }
.i-pen { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h8.5M15.5 4.5a2.1 2.1 0 0 1 3 3L8 18l-4 1 1-4z'/%3E%3C/svg%3E"); }
.i-file { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H6.5A1.5 1.5 0 0 0 5 4.5v15A1.5 1.5 0 0 0 6.5 21h11a1.5 1.5 0 0 0 1.5-1.5V8zM14 3v5h5M8.5 13h7M8.5 16.5h7'/%3E%3C/svg%3E"); }
.i-camera { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5A1.5 1.5 0 0 1 5 7h2.5L9 4.5h6L16.5 7H19a1.5 1.5 0 0 1 1.5 1.5v10A1.5 1.5 0 0 1 19 20H5a1.5 1.5 0 0 1-1.5-1.5z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E"); }
.i-flag { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 21V4M5 4h12l-2.5 4.5L17 13H5'/%3E%3C/svg%3E"); }
.i-stop { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.3 3h7.4L21 8.3v7.4L15.7 21H8.3L3 15.7V8.3z'/%3E%3Cpath d='M12 8v5M12 16.2v.1'/%3E%3C/svg%3E"); }
.i-alert { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 2.5 20h19z'/%3E%3Cpath d='M12 10v4.5M12 17.2v.1'/%3E%3C/svg%3E"); }
.i-clock { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E"); }
.i-bell { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 16.5V11a6 6 0 0 1 12 0v5.5l1.5 1.5h-15zM10 21h4'/%3E%3C/svg%3E"); }
.i-message { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.5 12a8.5 8.5 0 0 1-12.3 7.6L3.5 20.5l1-4.4A8.5 8.5 0 1 1 20.5 12z'/%3E%3C/svg%3E"); }
.i-lock { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10.5' width='14' height='10' rx='2'/%3E%3Cpath d='M8 10.5V7.5a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E"); }
.i-shield { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 4.5 6v5.5c0 4.6 3.2 8 7.5 9.5 4.3-1.5 7.5-4.9 7.5-9.5V6z'/%3E%3Cpath d='m9 12 2.2 2.2L15.5 10'/%3E%3C/svg%3E"); }
.i-ban { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m5.7 5.7 12.6 12.6'/%3E%3C/svg%3E"); }
.i-star { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3.5 2.6 5.4 5.9.8-4.3 4.1 1 5.9L12 16.9l-5.2 2.8 1-5.9-4.3-4.1 5.9-.8z'/%3E%3C/svg%3E"); }
.i-inbox { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 13h5l1.5 3h4l1.5-3h5M5.5 5h13l2 8v5.5a1.5 1.5 0 0 1-1.5 1.5H5a1.5 1.5 0 0 1-1.5-1.5V13z'/%3E%3C/svg%3E"); }
.i-folder { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 6.5A1.5 1.5 0 0 1 5 5h4.5l2 2.5H19a1.5 1.5 0 0 1 1.5 1.5v9.5A1.5 1.5 0 0 1 19 20H5a1.5 1.5 0 0 1-1.5-1.5z'/%3E%3C/svg%3E"); }
.i-key { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='15' r='4'/%3E%3Cpath d='m11 12 9-9M16.5 6.5l2.5 2.5M14 9l2 2'/%3E%3C/svg%3E"); }
.i-send { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 3 10.5 13.5M21 3l-6.5 18-4-7.5L3 9.5z'/%3E%3C/svg%3E"); }
.i-printer { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 9V3.5h10V9M7 17.5H5a1.5 1.5 0 0 1-1.5-1.5v-5A1.5 1.5 0 0 1 5 9.5h14a1.5 1.5 0 0 1 1.5 1.5v5a1.5 1.5 0 0 1-1.5 1.5h-2'/%3E%3Crect x='7' y='14' width='10' height='7'/%3E%3C/svg%3E"); }
.i-refresh { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.3-5.7M20 4v5h-5'/%3E%3C/svg%3E"); }
.i-truck { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6h11v10h-11zM13.5 9.5h4l3 3V16h-7'/%3E%3Ccircle cx='6.5' cy='17.5' r='1.8'/%3E%3Ccircle cx='17' cy='17.5' r='1.8'/%3E%3C/svg%3E"); }
.i-cloud { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 18.5a4.5 4.5 0 0 1-.5-9 6 6 0 0 1 11.5 1.5A3.8 3.8 0 0 1 17.5 18.5z'/%3E%3C/svg%3E"); }
.i-info { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5.5M12 7.8v.1'/%3E%3C/svg%3E"); }
.i-calculator { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='3' width='14' height='18' rx='2'/%3E%3Cpath d='M8.5 7h7M8.5 11.5h.1M12 11.5h.1M15.5 11.5h.1M8.5 15h.1M12 15h.1M15.5 15h.1M8.5 18h.1M12 18h3.5'/%3E%3C/svg%3E"); }
.i-logout { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h4.5A1.5 1.5 0 0 1 20 5.5v13a1.5 1.5 0 0 1-1.5 1.5H14M10 16.5 5.5 12 10 7.5M5.5 12H15'/%3E%3C/svg%3E"); }

.userbox button.who { background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 6px; font: inherit; }
.userbox button.who:hover { background: var(--ink-2); }

.date-sep .date-long { display: inline-block; }

/* ================= Déboursé sec ================= */
.deb-kpi { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 900px) { .deb-kpi { grid-template-columns: repeat(4, 1fr); } }
.deb-carte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.deb-carte span { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; }
.deb-carte b { display: block; font-family: var(--display); font-size: 1.45rem; letter-spacing: -.02em; margin-top: 4px; }
.deb-carte.bon b { color: var(--ok); }
.deb-haut { display: grid; gap: 12px; margin-bottom: 14px; }
@media (min-width: 900px) { .deb-haut { grid-template-columns: 1fr 1.3fr; align-items: start; } }
.deb-synthese { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.deb-donut { position: relative; width: 150px; height: 150px; flex: none; }
.deb-donut svg { width: 100%; height: 100%; }
.deb-donut div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.deb-donut b { font-family: var(--display); font-size: 1.5rem; }
.deb-donut small { color: var(--muted); font-size: .75rem; }
.deb-legende { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; flex: 1; min-width: 180px; }
.deb-legende li { display: flex; gap: 10px; align-items: center; }
.deb-legende small { display: block; color: var(--muted); }
.deb-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; display: inline-block; background: var(--line-2); }
.deb-dot.vert { background: var(--ok); } .deb-dot.orange { background: var(--amber); } .deb-dot.rouge { background: var(--bad); }
.deb-lot { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.deb-lot:last-child { border-bottom: 0; }
.deb-barre { height: 10px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.deb-barre i { display: block; height: 100%; border-radius: 99px; background: var(--ink); }
.deb-barre.fin { height: 6px; margin-top: 8px; }
.deb-barre.fin i { background: var(--ok); }
.deb-plan-bloc { margin: 16px 0; }
.deb-onglets { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.deb-onglets button { border: 1px solid var(--line-2); background: var(--surface); padding: 8px 14px; border-radius: 99px; font: 600 .88rem var(--body, inherit); cursor: pointer; }
.deb-onglets button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.deb-plan-grille { display: grid; gap: 12px; }
@media (min-width: 900px) { .deb-plan-grille { grid-template-columns: 1.5fr 1fr; align-items: start; } }
.deb-plan { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.deb-plan img { display: block; width: 100%; height: auto; }
.deb-zone { position: absolute; border: 2px solid transparent; background: rgba(217, 104, 63, .0); border-radius: 4px; cursor: pointer; padding: 0; transition: background .15s, border-color .15s; }
.deb-zone:hover, .deb-zone:focus-visible { background: rgba(217, 104, 63, .18); border-color: #d9683f; outline: none; }
.deb-zone.on { background: rgba(217, 104, 63, .28); border-color: #d9683f; }
.deb-zone span { display: none; }
.deb-zone:hover span, .deb-zone.on span, .deb-zone:focus-visible span { display: grid; position: absolute; left: 4px; top: 4px; background: var(--ink); color: #fff; padding: 4px 7px; border-radius: 6px; font-weight: 600; font-size: .72rem; line-height: 1.2; text-align: left; white-space: nowrap; }
.deb-zone span small { font-weight: 500; opacity: .85; }
.deb-panneau { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.deb-panneau.vide p { color: var(--muted); }
.deb-kicker { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.deb-panneau h3 { margin: 4px 0 10px; font-family: var(--display); font-size: 1.35rem; }
.deb-chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.deb-chiffres div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.deb-chiffres b { display: block; font-size: 1rem; }
.deb-chiffres small { color: var(--muted); font-size: .72rem; }
.deb-note { font-size: .78rem; color: var(--muted); margin: 8px 2px 0; }
.deb-alerte { margin-bottom: 12px; border-color: var(--amber); }
.deb-groupe { display: flex; align-items: center; gap: 8px; margin: 18px 0 6px; font-family: var(--display); font-size: 1.05rem; }
.deb-ligne { display: grid; grid-template-columns: 14px 1fr; gap: 8px 10px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; }
.deb-ligne > .deb-dot { align-self: start; margin-top: 6px; }
.deb-ligne select, .deb-ligne input { grid-column: 2; min-height: 36px; width: 100%; padding: .3rem .5rem; font-size: .85rem; }
.deb-des { min-width: 0; }
.deb-des b { display: block; font-size: .92rem; line-height: 1.3; }
.deb-des small { color: var(--muted); font-size: .8rem; }
@media (min-width: 900px) {
  .deb-ligne { grid-template-columns: 14px minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1.4fr); }
  .deb-ligne select, .deb-ligne input { grid-column: auto; }
}

/* ================= Déboursé par étapes ================= */
.deb-resume { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
@media (min-width: 900px) { .deb-resume { grid-template-columns: repeat(4, 1fr); } }
a.deb-carte { text-decoration: none; color: inherit; display: block; }
a.deb-carte:hover { border-color: var(--ink); }
.deb-carte.total { background: var(--ink); color: #fff; }
.deb-carte.total span, .deb-carte.total small { color: #cbd5e1; }
.deb-carte.total b { color: #fff; }
.deb-carte small { display: block; color: var(--muted); margin-top: 4px; font-size: .78rem; }
.deb-legende-ligne { font-size: .82rem; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 4px 0 16px; }
.deb-legende-ligne .deb-dot { margin-left: 8px; }
.deb-step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; scroll-margin-top: 70px; }
.deb-step-tete { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 12px; }
.deb-step-tete h2 { margin: 2px 0 0; font-family: var(--display); font-size: 1.35rem; }
.deb-step-total { text-align: right; }
.deb-step-total b { display: block; font-family: var(--display); font-size: 1.5rem; }
.deb-step-total small { color: var(--muted); font-size: .78rem; }
.deb-men { display: grid; gap: 8px; }
.deb-men-ligne { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.deb-men-ligne input { min-height: 36px; padding: .3rem .5rem; font-size: .85rem; width: 100%; }
.deb-men-ligne b { font-size: .9rem; }
@media (min-width: 900px) { .deb-men-ligne { grid-template-columns: 70px 1.6fr 1.4fr 80px 80px 60px 90px 100px 30px; } }
.deb-details { grid-column: 1 / -1; font-size: .85rem; }
.deb-details summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.deb-details select, .deb-details input { display: block; width: 100%; margin: 6px 0; min-height: 36px; font-size: .85rem; }
.deb-ligne { flex-wrap: wrap; }

/* Relances sur téléphone : la date passe sous le texte, qui garde toute la largeur */
@media (max-width: 640px) {
  .task { flex-wrap: wrap; }
  .task .grow { flex: 1 1 calc(100% - 44px); min-width: 0; }
  .task > .chip { margin-left: 44px; }
}

/* Déboursé tiré du plan, et plan + choix côté client */
.dp-tete, .dp-piece > summary, .dp-ligne { display: grid; grid-template-columns: minmax(0, 1fr) repeat(4, 84px); gap: 8px; align-items: center; }
.dp-tete { font-size: .76rem; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.dp-n { text-align: right; font-variant-numeric: tabular-nums; }
.dp-piece { border-bottom: 1px solid var(--line); }
.dp-piece > summary { padding: 10px 8px; cursor: pointer; list-style: none; }
.dp-piece > summary::-webkit-details-marker { display: none; }
.dp-piece > summary small, .dp-ligne small { display: block; color: var(--muted); font-size: .78rem; font-weight: 400; }
.dp-ligne { padding: 7px 8px 7px 20px; font-size: .88rem; border-top: 1px dashed var(--line); }
.dp-ligne em { color: var(--amber); font-style: normal; font-size: .78rem; }
@media (max-width: 640px) {
  .dp-tete, .dp-piece > summary, .dp-ligne { grid-template-columns: minmax(0, 1fr) 84px; }
  .dp-tete .dp-n:not(:last-child), .dp-piece > summary > span.dp-n, .dp-ligne > span.dp-n { display: none; }
}
.choix-niveau { margin-bottom: 12px; }
.choix-plan { width: 100%; max-height: 420px; display: block; margin: 0 auto 12px; }
.choix-pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.choix-piece { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.choix-piece ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.choix-piece li span, .choix-piece li small { display: block; font-size: .78rem; }
.choix-piece li small { color: var(--muted); }
.dp-report { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; margin-top: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.dp-report.ok { border-color: var(--ok); }
.dp-report.vieux { border-color: var(--amber); }

/* maj4-email : un email long ne déborde plus sur la colonne voisine ; espace client */
a[href^="mailto:"] { overflow-wrap: anywhere; word-break: break-word; }
.doc-client { padding: 10px 0; border-bottom: 1px solid var(--line); gap: 10px; color: inherit; text-decoration: none; }
.doc-client:last-child { border-bottom: 0; }
.doc-client .i { margin-right: 6px; }
.espace-client-actions { margin-top: 16px; }

/* maj5-lisibilite : texte plus grand et plus contrasté pour les clients et les chefs, gros boutons au doigt */
:root { --muted: #3f4d55; --faint: #66737a; }
body[data-role=client], body[data-role=chef] { font-size: 17px; }
body[data-role=client] .btn, body[data-role=chef] .btn { min-height: 48px; }
body[data-role=client] .btn.small, body[data-role=chef] .btn.small { min-height: 44px; font-size: .9rem; }
body[data-role=client] .meta, body[data-role=chef] .meta { font-size: .94rem; }
@media (max-width: 760px) { .btn { min-height: 48px; } .btn.small { min-height: 44px; } }
.synthese-client { margin-top: 16px; border-left: 5px solid var(--good, #2e7d32); font-size: 1.05rem; }
.synthese-client.amber { border-left-color: #c77700; }
.synthese-client:not(.green):not(.amber) { border-left-color: var(--faint); }
.dernieres-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.dernieres-photos .thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* maj6-mobile : les fenêtres ne débordent plus sur téléphone ; textes secondaires plus grands pour clients et chefs */
.form-grid > * { min-width: 0; }
.f input, .f select, .f textarea { max-width: 100%; min-width: 0; box-sizing: border-box; }
.f input[type=date] { width: 100%; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }
body[data-role=client] .meta, body[data-role=chef] .meta, body[data-role=client] small, body[data-role=chef] small { font-size: 1rem; }
body[data-role=client] .btn.small, body[data-role=chef] .btn.small { min-height: 48px; }

/* maj7-tailles : titres, badges, onglets et menu plus grands pour clients et chefs ; champs verrouillés grisés ; onglets visibles sur mobile */
body[data-role=client] .section-title h2, body[data-role=chef] .section-title h2 { font-size: 1rem; color: var(--text); }
body[data-role=client] .chip, body[data-role=chef] .chip { font-size: .94rem; padding: .15rem .55rem; }
body[data-role=client] .tabs a, body[data-role=chef] .tabs a { font-size: 1rem; }
body[data-role=client] .nav a, body[data-role=chef] .nav a { font-size: .8rem; }
.chip.green { color: #1b5e20; }
.f input:disabled, .f select:disabled, .f textarea:disabled { background: var(--surface-3, #ecebe7); color: var(--muted); cursor: not-allowed; opacity: .8; }
@media (max-width: 760px) { .tabs { flex-wrap: wrap; position: static; row-gap: 0; } .tabs a { padding: .6rem .6rem; } }

/* maj8-tailles : boutons, badges, onglets et menu à 16 px et plus pour clients et chefs */
body[data-role=client] .btn, body[data-role=chef] .btn, body[data-role=client] .btn.small, body[data-role=chef] .btn.small { font-size: 1rem; }
body[data-role=client] .chip, body[data-role=chef] .chip { font-size: 1rem; }
body[data-role=client] .nav a { font-size: .95rem; }
body[data-role=chef] .nav a { font-size: .85rem; }
body[data-role=client] .tabs a, body[data-role=chef] .tabs a { min-height: 48px; display: inline-flex; align-items: center; }
body[data-role=chef] .stat small, body[data-role=chef] .kpi small, body[data-role=chef] .stats small { font-size: 1rem; }

/* maj9-16px : aucun texte sous 16 px pour clients et chefs (le menu du bas garde sa taille pour tenir sur une ligne) */
body[data-role=client] #app :where(small, span, label, p, div, b, a, td, th, li, output, button):not(.nav *):not(.refonte *),
body[data-role=chef] #app :where(small, span, label, p, div, b, a, td, th, li, output, button):not(.nav *):not(.refonte *) { font-size: max(16px, 1em); }
