:root {
  --bg: #f6f1ea;
  --surface: #ffffff;
  --surface-2: #efe7dc;
  --line: #e2d8ca;
  --ink: #1f1915;
  --ink-2: #5d544b;
  --ink-3: #8b8178;
  --accent: #2e1a12;
  --on-accent: #fbf5f1;
  --liz: #7a5a3f;
  --liz-soft: #ece2d4;
  --ose: #c4566a;
  --ose-soft: #f7dde1;
  --good: #2f7d4f;
  --warn: #a8670a;
  --bad: #b3372b;
  --radius: 14px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  --serif: "New York", "Iowan Old Style", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1512;
    --surface: #251e1a;
    --surface-2: #30271f;
    --line: #3d332b;
    --ink: #f3ebe3;
    --ink-2: #c4b8ac;
    --ink-3: #8f8378;
    --accent: #f1d9a6;
    --on-accent: #241812;
    --liz: #c9a383;
    --liz-soft: #3a2e24;
    --ose: #ea8d9c;
    --ose-soft: #43272c;
    --good: #6cc08f;
    --warn: #e0a64a;
    --bad: #ec7b6e;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Structure ---------- */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 24px; padding: calc(24px + env(safe-area-inset-top)) 14px 20px; border-right: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: baseline; gap: 10px; padding: 0 10px; }
.mark { font-family: var(--serif); font-weight: 700; font-size: 1.9rem; letter-spacing: -0.03em; }
.brand-sub { font-size: .8rem; color: var(--ink-3); }
.tabs { display: grid; gap: 2px; }
.tabs a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.tabs a:hover { background: var(--surface-2); }
.tabs a.on { background: var(--accent); color: var(--on-accent); }
.tabs svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; flex: none; }
.sync-state { margin-top: auto; font-size: .78rem; color: var(--ink-3); padding: 0 10px; }
.sync-state b { color: var(--ink-2); font-weight: 600; }
.main { min-width: 0; padding: calc(20px + env(safe-area-inset-top)) 32px 48px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 auto 22px; max-width: 1180px; }
.top h1 { margin: 0; font-family: var(--serif); font-size: 2rem; letter-spacing: -0.02em; }
.year { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: .85rem; }
.view { max-width: 1180px; margin: 0 auto; display: grid; gap: 22px; }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: auto 0 0 0; height: auto; z-index: 20; flex-direction: row; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .brand, .sync-state { display: none; }
  .tabs { grid-template-columns: repeat(6, 1fr); width: 100%; gap: 0; }
  .tabs a { flex-direction: column; gap: 2px; padding: 6px 0; font-size: .66rem; border-radius: 8px; }
  .tabs a.on { background: transparent; color: var(--accent); }
  .tabs a.on svg { stroke-width: 2.2; }
  .tabs svg { width: 22px; height: 22px; }
  .main { padding: calc(14px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom)); }
  .top h1 { font-size: 1.6rem; }
}

