[hidden]{display:none!important}
/* Layout: app mobile à une colonne, carte solde en tête, barre d'onglets fixe en bas */
:root{
  --bg:#F3F5F4; --surface:#FFFFFF; --ink:#101814; --muted:#66736D; --line:#E3E8E5;
  --accent:#0E6B57; --accent-soft:#E2F1EC; --card:#0F2A24; --card-ink:#F1F7F4; --card-muted:#9DB8AE;
  --p1:#0E6B57; --p2:#C9A55C; --warn:#B4541E; --warn-soft:#FBEDE4; --pos:#0E6B57;
  --font:"Manrope",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --r:18px;
  --c1:#0E6B57; --c2:#C9A55C; --c3:#3B7FB6; --c4:#B4541E; --c5:#9AA8A1;
}
.chart{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px;display:grid;grid-template-columns:132px 1fr;gap:16px;align-items:center}
.donut{position:relative;width:132px;height:132px}
.donut svg{width:132px;height:132px;transform:rotate(-90deg)}
.donut .c{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
.donut .c small{font-size:11px;color:var(--muted)}
.donut .c b{font-size:15px;font-weight:800}
.dl{display:flex;flex-direction:column;gap:10px;min-width:0}
.dl div{display:grid;grid-template-columns:10px 1fr auto;gap:8px;align-items:center;font-size:13px}
.dl span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dl b{font-weight:700;color:var(--muted)}
@media (max-width:360px){.chart{grid-template-columns:1fr;justify-items:center}}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#0B100E; --surface:#151C19; --ink:#EAF1ED; --muted:#8C9A93; --line:#25302B;
  --accent:#4FC3A1; --accent-soft:#16312A; --card:#123A31; --card-ink:#F1F7F4; --card-muted:#A3C4B8;
  --p1:#4FC3A1; --p2:#D9B871; --warn:#F09A62; --warn-soft:#3A2418; --pos:#4FC3A1; color-scheme:dark;
  --c1:#4FC3A1; --c2:#D9B871; --c3:#6FA8DC; --c4:#F09A62; --c5:#6E7C75}}
:root[data-theme="dark"]{
  --bg:#0B100E; --surface:#151C19; --ink:#EAF1ED; --muted:#8C9A93; --line:#25302B;
  --accent:#4FC3A1; --accent-soft:#16312A; --card:#123A31; --card-ink:#F1F7F4; --card-muted:#A3C4B8;
  --p1:#4FC3A1; --p2:#D9B871; --warn:#F09A62; --warn-soft:#3A2418; --pos:#4FC3A1; color-scheme:dark;
  --c1:#4FC3A1; --c2:#D9B871; --c3:#6FA8DC; --c4:#F09A62; --c5:#6E7C75}
*{box-sizing:border-box}
html,body{height:100%}
body{background:var(--bg);color:var(--ink);font-family:var(--font);font-size:15px;-webkit-font-smoothing:antialiased}
.num{font-variant-numeric:tabular-nums}
.app{max-width:480px;margin:0 auto;min-height:100%;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));padding-block:12px calc(96px + env(safe-area-inset-bottom,0px))}
header.top{display:flex;align-items:center;justify-content:space-between;padding-block:8px 16px}
.hello{display:flex;flex-direction:column;gap:2px}
.hello small{color:var(--muted);font-size:13px}
.hello b{font-size:20px;font-weight:800;letter-spacing:-.02em}
.avatar{width:40px;height:40px;border-radius:50%;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;font-weight:800}
.view{display:flex;flex-direction:column;gap:16px}
/* Carte principale */
.hero{background:var(--card);color:var(--card-ink);border-radius:24px;padding:22px;display:flex;flex-direction:column;gap:18px;position:relative;overflow:hidden}
.hero::after{content:"";position:absolute;right:-60px;top:-60px;width:200px;height:200px;border-radius:50%;border:1px solid rgba(255,255,255,.08);box-shadow:0 0 0 30px rgba(255,255,255,.03)}
.hero .lbl{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--card-muted);font-weight:600}
.hero .big{font-size:34px;font-weight:800;letter-spacing:-.03em;line-height:1.1}
.hero .big span{font-size:16px;font-weight:600;color:var(--card-muted);margin-left:4px}
.hero .row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.hero .row div{display:flex;flex-direction:column;gap:2px}
.hero .row b{font-size:16px;font-weight:700}
.split{display:flex;flex-direction:column;gap:8px}
.bar{height:8px;border-radius:99px;background:rgba(255,255,255,.12);display:flex;overflow:hidden}
.bar i{display:block;height:100%}
.legend{display:flex;justify-content:space-between;font-size:12px;color:var(--card-muted)}
.legend span{display:flex;align-items:center;gap:6px}
.dot{width:8px;height:8px;border-radius:50%;display:inline-block}
/* Action rééquilibrage */
.action{background:var(--warn-soft);border-radius:var(--r);padding:16px;display:flex;gap:14px;align-items:center}
.action.ok{background:var(--accent-soft)}
.action .ic{width:40px;height:40px;border-radius:12px;background:var(--surface);display:grid;place-items:center;flex:none;color:var(--warn)}
.action.ok .ic{color:var(--accent)}
.action p{margin:0;font-size:13px;color:var(--muted)}
.action b{display:block;font-size:15px;margin-bottom:2px}
/* Raccourcis */
.quick{display:flex}
.quick button{all:unset;cursor:pointer;flex:1;display:flex;align-items:center;gap:14px;padding:12px;border-radius:var(--r);background:var(--surface);border:1px solid var(--line);color:var(--ink)}
.quick .qt{display:flex;flex-direction:column;gap:2px}
.quick .qt b{font-size:15px;font-weight:800}
.quick .qt small{font-size:12px;color:var(--muted)}
.quick button .q{width:48px;height:48px;border-radius:14px;background:var(--accent-soft);display:grid;place-items:center;color:var(--accent);flex:none}
.quick button:focus-visible .q,.tabs button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
/* Sections */
.sec{display:flex;justify-content:space-between;align-items:baseline;padding-top:6px}
.sec h2{margin:0;font-size:17px;font-weight:800;letter-spacing:-.01em}
.sec button{all:unset;cursor:pointer;color:var(--accent);font-weight:700;font-size:13px}
.list{background:var(--surface);border-radius:var(--r);border:1px solid var(--line);display:flex;flex-direction:column}
.tx{display:grid;grid-template-columns:40px 1fr auto;gap:12px;align-items:center;padding:12px 14px;border-bottom:1px solid var(--line)}
.tx:last-child{border-bottom:0}
.tx .cat{width:40px;height:40px;border-radius:12px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;font-weight:800;font-size:13px}
.tx .mid{min-width:0;display:flex;flex-direction:column;gap:2px}
.tx .mid b{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tx .mid small{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tx .amt{text-align:right;display:flex;flex-direction:column;gap:2px}
.tx .amt b{font-weight:700}
.tx .amt small{font-size:11px;color:var(--muted)}
.neg{color:var(--ink)} .pos{color:var(--pos)}
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
.chip{all:unset;cursor:pointer;flex:none;padding:8px 14px;border-radius:99px;background:var(--surface);border:1px solid var(--line);font-size:13px;font-weight:600}
.chip[aria-pressed="true"]{background:var(--ink);color:var(--bg);border-color:var(--ink)}
/* Catégories */
.cats{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px;display:flex;flex-direction:column;gap:14px}
.crow{display:flex;flex-direction:column;gap:6px}
.crow .t{display:flex;justify-content:space-between;font-size:14px}
.crow .t span{color:var(--muted)}
.track{height:6px;border-radius:99px;background:var(--line);overflow:hidden}
.track i{display:block;height:100%;background:var(--accent);border-radius:99px}
/* Associés */
.partners{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.pcard{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px;display:flex;flex-direction:column;gap:12px;min-width:0}
.pcard .who{display:flex;align-items:center;gap:10px;font-weight:800}
.pcard .who i{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;font-style:normal;font-size:13px;color:#fff}
.kv{display:flex;flex-direction:column;gap:2px}
.kv small{color:var(--muted);font-size:12px}
.kv b{font-size:15px}
/* Barre d'onglets */
.tabs{position:fixed;left:0;right:0;bottom:0;background:var(--surface);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom,0px);padding-left:max(8px,env(safe-area-inset-left,0px));padding-right:max(8px,env(safe-area-inset-right,0px));z-index:5}
.tabs nav{max-width:480px;margin:0 auto;display:grid;grid-template-columns:repeat(5,1fr);align-items:center;height:68px}
.tabs button{all:unset;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:4px;font-size:11px;font-weight:600;color:var(--muted)}
.tabs button[aria-current="page"]{color:var(--accent)}
.tabs .add{width:52px;height:52px;border-radius:18px;background:var(--accent);color:#fff;display:grid;place-items:center;margin:0 auto;box-shadow:0 6px 18px rgba(14,107,87,.35)}
svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
/* Feuille d'ajout */
.sheet{position:fixed;inset:0;z-index:20;background:rgba(5,10,8,.45);display:flex;align-items:flex-end;justify-content:center}
.sheet .panel{background:var(--surface);width:100%;max-width:480px;border-radius:24px 24px 0 0;padding:20px max(16px,env(safe-area-inset-right,0px)) calc(20px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px));display:flex;flex-direction:column;gap:14px;max-height:92%;overflow-y:auto}
.grab{width:40px;height:4px;border-radius:9px;background:var(--line);margin:0 auto}
.panel h3{margin:0;font-size:19px;font-weight:800}
.amount-in{display:flex;align-items:baseline;gap:6px;border-bottom:2px solid var(--line);padding-bottom:6px}
.amount-in input{all:unset;font-size:36px;font-weight:800;letter-spacing:-.03em;width:100%;font-family:var(--font)}
.amount-in span{font-weight:700;color:var(--muted)}
.amount-in:focus-within{border-color:var(--accent)}
.seg{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.seg button{all:unset;cursor:pointer;text-align:center;padding:10px 8px;border-radius:12px;border:1px solid var(--line);font-size:13px;font-weight:700}
.seg button[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:12px;font-weight:700;color:var(--muted);letter-spacing:.04em;text-transform:uppercase}
.field input,.field select{font:inherit;font-size:16px;padding:12px 14px;border-radius:12px;border:1px solid var(--line);background:var(--bg);color:var(--ink)}
.field input:focus,.field select:focus{outline:2px solid var(--accent);outline-offset:0;border-color:transparent}
.hint{font-size:12px;color:var(--muted);margin:0}
.err{font-size:13px;color:var(--warn);margin:0}
.primary{all:unset;cursor:pointer;text-align:center;background:var(--accent);color:#fff;padding:15px;border-radius:14px;font-weight:800}
.primary:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(84px + env(safe-area-inset-bottom,0px));background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:12px;font-weight:700;font-size:14px;z-index:30}
.demo{font-size:11px;color:var(--muted);text-align:center;margin:4px 0 0}
@media (prefers-reduced-motion:no-preference){.sheet .panel{animation:up .22s ease-out}@keyframes up{from{transform:translateY(30px);opacity:.6}}}

/* ---- Ajouts version réelle ---- */
html{-webkit-text-size-adjust:100%}
body{margin:0;overscroll-behavior-y:none}
.app{padding-top:calc(12px + env(safe-area-inset-top,0px))}
button{font-family:var(--font)}
.avatar{border:0;cursor:pointer;font-family:var(--font);font-size:15px}
.avatar:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tx{cursor:pointer;-webkit-tap-highlight-color:transparent}
.tx:active{background:var(--bg)}
.tx:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.list .empty{padding:20px 16px;color:var(--muted);font-size:14px;text-align:center}
.secondary{all:unset;cursor:pointer;text-align:center;padding:14px;border-radius:14px;font-weight:800;border:1px solid var(--line);color:var(--ink)}
.danger{all:unset;cursor:pointer;text-align:center;padding:14px;border-radius:14px;font-weight:800;color:var(--warn);background:var(--warn-soft)}
.secondary:focus-visible,.danger:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.primary[disabled]{opacity:.6;pointer-events:none}
.btns{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.detail{display:flex;flex-direction:column;gap:2px;border:1px solid var(--line);border-radius:14px}
.detail div{display:flex;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line);font-size:14px}
.detail div:last-child{border-bottom:0}
.detail span{color:var(--muted)}
.detail b{text-align:right;font-weight:700;min-width:0;overflow-wrap:anywhere}
.big-amt{font-size:30px;font-weight:800;letter-spacing:-.03em}
.banner{background:var(--warn-soft);color:var(--warn);border-radius:14px;padding:12px 14px;font-size:14px;font-weight:600}
.skel{background:linear-gradient(90deg,var(--line),var(--surface),var(--line));background-size:200% 100%;border-radius:var(--r)}
@media (prefers-reduced-motion:no-preference){.skel{animation:sk 1.2s linear infinite}@keyframes sk{to{background-position:-200% 0}}}
/* Écran de connexion */
.login{min-height:100%;display:flex;flex-direction:column;justify-content:center;gap:28px;max-width:420px;margin:0 auto;padding-block:calc(32px + env(safe-area-inset-top,0px)) calc(32px + env(safe-area-inset-bottom,0px));padding-left:max(24px,env(safe-area-inset-left,0px));padding-right:max(24px,env(safe-area-inset-right,0px))}
.brand{display:flex;flex-direction:column;gap:14px}
.mark{width:64px;height:64px;border-radius:20px;background:var(--card);color:var(--card-ink);display:grid;place-items:center;font-weight:800;font-size:20px;letter-spacing:-.02em}
.brand h1{margin:0;font-size:28px;font-weight:800;letter-spacing:-.03em;text-wrap:balance}
.brand p{margin:0;color:var(--muted);line-height:1.5}
.gbtn{min-height:44px;display:flex;justify-content:center}
/* assistant vocal */
.fab{all:unset;cursor:pointer;position:fixed;right:max(16px,env(safe-area-inset-right,0px));bottom:calc(84px + env(safe-area-inset-bottom,0px));width:56px;height:56px;border-radius:50%;background:var(--card);color:var(--card-ink);display:grid;place-items:center;box-shadow:0 8px 22px rgba(5,10,8,.28);z-index:6}
.fab svg,.rec svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.fab:focus-visible,.rec:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
@media (min-width:560px){.fab{right:calc(50% - 240px + 16px)}}
.rec{all:unset;cursor:pointer;align-self:center;width:84px;height:84px;border-radius:50%;background:var(--accent);color:#fff;display:grid;place-items:center;box-shadow:0 10px 26px rgba(14,107,87,.35)}
.rec svg{width:34px;height:34px}
.rec{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
.rec.on{background:var(--warn);transform:scale(1.08)}
.rec:disabled{opacity:.5}
.rec-time{text-align:center;font-weight:700;color:var(--muted);min-height:20px}
@media (prefers-reduced-motion:no-preference){.rec.on{animation:pulse 1.2s ease-in-out infinite}@keyframes pulse{50%{box-shadow:0 0 0 12px rgba(180,84,30,.15)}}}
.heard{background:var(--accent-soft);border-radius:14px;padding:10px 14px}
.heard small{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.heard p{margin:4px 0 0;font-size:14px;line-height:1.4}
.v-hint{min-height:4.5em}
/* pas de zoom : ni double-tap, ni pincement */
html,body{touch-action:pan-x pan-y;-webkit-text-size-adjust:100%;text-size-adjust:100%}
button,a,input,select,label{touch-action:manipulation}
/* pas d'effet élastique quand on tire l'écran (iPhone) */
html,body{overscroll-behavior:none}
/* recherche & filtres */
.sec button{display:inline-flex;align-items:center;gap:6px}
.sec button svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.search{display:flex;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:4px 4px 4px 12px}
.search>span svg{width:18px;height:18px;fill:none;stroke:var(--muted);stroke-width:2;stroke-linecap:round;display:block}
.search input{flex:1;min-width:0;border:0;background:transparent;font:inherit;font-size:16px;color:var(--ink);padding:8px 0;outline:none}
.search .chip{padding:8px 12px}
.fpanel{display:flex;flex-direction:column;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:14px}
.fsum{display:flex;justify-content:space-between;gap:12px;margin:0;font-size:13px;color:var(--muted)}
.fsum b{color:var(--ink);white-space:nowrap}
.mid b{display:flex;align-items:center;gap:6px;min-width:0}
.pj svg{width:14px;height:14px;fill:none;stroke:var(--muted);stroke-width:2;stroke-linecap:round;flex:none;display:block}
/* budget */
.crow .sub{font-size:12px;color:var(--muted)}
.crow.warn .track i{background:var(--p2)}
.crow.warn .sub{color:var(--warn)}
.crow.over .track i{background:var(--warn)}
.crow.over .sub{color:var(--warn);font-weight:700}
.bud-tot{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:14px}
.bud-tot div{display:flex;flex-direction:column;gap:4px;min-width:0}
.bud-tot small{font-size:11px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.04em}
.bud-tot b{font-size:14px;overflow-wrap:anywhere}
.bud-tot b.neg{color:var(--warn)}
button.action{font:inherit;color:inherit;border:0;cursor:pointer;box-sizing:border-box;width:100%;text-align:left}
.budget-alert small{display:block;font-size:12px;opacity:.8;margin-top:2px}
.bud-list{display:flex;flex-direction:column;gap:10px}
.field.bud{flex-direction:row;align-items:center;justify-content:space-between;gap:12px}
.field.bud label{text-transform:none;letter-spacing:0;font-size:14px;color:var(--ink);font-weight:600;flex:1}
.field.bud input{width:44%;text-align:right}
/* photos */
.photos{display:flex;flex-direction:column;gap:10px}
.ph-head{display:flex;justify-content:space-between;align-items:center}
.ph-head b{font-size:14px}
.ph-add,.attach,.scan{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-weight:700;color:var(--accent)}
.ph-add svg,.attach svg,.scan svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
.ph-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.ph-grid .hint{grid-column:1/-1}
.ph{all:unset;cursor:pointer;aspect-ratio:1;border-radius:12px;overflow:hidden;border:1px solid var(--line);background:var(--bg)}
.ph img{width:100%;height:100%;object-fit:cover;display:block}
.ph-wait{aspect-ratio:1;border-radius:12px}
.ph-full img{width:100%;border-radius:14px;display:block;border:1px solid var(--line)}
.btns a.secondary{display:block}
.attach{padding:12px 14px;border:1px dashed var(--line);border-radius:12px;background:var(--bg)}
.lbl-like{font-size:12px;font-weight:700;color:var(--muted);letter-spacing:.04em;text-transform:uppercase}
.scan{justify-content:center}
/* réponses du bot */
.answer{background:var(--accent-soft);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:8px}
.answer small{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.answer p{margin:0}
.answer .q{font-size:14px;color:var(--muted)}
.answer .a{font-size:16px;font-weight:700;line-height:1.4}
.answer .mini{display:flex;flex-direction:column;border-top:1px solid var(--line)}
.answer .mini div{display:flex;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid var(--line);font-size:13px}
.answer .mini span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.field{min-width:0}
.field input,.field select{width:100%;box-sizing:border-box;min-width:0}
.fpanel .seg{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.crow .t{gap:10px}
.crow .t span{white-space:nowrap}
/* iPhone : le champ date ne doit jamais déborder de sa colonne */
.seg{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.fpanel .seg{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.field input[type="date"]{-webkit-appearance:none;appearance:none;display:block;min-width:0;max-width:100%;width:100%;min-height:48px;text-align:left;line-height:1.2}
.field input[type="date"]::-webkit-date-and-time-value{text-align:left;margin:0}
.field input[type="date"]::-webkit-calendar-picker-indicator{margin-left:auto}
/* ===== écrans promoteur ===== */
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(100px,1fr));gap:8px}
.kpis.k4{grid-template-columns:repeat(2,minmax(0,1fr))}
.kpi{all:unset;box-sizing:border-box;cursor:pointer;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:12px;display:flex;flex-direction:column;gap:3px;min-width:0}
div.kpi{cursor:default}
.kpi small{font-size:11px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.03em}
.kpi b{font-size:18px;font-weight:800;overflow-wrap:anywhere}
.kpi span{font-size:12px;color:var(--muted)}
.action.due{background:var(--surface);border:1px solid var(--line)}
.action.due .ic{background:var(--accent-soft);color:var(--accent)}
.action small{display:block;font-size:12px;color:var(--muted);margin-top:2px}
.empty-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:18px;display:flex;flex-direction:column;gap:12px}
.empty-card p{margin:0;color:var(--muted);font-size:14px;line-height:1.45}
/* grille des lots */
.legend-lots{display:flex;flex-wrap:wrap;gap:14px;align-items:center;font-size:13px;color:var(--muted)}
.legend-lots i{display:inline-block;width:12px;height:12px;border-radius:4px;margin-right:6px;vertical-align:-1px}
.legend-lots .link{all:unset;cursor:pointer;margin-left:auto;color:var(--accent);font-weight:700}
.bloc{display:flex;flex-direction:column;gap:8px}
.bloc h3{margin:6px 0 0;font-size:15px}
.floor{display:grid;grid-template-columns:44px 1fr;gap:8px;align-items:start}
.fl{font-size:12px;color:var(--muted);font-weight:700;padding-top:12px}
.lots{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:10px}
.lot{all:unset;box-sizing:border-box;cursor:pointer;position:relative;overflow:hidden;border-radius:16px;padding:14px 12px 16px;min-height:88px;display:flex;flex-direction:column;justify-content:center;gap:4px;border:1px solid transparent;min-width:0}
.lot b{font-size:18px;font-weight:800;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lot small{font-size:12px;opacity:.85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lot i{position:absolute;left:0;bottom:0;height:5px;background:currentColor;opacity:.55}
.lot.free,.legend-lots .free,.badge.free{background:var(--surface);border-color:var(--line);color:var(--ink)}
.lot.resa,.legend-lots .resa,.badge.resa{background:#F6EAD2;color:#8A6416}
.lot.sold,.legend-lots .sold,.badge.sold{background:var(--accent-soft);color:var(--accent)}
.lot:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.badge{font-size:12px;font-weight:800;padding:3px 9px;border-radius:99px;vertical-align:3px;margin-left:6px;border:1px solid transparent}
/* Ventes : résumé compact (montants, barre, filtres, marge) */
.vsum{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:12px 14px 2px;display:flex;flex-direction:column;gap:10px}
.vk{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.vk div{display:flex;flex-direction:column;gap:2px;min-width:0}
.vk small{font-size:10.5px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.03em;white-space:nowrap}
.vk b{font-size:17px;font-weight:800;letter-spacing:-.01em;white-space:nowrap}
.vk span{font-size:11.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.vk span.warn{color:var(--warn)}
.vbar{height:6px;border-radius:3px;background:var(--line);display:flex;overflow:hidden}
.vbar i{display:block;height:100%}
.vbar .sold,.vf i.sold{background:var(--accent)}
.vbar .resa,.vf i.resa{background:#D9A441}
.vfilt{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;padding:3px;border-radius:13px;background:var(--bg)}
.vf{all:unset;box-sizing:border-box;cursor:pointer;min-height:44px;border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;color:var(--ink);text-align:center}
.vf b{font-size:15px;font-weight:800;line-height:1.15}
.vf span{display:flex;align-items:center;gap:4px;font-size:11px;color:var(--muted);white-space:nowrap}
.vf i{display:inline-block;width:8px;height:8px;border-radius:3px}
.vf i.free{background:var(--surface);box-shadow:inset 0 0 0 1px var(--muted)}
.vf.on{background:var(--surface);box-shadow:0 1px 3px rgba(0,0,0,.14)}
.vf:focus-visible,.vmarge:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.vmarge{all:unset;box-sizing:border-box;cursor:pointer;min-height:44px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:13px;color:var(--ink)}
.vmarge>span{color:var(--muted)}
.vmarge b{display:inline-flex;align-items:center;gap:2px;font-weight:700}
.vmarge b.go{color:var(--accent)}
.vmarge b.neg{color:var(--warn)}
.vmarge svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
/* Ventes : l'immeuble étage par étage, chaque étage remplit la ligne */
.bld{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:0 12px 12px;display:flex;flex-direction:column;gap:6px}
.bld-h{min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:8px}
.bld-h h3{margin:0;font-size:15px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bld-h h3 span{font-size:12.5px;font-weight:600;color:var(--muted)}
.bld-h .link{all:unset;cursor:pointer;min-height:44px;display:inline-flex;align-items:center;color:var(--accent);font-weight:700;font-size:13px;white-space:nowrap}
.flr,.sol{display:grid;grid-template-columns:36px minmax(0,1fr);gap:6px;align-items:center}
.flr .fl{padding-top:0;white-space:nowrap}
.flr .lots{display:flex;flex-wrap:wrap;gap:6px}
.flr .lots.many{display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr))}
.flr .lot{flex:100 1 0;min-width:88px;min-height:0;height:62px;padding:6px 10px;border-radius:12px;gap:1px;justify-content:center}
.flr .lots.many .lot{min-width:0}
.flr .lot .l1{display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0}
.flr .lot .l1 b{min-width:0;font-size:15px}
.flr .lot em{font-style:normal;font-size:10.5px;font-weight:700;display:inline-flex;align-items:center;gap:3px;white-space:nowrap;flex:none}
.flr .lot em svg{width:11px;height:11px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.flr .lot small{font-size:11.5px}
.flr .lot .px{font-size:11.5px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.flr .lot .px.none{font-weight:500;opacity:.75}
.flr .lot .pay{display:flex;align-items:center;gap:6px;font-size:10.5px;font-weight:700;white-space:nowrap}
.flr .lot .pt{position:relative;flex:1;height:4px;border-radius:2px;overflow:hidden}
.flr .lot .pt::before{content:"";position:absolute;inset:0;background:currentColor;opacity:.3}
.flr .lot .pt i{top:0;bottom:0;height:auto;border-radius:2px;opacity:1}
.flr .lot.sold{background:var(--accent);border-color:var(--accent);color:var(--surface)}
.flr .lot.dim{opacity:.28}
.sol{height:12px}
.sol span{font-size:10px;font-weight:800;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.sol::after{content:"";border-top:1.5px dashed var(--muted);opacity:.45}
.paybar{display:flex;flex-direction:column;gap:6px}
.paybar .t{display:flex;justify-content:space-between;font-size:13px;color:var(--muted)}
.paybar b{color:var(--ink)}
.vers{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:14px;padding:4px 12px}
.vers>b{font-size:13px;padding:8px 0 4px}
.vers .v{display:flex;align-items:center;gap:8px;padding:8px 0;border-top:1px solid var(--line);font-size:13px}
.vers .v span{flex:1;min-width:0;color:var(--muted)}
.mini-btn{all:unset;cursor:pointer;font-size:12px;font-weight:800;padding:6px 10px;border-radius:10px;border:1px solid var(--line);color:var(--ink);white-space:nowrap}
.mini-btn.strong{background:var(--accent);color:#fff;border-color:var(--accent)}
.mini-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.muted{color:var(--muted);font-weight:500}
.linkbox{font-size:13px;word-break:break-all;background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:12px;user-select:all;-webkit-user-select:all}
.secondary[disabled]{opacity:.45;pointer-events:none}
.primary.alt{background:var(--card)}
/* menu « Plus » */
.menu{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);display:flex;flex-direction:column}
.menu-row{all:unset;cursor:pointer;display:flex;align-items:center;gap:12px;padding:14px;border-bottom:1px solid var(--line)}
.menu-row:last-child{border-bottom:0}
.menu-row:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;border-radius:var(--r)}
.mi{width:38px;height:38px;border-radius:12px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;flex:none}
.mi svg,.mc svg,.back svg,.notice svg,.iconbtn svg,.ech .d.doc svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;display:block}
.mt{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.mt b{font-size:15px}
.mt small{font-size:12.5px;color:var(--muted)}
.mc{color:var(--muted)}
.dotalert{width:9px;height:9px;border-radius:50%;background:var(--warn);flex:none}
.subhead{align-items:center;gap:8px;justify-content:flex-start}
.subhead h2{flex:1}
.back{all:unset;cursor:pointer;width:34px;height:34px;border-radius:10px;display:grid;place-items:center;border:1px solid var(--line);background:var(--surface);color:var(--ink);flex:none}
/* chantier */
.progress-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px;display:flex;flex-direction:column;gap:8px}
.progress-card .t{display:flex;justify-content:space-between;font-size:15px}
.progress-card small{color:var(--muted);font-size:12px}
.track.big{height:10px}
.step{all:unset;box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;gap:6px;padding:14px 16px;border-bottom:1px solid var(--line);width:100%}
.step:last-child{border-bottom:0}
.step .t{display:flex;justify-content:space-between;gap:10px;font-size:14px}
.step small{font-size:12px;color:var(--muted)}
.step.static{cursor:default}
.step .ph-grid{margin-top:6px}
.field input[type="range"]{padding:0;border:0;background:transparent;accent-color:var(--accent);height:32px}
.field textarea{font:inherit;font-size:16px;padding:12px 14px;border-radius:12px;border:1px solid var(--line);background:var(--bg);color:var(--ink);resize:vertical;width:100%;box-sizing:border-box}
.ph{position:relative}
.ph-date{position:absolute;left:4px;bottom:4px;font-size:10px;font-weight:700;background:rgba(0,0,0,.55);color:#fff;padding:2px 6px;border-radius:6px}
/* échéancier & documents */
.grp{margin:8px 0 0;font-size:13px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
.grp.late{color:var(--warn)}
.ech{all:unset;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line);width:100%}
.ech:last-child{border-bottom:0}
.ech .d{width:46px;flex:none;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--bg);border-radius:12px;padding:6px 0}
.ech .d b{font-size:14px}
.ech .d small{font-size:10px;color:var(--muted)}
.ech .d.doc{color:var(--accent);height:40px}
.ech .mid{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.ech .mid b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ech .mid small,.ech .amt small{font-size:12px;color:var(--muted)}
.ech .amt{text-align:right;display:flex;flex-direction:column;gap:2px;flex:none}
.ech.late .d{background:var(--warn-soft);color:var(--warn)}
.ech.late .amt small{color:var(--warn);font-weight:700}
.ech.soon .d{background:#F6EAD2;color:#8A6416}
.ech.ok{opacity:.65}
.notice{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:12px 14px}
.notice>svg{flex:none;color:var(--accent);width:22px;height:22px}
.notice div{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.notice b{font-size:14px}
.notice small{font-size:12px;color:var(--muted);line-height:1.4}
.notice.ok{background:var(--accent-soft);border-color:transparent}
.flist{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:12px}
.frow{display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid var(--line);font-size:14px}
.frow:last-child{border-bottom:0}
.frow a{flex:1;min-width:0;color:var(--accent);font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.frow small{color:var(--muted);font-size:12px}
/* projet */
.stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.stat{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:12px;display:flex;flex-direction:column;gap:3px;min-width:0}
.stat small{font-size:11px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.03em;line-height:1.3}
.stat b{font-size:20px;font-weight:800}
.stat span{font-size:12px;color:var(--muted)}
.formcard{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px;display:flex;flex-direction:column;gap:12px}
.iconbtn{display:flex;align-items:center;justify-content:center;gap:10px}
.login .iconbtn{width:100%;max-width:320px;box-sizing:border-box}
/* hors ligne */
.banner.offline{background:#F6EAD2;color:#8A6416}
.tx.pending{opacity:.7}
.tx.pending .amt small{color:#8A6416;font-weight:700}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .lot.resa,:root:not([data-theme="light"]) .legend-lots .resa,:root:not([data-theme="light"]) .badge.resa,:root:not([data-theme="light"]) .ech.soon .d,:root:not([data-theme="light"]) .banner.offline{background:#3A2E14;color:#E8C77A}}

/* Sélection multiple (liste des documents) */
.coche{flex:none;width:24px;height:24px;border-radius:12px;border:2px solid var(--line);display:flex;align-items:center;justify-content:center;color:#fff;font-size:14px;font-weight:800;background:#fff}
.coche.on{background:var(--accent);border-color:var(--accent)}
.ech.sel{background:var(--accent-soft)}
.selbar{position:fixed;left:0;right:0;bottom:0;z-index:10;background:#fff;border-top:1px solid var(--line);padding:12px 16px calc(env(safe-area-inset-bottom) + 12px);display:flex;align-items:center;justify-content:space-between;gap:12px;box-shadow:0 -4px 16px rgba(0,0,0,.06)}

/* Page Catégories */
.cg-intro{margin:4px 0 14px;font-size:14px;line-height:1.45;color:var(--muted,#6b7872)}
.cg-add{display:flex;gap:10px;margin-bottom:12px}
.cg-add input{flex:1;min-width:0;min-height:50px;padding:0 14px;border:1px solid var(--line);border-radius:14px;background:#fff;font:inherit;font-size:16px;color:var(--ink)}
.cg-add button{width:auto;padding:0 18px;min-height:50px;border-radius:14px;white-space:nowrap}
.cg-head{display:flex;justify-content:space-between;align-items:baseline;margin:18px 2px 8px;font-size:13px;color:var(--muted,#6b7872);text-transform:uppercase;letter-spacing:.04em}
.cg-list{background:#fff;border:1px solid var(--line);border-radius:16px;overflow:hidden}
.cg-row{display:flex;align-items:center;gap:10px;padding:12px 12px 12px 16px;border-bottom:1px solid var(--line)}
.cg-row:last-child{border-bottom:0}
.cg-t{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.cg-t b{font-size:15px;font-weight:700;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cg-t small{font-size:12.5px;color:var(--muted,#6b7872)}
.cg-ico{all:unset;box-sizing:border-box;cursor:pointer;flex:none;width:40px;height:40px;border-radius:12px;display:flex;align-items:center;justify-content:center;color:var(--accent);background:var(--accent-soft)}
.cg-ico.danger{color:var(--warn);background:var(--warn-soft)}
.cg-ico:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.cg-vide{padding:18px 16px;margin:0}
.cg-mv{display:flex;flex-direction:column;gap:2px;flex:none}
.cg-fl{all:unset;box-sizing:border-box;cursor:pointer;width:30px;height:22px;border-radius:8px;display:flex;align-items:center;justify-content:center;color:var(--muted,#6b7872)}
.cg-fl:disabled{opacity:.25;cursor:default}
.cg-fl:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* Bannière de mise à jour */
.maj-banner{position:fixed;left:12px;right:12px;top:calc(env(safe-area-inset-top) + 10px);z-index:200;background:#0f766e;color:#fff;border-radius:14px;padding:10px 10px 10px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px;box-shadow:0 8px 24px rgba(0,0,0,.2);font-size:14px;font-weight:600}
.maj-banner button{all:unset;cursor:pointer;background:#fff;color:#0f766e;padding:8px 14px;border-radius:10px;font-weight:800;font-size:14px;white-space:nowrap}
.maj-banner button:disabled{opacity:.6}

/* Historique d'une opération */
.hist { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }
.hist-ev { background: var(--surface); border: 1px solid var(--line, #E3E7E5); border-radius: 14px; padding: 10px 14px; }
.hist-ev summary { list-style: none; cursor: pointer; }
.hist-ev summary::-webkit-details-marker { display: none; }
.hist-ev summary span { display: flex; flex-direction: column; gap: 2px; }
.hist-ev small { color: var(--muted, #6B7280); font-size: 12px; }
.hist-ev p { margin: 8px 0 0; font-size: 14px; }
.hist-ev p small { display: block; font-weight: 700; }

/* ===== App Promoteurs : ajouts ===== */
/* en-tête : changement de projet */
.projsw{all:unset;cursor:pointer;display:flex;flex-direction:column;gap:2px;min-width:0;max-width:calc(100% - 56px)}
.projsw small{color:var(--muted);font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.projsw b{font-size:19px;font-weight:800;letter-spacing:-.02em;display:flex;align-items:center;gap:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.projsw b svg{width:18px;height:18px;flex:none;color:var(--muted)}
.projsw:focus-visible{outline:2px solid var(--accent);outline-offset:4px;border-radius:8px}
#bandeau{display:flex;flex-direction:column;gap:8px;margin-bottom:8px}
#bandeau:empty{display:none}
.banner b{font-weight:800}
button.banner{all:unset;box-sizing:border-box;cursor:pointer;display:block;width:100%;background:var(--warn-soft);color:var(--warn);border-radius:14px;padding:12px 14px;font-size:14px;font-weight:600;line-height:1.4}
.banner.essai{background:var(--accent-soft);color:var(--accent)}
.banner.dev{background:#E7EEF9;color:#284B7A}
/* connexion */
.login-form{display:flex;flex-direction:column;gap:14px}
.login .field input{font-size:17px}
.code-in{letter-spacing:.4em;font-size:24px!important;text-align:center;font-weight:800}
.center{text-align:center}
.legal{font-size:12px;color:var(--muted);text-align:center;margin:0;line-height:1.5}
.legal a,.foot a{color:var(--accent)}
.link{all:unset;cursor:pointer;color:var(--accent);font-weight:700;font-size:14px}
.link.center{display:block;text-align:center;padding:8px}
.onb .seg button{padding:12px 8px}
.fhint{font-size:12px;color:var(--muted);line-height:1.4}
.check{display:flex;align-items:flex-start;gap:10px;font-size:14px;line-height:1.4;cursor:pointer;padding:4px 0}
.check input{width:20px;height:20px;flex:none;margin:0;accent-color:var(--accent)}
.seg.four{grid-template-columns:repeat(4,minmax(0,1fr))}
.seg.four button{padding:10px 2px;font-size:12.5px}
/* menus */
.menu-row.on{background:var(--accent-soft)}
.menu-row.static{cursor:default}
.menu-row .mini-btn{flex:none}
.menu-row[disabled]{cursor:default;opacity:1}
details.arch summary,details.imp summary{cursor:pointer;font-weight:700;font-size:14px;color:var(--accent);padding:6px 0}
details.imp{display:flex;flex-direction:column;gap:10px}
details.imp[open] summary{margin-bottom:8px}
.foot{font-size:12px;color:var(--muted);text-align:center;margin:6px 0 0}
.sec-actions{display:flex;gap:14px}
/* journal */
.tx .cat.alt{background:#F6EAD2;color:#8A6416}
.kpi.warn b{color:var(--warn)}
.legend.wrap{flex-wrap:wrap;gap:6px 14px;justify-content:flex-start}
.hero .big.negative{color:#FFD9C2}
.marges{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.marges div{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:12px;display:flex;flex-direction:column;gap:3px}
.marges small{font-size:11px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.03em}
.marges b{font-size:18px;font-weight:800}
.marges b.neg{color:var(--warn)}
.marges span{font-size:12px;color:var(--muted)}
.ph.pdf{display:grid;place-items:center;font-weight:800;color:var(--accent);background:var(--accent-soft)}
.ph-full{all:unset;cursor:pointer;display:block;width:100%}
.imp textarea{font:inherit;font-size:14px;padding:10px 12px;border-radius:12px;border:1px solid var(--line);background:var(--bg);color:var(--ink);width:100%;box-sizing:border-box}
.file-btn{display:block}
.imp-list{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:12px;margin:8px 0}
.imp-row{display:grid;grid-template-columns:1fr auto;gap:4px 10px;padding:8px 10px;border-bottom:1px solid var(--line);font-size:13px;align-items:center}
.imp-row:last-child{border-bottom:0}
.imp-row select{grid-column:1/-1;font:inherit;font-size:14px;padding:8px;border-radius:10px;border:1px solid var(--line);background:var(--bg);color:var(--ink)}
/* ventes */
.lot.done,.badge.done{background:var(--card);color:var(--card-ink)}
.flr .lot.done{background:var(--card);border-color:var(--card);color:var(--card-ink)}
.lot.attr,.badge.attr{background:#E7EEF9;color:#284B7A}
.vbar .attr{background:#6F95C9}
.vfilt{grid-template-columns:repeat(4,minmax(0,1fr))}
.ech.wait .d{background:var(--line)}
.ech.static{cursor:default}
.ech-list{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:14px;overflow:hidden}
.ech-list .ech{cursor:default}
.hint.warn,.warn{color:var(--warn)}
.sub-h{margin:6px 0 0;font-size:14px;display:flex;justify-content:space-between;align-items:baseline}
.sub-h .link{font-size:13px}
.tr-box{display:flex;flex-direction:column;gap:8px}
.tr-row{border:1px solid var(--line);border-radius:12px;padding:8px;display:flex;flex-direction:column;gap:6px;background:var(--bg)}
.tr-top,.tr-bot{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.tr-row input,.tr-row select{font:inherit;font-size:14px;padding:8px 10px;border-radius:10px;border:1px solid var(--line);background:var(--surface);color:var(--ink);min-width:0}
.tr-lib,.md-lib{flex:1 1 140px}
.tr-mt{width:120px;text-align:right}
.tr-decl,.md-decl{flex:1 1 150px}
.tr-et,.md-et{flex:1 1 150px}
.tr-date{flex:1 1 140px}
.tr-delai{display:inline-flex;align-items:center;gap:4px;font-size:13px;color:var(--muted);white-space:nowrap}
.tr-delai input{width:56px;text-align:center}
.md-pct{width:64px;text-align:right}
.tr-foot{display:flex;justify-content:space-between;align-items:center;font-size:13px;font-weight:700;padding:2px}
/* relances */
.rel{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:12px 14px;display:flex;flex-direction:column;gap:6px}
.rel.late{border-color:var(--warn)}
.rel-h{display:flex;justify-content:space-between;gap:10px;font-size:14px}
.rel>small{font-size:12px;color:var(--muted)}
.rel-msg{margin:0;font-size:13px;line-height:1.45;background:var(--bg);border-radius:10px;padding:8px 10px;white-space:pre-wrap}
.rel-b{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.mini-btn{display:inline-flex;align-items:center;gap:6px;text-decoration:none}
.mini-btn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
a.secondary,a.primary{display:block;text-decoration:none}
a.iconbtn{display:flex}
/* associés */
.partners{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
button.pcard{all:unset;box-sizing:border-box;cursor:pointer;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px;display:flex;flex-direction:column;gap:10px;min-width:0;color:var(--ink)}
button.pcard[disabled]{cursor:default}
.pcard .who span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pcard .who em{color:var(--accent);display:grid}
.pcard .who em svg{width:16px;height:16px}
.kv b.neg{color:var(--warn)}
.ptable{display:flex;flex-direction:column;border-top:1px solid var(--line);margin-top:4px}
.ptable div{display:flex;flex-direction:column;gap:2px;padding:10px 0;border-bottom:1px solid var(--line);font-size:13px}
.ptable div:last-child{border-bottom:0}
.ptable span{color:var(--muted)}
.ptable span.num{color:var(--ink);font-weight:700}
/* projets */
.pjcard{all:unset;box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;gap:10px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:14px;margin-bottom:10px;width:100%}
.pjcard.on{border-color:var(--accent)}
.pj-h{display:flex;justify-content:space-between;align-items:center;gap:10px}
.pj-h b{font-size:16px}
.pj-k{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.pj-k div{display:flex;flex-direction:column;gap:2px;min-width:0}
.pj-k small{font-size:10.5px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.02em;line-height:1.2}
.pj-k b{font-size:15px}
.pj-k b.neg{color:var(--warn)}
@media (max-width:380px){.pj-k{grid-template-columns:repeat(2,minmax(0,1fr))}}
.step.done .t b{color:var(--accent)}
.step .t b svg{width:14px;height:14px;vertical-align:-2px}
/* abonnement */
.bk-hero{display:flex;gap:14px;align-items:center;padding:16px;border-radius:18px;background:var(--surface);border:1px solid var(--line)}
.bk-hero.ok{background:var(--accent-soft);border-color:transparent}
.bk-hero.warn{background:var(--warn-soft);border-color:transparent}
.bk-hero>div{display:flex;flex-direction:column;gap:3px;min-width:0}
.bk-hero b{font-size:16px}
.bk-hero small{font-size:13px;line-height:1.4;color:var(--muted)}
.bk-badge{flex:none;width:44px;height:44px;border-radius:14px;display:flex;align-items:center;justify-content:center;background:var(--surface);color:var(--accent)}
.bk-hero.warn .bk-badge{color:var(--warn)}
.plans{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px}
.plan{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:6px}
.plan.on{border-color:var(--accent);background:var(--accent-soft)}
.plan>b{font-size:16px}
.plan>span{font-size:20px;font-weight:800}
.plan>span small{font-size:12px;font-weight:600;color:var(--muted)}
.plan>small{font-size:12px;color:var(--muted)}
.plan .primary{padding:10px;font-size:14px;margin-top:4px}
/* historique */
.hist-ev{display:flex;flex-direction:column;gap:4px}
.hist-ev.del{border-color:var(--warn-soft)}
.hist-ev .mini-btn{align-self:flex-start}
.hist-ev small.ok{color:var(--accent);font-weight:700}
/* feuilles et visionneuse */
.sheet .panel{position:relative}
.sheet-x{position:absolute;top:10px;right:12px;width:36px;height:36px;border:0;border-radius:18px;background:var(--bg);font-size:22px;line-height:1;color:var(--ink);cursor:pointer}
.viewer{position:fixed;inset:0;z-index:400;background:rgba(0,0,0,.92)}
.viewer-x{position:absolute;top:calc(env(safe-area-inset-top,0px) + 10px);right:12px;width:44px;height:44px;border:0;border-radius:22px;background:#fff;font-size:26px;line-height:1;color:#111;z-index:1;cursor:pointer}
.viewer-in{position:absolute;top:calc(env(safe-area-inset-top,0px) + 64px);left:12px;right:12px;bottom:calc(env(safe-area-inset-bottom,0px) + 12px)}
.viewer-in img,.viewer-in iframe{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;border:0;border-radius:8px}
.viewer-in iframe{background:#fff}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .tx .cat.alt{background:#3A2E14;color:#E8C77A}:root:not([data-theme="light"]) .lot.attr,:root:not([data-theme="light"]) .badge.attr,:root:not([data-theme="light"]) .banner.dev{background:#1B2A40;color:#A9C5EE}}
/* Le contenu d'une feuille ne doit jamais être écrasé quand elle défile */
.sheet .panel>*{flex-shrink:0}
.hist-ev>span{display:flex;flex-direction:column;gap:2px}
.field .attach{text-transform:none;letter-spacing:0;font-size:14px;color:var(--accent)}
.vers .v span.two{display:flex;flex-direction:column;gap:1px;color:var(--ink)}
.vers .v span.two small{color:var(--muted);font-size:12px}
.flr .lot em svg{width:13px;height:13px}

/* ---------- Ordinateur (900 px et plus) : menu latéral, contenu en largeur, fenêtres centrées.
   L'accueil passe sur deux colonnes à partir de 1200 px. ---------- */
.side{display:none}
.dash,.dash-top,.dash-col,.dash-kpis,.blds{display:flex;flex-direction:column;gap:16px}
@media (min-width:900px){
  .side{display:flex;flex-direction:column;gap:2px;position:fixed;top:0;bottom:0;left:0;width:232px;padding:18px 14px 12px;background:var(--surface);border-right:1px solid var(--line);overflow-y:auto;z-index:15}
  .side-brand{display:flex;align-items:center;gap:10px;padding:0 8px 10px;font-size:16px;letter-spacing:-.01em}
  .side-brand b{font-weight:800}
  .side-brand .mark{width:34px;height:34px;border-radius:10px;background:var(--card);color:var(--card-ink);display:grid;place-items:center;font-size:13px;font-weight:800;flex:none}
  .side-proj{all:unset;box-sizing:border-box;cursor:pointer;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:8px;padding:9px 12px;border:1px solid var(--line);border-radius:14px;background:var(--bg);margin-bottom:8px}
  .side-proj small{grid-column:1;color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .side-proj b{grid-column:1;font-size:14px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .side-proj svg{grid-column:2;grid-row:1/3;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
  .side-proj:hover{border-color:var(--accent)}
  .side-add{display:flex;align-items:center;justify-content:center;gap:8px;padding:11px;margin-bottom:8px}
  .side-add svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round}
  .side-h{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);padding:12px 10px 4px}
  .side-nav{display:flex;flex-direction:column;gap:2px}
  .side-nav button,.side-link{all:unset;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;gap:12px;padding:6px 10px;border-radius:10px;font-weight:600;font-size:14px;color:var(--ink)}
  .side-nav svg,.side-link svg{width:19px;height:19px;flex:none;fill:none;stroke:var(--muted);stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
  .side-nav button:hover,.side-link:hover{background:var(--bg)}
  .side-nav button[aria-current="page"]{background:var(--accent-soft);color:var(--accent)}
  .side-nav button[aria-current="page"] svg{stroke:var(--accent)}
  .side-nav button:focus-visible,.side-link:focus-visible,.side-me:focus-visible,.side-proj:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
  .side-link{margin-top:4px}
  .side-mic{margin:0 0 6px;padding:8px 10px;justify-content:center;border:1px solid var(--line);font-weight:700}
  .side-mic svg{stroke:var(--accent)}
  .side-me{all:unset;box-sizing:border-box;cursor:pointer;margin-top:auto;display:flex;align-items:center;gap:10px;padding:12px 8px 2px;border-top:1px solid var(--line)}
  .side-me[aria-current="page"] b{color:var(--accent)}
  .side-me>span:last-child{display:flex;flex-direction:column;min-width:0}
  .side-me b{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .side-me small{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .side-me .avatar{flex:none}
  .app.has-side{max-width:none;margin:0 0 0 232px;padding:28px 28px 48px}
  .app.has-side>header.top{display:none}
  .app.has-side .tabs,.has-side~.tabs{display:none}
  #bandeau,.app.has-side .view{max-width:1180px;margin-inline:auto}
  #bandeau:not(:empty){margin-bottom:16px}
  .app.has-side .view{gap:20px}
  .app.has-side .view[data-tab="ops"],.app.has-side .view[data-tab="cats"],.app.has-side .view[data-tab="categories"],.app.has-side .view[data-tab="relances"],.app.has-side .view[data-tab="acheteurs"],.app.has-side .view[data-tab="echeances"],.app.has-side .view[data-tab="historique"],.app.has-side .view[data-tab="compte"],.app.has-side .view[data-tab="membres"],.app.has-side .view[data-tab="entreprise"],.app.has-side .view[data-tab="abonnement"],.app.has-side .view[data-tab="projet"],.app.has-side .view[data-tab="admin"]{max-width:980px}
  .sec h2{font-size:18px}
  /* Les rubriques sont toutes dans le menu : pas de retour vers « Plus » */
  .app.has-side .back[data-go="plus"]{display:none}
  /* Accueil : indicateurs sur une ligne (grille à deux colonnes à partir de 1200 px) */
  .dash-top .kpis.k4{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
  .dash-top .kpi{padding:16px 18px;justify-content:center;border-radius:18px}
  .dash-top .kpi b{font-size:22px}
  .dash .hero{padding:26px 28px;justify-content:center}
  .dash .hero .big{font-size:40px}
  .dash-col{gap:14px}
  .dash-col .chart{grid-template-columns:150px 1fr;padding:20px}
  /* Associés : cartes sur toute la largeur */
  .partners{grid-template-columns:repeat(auto-fit,minmax(230px,1fr))}
  .partners .pcard{width:auto;min-width:0}
  /* L'assistant vocal passe dans le menu latéral */
  .has-side~.fab{display:none}
  /* Ventes : les bâtiments côte à côte */
  .blds{display:grid;grid-template-columns:repeat(auto-fit,minmax(420px,1fr));gap:20px;align-items:start}
  .vsum{padding:20px}
  /* Menu « Plus » sur deux colonnes */
  .app.has-side .view[data-tab="plus"]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:start;max-width:1180px}
  .view[data-tab="plus"]>.sec,.view[data-tab="plus"]>.foot{grid-column:1/-1}
  /* Fenêtres centrées au lieu des feuilles qui montent du bas */
  .sheet{align-items:center;padding:24px}
  .sheet .panel{max-width:600px;border-radius:20px;max-height:88vh;padding:26px 30px}
  .sheet .grab{display:none}
  .tx:hover,.menu-row:hover,.ech:hover{background:var(--bg)}
  .kpi:hover,.lot:hover{filter:brightness(.98)}
}
@media (min-width:900px) and (prefers-reduced-motion:no-preference){.sheet .panel{animation:pop .16s ease-out}@keyframes pop{from{transform:scale(.97);opacity:.5}}}
@media (min-width:1200px){
  .side{width:260px}
  .app.has-side{margin-left:260px;padding:32px 40px 56px}
  .dash{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:24px;align-items:start}
  .dash-top{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:24px;align-items:stretch}
  .dash-top .kpis.k4{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;grid-auto-rows:1fr}
  .dash-top .kpi{padding:18px 20px}
  .dash-top .kpi b{font-size:26px}
  .dash-top .kpi small{font-size:12px}
  .dash-top .kpi span{font-size:13px}
  .dash-kpis{justify-content:space-between}
  .dash .hero{padding:28px 30px}
  .dash .hero .big{font-size:42px}
}
