/* SIFET — démo. Palette provisoire : vert #0E6B4F · doré #F4B23E · encre #10241C · sable #F3F5F1 */
:root{
  --green:#0E6B4F; --green-2:#0b5a42; --green-soft:#e0eee8;
  --gold:#F4B23E; --gold-soft:#fdf1da;
  --ink:#10241C; --muted:#56675e; --sand:#F3F5F1; --white:#fff; --line:#dbe3dc;
  --red:#b3261e; --red-soft:#fbe7e5;
  --r:18px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0}
body{background:var(--ink);color:var(--ink);font-family:"Readex Pro",system-ui,sans-serif;font-size:17px;line-height:1.45;-webkit-font-smoothing:antialiased}
button{font-family:inherit;font-size:inherit;color:inherit;cursor:pointer}
button:disabled{opacity:.45;cursor:not-allowed}
bdi{unicode-bidi:isolate}
.ic{width:24px;height:24px;flex:none}

.app{max-width:440px;min-height:100vh;min-height:100dvh;margin:0 auto;background:var(--sand);position:relative;display:flex;flex-direction:column}
.app.has-nav{padding-bottom:84px}

/* barre démo */
.demo-bar{display:block;width:100%;border:0;background:var(--gold);color:var(--ink);font-size:13px;font-weight:600;padding:6px 12px;text-align:center;min-height:30px}