/* ---------- Blocs ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.card > h2, .sec-title { margin: 0 0 12px; font-size: 1.02rem; font-weight: 650; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card > h2 small, .muted { color: var(--ink-3); font-weight: 400; font-size: .85rem; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: 1fr; } }

.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; min-width: 0; }
.kpi .k { font-size: .8rem; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 1.55rem; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .s { font-size: .78rem; color: var(--ink-3); }
.kpi.liz { box-shadow: inset 4px 0 0 var(--liz); }
.kpi.ose { box-shadow: inset 4px 0 0 var(--ose); }
.kpi.hero .v { font-size: 2rem; }
@media (max-width: 640px) { .kpi .v { font-size: 1.3rem; } .kpi.hero .v { font-size: 1.6rem; } }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot.liz { background: var(--liz); } .dot.ose { background: var(--ose); }

.banner { border-radius: var(--radius); padding: 14px 18px; background: var(--surface-2); color: var(--ink-2); font-size: .92rem; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner b { color: var(--ink); }

/* ---------- Boutons & champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 10px; font-weight: 550; font-size: .9rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.12); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: .82rem; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
input[type=text], input[type=number], input[type=date], input[type=email], input[type=password], input[type=url], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0;
}
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.year select { width: auto; padding: 6px 30px 6px 10px; font-weight: 600; color: var(--ink); }
label.f { display: grid; gap: 5px; font-size: .84rem; color: var(--ink-2); font-weight: 500; }
label.chk { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 540px) { .form-grid { grid-template-columns: 1fr; } }
.hint { font-size: .8rem; color: var(--ink-3); margin: 0; }

/* ---------- Listes ---------- */
.list { display: grid; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--line); cursor: pointer; }
.row:first-child { border-top: 0; }
.row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.row .t { font-weight: 550; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .d { font-size: .8rem; color: var(--ink-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .m { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.row .m.pos { color: var(--good); }
.row .r2 { font-size: .8rem; text-align: right; }
.empty { padding: 22px 8px; text-align: center; color: var(--ink-3); font-size: .9rem; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 99px; font-size: .72rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.tag.liz { background: var(--liz-soft); color: var(--liz); }
.tag.ose { background: var(--ose-soft); color: var(--ose); }
.tag.good { color: var(--good); } .tag.warn { color: var(--warn); } .tag.bad { color: var(--bad); }
.tag.good::before, .tag.warn::before, .tag.bad::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

table.t { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
table.t th { text-align: left; font-weight: 550; color: var(--ink-3); font-size: .78rem; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.t td { padding: 8px; border-bottom: 1px solid var(--line); }
table.t td.n, table.t th.n { text-align: right; white-space: nowrap; }
table.t tr.tot td { font-weight: 650; border-bottom: 0; }
.scroll-x { overflow-x: auto; }

.bank-row { display: grid; grid-template-columns: 104px 1fr 110px 130px 150px; gap: 10px; align-items: center; padding: 9px 2px; border-top: 1px solid var(--line); font-size: .88rem; }
.bank-row:first-child { border-top: 0; }
.bank-row .lib { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bank-row .m { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bank-row select { padding: 6px 26px 6px 8px; font-size: .82rem; }
@media (max-width: 760px) {
  .bank-row { grid-template-columns: 1fr auto; }
  .bank-row .dt { grid-column: 1 / -1; font-size: .75rem; color: var(--ink-3); }
  .bank-row .lib { white-space: normal; }
}

/* ---------- Jauges ---------- */
.meter { display: grid; gap: 6px; }
.meter .lab { display: flex; justify-content: space-between; gap: 10px; font-size: .85rem; }
.meter .lab b { font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.bar i.liz { background: var(--liz); } .bar i.ose { background: var(--ose); } .bar i.warn { background: var(--warn); } .bar i.bad { background: var(--bad); }

/* ---------- Graphique ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--ink-3); font-size: 11px; }
.chart .b-liz { fill: var(--liz); } .chart .b-ose { fill: var(--ose); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover { fill: color-mix(in srgb, var(--ink) 5%, transparent); }
.legend { display: flex; gap: 16px; font-size: .82rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: .8rem; line-height: 1.4; white-space: nowrap; transform: translate(-50%, calc(-100% - 8px)); opacity: 0; transition: opacity .12s; z-index: 2; font-variant-numeric: tabular-nums; }
.tip.on { opacity: 1; }

/* ---------- Dialogue ---------- */
.dlg { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); }
.dlg::backdrop { background: rgba(20,14,10,.45); }
.dlg form { display: grid; gap: 16px; padding: 22px; }
.dlg h3 { margin: 0; font-family: var(--serif); font-size: 1.4rem; }
.dlg .act { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.dlg .act .r { display: flex; gap: 8px; margin-left: auto; }
.dlg.wide { width: min(900px, calc(100vw - 24px)); }
.preview { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.preview table.t { font-size: .78rem; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 820px) { .toast { bottom: calc(86px + env(safe-area-inset-bottom)); } }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; font-size: .84rem; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.sub-tabs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* ---------- Suivi mensuel Lizeor ---------- */
.seg-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg-scroll::-webkit-scrollbar { display: none; }
.seg-scroll button { white-space: nowrap; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav select { width: auto; font-weight: 650; font-size: 1.05rem; text-transform: capitalize; }
.month-nav .btn[disabled] { opacity: .35; cursor: default; }
.releve h2 small { font-weight: 400; color: var(--ink-3); }
.m-big { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-big small { font-size: .78rem; font-weight: 400; color: var(--ink-3); }
.rel-figs { display: flex; flex-wrap: wrap; gap: 6px 22px; font-variant-numeric: tabular-nums; font-weight: 600; margin-bottom: 8px; }
.rel-figs small { display: block; font-size: .72rem; font-weight: 500; color: var(--ink-3); }
.rel-det summary { cursor: pointer; font-size: .86rem; color: var(--ink-2); padding: 4px 0; }
.rel-det .list { margin: 6px 0 4px; }
.steps { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.step-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 12px 6px 8px; cursor: pointer; font-size: .88rem; font-weight: 550; text-align: left; }
.step-btn i { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--ink-3); display: grid; place-items: center; font-style: normal; font-size: .8rem; flex: none; }
.step-btn small { display: block; font-size: .72rem; font-weight: 400; color: var(--ink-3); }
.step-btn.on { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); background: color-mix(in srgb, var(--good) 8%, var(--surface)); }
.step-btn.on i { background: var(--good); border-color: var(--good); color: #fff; }
.pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
@media (max-width: 800px) { .pay-grid { grid-template-columns: 1fr; } }
.pay { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; align-content: start; justify-items: start; }
.pay-h { display: flex; justify-content: space-between; gap: 10px; width: 100%; }
.pay-h .m { font-weight: 700; font-variant-numeric: tabular-nums; }
table.compta td, table.compta th { white-space: nowrap; }
table.compta tr.dim td { color: var(--ink-3); }
table.compta td:first-child { position: sticky; left: 0; background: var(--surface); text-transform: capitalize; }
.view > * { min-width: 0; }
.sub-tabs { min-width: 0; }
.sub-tabs > .seg { min-width: 0; }
.list.todo .row .t { white-space: normal; }
.live { border-radius: 12px; background: var(--surface-2); padding: 12px 14px; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 16px; }
.live-grid span { display: grid; gap: 1px; min-width: 0; }
.live-grid small { font-size: .74rem; color: var(--ink-3); }
.live-grid b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.live-grid em { font-style: normal; font-size: .72rem; color: var(--ink-3); }
.live-grid .hl b { color: var(--liz); }
.row .split { grid-column: 1 / -1; font-size: .8rem; color: var(--ink-2); }
.row .split b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.form-grid { align-items: start; }
.live { position: sticky; bottom: -22px; z-index: 1; box-shadow: 0 -10px 18px -12px rgba(0,0,0,.25); }
.search-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.search { position: relative; flex: 1 1 220px; display: block; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search input { width: 100%; padding: 9px 11px 9px 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); -webkit-appearance: none; appearance: none; }
.benef { font-size: .74rem; font-weight: 600; color: var(--good); }
.benef.neg { color: var(--bad); }
.benef-line { margin: 0; font-size: .86rem; }
.benef-line b { color: var(--good); font-variant-numeric: tabular-nums; }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* ---------- Prospection Osé ---------- */
.chips-f { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-f button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 11px; font-size: .82rem; font-weight: 550; cursor: pointer; color: var(--ink-2); }
.chips-f button.on { background: var(--ose); border-color: var(--ose); color: #fff; }
.chips-f button i { font-style: normal; opacity: .7; margin-left: 2px; font-variant-numeric: tabular-nums; }
.prospect { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 12px 4px; border-top: 1px solid var(--line); }
.prospect:first-child { border-top: 0; }
.prospect.due { box-shadow: inset 3px 0 0 var(--warn); padding-left: 12px; }
.pr-main { min-width: 0; display: grid; gap: 3px; }
.pr-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pr-h b { font-size: 1rem; }
.prospect .d { font-size: .8rem; color: var(--ink-3); }
.pr-ids { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.chip-cp { border: 1px solid var(--line); background: var(--surface-2); border-radius: 99px; padding: 3px 10px; font-size: .8rem; cursor: pointer; max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.pr-note { margin: 4px 0 0; font-size: .86rem; color: var(--ink-2); overflow-wrap: anywhere; }
.pr-flag { margin: 4px 0 0; font-size: .8rem; font-weight: 600; color: var(--warn); }
.pr-side { display: grid; gap: 6px; justify-items: end; align-content: start; }
.pr-side select { width: auto; padding: 6px 28px 6px 10px; font-size: .84rem; font-weight: 600; }
.pr-msg { grid-column: 1 / -1; display: grid; gap: 8px; background: var(--surface-2); border-radius: 12px; padding: 12px; justify-items: start; }
.pr-msg textarea { min-height: 170px; font-size: .86rem; width: 100%; }
.pr-msg label.f { width: 100%; }
@media (max-width: 640px) { .prospect { grid-template-columns: 1fr; } .pr-side { justify-items: start; } }
/* ---------- Avis ---------- */
.avis { padding: 12px 4px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.avis:first-child { border-top: 0; }
.avis.bas { box-shadow: inset 3px 0 0 var(--bad); padding-left: 12px; }
.avis-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: .9rem; }
.avis-h .muted { font-size: .8rem; }
.stars { color: #c99a2e; letter-spacing: 1px; }
.avis p { margin: 0; font-size: .9rem; color: var(--ink-2); overflow-wrap: anywhere; }
.avis .avis-rep { font-size: .82rem; color: var(--ink-3); border-left: 2px solid var(--line); padding-left: 8px; }
/* ---------- Agenda ---------- */
.tache { display: flex; gap: 6px; align-items: flex-start; font-size: .82rem; line-height: 1.3; min-width: 0; }
.tache span { min-width: 0; overflow-wrap: anywhere; }
.tache b { font-variant-numeric: tabular-nums; font-weight: 600; }
.tache.fait span { color: var(--ink-3); text-decoration: line-through; }
.tache.late span { color: var(--bad); }
.tk { flex: none; width: 16px; height: 16px; margin-top: 1px; border-radius: 5px; border: 1.5px solid var(--ink-3); background: var(--surface); font-size: .65rem; line-height: 1; display: grid; place-items: center; cursor: pointer; padding: 0; color: #fff; }
.tk.liz { border-color: var(--liz); } .tk.ose { border-color: var(--ose); } .tk.warn { border-color: var(--warn); } .tk.bad { border-color: var(--bad); }
.tache.fait .tk { background: var(--good); border-color: var(--good); }
.tk:disabled { cursor: default; }
.ag-grille { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ag-jt { font-size: .74rem; color: var(--ink-3); text-align: center; padding-bottom: 2px; }
.ag-c { min-height: 92px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 5px; display: grid; gap: 3px; align-content: start; min-width: 0; }
.ag-c.vide { border: 0; }
.ag-c.auj { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ag-c .tache { font-size: .7rem; }
.ag-c .tk { width: 12px; height: 12px; border-radius: 4px; }
.ag-n { font-size: .74rem; font-weight: 600; color: var(--ink-2); }
.ag-liste { display: grid; margin-top: 14px; }
.ag-li { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 8px 2px; border-top: 1px solid var(--line); align-items: start; }
.ag-li .tache { font-size: .88rem; }
.ag-d { font-size: .8rem; color: var(--ink-3); }
.ag-sem { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.ag-jour { border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: grid; gap: 6px; align-content: start; min-height: 140px; min-width: 0; }
.ag-jour.auj { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ag-jh { font-size: .8rem; color: var(--ink-3); }
.ag-jh b { color: var(--ink); font-size: 1rem; }
.ag-an { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ag-m { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px; text-align: left; display: grid; gap: 2px; cursor: pointer; }
.ag-m:hover { background: var(--surface-2); }
.ag-m.auj { border-color: var(--accent); }
.ag-m b { text-transform: capitalize; }
.ag-m span { font-size: .8rem; color: var(--ink-3); }
.ag-m i { font-style: normal; font-size: .78rem; font-weight: 600; color: var(--warn); }
.ag-m i.late { color: var(--bad); } .ag-m i.ok { color: var(--good); }
@media (max-width: 820px) {
  .ag-c { min-height: 54px; } .ag-c .tache span { display: none; } .ag-c .tache { display: inline-flex; }
  .ag-sem { grid-template-columns: 1fr; } .ag-jour { min-height: 0; }
  .ag-an { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ag-li { grid-template-columns: 1fr; gap: 2px; }
}

/* Facture affichée dans QG */
.fact-ov { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; }
.fact-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.fact-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .9rem; }
.fact-zone { flex: 1; overflow: auto; padding: 16px 12px calc(24px + env(safe-area-inset-bottom)); }
.fact-page { margin: 0 auto; background: #fff; box-shadow: 0 10px 40px -12px rgba(0,0,0,.35); border-radius: 6px; overflow: hidden; }
.fact-page iframe { border: 0; display: block; transform-origin: 0 0; background: #fff; }
.btn:disabled { opacity: .6; cursor: default; }
@media (max-width: 560px) { .fact-nom { order: -1; flex-basis: 100%; } }
.docs-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
@media (max-width: 560px) { .docs-btns { margin-left: 0; width: 100%; } }

/* Page d'un logement */
.mois-log { padding: 14px 0; border-bottom: 1px solid var(--line); }
.mois-log:last-child { border-bottom: 0; }
.ml-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ml-docs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 99px; padding: 5px 12px; font-size: .82rem; font-weight: 550; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip small { color: var(--ink-3); font-weight: 500; }
.ml-gen { font-size: .8rem; color: var(--ink-3); margin-left: auto; }
.fact-pdf { width: 100%; height: 100%; min-height: 70vh; border: 0; background: #fff; border-radius: 6px; }
pre.sql { white-space: pre-wrap; word-break: break-word; font-size: .72rem; background: var(--surface-2); padding: 10px; border-radius: 8px; max-height: 180px; overflow: auto; }
