/* Yiriwa — microfinance & tontine — feuille de style unique */
/* Polices de la marque Yiriwa (licence SIL Open Font License, voir fonts/LICENCE-OFL.txt) */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(/fonts/Inter-Regular.woff) format("woff"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url(/fonts/Inter-Medium.woff) format("woff"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(/fonts/Inter-SemiBold.woff) format("woff"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url(/fonts/Poppins-Medium.woff) format("woff"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url(/fonts/Poppins-Bold.woff) format("woff"); }
/* Charte Yiriwa : Vert Forêt #14532D, Vert Feuille #2A9150, Vert Tendre #8AD68C, Or Cauri #E8B640, Or Foncé #B07A14, Crème #F6F1E4 */
:root {
  --brand: #14532D; --brand-leaf: #2A9150; --brand-light: #8AD68C; --brand-gold: #E8B640; --brand-cream: #F6F1E4;
  --ink: #16261C; --ink-2: #44554A; --ink-3: #6B7A70;
  --bg: #F4F6F1; --surface: #ffffff; --line: #DCE3DA; --line-2: #EDF1EB;
  --primary: #1B7340; --primary-2: #14532D; --primary-soft: #E2F1E3;
  --gold: #B07A14; --gold-soft: #FBF1D6;
  --ok: #2e7d4f; --ok-soft: #e2f2e8; --warn: #8a6d1d; --warn-soft: #f8f0d8; --bad: #b3362f; --bad-soft: #f8e3e1; --info-soft: #e6eef8;
  --radius: 10px; --radius-s: 6px;
  --side: 244px; --head: 58px;
  --shadow: 0 1px 2px rgba(20, 83, 45, .06), 0 4px 14px rgba(20, 83, 45, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Arial, sans-serif;
  --font-title: "Poppins", "Inter", system-ui, sans-serif;
  --side-bg: #14532D; --on-primary: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #E6EEE8; --ink-2: #B3C2B8; --ink-3: #85968B; --bg: #0F1712; --surface: #17211A; --line: #29382D; --line-2: #1F2B23;
    --primary: #6CC38F; --primary-2: #8FD6A8; --primary-soft: #17331F; --gold: #E8B640; --gold-soft: #3A2E17;
    --ok: #6cc38f; --ok-soft: #173325; --warn: #e2c060; --warn-soft: #3a3217; --bad: #ee8077; --bad-soft: #3d1d1b; --info-soft: #1c2a3c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --side-bg: #0B2214; --on-primary: #0B2214;
  }
}
:root[data-theme="dark"] {
  --ink: #E6EEE8; --ink-2: #B3C2B8; --ink-3: #85968B; --bg: #0F1712; --surface: #17211A; --line: #29382D; --line-2: #1F2B23;
  --primary: #6CC38F; --primary-2: #8FD6A8; --primary-soft: #17331F; --gold: #E8B640; --gold-soft: #3A2E17;
  --ok: #6cc38f; --ok-soft: #173325; --warn: #e2c060; --warn-soft: #3a3217; --bad: #ee8077; --bad-soft: #3d1d1b; --info-soft: #1c2a3c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --side-bg: #0B2214; --on-primary: #0B2214;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-text-size-adjust: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-family: var(--font-title); font-weight: 700; letter-spacing: -.005em; }
h2, h3 { font-weight: 500; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
.num, td.num, .money { font-variant-numeric: tabular-nums; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--ink-3); } .small { font-size: .85rem; }
.hidden { display: none !important; }

/* ---------- Écran de chargement ---------- */
.splash { position: fixed; inset: 0; background: #14532D; display: grid; place-items: center; align-content: center; gap: 30px; }
.splash img { width: 190px; height: auto; }
.splash-bar { width: 140px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.18); overflow: hidden; position: relative; }
.splash-bar::after { content: ""; position: absolute; inset: 0; width: 40%; background: #E8B640; border-radius: 3px; animation: splash 1.1s ease-in-out infinite; }
@keyframes splash { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { .splash-bar::after { animation: none; width: 100%; } }

/* ---------- Structure générale ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--side-bg); color: #DCEBDF; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; gap: 10px; align-items: center; padding: 16px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand img { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; background: #fff; }
.brand .logo-ph { width: 36px; height: 36px; border-radius: 8px; background: var(--primary); display: grid; place-items: center; color: #fff; font-weight: 700; }
.brand b { display: block; color: #fff; font-family: var(--font-title); font-weight: 700; font-size: .98rem; line-height: 1.2; }
.brand span { font-size: .75rem; color: #A6CDB0; }
.brand img.app-icon { background: none; border-radius: 9px; }
.side-foot { padding: 14px 18px 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: #A6CDB0; font-size: .7rem; }
.side-foot img { height: 22px; width: auto; opacity: .85; }
.nav { padding: 8px 8px 24px; flex: 1; }
.nav a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: #DCEBDF; font-size: .92rem; border-left: 3px solid transparent; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: #E8B640; font-weight: 500; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav .sep { height: 1px; background: rgba(255,255,255,.08); margin: 8px 6px; }
.nav .badge { margin-left: auto; }
.main { min-width: 0; display: flex; flex-direction: column; }
.head { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.head-row { height: var(--head); display: flex; align-items: center; gap: 10px; padding: 0 18px; }
.head .menu-btn { display: none; }
.search-global { flex: 1; max-width: 440px; position: relative; }
.search-global input { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); color: var(--ink); font: inherit; font-size: .9rem; }
.search-global svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--ink-3); }
.search-results { position: absolute; top: 42px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 60vh; overflow: auto; z-index: 40; }
.search-results a { display: block; padding: 8px 12px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.search-results a small { display: block; color: var(--ink-3); }
.search-results a:hover, .search-results a.sel { background: var(--primary-soft); text-decoration: none; }
.head-info { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: .85rem; }
.caisse-badge { white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 16px; background: var(--gold-soft); color: var(--ink); font-weight: 600; border: 1px solid var(--gold); }
.caisse-badge.off { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 14px; background: var(--line-2); color: var(--ink-2); font-size: .8rem; white-space: nowrap; }
.net-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.net-dot.off { background: var(--bad); }
.space-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.space-switch a { padding: 4px 12px; font-size: .82rem; color: var(--ink-2); }
.space-switch a.on { background: var(--primary); color: var(--on-primary); text-decoration: none; }
.profile-btn { display: flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; color: var(--ink); font: inherit; padding: 4px; border-radius: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.content { padding: 22px 24px 60px; max-width: none; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { margin: 2px 0 0; color: var(--ink-3); font-size: .9rem; }
.crumbs { font-size: .82rem; color: var(--ink-3); margin-bottom: 4px; }
.offline-bar { background: var(--warn-soft); color: var(--warn); padding: 6px 18px; font-size: .85rem; display: flex; gap: 10px; align-items: center; }

/* ---------- Surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { margin: 0; }
.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)); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .v { font-size: 1.35rem; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .l { color: var(--ink-3); font-size: .82rem; }
.stat.accent { border-left: 3px solid var(--primary); }
.stat.warn { border-left: 3px solid var(--warn); } .stat.bad { border-left: 3px solid var(--bad); } .stat.ok { border-left: 3px solid var(--ok); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: .92rem; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; }

/* ---------- Tuiles des espaces ---------- */
.tile-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tile-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.tile-group h3 { font-size: .85rem; color: var(--ink-3); font-weight: 600; margin: 2px 4px 8px; }
.tile { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; color: var(--ink); }
.tile:hover { background: var(--primary-soft); text-decoration: none; }
.tile .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.tile .ic svg { width: 18px; height: 18px; }
.tile span { font-size: .93rem; }

/* ---------- Boutons, formulaires ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .9rem; font-weight: 550; cursor: pointer; white-space: nowrap; min-height: 38px; }
.btn:hover { border-color: var(--ink-3); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-2); }
.btn.danger { color: var(--bad); border-color: var(--bad); } .btn.danger.solid { background: var(--bad); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 9px; min-height: 30px; font-size: .82rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form .full { grid-column: 1 / -1; }
.field label { display: block; font-size: .83rem; color: var(--ink-2); margin-bottom: 3px; font-weight: 550; }
.field .hint { font-size: .78rem; color: var(--ink-3); margin-top: 3px; }
.field .req { color: var(--bad); }
input, select, textarea { font: inherit; color: var(--ink); }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .inp {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); min-height: 40px; font-size: .95rem; }
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field.check { display: flex; align-items: center; gap: 8px; } .field.check label { margin: 0; font-weight: 500; color: var(--ink); }
.field.check input { width: 18px; height: 18px; }
.money-input { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 10px; }
.filters .field { min-width: 140px; } .filters .field label { font-size: .76rem; }
.filters .field input, .filters .field select { min-height: 34px; padding: 5px 8px; font-size: .88rem; }
.picker { position: relative; }
.picker-list { position: absolute; z-index: 60; left: 0; right: 0; top: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: var(--shadow); max-height: 260px; overflow: auto; }
.picker-list div { padding: 7px 10px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.picker-list div:hover { background: var(--primary-soft); }
.picker-list small { color: var(--ink-3); display: block; }
.photo-box { display: flex; gap: 10px; align-items: center; }
.photo-box img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--line-2); }

/* ---------- Tableaux ---------- */
.dt-tools { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; }
.dt-tools .inp { max-width: 260px; min-height: 34px; padding: 5px 10px; font-size: .88rem; }
.dt-exports { display: flex; gap: 4px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
table.dt { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.dt th { text-align: left; font-weight: 600; color: var(--ink-2); background: var(--line-2); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
table.dt th.num, table.dt td.num { text-align: right; }
table.dt td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.dt tbody tr:hover { background: var(--primary-soft); }
table.dt tr.clickable { cursor: pointer; }
table.dt tfoot td { font-weight: 650; background: var(--line-2); }
table.dt td.actions { white-space: nowrap; text-align: right; }
.dt-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 2px; font-size: .84rem; color: var(--ink-3); flex-wrap: wrap; }
.empty { padding: 28px; text-align: center; color: var(--ink-3); }
.empty .btn { margin-top: 10px; }

/* ---------- Statuts ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: .76rem; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.st-ok { background: var(--ok-soft); color: var(--ok); } .st-warn { background: var(--warn-soft); color: var(--warn); } .st-bad { background: var(--bad-soft); color: var(--bad); } .st-info { background: var(--info-soft); color: var(--primary); }
tr.row-bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); } tr.row-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); } tr.row-ok td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.alert { border-radius: var(--radius-s); padding: 10px 12px; margin-bottom: 8px; display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; border: 1px solid transparent; }
.alert b { display: block; } .alert a { margin-left: auto; white-space: nowrap; }
.alert.info { background: var(--info-soft); } .alert.warning { background: var(--warn-soft); border-color: rgba(138,109,29,.25); } .alert.danger { background: var(--bad-soft); border-color: rgba(179,54,47,.25); } .alert.success { background: var(--ok-soft); }

/* ---------- Carnet : 12 pages x 31 jours ---------- */
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.page-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--surface); }
.page-card.cur { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.page-card header { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: 6px; }
.days { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.days i { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--line-2); font-style: normal; font-size: .62rem; color: var(--ink-3); display: grid; place-items: center; }
.days i.f { background: var(--primary); color: var(--on-primary); } .days i.c { background: var(--gold); color: #fff; }

/* ---------- Saisie rapide de la collecte ---------- */
.collect-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.collect-row:last-child { border-bottom: 0; }
.collect-row .who b { display: block; font-size: .95rem; }
.collect-row .who small { color: var(--ink-3); }
.collect-row.done { background: var(--ok-soft); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button { width: 38px; height: 38px; border: 0; background: var(--line-2); font-size: 1.15rem; cursor: pointer; color: var(--ink); }
.stepper input { width: 46px; height: 38px; border: 0; text-align: center; font-weight: 700; font-size: 1rem; background: var(--surface); }
.sticky-bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; z-index: 5; border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Fenêtres modales, notifications ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 22, 32, .48); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 640px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: min(1280px, 96vw); } .modal.narrow { max-width: 440px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.08rem; }
.modal-body { padding: 16px 18px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.x-btn { border: 0; background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink-3); padding: 4px 8px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); font-size: .9rem; animation: tin .18s ease-out; }
.toast.error { background: var(--bad); } .toast.success { background: var(--ok); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
.dropdown { position: absolute; right: 12px; top: calc(var(--head) - 4px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 240px; z-index: 50; padding: 6px; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 6px; color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--primary-soft); text-decoration: none; }
.dropdown .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: .85rem; }
.notif-item { padding: 8px 10px; border-bottom: 1px solid var(--line-2); font-size: .88rem; }
.notif-item.unread { background: var(--info-soft); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; font-size: .92rem; }
.tabs a.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; text-decoration: none; }
.help-btn { position: fixed; right: 18px; bottom: 18px; z-index: 30; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow); cursor: pointer; font-size: 1.2rem; font-weight: 700; }
.tour-tip { position: fixed; z-index: 300; background: var(--surface); border: 2px solid var(--primary); border-radius: 10px; padding: 12px 14px; max-width: 320px; box-shadow: var(--shadow); font-size: .9rem; }
.tour-hl { position: relative; z-index: 250; box-shadow: 0 0 0 4px var(--gold) !important; border-radius: 8px; }
.chart { width: 100%; height: 190px; }
.chart text { font-size: 10px; fill: var(--ink-3); }
.lock-screen { position: fixed; inset: 0; z-index: 500; background: var(--bg); display: grid; place-items: center; padding: 16px; }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: #14532D; color: #DCEBDF; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art h1 { color: #fff; font-size: 2.1rem; max-width: 14em; margin-top: 34px; }
.login-art .login-logo { width: 210px; height: auto; display: block; position: relative; }
.login-art > * { position: relative; z-index: 1; }
.login-art p { color: #BBD9C2; max-width: 30em; }
.login-art .login-deco { position: absolute; right: -90px; bottom: -70px; width: 430px; height: auto; opacity: .07; z-index: 0; transform: rotate(-14deg); pointer-events: none; }
.login-form .login-mobile-logo { display: none; }
.login-form { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.login-form form { width: 100%; max-width: 360px; }
.login-form .field { margin-bottom: 12px; }
.pw-wrap { position: relative; } .pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--primary); cursor: pointer; font-size: .82rem; }
.server-time { font-size: .82rem; color: var(--ink-3); margin-top: 18px; }

/* ---------- Petits écrans ---------- */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 90; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
  .head .menu-btn { display: inline-flex; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login { grid-template-columns: 1fr; } .login-art { display: none; }
  .login-form .login-mobile-logo { display: block; width: 170px; margin: 0 auto 26px; }
}
@media (max-width: 640px) {
  .content { padding: 14px 12px 70px; }
  .head-row { padding: 0 10px; gap: 6px; }
  .head-info .hide-sm { display: none; }
  .form, .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .search-global { max-width: none; min-width: 0; }
  .help-btn { bottom: 78px; right: 10px; width: 40px; height: 40px; }
  .caisse-badge { padding: 3px 8px; font-size: .78rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .v { font-size: 1.1rem; }
  .modal-bg { padding: 0; } .modal { border-radius: 0; min-height: 100vh; }
  .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print {
  .side, .head, .help-btn, .toasts, .dt-tools, .dt-foot, .btns, .filters, .no-print, .tabs { display: none !important; }
  .app { display: block; } .content { padding: 0; max-width: none; }
  .panel, .table-wrap { border: 0; } body { background: #fff; color: #000; font-size: 11px; }
  table.dt th { background: #eee !important; }
}

/* ---------- Listes longues : affichage partiel ---------- */
.dt-more { display: flex; gap: 8px; align-items: center; width: 100%; padding: 8px 12px; margin-bottom: 8px; border-radius: var(--radius-s); background: var(--gold-soft); color: var(--ink); font-size: .85rem; }
.dt-more svg { width: 16px; height: 16px; flex: none; color: var(--gold); }
.dt-foot { flex-wrap: wrap; }

/* ---------- Onglets de rubrique (sous le titre) ---------- */
.tabs.section-tabs { display: inline-flex; gap: 4px; padding: 4px; margin: -4px 0 18px; border: 0; border-radius: 12px; background: var(--line-2); max-width: 100%; }
.section-tabs a { border: 0; border-radius: 9px; padding: 7px 16px; color: var(--ink-2); font-weight: 500; }
.section-tabs a:hover { background: rgba(255,255,255,.6); text-decoration: none; }
.section-tabs a.on { background: var(--surface); color: var(--primary-2); box-shadow: var(--shadow); font-weight: 600; }
:root[data-theme="dark"] .section-tabs a.on { color: var(--primary); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .section-tabs a.on { color: var(--primary); } }

/* ---------- Accueil : indicateurs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
a.kpi:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 22px rgba(20, 83, 45, .12); }
.kpi::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--primary-soft); opacity: .55; pointer-events: none; }
.kpi > * { position: relative; z-index: 1; }
.kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.kpi-ic svg { width: 18px; height: 18px; }
.kpi-l { font-size: .86rem; color: var(--ink-2); font-weight: 500; }
.kpi-v { font-family: var(--font-title); font-weight: 700; font-size: 1.65rem; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-b { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 30px; }
.kpi-b > div { display: flex; flex-direction: column; gap: 3px; }
.kpi-sub { font-size: .8rem; color: var(--ink-3); }
.kpi .spark { color: var(--primary); flex: none; }
.kpi.k-leaf { background: linear-gradient(135deg, #14532D, #1F7A42); color: #fff; border-color: transparent; }
.kpi.k-leaf::after { background: rgba(255,255,255,.08); opacity: 1; }
.kpi.k-leaf .kpi-l, .kpi.k-leaf .kpi-sub { color: #CDEBD0; }
.kpi.k-leaf .kpi-ic { background: rgba(255,255,255,.14); color: #E8B640; }
.kpi.k-leaf .spark { color: #E8B640; }
.kpi.k-leaf .trend.up { background: rgba(255,255,255,.15); color: #fff; }
.kpi.k-leaf .trend.down { background: rgba(255,255,255,.15); color: #FFD6D2; }
.kpi.k-gold .kpi-ic { background: var(--gold-soft); color: var(--gold); }
.kpi.k-gold::after { background: var(--gold-soft); }
.kpi.k-warn .kpi-ic { background: var(--bad-soft); color: var(--bad); }
.trend { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; width: fit-content; padding: 2px 8px; border-radius: 20px; font-size: .76rem; font-weight: 600; }
.trend svg { width: 13px; height: 13px; }
.trend.up { background: var(--ok-soft); color: var(--ok); }
.trend.down { background: var(--bad-soft); color: var(--bad); }
.mini-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.mini-stats > * { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: .86rem; }
.mini-stats a:hover { text-decoration: none; border-color: var(--primary); }
.mini-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.dash-grid > div > .panel { border-radius: 16px; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.panel.quick .tile-groups { margin: 0; }
.tasks-panel .task { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink); border: 1px solid var(--line-2); margin-bottom: 8px; background: var(--bg); }
.tasks-panel .task:hover { text-decoration: none; border-color: var(--primary); }
.task-n { min-width: 36px; height: 36px; padding: 0 8px; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-title); font-weight: 700; background: var(--primary-soft); color: var(--primary); }
.task.warn .task-n { background: var(--gold-soft); color: var(--gold); }
.task.bad .task-n { background: var(--bad-soft); color: var(--bad); }
.task-l { flex: 1; font-size: .9rem; }
.task-go { width: 16px; height: 16px; color: var(--ink-3); }
.all-good { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 12px; background: var(--ok-soft); color: var(--ok); }
.all-good svg { width: 26px; height: 26px; flex: none; }
.all-good span { display: block; color: var(--ink-2); font-size: .85rem; }
.cta-collect { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-bottom: 18px; border-radius: 16px; background: linear-gradient(135deg, #E8B640, #D9A12E); color: #2A1E05; box-shadow: 0 6px 18px rgba(176, 122, 20, .25); }
.cta-collect:hover { text-decoration: none; filter: brightness(1.03); }
.cta-collect > svg { width: 30px; height: 30px; flex: none; }
.cta-collect > svg:last-child { width: 22px; height: 22px; }
.cta-collect span { flex: 1; } .cta-collect b { display: block; font-family: var(--font-title); font-size: 1.15rem; } .cta-collect small { color: #4A3610; }
.panel.quick .tile-groups { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.panel.quick .tile-group { border: 0; background: var(--bg); border-radius: 12px; padding: 10px; }
.panel.quick .tile { padding: 8px; border-radius: 10px; }
.panel.quick .tile:hover { background: var(--surface); box-shadow: var(--shadow); }

/* ---------- Réussite animée ---------- */
.celebrate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(10, 30, 18, .28); animation: cel-in .2s ease; }
.celebrate.out { opacity: 0; transition: opacity .35s ease; }
.cel-card { background: var(--surface); border-radius: 22px; padding: 26px 34px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.25); display: flex; flex-direction: column; align-items: center; gap: 6px; animation: cel-pop .35s cubic-bezier(.2,1.4,.4,1); max-width: 86vw; }
.cel-card b { font-family: var(--font-title); font-size: 1.15rem; } .cel-card span { color: var(--ink-2); font-size: .95rem; }
.cel-check { width: 74px; height: 74px; margin-bottom: 6px; }
.cel-check circle { fill: var(--ok-soft); stroke: var(--primary); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; animation: cel-draw .45s ease forwards; }
.cel-check path { fill: none; stroke: var(--primary); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: cel-draw .3s .35s ease forwards; }
@keyframes cel-draw { to { stroke-dashoffset: 0; } }
@keyframes cel-pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes cel-in { from { opacity: 0; } }
.op-done { text-align: center; margin-bottom: 14px; }
.op-done .cel-check { width: 64px; height: 64px; }
.op-amt { font-family: var(--font-title); font-weight: 700; font-size: 1.8rem; }
.btn.wa { background: #25D366; border-color: #25D366; color: #fff; } .btn.wa:hover { background: #1EB955; text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .celebrate, .cel-card, .cel-check circle, .cel-check path { animation: none !important; stroke-dashoffset: 0 !important; } }

/* ---------- Collecte terrain ---------- */
.collect-progress { display: flex; align-items: center; gap: 16px; padding: 14px 18px; margin-bottom: 14px; border-radius: 16px; background: linear-gradient(135deg, #14532D, #1F7A42); color: #fff; }
.collect-progress:empty { display: none; }
.cp-ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(#E8B640 calc(var(--p) * 1%), rgba(255,255,255,.18) 0); }
.cp-ring span { width: 50px; height: 50px; border-radius: 50%; background: #17603A; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.cp-txt { flex: 1; min-width: 0; } .cp-txt b { display: block; font-family: var(--font-title); font-size: 1.1rem; } .cp-txt span { color: #CDEBD0; font-size: .88rem; }
.cp-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.18); margin-top: 8px; overflow: hidden; } .cp-bar i { display: block; height: 100%; background: #E8B640; border-radius: 6px; transition: width .4s ease; }
.chips-filter { display: flex; gap: 8px; margin: 0 0 10px; overflow-x: auto; }
.chip-f { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); padding: 7px 14px; border-radius: 20px; font: inherit; font-size: .88rem; cursor: pointer; white-space: nowrap; }
.chip-f.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.collect-panel { border-radius: 16px; overflow: hidden; }
.collect-row { grid-template-columns: auto 1fr auto !important; cursor: pointer; padding: 12px 14px !important; transition: background .15s; }
.collect-row:hover { background: var(--line-2); }
.collect-row.picked { background: var(--gold-soft); box-shadow: inset 4px 0 0 var(--brand-gold); }
.collect-row .av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: .9rem; flex: none; }
.collect-row.done .av { background: var(--primary); color: #fff; } .collect-row .av svg { width: 20px; height: 20px; }
.collect-row .who small { display: block; } .collect-row .ok-txt { color: var(--ok); font-weight: 500; } .collect-row .calc { color: var(--gold); }
.collect-row .stepper button { width: 44px; height: 44px; font-size: 1.3rem; }
.collect-row .stepper input { width: 48px; height: 44px; font-size: 1.1rem; }
.sticky-bar .sum-v { font-family: var(--font-title); font-size: 1.15rem; color: var(--primary); }
.btn.big { padding: 12px 20px; font-size: 1rem; border-radius: 12px; }

/* ---------- Fiche client 360° ---------- */
.client-hero { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; padding: 18px 20px; margin-bottom: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ch-id { display: flex; gap: 16px; align-items: center; min-width: 0; }
.ch-photo { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; flex: none; border: 3px solid var(--primary-soft); }
.ch-photo.ph { display: grid; place-items: center; background: linear-gradient(135deg, #14532D, #2A9150); color: #fff; font-family: var(--font-title); font-weight: 700; font-size: 1.5rem; }
.ch-name { font-family: var(--font-title); font-weight: 700; font-size: 1.4rem; line-height: 1.2; }
.ch-meta { color: var(--ink-3); font-size: .88rem; margin: 3px 0 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ch-contact { display: flex; gap: 8px; flex-wrap: wrap; }
.ch-figs { display: grid; grid-template-columns: repeat(4, minmax(120px, auto)); gap: 10px; }
.ch-figs > div { padding: 10px 14px; border-radius: 12px; background: var(--bg); }
.ch-figs span { display: block; font-size: .78rem; color: var(--ink-3); }
.ch-figs b { font-family: var(--font-title); font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-figs .sc.ok b { color: var(--ok); } .ch-figs .sc.warn b { color: var(--warn); } .ch-figs .sc.bad b { color: var(--bad); }
@media (max-width: 900px) { .ch-figs { grid-template-columns: repeat(2, 1fr); width: 100%; } }
.client-tabs { position: sticky; top: calc(var(--head) + 4px); z-index: 6; background: var(--bg); }

/* ---------- Barre de navigation mobile ---------- */
.bottom-nav { display: none; }
@media (max-width: 960px) {
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; height: calc(64px + env(safe-area-inset-bottom)); padding: 6px 6px env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(20, 83, 45, .08); justify-content: space-around; align-items: center; }
  .bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 2px; color: var(--ink-3); font: inherit; font-size: .7rem; font-weight: 500; background: none; border: 0; cursor: pointer; text-decoration: none; min-width: 0; }
  .bottom-nav span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .bottom-nav svg { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav a.active svg { stroke-width: 2.3; }
  .bottom-nav .bn-main { flex: none; width: 66px; height: 66px; margin-top: -26px; border-radius: 50%; background: linear-gradient(135deg, #E8B640, #D29A26); color: #2A1E05; justify-content: center; box-shadow: 0 6px 16px rgba(176, 122, 20, .35); border: 4px solid var(--surface); }
  .bottom-nav .bn-main span { font-size: .62rem; font-weight: 700; }
  .content { padding-bottom: 96px !important; }
  .help-btn { bottom: calc(80px + env(safe-area-inset-bottom)) !important; }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)) !important; }
  .sticky-bar { bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* ---------- États vides ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 20px; }
.empty-state .es-ic { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 6px; }
.empty-state .es-ic svg { width: 28px; height: 28px; }
.empty-state b { color: var(--ink-2); font-weight: 600; } .empty-state span { font-size: .86rem; }
.empty-state .btn { margin-top: 8px; }

/* ---------- Palette de commandes (Ctrl+K) ---------- */
.kbd-hint { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
kbd { display: inline-block; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--surface); color: var(--ink-3); font: 600 .7rem/1.5 var(--font); }
.palette { position: fixed; inset: 0; z-index: 150; background: rgba(10, 30, 18, .35); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 14px 14px; animation: cel-in .12s ease; }
.pal-box { width: 100%; max-width: 620px; background: var(--surface); border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.3); overflow: hidden; border: 1px solid var(--line); }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pal-in svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.pal-in input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 1.05rem; background: none; color: var(--ink); min-width: 0; }
.pal-list { max-height: 52vh; overflow: auto; padding: 6px; }
.pal-list a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.pal-list a svg { width: 18px; height: 18px; color: var(--primary); flex: none; }
.pal-list a span { flex: 1; min-width: 0; } .pal-list small { display: block; color: var(--ink-3); font-size: .8rem; }
.pal-list a em { font-style: normal; font-size: .72rem; color: var(--ink-3); background: var(--line-2); padding: 2px 8px; border-radius: 10px; }
.pal-list a.sel, .pal-list a:hover { background: var(--primary-soft); text-decoration: none; }
.pal-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: .75rem; color: var(--ink-3); flex-wrap: wrap; }
@media (max-width: 640px) { .pal-foot { display: none; } .palette { padding-top: 8vh; } }
.search-global input { padding-right: 62px; }
@media (max-width: 960px) {
  .collect-panel { margin-bottom: 92px; overflow: visible; }
  .collect-panel .sticky-bar { position: fixed; left: 10px; right: 10px; bottom: calc(74px + env(safe-area-inset-bottom)); border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(0,0,0,.18); z-index: 70; }
}
@media (max-width: 640px) {
  .kbd-hint { display: none; } .search-global input { padding-right: 12px; }
  .collect-row { grid-template-columns: auto 1fr !important; }
  .collect-row .stepper { grid-column: 2; justify-self: start; }
  .collect-panel .sticky-bar .sum { font-size: .85rem; }
  .collect-progress { padding: 12px 14px; gap: 12px; }
}
@media (max-width: 640px) {
  .search-global { flex: 1 1 0; min-width: 44px; }
  .caisse-badge { max-width: 104px; overflow: hidden; text-overflow: ellipsis; font-size: .76rem; padding: 3px 9px; }
  .head-info { gap: 4px; flex: none; }
}

/* ---------- Santé du système ---------- */
.health-hero { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: 16px; margin-bottom: 16px; }
.health-hero.ok { background: var(--ok-soft); } .health-hero.warn { background: var(--warn-soft); } .health-hero.bad { background: var(--bad-soft); }
.hh-ic { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface); }
.health-hero.ok .hh-ic { color: var(--ok); } .health-hero.warn .hh-ic { color: var(--warn); } .health-hero.bad .hh-ic { color: var(--bad); }
.hh-ic svg { width: 26px; height: 26px; }
.health-hero b { display: block; font-family: var(--font-title); font-size: 1.15rem; } .health-hero span { color: var(--ink-2); font-size: .88rem; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.hc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; border-top: 3px solid var(--ok); }
.hc.warn { border-top-color: var(--brand-gold); } .hc.bad { border-top-color: var(--bad); }
.hc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .hc-l { flex: 1; font-weight: 600; font-size: .9rem; }
.hc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); } .hc.warn .hc-dot { background: var(--brand-gold); } .hc.bad .hc-dot { background: var(--bad); }
.hc-v { font-family: var(--font-title); font-weight: 700; font-size: 1.1rem; } .hc-d { color: var(--ink-3); font-size: .82rem; margin-top: 2px; }
.hc-a { display: flex; gap: 6px; margin-top: 8px; font-size: .82rem; color: var(--ink-2); background: var(--bg); border-radius: 8px; padding: 7px 9px; }
.hc-a svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--gold); }
.steps-list li { margin-bottom: 6px; }
.ai-panel h2 svg, .panel-head h2 svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--primary); }
.ai-answer { background: var(--primary-soft); border-radius: 12px; padding: 12px 16px; margin-top: 10px; line-height: 1.6; }
.ai-answer p:last-child, .ai-answer ul:last-child, .ai-answer ol:last-child { margin-bottom: 0; }
.ai-wait { display: flex; align-items: center; gap: 4px; color: var(--ink-3); padding: 12px 0; font-size: .9rem; }
.ai-wait span { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: ai-b 1s infinite ease-in-out; } .ai-wait span:nth-child(2) { animation-delay: .15s; } .ai-wait span:nth-child(3) { animation-delay: .3s; margin-right: 6px; }
@keyframes ai-b { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* ---------- Tournées ---------- */
.tour-map { margin: 10px 0; } .tour-map svg { width: 100%; height: auto; display: block; }
.tour-map figcaption { font-size: .8rem; color: var(--ink-3); margin-top: 4px; }
.tm-bg { fill: var(--primary-soft); } .tm-path { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-dasharray: 6 5; stroke-linejoin: round; }
.tm-pt { fill: var(--surface); stroke: var(--primary); stroke-width: 2.5; } .tm-pt.first { fill: var(--primary); } .tm-pt.last { fill: var(--brand-gold); stroke: var(--gold); }
.tour-map text { font: 700 9px var(--font); fill: var(--ink); pointer-events: none; }
.tour-list { display: grid; gap: 6px; } .tour-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg); color: var(--ink); }
.tour-list a:hover { text-decoration: none; background: var(--primary-soft); } .tour-list a span:nth-child(2) { flex: 1; } .tour-list small { display: block; color: var(--ink-3); }
.tl-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-size: .78rem; font-weight: 700; flex: none; }
/* Icônes placées dans un texte : taille du texte */
p > svg[viewBox="0 0 24 24"], li > svg[viewBox="0 0 24 24"], span > svg[viewBox="0 0 24 24"].inl, .small > svg[viewBox="0 0 24 24"], .muted > svg[viewBox="0 0 24 24"] { width: 1.15em; height: 1.15em; vertical-align: -.22em; flex: none; }
@media (max-width: 640px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpis > .kpi:first-child { grid-column: 1 / -1; }
  .kpi { padding: 12px 14px; border-radius: 14px; gap: 4px; }
  .kpi-v { font-size: 1.2rem; } .kpis > .kpi:first-child .kpi-v { font-size: 1.6rem; }
  .kpi-ic { width: 28px; height: 28px; border-radius: 8px; } .kpi-l { font-size: .78rem; }
  .kpi .spark { display: none; } .kpis > .kpi:first-child .spark { display: block; }
  .kpi-b { min-height: 0; } .kpi::after { width: 80px; height: 80px; right: -30px; top: -30px; }
  .net .net-label { display: none; } .net { padding: 6px; }
  .profile-btn { padding: 2px; }
  .page-head .btns { gap: 6px; }
}
/* Accès provisoires lisibles */
.cred { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; padding: 14px 16px; border-radius: 12px; background: var(--primary-soft); margin: 10px 0; }
.cred span { color: var(--ink-2); font-size: .85rem; }
.cred b { font-size: 1.25rem; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .06em; }
.cred .pw i { font-style: normal; } .cred .pw i.dg { color: var(--ok); } .cred .pw i.up { text-decoration: underline; text-underline-offset: 3px; }

/* Bandes décoratives retirées (demande du client) */

/* Onglets : passent à la ligne au lieu d'être coupés (tous les onglets restent visibles, même sur petit écran) */
.tabs { flex-wrap: wrap; overflow: visible; }
.tabs.section-tabs { flex-wrap: wrap; }
@media (max-width: 700px) {
  .tabs:not(.section-tabs) { gap: 6px; border-bottom: 0; }
  .tabs:not(.section-tabs) a { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: var(--surface); }
  .tabs:not(.section-tabs) a.on { background: var(--primary); color: #fff; border-color: var(--primary); }
  .section-tabs a { padding: 6px 12px; }
}

/* Crédit éditeur (ODISIA GROUP) et assistance : discret mais présent */
.credit { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: .72rem; letter-spacing: .02em; }
.credit i { width: 1px; height: 11px; background: currentColor; opacity: .35; }
.credit b { font-weight: 600; letter-spacing: .06em; }
.credit a { color: inherit; text-decoration: none; white-space: nowrap; }
.credit a:hover { text-decoration: underline; }
.login-credit p { margin: 0 0 10px; }
.login-art .credit { color: #8FB79A; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); max-width: 30em; }
.login-form { position: relative; }
.login-foot { display: none; }
@media (max-width: 960px) {
  .login-form { padding-bottom: 64px; }
  .login-foot { display: flex; justify-content: center; position: absolute; left: 0; right: 0; bottom: 18px; color: var(--ink-3); opacity: .75; font-size: .68rem; }
}
.side-credit { font-size: .64rem; line-height: 1.5; color: rgba(255,255,255,.42); letter-spacing: .02em; }
.side-credit a { color: inherit; text-decoration: none; }
a[href^="tel:"] { white-space: nowrap; }

/* Flèche de retour (en-tête de chaque page) */
.ph-title { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.back-btn { flex: none; width: 38px; height: 38px; margin-top: 2px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: inline-grid; place-items: center; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.back-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.back-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.back-btn svg { width: 18px; height: 18px; }
@media (max-width: 640px) { .back-btn { width: 34px; height: 34px; } }
@media print { .back-btn { display: none !important; } }

/* Ordre de passage (tontine rotative) */
.order-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.order-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.order-list .ord-n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .85rem; }
.order-list .ord-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.order-list .ord-name small { color: var(--ink-3); }
.order-list button[disabled] { opacity: .3; }

/* ---------- Démo publique ---------- */
.demo-box { margin-top: 18px; text-align: center; }
.demo-or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .8rem; margin-bottom: 14px; }
.demo-or::before, .demo-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-btn { width: 100%; justify-content: center; gap: 8px; border: 1.5px solid var(--brand-gold); background: var(--gold-soft); color: var(--ink); font-weight: 600; }
.demo-btn svg { width: 16px; height: 16px; color: var(--gold); }
.demo-btn:not(:disabled):hover { background: var(--brand-gold); color: #16261C; }
.demo-btn:disabled { opacity: .55; cursor: not-allowed; filter: grayscale(.6); }
.demo-note { margin: 8px 0 4px; }
.demo-note b { color: var(--warn); font-weight: 600; }
.link-btn { background: none; border: 0; padding: 4px; color: var(--primary); font: inherit; font-size: .85rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.demo-bar { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 16px; background: #14532D; color: #F6F1E4; font-size: .85rem; }
.demo-bar .demo-tag { background: #E8B640; color: #14532D; font-weight: 700; letter-spacing: .08em; font-size: .7rem; padding: 2px 8px; border-radius: 999px; }
.demo-bar .demo-left { font-variant-numeric: tabular-nums; font-weight: 600; margin-left: auto; font-size: .95rem; }
.demo-bar.ending .demo-left { color: #E8B640; }
.demo-bar .btn { min-height: 28px; }
.demo-bar .demo-sub { background: #E8B640; border-color: #E8B640; color: #14532D; font-weight: 600; }
.demo-bar .demo-quit { color: #F6F1E4; }
.demo-bar ~ .head { top: 40px; }
.subscribe .sub-actions { display: grid; gap: 8px; margin: 14px 0; }
.subscribe .sub-actions .btn { justify-content: center; gap: 8px; }
.subscribe .sub-actions svg { width: 16px; height: 16px; }
@media (max-width: 560px) {
  .demo-bar { flex-wrap: nowrap; gap: 8px; padding: 6px 10px; }
  .demo-bar .demo-fict { display: none; }
  .demo-bar .btn { padding: 3px 8px; font-size: .78rem; }
}
.member-link { margin: 14px 0 0; text-align: center; }
.member-link a { color: var(--ink-2); text-decoration: none; }
.member-link b { color: var(--primary); font-weight: 600; }
.macc .big-code { font-size: 1.25rem; letter-spacing: .08em; font-family: var(--font-title); }

/* ---------- Tontine : cotisation journalière ---------- */
.dchip { display: inline-block; min-width: 42px; text-align: center; padding: 2px 6px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--line-2); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dchip.part { background: var(--gold-soft); color: var(--gold); }
.dchip.full { background: var(--ok-soft); color: var(--ok); }
.dt tr.row-sel > td { background: var(--primary-soft); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.round-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.chipbtn { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: .8rem; cursor: pointer; }
.chipbtn.done { color: var(--ok); border-color: var(--ok-soft); }
.chipbtn.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.daysheet th, .daysheet td { text-align: center; white-space: nowrap; }
.daysheet th:first-child, .daysheet td:first-child, .daysheet td:nth-child(2) { text-align: left; }
.daysheet .dcell.ok { color: var(--ok); font-weight: 700; font-size: 1.05rem; background: var(--ok-soft); }
.daysheet .dcell.late { background: var(--bad-soft); color: var(--bad); font-size: .8rem; }
.daysheet tfoot td { border-top: 2px solid var(--line); vertical-align: top; }
.daysheet tfoot .btn { margin-top: 4px; }
.cellbtn { background: none; border: 0; padding: 2px 8px; font: inherit; color: inherit; cursor: pointer; border-radius: 6px; }
.cellbtn:hover { background: rgba(0, 0, 0, .06); }
.daysheet .sticky-col { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; min-width: 170px; white-space: normal; box-shadow: 1px 0 0 var(--line); }
.daysheet thead .sticky-col { background: var(--line-2); z-index: 2; }
.daysheet tr.row-ok > td.sticky-col { background: var(--ok-soft); }
.daysheet .dcell.ok .cellbtn { font-weight: 600; font-size: .85rem; font-variant-numeric: tabular-nums; }
.daysheet th.th-today { background: var(--primary-soft); }
.daysheet td, .daysheet th { padding-left: 6px; padding-right: 6px; }
.daysheet .tick { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 6px; padding: 4px 8px; font: inherit; font-size: .8rem; cursor: pointer; white-space: nowrap; }
.daysheet .tick:hover { border-color: var(--primary); color: var(--primary); }
.daysheet .tick.on { border-color: transparent; background: none; color: var(--ok); font-weight: 700; }
.daysheet .tick.late { border-color: var(--bad); color: var(--bad); }
.daysheet td.ben { box-shadow: inset 0 0 0 2px var(--brand-gold); }
.daysheet .enc { margin-top: 4px; font-size: .75rem; font-weight: 700; color: var(--gold); line-height: 1.2; }
.daysheet .enc span { font-weight: 600; }
.daysheet .enc.wait { font-weight: 500; color: var(--ink-3); }
.daysheet .enc-btn { margin-top: 4px; }

/* ---------- Espaces Tontine / Microfinance ---------- */
.show-sm { display: none; }
@media (max-width: 640px) { .show-sm { display: inline; } .space-switch a { padding: 4px 9px; font-size: .78rem; } }
.space-switch a { font-weight: 600; }
:root[data-space="tontine"] .space-switch a.on { background: #B07A14; color: #fff; }
.space-chip { font-weight: 600; }
:root[data-space="tontine"] .space-chip { background: var(--gold-soft); color: var(--gold); }
.side .space-label { display: inline-block; margin-top: 3px; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.14); color: #F6F1E4; }
:root[data-space="tontine"] .side .space-label { background: #E8B640; color: #14532D; }
.space-tag { display: inline-block; vertical-align: middle; margin-left: 10px; font-family: var(--font); font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.space-tag.sp-tontine { background: var(--gold-soft); color: var(--gold); }
/* Choix de l'espace sur la page de connexion */
.space-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 18px; }
.space-pick button { text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; cursor: pointer; font: inherit; color: var(--ink); display: grid; gap: 2px; transition: border-color .15s, background .15s; }
.space-pick button b { font-family: var(--font-title); font-size: 1rem; }
.space-pick button span { font-size: .76rem; color: var(--ink-3); }
.space-pick button[data-sp="tontine"].on { border-color: #B07A14; background: var(--gold-soft); box-shadow: 0 0 0 3px rgba(232, 182, 64, .25); }
.space-pick button[data-sp="micro"].on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(27, 115, 64, .18); }
.cl-space { display: inline-block; margin-left: 6px; font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; vertical-align: middle; background: var(--gold-soft); color: var(--gold); text-transform: uppercase; letter-spacing: .04em; }
.cl-space.m { background: var(--primary-soft); color: var(--primary); }
.alert.gold-cta { background: var(--gold-soft); border-color: var(--brand-gold); color: var(--ink); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.alert.gold-cta .btns { flex-shrink: 0; }
/* Collecte : moyen de paiement */
.collect-panel .sticky-bar { flex-direction: column; align-items: stretch; gap: 8px; }
.sticky-bar .sb-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pay-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pay-lbl { font-size: .78rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.pay-pick { display: flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; flex: 1 1 260px; min-width: 0; }
.pay-pick button { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; border: 0; background: var(--surface); color: var(--ink-2); font: inherit; font-weight: 600; font-size: .85rem; padding: 9px 6px; cursor: pointer; white-space: nowrap; }
.pay-pick button + button { border-left: 1px solid var(--line); }
.pay-pick button.on[data-pm="especes"] { background: var(--primary); color: var(--on-primary); }
.pay-pick button.on[data-pm="orange_money"] { background: #FF7900; color: #fff; }
.pay-pick button.on[data-pm="moov_money"] { background: #0057A8; color: #fff; }
.pay-ref { flex-basis: 100%; }
@media (max-width: 640px) { .pay-lbl { display: none; } .pay-pick { flex-basis: 100%; } .pay-pick button { font-size: .78rem; padding: 10px 2px; } .sticky-bar .sb-row .sum { flex: 1; min-width: 0; } .sb-row .pr-btn { padding: 6px; } }
.sb-row .sum { margin-right: auto; }
/* Petits écrans (TPE 360 px) : en-tête compact, rien ne dépasse */
@media (max-width: 640px) {
  .head-info { gap: 4px; min-width: 0; flex-shrink: 1; }
  .head-info .space-chip { display: none; }
  .head-info .net .net-label { display: none; }
  .head-info .caisse-badge { max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .head-info .notif-btn { padding: 6px; }
  .head-row .search-global { flex: 1 1 40px; }
  .space-switch a { padding: 4px 7px; }
}
@media (max-width: 640px) {
  .sticky-bar .sb-row { flex-wrap: wrap; gap: 6px 8px; }
  .sticky-bar .sb-row .sum { flex: 1 1 100%; font-size: 13px; line-height: 1.3; }
  .sticky-bar .sb-row .btn.primary { flex: 1 1 auto; }
}
/* ---------- Cartes de membre : aperçu (1 em = 1 point de la carte imprimée) ---------- */
.mc-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.mc-pair figure { margin: 0; container-type: inline-size; }
.mc-pair figcaption { text-align: center; font-size: 12px; color: var(--muted, #6b7570); margin-top: 6px; }
.mcard { width: 100%; aspect-ratio: 85.6 / 53.98; font-size: calc(100cqw / 242.65); border-radius: 3.2em; overflow: hidden; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.06); color: #111A15; font-family: Helvetica, Arial, sans-serif; line-height: 1.15; position: relative; }
.mc-in { position: absolute; inset: 0; display: flex; flex-direction: column; }
.mc-band { height: 34em; border-bottom: 2em solid; display: flex; align-items: center; gap: 7em; padding: 0 8em 0 6em; flex: none; }
.mc-logo { background: #fff; height: 25em; padding: 0 2.5em; display: flex; align-items: center; border-radius: 1em; flex: none; }
.mc-logo img { max-height: 24em; max-width: 52em; display: block; }
.mc-bt { display: flex; flex-direction: column; gap: 2.5em; min-width: 0; }
.mc-bt b { color: #fff; font-size: 8.5em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-bt span { font-size: 6em; font-weight: 700; letter-spacing: .04em; }
.mc-body { flex: 1; display: flex; gap: 8em; padding: 7em 8em 0 11em; min-height: 0; }
.mc-body.with-photo { padding-left: 9em; }
.mc-photo { width: 46em; height: 56em; flex: none; border: .5em solid #CBD3CE; background: #F2F4F3; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.mc-photo img { width: 100%; height: 100%; object-fit: cover; }
.mc-id { flex: 1; min-width: 0; }
.mc-name { font-size: 9.6em; font-weight: 700; margin-bottom: .4em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.with-photo .mc-name { font-size: 8.4em; }
.mc-f { margin-top: 3.5em; }
.mc-f span { display: block; font-size: 5.3em; color: #6B7570; }
.mc-f b { display: block; font-size: 7em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-f.big b { font-size: 7.8em; }
.mc-zone { font-size: 5.6em; color: #44504A; margin-top: .6em; }
.mc-qr { width: 64em; flex: none; text-align: center; }
.mc-qrbox { border: .5em solid #E1E6E3; padding: 2em; background: #fff; }
.mc-qrbox svg { width: 100%; height: auto; display: block; }
.mc-qr span { font-size: 5em; font-weight: 700; color: #44504A; }
.mc-foot { height: 9em; flex: none; color: #fff; display: flex; align-items: center; padding: 0 8em; }
.mc-foot, .mc-foot.b { font-size: 1em; }
.mc-foot { font-size: 5em; height: 1.8em; padding: 0 1.6em; }
.mc-foot.b { justify-content: center; font-size: 4.6em; height: 1.52em; }
.mc-top { height: 5em; border-bottom: 1.5em solid; flex: none; }
.mc-rules { list-style: none; margin: 0; padding: 4.5em 9em 0; flex: 1; overflow: hidden; }
.mc-rules li { font-size: 5.3em; position: relative; padding-left: 1em; margin-bottom: .38em; }
.mc-rules li i { position: absolute; left: 0; top: .32em; width: .38em; height: .38em; }
.mc-sig { display: flex; justify-content: space-between; align-items: center; padding: 0 9em; height: 17em; flex: none; }
.mc-sigbox { width: 104em; height: 17em; border: .5em solid #BFC8C3; font-size: 1em; }
.mc-sigbox { font-size: 4.6em; width: 22.6em; height: 3.7em; padding: .4em .6em; color: #6B7570; }
.mc-sig img { max-height: 20em; max-width: 60em; }
.mc-found { font-size: 4.8em; color: #44504A; padding: .5em 1.9em .6em; flex: none; }
.mc-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mc-editor .mc-live { margin-bottom: 14px; }
.mc-color { display: flex; gap: 8px; align-items: center; }
.mc-color input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line, #ddd); border-radius: 8px; background: #fff; }
.mc-color .inp { max-width: 110px; font-family: monospace; }
.mc-rules li { font-size: 5.9em; margin-bottom: .3em; }
.mc-rules.sm li { font-size: 5.3em; }
.mc-rules.xs li { font-size: 4.8em; }
.mc-rules li.mc-h { font-size: 5.6em; font-weight: 700; padding-left: 0; margin-bottom: .55em; }
.mc-editor .mc-color input[type=color] { width: 52px; flex: none; }
.mc-editor .mc-color .inp { width: 110px; flex: none; }
.mc-prog { margin-top: 12px; }
.mc-prog .mc-bar { height: 10px; border-radius: 6px; background: var(--line, #e5e9e6); overflow: hidden; }
.mc-prog .mc-bar i { display: block; height: 100%; width: 0; background: var(--primary, #1B7A43); transition: width .2s; }
.mc-prog span { font-size: 13px; color: var(--muted, #6b7570); }
.mc-canvas { width: 100%; height: auto; display: block; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.06); }
.mc-h3 { font-size: 15px; margin: 18px 0 8px; }
.mc-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mc-tpl { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 8px; border: 2px solid var(--line, #dfe4e1); border-radius: 12px; background: var(--card, #fff); cursor: pointer; color: inherit; font: inherit; }
.mc-tpl.on { border-color: var(--primary, #1B7A43); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #1B7A43) 22%, transparent); }
.mc-tpl .mc-thumb { display: block; aspect-ratio: 85.6 / 53.98; border-radius: 6px; overflow: hidden; background: #eef1ef; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.mc-tpl .mc-thumb canvas { width: 100%; height: 100%; display: block; }
.mc-tpl b { font-size: 13px; margin-top: 4px; }
.mc-tpl small { font-size: 11px; color: var(--muted, #6b7570); line-height: 1.3; }
.mc-colors { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.mc-photo-demo { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 14px; }
/* Carte scannée : résumé des carnets */
.cs-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.cs-ph { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; }
.cs-ph.ini { display: flex; align-items: center; justify-content: center; background: var(--primary-soft, #E2F1E3); color: var(--primary, #1B7A43); font-weight: 700; font-size: 18px; }
.cs-name { font-size: 17px; }
.cs-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.cs-kpis > div { border: 1px solid var(--line, #dfe4e1); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; }
.cs-kpis span, .cs-k3 span { font-size: 11.5px; color: var(--muted, #6b7570); }
.cs-kpis b { font-size: 17px; }
.cs-kpis small { font-size: 11px; color: var(--muted, #6b7570); }
.cs-list { display: flex; flex-direction: column; gap: 8px; }
.cs-k { border: 1px solid var(--line, #dfe4e1); border-left: 4px solid var(--primary, #1B7A43); border-radius: 12px; padding: 10px 12px; }
.cs-k.off { opacity: .6; border-left-color: var(--line, #dfe4e1); }
.cs-k1 { display: flex; justify-content: space-between; align-items: center; }
.cs-k2 { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted, #6b7570); margin: 2px 0 8px; }
.cs-k3 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cs-k3 > div { display: flex; flex-direction: column; }
.cs-k3 b { font-size: 14px; }
.cs-k4 { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }
.cs-k4 .btns { display: flex; gap: 6px; margin: 0; }
.ok-txt { color: var(--ok, #1B7A43); }
@media (max-width: 520px) { .cs-k3, .cs-kpis { grid-template-columns: repeat(2, 1fr); } }
/* Collecte : total à valider bien visible (téléphone et TPE) */
.sticky-bar .sum { display: flex; flex-direction: column; line-height: 1.15; }
.sticky-bar .sum .sum-l { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.sticky-bar .sum .sum-v { font-family: var(--font-title); font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.sticky-bar .sum .sum-d { font-size: .8rem; color: var(--ink-2, #44504A); }
.sticky-bar .sum.has { background: color-mix(in srgb, var(--primary) 9%, transparent); border-radius: 10px; padding: 6px 10px; }
@media (max-width: 640px) {
  .sticky-bar .sb-row .sum { font-size: inherit; }
  .sticky-bar .sb-row .sum.has { flex: 1 1 100%; }
  .collect-panel .sticky-bar { gap: 6px; padding: 8px 10px; }
  .collect-panel .pay-pick button { padding: 8px 2px; }
}
.collect-row .who small b { display: inline; font-size: inherit; }
.collect-row .who small.calc:not(:empty) { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 8px; background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); font-weight: 700; font-size: .9rem; }
.collect-row .who small.calc b { color: var(--primary); }
/* Collecte : barre compacte — total à gauche, moyen de paiement en menu déroulant à droite */
.collect-panel .sticky-bar.cbar { flex-direction: column; align-items: stretch; gap: 8px; }
.cbar .cb-top { display: flex; align-items: center; gap: 10px; }
.cbar .cb-top .sum { flex: 1 1 auto; min-width: 0; padding: 6px 10px; border-radius: 10px; background: color-mix(in srgb, var(--primary) 9%, transparent); }
.cbar .cb-pm { display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto; margin: 0; }
.cbar .cb-pm span { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.cbar .pay-sel { min-width: 142px; font-weight: 700; padding: 10px 8px; }
.cbar .pay-sel[data-pm="orange_money"] { border-color: #FF7900; color: #C25B00; background: #FFF4EA; }
.cbar .pay-sel[data-pm="moov_money"] { border-color: #0057A8; color: #0057A8; background: #EEF5FC; }
.cbar .sb-row { display: flex; align-items: center; gap: 8px; }
.cbar .sb-row .btn.primary { flex: 1 1 auto; }
@media (max-width: 640px) {
  .cbar .sum .sum-v { font-size: 1.45rem; }
  .cbar .pay-sel { min-width: 128px; font-size: .9rem; }
}
.app-ver { opacity: .75; font-size: .72rem; }
/* Secours : même sans JavaScript à jour, la fin de la liste n'est jamais sous la barre du bas */
@media (max-width: 960px) { .collect-panel { margin-bottom: 230px; } }
.cf-msg { white-space: pre-line; }
.collect-row .who small.acpt { display:block; color: var(--gold, #B7791F); font-weight: 600; }
.dep-total { display:flex; flex-direction:column; background: color-mix(in srgb, var(--primary) 9%, transparent); border-radius: 10px; padding: 8px 12px; margin: 4px 0 6px; }
.dep-total span { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--ink-3); }
.dep-total b { font-size: 1.5rem; color: var(--primary); font-family: var(--font-title); }
.dep-total small { color: var(--ink-2, #44504A); }

/* Arrêt de caisse */
.arret .ar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ar-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.ar-card span { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-3); }
.ar-card b { font-size: 1.25rem; font-family: var(--font-title); }
.ar-card.big b { font-size: 1.5rem; color: var(--primary); }
.ar-card.ok { background: color-mix(in srgb, var(--primary) 9%, transparent); }
.ar-card small { color: var(--ink-3); font-size: .75rem; }
.ar-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 12px 0 6px; }
.ar-cols h3 { font-size: .95rem; margin: 0 0 6px; }
.ar-l { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--line-2, #e5e9e6); font-size: .9rem; }
.ar-l.tot { border-bottom: 0; border-top: 2px solid var(--line); margin-top: 2px; padding-top: 6px; }
.ar-l.tot b { color: var(--primary); font-size: 1.05rem; }

/* Point par agent */
.pa-card { margin-bottom: 14px; }
.pa-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.pa-name { font-size: 1.1rem; }
.pa-hold { display: flex; flex-direction: column; align-items: flex-end; background: color-mix(in srgb, var(--primary) 10%, transparent); border-radius: 12px; padding: 8px 14px; }
.pa-hold span { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-3); }
.pa-hold b { font-size: 1.6rem; color: var(--primary); font-family: var(--font-title); }
.pa-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.pa-kpis > div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.pa-kpis span { font-size: .72rem; color: var(--ink-3); font-weight: 600; }
.pa-kpis b { font-size: 1.05rem; }
.pa-kpis small { font-size: .72rem; color: var(--ink-3); }
.pa-card tr.tot td { border-top: 2px solid var(--line); }
.pa-card td.neg { color: var(--bad, #B42318); }
.pa-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pa-foot .btns { margin: 0; }
/* Carnet : pages retirées */
.page-card { position: relative; }
.page-card.retiree .days, .page-card.retiree header { opacity: .45; }
.page-card .stamp { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); border: 3px solid #B42318; color: #B42318; font-weight: 900; font-size: 1.6rem; letter-spacing: .12em; padding: 4px 14px; border-radius: 8px; background: rgba(255,255,255,.75); pointer-events: none; z-index: 2; }
.ret-txt { color: #B42318; }
.part-txt { color: #B7791F; }

.wa-prev { background: #E7F8EE; border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin: 8px 0; white-space: normal; }
.relance-all { margin: 8px 0 10px; }

/* Point de trésorerie */
.pt-tbl input.pt-in { width: 140px; text-align: right; }
.pt-gap.neg, b.neg { color: var(--bad, #B42318); font-weight: 700; }
.pt-gap.pos { color: #B54708; font-weight: 700; }
.pt-gap.zero { color: var(--ok, #067647); font-weight: 700; }
.pt-tbl tfoot td { border-top: 2px solid var(--line); }

/* Carnet : écran allégé en onglets */
.kbar { margin: 0 0 12px; }
.ktabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 12px; overflow-x: auto; }
.ktab-b { background: none; border: 0; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--ink-3); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.ktab-b.on { color: var(--primary); border-bottom-color: var(--primary); }
.kcur { max-width: 420px; }
.kcur .page-card { padding: 14px; }
.pchip { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; margin: 2px 3px; font-size: .78rem; }
.pchip.full { border-color: var(--primary); color: var(--primary); }
.pchip.clo { border-color: var(--gold); color: #8a6d1a; }
.pchip.ret { opacity: .55; text-decoration: line-through; }

.pay-sel.need, select.need { outline: 3px solid var(--bad, #B42318); }
.panel.hl { box-shadow: 0 0 0 2px var(--primary); }


/* Téléchargement des applications (page de connexion) */
.dl-apps { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.dl-title { margin: 0 0 10px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); text-align: center; }
.dl-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.dl-card { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.dl-card:hover, .dl-card:focus-visible { border-color: var(--primary); box-shadow: 0 6px 18px -10px var(--primary); transform: translateY(-1px); }
.dl-ic { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.dl-ic svg, .dl-arrow { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dl-tx { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.dl-tx b { font-size: .95rem; }
.dl-tx small { font-size: .74rem; color: var(--ink-3); }
.dl-arrow { margin-left: auto; width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.dl-card:hover .dl-arrow { color: var(--primary); }
@media (max-width: 360px) { .dl-row { grid-template-columns: 1fr; } }

.collect-row.inactive { opacity: .85; background: color-mix(in srgb, var(--gold, #C9A227) 8%, transparent); }
.inact-txt { color: #8a6d1a; font-weight: 600; }
.alert span b, .alert p b, .alert li b { display: inline; }

/* 1.28 : paiement en ligne LigdiCash */
.lg-box .lg-amt { font-family: var(--font-title, inherit); font-size: 1.9rem; font-weight: 700; text-align: center; margin: 4px 0 0; }
.lg-box .lg-lbl { text-align: center; margin: 2px 0 14px; }
.lg-tabs { display: grid; gap: 8px; margin: 12px 0 14px; }
.lg-tabs label { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line, #dde3db); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-weight: 600; }
.lg-tabs label:has(input:checked) { border-color: var(--brand-leaf); background: rgba(42, 145, 80, .08); }
.lg-box .hidden { display: none !important; }
.lg-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.lg-wait { display: grid; gap: 10px; justify-items: stretch; text-align: center; }
.lg-wait > p { margin: 0; }
.lg-wait .btn { justify-content: center; text-decoration: none; }
.lg-spin { justify-self: center; width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--line, #dde3db); border-top-color: var(--brand-leaf); animation: lgsp 1s linear infinite; }
@keyframes lgsp { to { transform: rotate(360deg); } }
.lg-link { display: flex; gap: 8px; }
.lg-link .inp { flex: 1; font-size: .85rem; }
.lg-cfg-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.lg-cfg-head h3 { margin: 0 0 4px; }
.lg-help { margin-top: 12px; }
.lg-help summary { cursor: pointer; font-weight: 600; }
.lg-help code { background: rgba(0, 0, 0, .06); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