/* en-tête */
.top{display:grid;grid-template-columns:48px 1fr 48px;align-items:center;gap:8px;padding:10px 12px;background:var(--sand);position:sticky;top:0;z-index:5}
.top h1{font-size:19px;font-weight:600;margin:0;text-align:center;line-height:1.25}
.top .logo{transform:scale(.62);transform-origin:left center}
[dir=rtl] .top .logo{transform-origin:right center}
.ic-btn{width:48px;height:48px;border-radius:50%;border:0;background:var(--white);display:grid;place-items:center;box-shadow:0 1px 3px rgba(16,36,28,.1)}
[dir=rtl] .ic-btn:not(.speaker) .ic{transform:scaleX(-1)}
.ic-btn.speaker{background:var(--green);color:#fff}

.screen{padding:8px 16px 28px;flex:1;display:flex;flex-direction:column;gap:14px}
h2,.h2{font-size:17px;font-weight:600;margin:8px 0 0}
.sub{color:var(--muted);margin:0}
.hint{color:var(--muted);font-size:15px;margin:0}
.center{text-align:center}
.empty{color:var(--muted);text-align:center;padding:16px 0;margin:0}

/* logo */
.logo{display:inline-flex;align-items:center;gap:10px}
.logo-mark{width:44px;height:44px;border-radius:13px;background:var(--green);display:grid;place-items:center}
.logo-mark svg{width:26px;height:26px}
.logo-txt{display:flex;flex-direction:column;line-height:1}
.logo-txt b{font-size:22px;letter-spacing:.08em}
.logo-txt span{color:var(--green);font-size:17px;font-weight:600}
.logo.big .logo-mark{width:72px;height:72px;border-radius:22px}
.logo.big .logo-mark svg{width:42px;height:42px}
.logo.big .logo-txt b{font-size:36px}
.logo.big .logo-txt span{font-size:26px}

/* boutons */
.btn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:56px;border-radius:16px;border:0;font-weight:600;font-size:18px;padding:12px 16px;text-decoration:none;text-align:center}
.btn.primary{background:var(--green);color:#fff}
.btn.secondary{background:var(--white);color:var(--ink);border:1.5px solid var(--line)}
.btn.demo{background:transparent;border:2px dashed var(--gold);color:#7a5200;font-size:15px}
.btn.danger{background:var(--red-soft);color:var(--red)}
.btn.whatsapp{background:#1f7a4d;color:#fff}
.btn.big{min-height:68px;font-size:22px}
.lang-btn{background:var(--white);border:2px solid var(--line)}
.lang-btn:hover,.lang-btn:focus-visible{border-color:var(--green)}
.stack{display:flex;flex-direction:column;gap:12px}
.center-col{display:flex;flex-direction:column;align-items:stretch;gap:22px;padding-top:28px}
.center-col .logo{align-self:center}
.big-title{font-size:22px;text-align:center;margin:0;font-weight:600}
.big-title span{display:block;font-size:19px;color:var(--muted);margin-top:6px}
.listen-inline{align-self:center;display:inline-flex;gap:8px;align-items:center;border:0;background:var(--green);color:#fff;border-radius:999px;padding:12px 20px;min-height:48px}
.link{border:0;background:none;color:var(--green);font-weight:600;padding:8px;min-height:44px}

/* champs + clavier */
.field-big{display:flex;align-items:center;gap:12px;background:var(--white);border:2px solid var(--green);border-radius:16px;padding:16px;font-size:26px;font-weight:600;letter-spacing:.04em;min-height:68px}
.prefix{color:var(--muted);font-size:18px;font-weight:500}
.keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:4px}
.key{min-height:62px;border-radius:16px;border:0;background:var(--white);font-size:28px;font-weight:500;box-shadow:0 1px 2px rgba(16,36,28,.08)}
.key:active{background:var(--green-soft)}
.pindots{display:flex;justify-content:center;gap:18px;margin:22px 0 10px}
.pindots i{width:20px;height:20px;border-radius:50%;border:2.5px solid var(--green)}
.pindots i.on{background:var(--green)}
.lock{text-align:center;font-size:40px;margin-top:6px}
.amount-display{text-align:center;font-size:52px;font-weight:700;color:var(--green);line-height:1.1;margin:8px 0 0}
.amount-display small{font-size:22px;color:var(--muted);font-weight:500}
.amount-display.small{font-size:34px;margin:0}
.chips{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}
.chip{border:1.5px solid var(--line);background:var(--white);border-radius:999px;padding:8px 16px;min-height:44px;font-weight:600}

/* inscription : photos */
.id-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.id-tile{min-height:120px;border-radius:var(--r);border:2px dashed var(--line);background:var(--white);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;font-weight:600}
.id-tile:last-child{grid-column:1/-1}
.id-tile .ic{width:36px;height:36px;color:var(--muted)}
.id-tile.done{border:2px solid var(--green);background:var(--green-soft);color:var(--green)}
.id-tile.done .ic{color:var(--green)}

/* accueil */
.balance-card{background:var(--green);color:#fff;border-radius:22px;padding:18px 18px 14px;position:relative;overflow:hidden}
.balance-card::after{content:"";position:absolute;inset:auto -60px -80px auto;width:200px;height:200px;border-radius:50%;background:radial-gradient(circle,rgba(244,178,62,.35),transparent 70%)}
.bal-top{display:flex;justify-content:space-between;align-items:center;font-size:15px;opacity:.95}
.ghost-ic{display:inline-flex;align-items:center;gap:6px;border:0;background:rgba(255,255,255,.14);color:#fff;border-radius:999px;padding:8px 12px;min-height:44px}
.ghost-ic small{font-size:13px}
.bal-amount{font-size:44px;font-weight:700;margin:6px 0 10px;position:relative;z-index:1}
.bal-amount small{font-size:20px;font-weight:500;opacity:.85}
.qr-link{display:inline-flex;align-items:center;gap:8px;border:0;background:#fff;color:var(--green);border-radius:999px;padding:8px 14px;font-weight:600;min-height:44px;position:relative;z-index:1}
.sifet-btn{display:flex;align-items:center;gap:16px;width:100%;min-height:84px;border:0;border-radius:22px;background:var(--gold);color:var(--ink);padding:14px 20px;text-align:start;box-shadow:0 4px 14px rgba(244,178,62,.35)}
.sifet-btn .ic{width:40px;height:40px}
[dir=rtl] .sifet-btn .ic{transform:scaleX(-1)}
.sifet-btn span{display:flex;flex-direction:column}
.sifet-btn b{font-size:28px;line-height:1.1}
.sifet-btn small{font-size:15px;opacity:.8}
.sifet-btn.green{background:var(--green);color:#fff;box-shadow:none}
.two-btn{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.action-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:92px;border-radius:20px;border:0;background:var(--white);box-shadow:0 1px 3px rgba(16,36,28,.08)}
.action-btn .ic{width:32px;height:32px;color:var(--green)}
.action-btn b{font-size:20px}
.soon-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.soon-tile{display:flex;flex-direction:column;align-items:center;gap:4px;padding:12px 6px;border-radius:16px;border:1.5px dashed #c7d1c9;background:transparent;color:#7f8c85;min-height:100px;text-align:center}
.soon-tile b{font-size:13px;font-weight:600;line-height:1.2}
.soon-tile small{font-size:11px;background:#e6ebe6;border-radius:999px;padding:2px 8px}
.sec-row{display:flex;justify-content:space-between;align-items:center}
.sec-row h2{margin:0}

/* listes */
.tx-list,.contact-list,.agent-list{display:flex;flex-direction:column;background:var(--white);border-radius:var(--r);overflow:hidden}
.tx,.contact,.agent{display:flex;align-items:center;gap:12px;padding:12px 14px;border:0;background:transparent;text-align:start;border-bottom:1px solid var(--line);width:100%;min-height:64px}
.tx:last-child,.contact:last-child,.agent:last-child{border-bottom:0}
.tx-ic{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:var(--green-soft);color:var(--green);flex:none}
.tx-ic.out{background:var(--gold-soft);color:#8a5a00}
.tx-ic .ic{width:20px;height:20px}
.tx-main{flex:1;display:flex;flex-direction:column;min-width:0}
.tx-main b{font-weight:600;font-size:16px}
.tx-main small{color:var(--muted);font-size:13px}
.tx-amt{font-weight:700;text-align:end;white-space:nowrap;display:flex;flex-direction:column}
.tx-amt.in{color:var(--green)}
.tx-amt small{font-weight:500;color:var(--muted);font-size:12px}
.avatar{width:46px;height:46px;border-radius:50%;background:var(--green-soft);color:var(--green);display:grid;place-items:center;font-weight:700;font-size:20px;flex:none}
.avatar.shop{background:var(--gold-soft);color:#8a5a00}
.avatar.big{width:64px;height:64px;font-size:28px}
.badge{display:flex;flex-direction:column;align-items:center;font-size:12px;font-weight:600;color:var(--green);background:var(--green-soft);border-radius:10px;padding:4px 8px}
.badge small{font-weight:500;color:var(--muted)}

/* récap / reçu */
.recap,.receipt{background:var(--white);border-radius:var(--r);padding:6px 16px}
.row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}
.row:last-child{border-bottom:0}
.row span{color:var(--muted)}
.row b{font-weight:600;text-align:end}
.row.hl b{color:var(--green);font-size:20px}
.row.total b{font-size:20px}
.row.total span{color:var(--ink);font-weight:600}
.receipt{border:1.5px dashed var(--line)}
.receipt-head{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}
.receipt-head .logo{transform:scale(.7);transform-origin:left center}
[dir=rtl] .receipt-head .logo{transform-origin:right center}
.receipt-head > span{font-weight:600;color:var(--muted)}
.demo-stamp{text-align:center;color:#8a5a00;background:var(--gold-soft);border-radius:8px;font-size:13px;font-weight:600;padding:6px;margin:6px 0 10px}

.success{text-align:center;padding-top:12px}
.success h1{margin:10px 0 4px;font-size:28px}
.success p{margin:0;color:var(--muted);font-size:18px}
.ok-ic{width:84px;height:84px;border-radius:50%;background:var(--green);color:#fff;display:grid;place-items:center;margin:0 auto;animation:pop .4s ease-out}
.ok-ic .ic{width:46px;height:46px;stroke-width:3}
@keyframes pop{from{transform:scale(.4);opacity:0}to{transform:scale(1);opacity:1}}

.info-card{display:flex;gap:12px;align-items:flex-start;background:var(--green-soft);border-radius:var(--r);padding:14px 16px}
.info-card p{margin:0}
.info-card .ic{color:var(--green);margin-top:2px}
.info-card.gold{background:var(--gold-soft)}
.info-card.gold .ic{color:#8a5a00}

/* QR */
.qr-box{background:var(--white);border-radius:22px;padding:22px;display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center}
.qr-box.gold{border:3px solid var(--gold)}
.qr{background:#fff;padding:8px;border-radius:12px;line-height:0}
.qr img,.qr canvas{display:block}
.qr-fallback .ic{width:120px;height:120px;color:var(--ink)}
.code{font-size:24px;font-weight:700;letter-spacing:.2em}

/* profil */
.profile-head{display:flex;align-items:center;gap:14px;background:var(--white);border-radius:var(--r);padding:14px}
.profile-head div{display:flex;flex-direction:column}
.profile-head span{color:var(--muted)}
.seg{display:grid;grid-template-columns:repeat(auto-fit,minmax(0,1fr));background:var(--white);border-radius:14px;padding:4px;gap:4px}
.seg button{border:0;background:transparent;border-radius:11px;min-height:48px;font-weight:600}
.seg button.on{background:var(--green);color:#fff}
.menu{display:flex;flex-direction:column;background:var(--white);border-radius:var(--r);overflow:hidden}
.menu button{display:flex;align-items:center;gap:12px;border:0;background:transparent;border-bottom:1px solid var(--line);padding:14px 16px;min-height:56px;text-align:start;font-weight:500}
.menu button:last-child{border-bottom:0}
.menu .ic{color:var(--green)}

/* carte QR de Fatima */
.card-label{margin:4px 0 -6px;color:var(--muted);font-weight:600;font-size:14px}
.qr-card{border-radius:20px;aspect-ratio:1.586;padding:16px 18px;display:flex;flex-direction:column;justify-content:space-between;box-shadow:0 6px 18px rgba(16,36,28,.18)}
.qr-card.front{background:linear-gradient(135deg,var(--green),#0a4e3a);color:#fff}
.qr-card.front .logo-txt span{color:var(--gold)}
.qr-card .logo{transform:scale(.75);transform-origin:left center}
.qc-top{display:flex;justify-content:space-between;align-items:center}
.qc-chip{background:var(--gold);color:var(--ink);font-weight:700;border-radius:8px;padding:2px 10px;font-size:14px}
.qc-mid{display:flex;gap:14px;align-items:center}
.qc-mid div:last-child{display:flex;flex-direction:column}
.qc-mid small{opacity:.8;font-size:12px}
.qc-mid b{font-size:18px;letter-spacing:.06em}
.qc-foot{text-align:end;color:var(--gold);font-weight:600}
.qr-card.back{background:var(--white);color:var(--ink);justify-content:center;gap:6px}
.qr-card.back ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;font-size:17px;font-weight:500}
.qr-card.back ol b{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--green);color:#fff;margin-inline-end:8px;font-size:15px}
.qc-warn{margin:6px 0 0;color:var(--red);font-weight:600;font-size:15px}
.qc-small{margin:0;color:var(--muted);font-size:11px;direction:ltr;text-align:left}
.qr.small{padding:4px;border-radius:8px}

/* agent */
.stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.stat-grid.two{grid-template-columns:1fr 1fr}
.stat{background:var(--white);border-radius:var(--r);padding:12px 14px;display:flex;flex-direction:column;gap:2px}
.stat small{color:var(--muted);font-size:13px}
.stat b{font-size:21px}
.stat.cash{grid-column:1/-1;background:var(--ink);color:#fff}
.stat.cash small{color:#b8c8bf}
.stat.cash b{font-size:30px;color:var(--gold)}
.stat-grid.two .stat{grid-column:auto}
.stat.comm b{color:var(--green)}
.camera{position:relative;height:220px;border-radius:22px;background:#0b1913;display:grid;place-items:center;color:#46655a;overflow:hidden}
.camera .ic{width:48px;height:48px}
.camera .frame{position:absolute;inset:30px 70px;border:3px solid var(--gold);border-radius:18px}
.camera .scanline{position:absolute;left:70px;right:70px;height:3px;background:var(--gold);box-shadow:0 0 12px var(--gold);animation:scan 2s ease-in-out infinite}
@keyframes scan{0%,100%{top:34px}50%{top:184px}}
.scan-opt{display:flex;align-items:center;gap:12px;min-height:60px;border-radius:16px;border:1.5px solid var(--line);background:var(--white);padding:12px 16px;font-weight:600;text-align:start}
.scan-opt .ic{color:var(--green)}

/* menu démo */
.scen{display:flex;align-items:center;gap:14px;min-height:64px;border-radius:16px;border:0;background:var(--white);padding:12px 16px;font-weight:600;text-align:start;box-shadow:0 1px 3px rgba(16,36,28,.08)}
.scen span{width:36px;height:36px;border-radius:50%;background:var(--gold);display:grid;place-items:center;flex:none;font-weight:700}
.scen.alt span{background:var(--green);color:#fff}

/* barre du bas */
.bottom-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:440px;display:grid;grid-template-columns:repeat(3,1fr);background:var(--white);border-top:1px solid var(--line);padding:6px 6px calc(6px + env(safe-area-inset-bottom));z-index:6}
.bottom-nav button{display:flex;flex-direction:column;align-items:center;gap:2px;border:0;background:transparent;min-height:60px;color:var(--muted);font-size:13px;font-weight:500;border-radius:12px}
.bottom-nav button.on{color:var(--green);background:var(--green-soft)}

/* toast */
.toast{position:fixed;left:50%;bottom:96px;transform:translateX(-50%) translateY(20px);width:calc(100% - 32px);max-width:408px;background:var(--ink);color:#fff;padding:14px 16px;border-radius:14px;font-size:16px;opacity:0;pointer-events:none;transition:all .25s;z-index:20;text-align:center}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.toast.err{background:var(--red)}
.toast.ok{background:var(--green)}
.toast.say{background:var(--ink);border:2px solid var(--gold);font-size:18px;direction:rtl}

/* blocs qui s'empilent sur téléphone, se répartissent sur ordinateur */
.dash,.dash .col,.card-pair,.card-side{display:flex;flex-direction:column;gap:14px}
.wide-only,.nav-demo{display:none !important}
.bottom-nav.nav-optional{display:none}

/* tablette : l'appli reste au format téléphone, centrée */
@media (min-width:480px) and (max-width:899px){
  body{padding:20px 0}
  .app{border-radius:28px;overflow:hidden;min-height:calc(100vh - 40px);box-shadow:0 20px 60px rgba(0,0,0,.4)}
  .bottom-nav{bottom:20px;border-radius:0 0 28px 28px}
}

/* ============ VERSION ORDINATEUR (≥ 900 px) ============ */
@media (min-width:900px){
  body{background:var(--sand)}
  .app{max-width:none;margin:0;min-height:100vh;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto 1fr;align-items:start}
  .app.has-side{grid-template-columns:270px minmax(0,1fr)}
  .app.has-nav{padding-bottom:0}
  .demo-bar{grid-column:1/-1;font-size:14px}
  .top,.screen{grid-column:-2/-1}
  .top{background:transparent;position:static;padding:28px 40px 4px;grid-template-columns:auto 1fr 48px;gap:16px}
  .top h1{text-align:start;font-size:28px}
  .top > .logo{width:0;height:0;overflow:hidden;visibility:hidden}
  .top > span:first-child{width:0}
  .screen{width:100%;max-width:560px;margin:0 auto;padding:12px 40px 48px}
  .screen-home,.screen-ahome,.screen-history,.screen-ahistory,.screen-launch,.screen-deposit,.screen-card,.screen-profile{max-width:1080px;margin:0}

  /* menu latéral */
  .wide-only{display:flex !important}
  .narrow-only{display:none !important}
  .bottom-nav,.bottom-nav.nav-optional{display:flex;position:sticky;top:0;left:auto;bottom:auto;transform:none;grid-column:1;grid-row:2/4;flex-direction:column;align-self:stretch;width:auto;max-width:none;min-height:calc(100vh - 30px);border-top:0;border-inline-end:1px solid var(--line);border-radius:0;padding:24px 16px;gap:6px}
  .nav-head{flex-direction:column;align-items:flex-start;gap:6px;padding:0 8px 18px;margin-bottom:8px;border-bottom:1px solid var(--line)}
  .nav-head .logo{transform:none}
  .nav-head small{color:var(--muted);font-size:13px}
  .bottom-nav button{flex-direction:row;justify-content:flex-start;gap:14px;min-height:52px;padding:0 14px;font-size:16px;color:var(--ink)}
  .bottom-nav button .ic{color:var(--green)}
  .bottom-nav button.on{background:var(--green);color:#fff}
  .bottom-nav button.on .ic{color:#fff}
  .bottom-nav .nav-demo{display:flex !important;margin-top:auto;background:var(--gold-soft);color:#7a5200;font-weight:600}

  /* tableaux de bord en 2 colonnes */
  .dash{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:28px;align-items:start}
  .bal-amount{font-size:54px}
  .tx-list .tx{padding:14px 18px}
  .screen-history .tx-list,.screen-ahistory .tx-list{max-width:760px}
  .screen-history .tx-list{width:100%}
  .screen-ahistory .stat-grid{max-width:760px}
  .screen-launch > *,.screen-profile > *,.screen-deposit > *{max-width:640px}
  .card-pair{display:grid;grid-template-columns:1fr 1fr;gap:28px;align-items:start}

  /* claviers : plus compacts, on peut aussi taper au clavier */
  .key{min-height:54px;font-size:24px}
  .toast{bottom:28px}
  .app.has-side .toast{left:calc(50% + 135px)}
  .lang-btn:hover,.key:hover,.scan-opt:hover,.scen:hover,.contact:hover,.tx:hover,.menu button:hover{filter:brightness(.97)}
  .screen-lang{max-width:520px;margin:0 auto}
}
