/* Tableau de bord, page de paiement et documentation PAYFLOW : indigo et mangue, en clair ou en sombre (espace client seulement).
   .theme-light garde un bloc en clair dans une page sombre : aperçu de la page de paiement, par exemple. */
:root, .theme-light {
  --bg: #F2F4FD;
  --card: #FFFFFF;
  --fg: #12141F;
  --fg-2: #3D4457;
  --muted: #59617A;
  --line: #E2E6F4;
  --line-2: #EDF0FA;
  --field: #E2E6F4;
  --hover: #F2F4FD;
  --brand: #4453E0;
  --brand-hover: #171A2B;
  --brand-soft: #ECEEFC;
  --brand-ink: #4453E0;
  --brand-tint: #ECEEFC;
  --mango: #C7CDF8;
  --mango-soft: #ECEEFC;
  --ok: #0B7A4F;
  --ok-soft: #E6F6EF;
  --ok-on-dark: #6FE3A7;
  --danger: #B42318;
  --danger-soft: #FDECEC;
  --warn: #8A5A0B;
  --warn-soft: #FDF5E4;
  --warn-line: #F5D9AE;
  --warn-strong: #D97706;
  --info: #3046B5;
  --info-soft: #EEF0FC;
  --card-blue: #3D63DD;
  --code-bg: #12141F;
  --code-bg-2: #1B1F33;
  --code-line: #2A2E45;
  --code-fg: #ECEEFC;
  --code-dim: #9AA1BC;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --display: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  /* Texte posé sur un fond de marque pâle (onglet actif, puce choisie) */
  --brand-strong: #3241C8;
  /* Surfaces secondaires : survol d'une ligne, fond d'un champ en lecture, piste d'une jauge */
  --surface-2: #F8F9FE;
  --track: #E2E6FB;
  --shadow: #0B0F2A1F;
  /* Fond encre (bouton sombre, avatar, notification) et son texte */
  --on-ink: #FFFFFF;
  --ink-hover: #000000;
  /* Interrupteur éteint, point de frise inactif */
  --toggle-off: #C9CDE0;
  /* Bandeaux de couleur (solde, boutique, profil) : texte blanc dessus */
  --band: #4453E0;
  --band-text: #E2E6FB;
  --link-hover: #171A2B;
  /* Texte sur un fond vert de réussite */
  --on-ok: #FFFFFF;
  color-scheme: light;
}

/* Thème sombre de l'espace client (loader.js pose data-theme). Chaque couleur garde un contraste d'au moins 4,5:1 pour le texte. */
:root[data-theme="dark"] {
  --bg: #0D0F1C;
  --card: #151829;
  --fg: #EDEFF7;
  --fg-2: #C5CAE0;
  --muted: #9AA0BA;
  --line: #262A42;
  --line-2: #1E2236;
  --field: #343A5A;
  --hover: #1B1F33;
  --brand: #5563EE;
  --brand-hover: #4652DB;
  --link-hover: #C3C9FF;
  --on-ok: #0D0F1C;
  --brand-soft: #232A55;
  --brand-ink: #A3ACFF;
  --brand-tint: #1E2450;
  --brand-strong: #C3C9FF;
  --mango: #39407A;
  --mango-soft: #232A55;
  --ok: #45D49A;
  --ok-soft: #10332A;
  --danger: #FF8B84;
  --danger-soft: #3B1C20;
  --warn: #F2C66D;
  --warn-soft: #2F2611;
  --warn-line: #5C4818;
  --warn-strong: #F59E0B;
  --info: #A3AEFF;
  --info-soft: #1E2450;
  --code-bg: #0A0C17;
  --code-bg-2: #12152A;
  --code-line: #262A42;
  --surface-2: #1A1E33;
  --track: #2A3050;
  --shadow: #00000066;
  --on-ink: #0D0F1C;
  --ink-hover: #FFFFFF;
  --toggle-off: #3A4064;
  --band: #3B48C9;
  --band-text: #E6E9FF;
  --mm: #7C88FF;
  --mm-soft: #232A55;
  --mm-ink: #C3C9FF;
  --crypto: #0E6B52;
  --crypto-soft: #10332A;
  --crypto-ink: #6FE3B8;
  --cards: #7B2FBE;
  --cards-soft: #2E1C47;
  --cards-ink: #D7B8F5;
  color-scheme: dark;
}

.theme-light { color: var(--fg); color-scheme: light; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2 { text-wrap: balance; font-family: var(--display); }
button, input, select { font: inherit; color: var(--fg); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.search { flex: 1 1 260px; max-width: 420px; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; color: var(--muted); }
.search.white { background: var(--card); border-color: var(--field); max-width: none; }
.search input { border: 0; background: transparent; outline: none; font-size: 14px; flex: 1; min-width: 0; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--fg-2); }

/* Éléments communs */
.page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-title h1 { margin: 0; font-size: clamp(30px, 3vw, 40px); font-weight: 700; letter-spacing: -0.03em; }
.page-title p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 500; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--field); background: var(--card); color: var(--fg); cursor: pointer; min-height: 38px; }
.btn:hover { color: var(--fg); background: var(--bg); }
.btn-dark { background: var(--fg); border-color: var(--fg); color: var(--on-ink); }
.btn-dark:hover { background: var(--ink-hover); color: var(--on-ink); }
.btn-brand { background: var(--brand); border-color: var(--brand-ink); color: #FFFFFF; }
.btn-brand:hover { background: var(--brand-hover); color: #FFFFFF; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.panel-pad { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.panel h2 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line-2); }
.muted { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.grow-2 { flex: 2 1 520px; min-width: 0; }
.grow-1 { flex: 1 1 300px; min-width: 0; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.kpi { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi strong { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12px; font-weight: 500; }
.up { color: var(--ok); } .down { color: var(--danger); }

.seg { display: flex; gap: 4px; background: var(--bg); border-radius: 8px; padding: 3px; font-size: 13px; }
.seg button { border: 0; background: transparent; padding: 6px 10px; border-radius: 6px; color: var(--fg-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); font-weight: 500; color: var(--fg); box-shadow: 0 1px 2px rgba(20, 23, 28, 0.08); }
.chart { width: 100%; height: 220px; display: block; }
.axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.bar { height: 6px; background: var(--line-2); border-radius: 3px; }
.bar i { display: block; height: 6px; border-radius: 3px; }

.table-box { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 500; padding: 10px 12px; background: var(--surface-2); white-space: nowrap; }
td { padding: 13px 12px; border-top: 1px solid var(--line-2); color: var(--fg-2); white-space: nowrap; }
th:first-child, td:first-child { padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
td.amount a { color: var(--fg); font-weight: 600; }
tbody tr:hover td { background: var(--surface-2); }
.badge { display: inline-block; font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-wait { background: var(--hover); color: var(--fg-2); }
.b-fail { background: var(--danger-soft); color: var(--danger); }
.b-refund { background: var(--info-soft); color: var(--info); }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 24px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 14px; }

.tabs-status { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs-status button { text-align: left; display: flex; flex-direction: column; gap: 4px; min-width: 120px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 13px; font-weight: 500; }
.tabs-status button span { color: var(--muted); }
.tabs-status button strong { font-size: 18px; }
.tabs-status button[aria-pressed="true"] { border-color: var(--brand-ink); background: var(--brand-tint); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters label.select-wrap { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.filters select { font-size: 14px; border: 1px solid var(--field); background: var(--card); border-radius: 8px; padding: 8px 10px; min-height: 38px; }
.btn-dashed { border-style: dashed; background: transparent; color: var(--fg-2); }

/* Détail paiement */
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.detail-head .amount-big { font-family: var(--display); font-size: 46px; font-weight: 700; letter-spacing: -0.035em; }
.meta { display: flex; gap: 8px 24px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { display: flex; gap: 16px; }
.timeline .rail { display: flex; flex-direction: column; align-items: center; }
.timeline .pt { width: 12px; height: 12px; border-radius: 6px; background: var(--ok); margin-top: 4px; flex: none; }
.timeline .pt.hollow { background: transparent; border: 2px solid var(--ok); }
.timeline .pt.grey { background: transparent; border: 2px solid var(--toggle-off); }
.timeline .line { flex: 1; width: 2px; background: var(--line); min-height: 24px; }
.timeline .txt { display: flex; flex-direction: column; gap: 2px; padding-bottom: 18px; }
.timeline b { font-size: 14px; font-weight: 500; }
.timeline small { font-size: 13px; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv.total { border-top: 1px solid var(--line-2); padding-top: 14px; font-weight: 600; }
.field-ro { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.field-ro span:first-child { font-size: 12px; color: var(--muted); }
.code-block { margin: 0; background: var(--code-bg); color: #C9CDD4; border-radius: 10px; padding: 18px; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; overflow-x: auto; }

/* Page de paiement */
.checkout-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 20px; padding-block: 40px 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: #F2F3F5; }
.demo-note { width: 100%; max-width: 460px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.co-card { width: 100%; max-width: 460px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 12px 32px rgba(20, 23, 28, 0.06); }
.co-summary { position: relative; padding: 28px 24px 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; border-bottom: 1px solid var(--line-2); }
.co-test { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 3px 9px; }
.co-logo { width: 56px; height: 56px; border-radius: 16px; background: #171A2B; color: #FFFFFF; font-weight: 600; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.co-amount { font-family: var(--display); font-size: 44px; font-weight: 700; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.co-body { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.co-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: #F2F3F5; border-radius: 10px; padding: 4px; }
.co-tabs button { border: 0; border-radius: 8px; padding: 10px 6px; min-height: 44px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; }
.co-tabs button[aria-selected="true"] { background: var(--card); color: var(--fg); box-shadow: 0 1px 3px rgba(20, 23, 28, 0.12); }
.co-field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 500; color: var(--fg-2); }
.co-input { font-size: 16px; border: 1px solid var(--field); border-radius: 10px; padding: 12px; background: var(--card); min-width: 0; min-height: 48px; }
.ops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ops button { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; font-size: 14px; font-weight: 500; text-align: left; }
.ops button[aria-pressed="true"] { border-color: var(--brand-ink); background: var(--brand-tint); }
.op-mark { width: 28px; height: 28px; border-radius: 8px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.m-orange { background: #FF7900; color: #14171C; } .m-mtn { background: #FFCB05; color: #14171C; }
.m-wave { background: #1DC8F2; color: #14171C; } .m-moov { background: #0055A5; color: #FFFFFF; }
.phone { display: flex; min-height: 50px; overflow: hidden; border: 1px solid var(--field); border-radius: 10px; }
.phone:focus-within { border-color: var(--brand-ink); }
.phone select { border: 0; border-right: 1px solid var(--line); background: #FAFBFC; padding: 0 10px; font-size: 15px; }
.phone input { flex: 1; min-width: 0; border: 0; outline: none; padding: 12px; font-size: 16px; }
.pay { width: 100%; min-height: 52px; border: 0; border-radius: 10px; background: var(--brand); color: #FFFFFF; font-size: 16px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pay:hover { background: var(--brand-hover); color: #FFFFFF; }
.pay.dark { background: var(--fg); }
.hint { margin: 0; font-size: 12px; color: var(--muted); }
.alert { padding: 12px 14px; font-size: 14px; color: var(--danger); background: var(--danger-soft); border-radius: 10px; }
.warn-box { font-size: 12px; color: var(--warn); background: var(--warn-soft); border-radius: 8px; padding: 10px 12px; }
.qr-box { display: flex; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 16px; flex-wrap: wrap; }
.qr-box svg { flex: none; background: #FFFFFF; }
.addr { display: flex; gap: 8px; align-items: center; border: 1px solid var(--field); border-radius: 10px; padding: 8px 8px 8px 12px; }
.addr span { font-family: var(--mono); font-size: 12.5px; flex: 1; min-width: 0; word-break: break-all; }
.state { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding-block: 8px; }
.state h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.state h2:focus { outline: none; }
.state p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); max-width: 340px; }
.help { width: 100%; padding: 14px; font-size: 13px; line-height: 1.6; color: var(--fg-2); text-align: left; background: #FAFBFC; border: 1px solid var(--line-2); border-radius: 10px; }
.pulse { position: relative; width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; }
.pulse::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--brand); opacity: 0.25; animation: pf-pulse 1.8s ease-out infinite; }
.pulse span { position: relative; width: 64px; height: 64px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; }
@keyframes pf-pulse { 0% { transform: scale(0.9); opacity: 0.6; } 70% { transform: scale(1.35); opacity: 0; } 100% { opacity: 0; } }
.ok-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--ok); color: var(--on-ok); display: flex; align-items: center; justify-content: center; }
.recap { width: 100%; margin: 6px 0 0; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 13px; }
.recap div { display: flex; justify-content: space-between; gap: 12px; padding-block: 4px; }
.recap dt { color: var(--muted); } .recap dd { margin: 0; }
.link-btn { border: 0; background: transparent; color: var(--brand-ink); cursor: pointer; padding: 8px; min-height: 44px; font-size: 14px; }
.co-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; justify-content: center; }
.co-foot strong { color: var(--fg); letter-spacing: 0.06em; }

/* Documentation */
.docs-top { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; padding-block: 14px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--card); border-bottom: 1px solid var(--line); }
.docs-top nav { display: flex; gap: 20px; font-size: 14px; flex-wrap: wrap; }
.docs-top nav a { color: var(--fg-2); }
.docs-top nav a[aria-current="page"] { color: var(--fg); font-weight: 500; }
.docs-top .search { margin-left: auto; flex: 0 1 280px; }
.docs { display: flex; flex-wrap: wrap; background: var(--card); }
.docs-nav { flex: 1 1 240px; max-width: 100%; border-right: 1px solid var(--line); padding-block: 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: 16px; font-size: 14px; display: flex; flex-direction: column; gap: 22px; }
.docs-nav div { display: flex; flex-direction: column; gap: 2px; }
.docs-nav .group { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 0 10px 8px; }
.docs-nav a { padding: 7px 10px; border-radius: 6px; color: var(--fg-2); display: flex; justify-content: space-between; gap: 8px; }
.docs-nav a:hover { background: var(--bg); }
.docs-nav a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-ink); font-weight: 600; }
.docs-nav a span { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.docs-main { flex: 999 1 640px; min-width: 0; display: flex; flex-wrap: wrap; }
.docs-article { flex: 1 1 440px; min-width: 0; padding-block: 40px 64px; padding-inline: clamp(16px, 4vw, 48px); display: flex; flex-direction: column; gap: 32px; max-width: 760px; }
.docs-article h1 { margin: 0; font-size: clamp(36px, 4vw, 48px); font-weight: 700; letter-spacing: -0.035em; }
.docs-article h2 { margin: 0 0 12px; font-size: 18px; font-weight: 600; }
.docs-article p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--fg-2); max-width: 65ch; }
.endpoint { display: inline-flex; align-self: flex-start; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-family: var(--mono); font-size: 13px; }
.endpoint b { color: var(--brand-ink); font-weight: 500; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.note { background: var(--mango-soft); border: 1px solid #F5D58C; border-radius: 12px; padding: 14px 16px; font-size: 14px; line-height: 1.6; color: #2F3AA8; }
.param { border-top: 1px solid var(--line); padding-block: 16px; display: flex; flex-direction: column; gap: 6px; }
.param-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.param-head code { background: transparent; padding: 0; font-size: 14px; font-weight: 500; color: var(--fg); }
.param-head span { font-size: 12px; color: var(--muted); }
.param-head .req { color: var(--danger); font-weight: 500; }
.param p { font-size: 14px; line-height: 1.6; }
.err-table { border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.err-table td { white-space: normal; font-size: 13.5px; }
.err-table td:first-child { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; color: var(--fg); }
.err-table tr:first-child td { border-top: 0; }
.pager { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 24px; font-size: 14px; flex-wrap: wrap; }
.docs-code { flex: 1 1 420px; min-width: 0; background: var(--code-bg); color: #C9CDD4; padding-block: 32px; padding-left: 24px; padding-right: max(24px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 20px; }
.code-panel { background: var(--code-bg-2); border: 1px solid var(--code-line); border-radius: 12px; overflow: hidden; }
.code-tabs { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--code-line); padding-right: 8px; flex-wrap: wrap; }
.code-tabs [role="tablist"] { display: flex; }
.code-tabs button[role="tab"] { border: 0; background: transparent; cursor: pointer; padding: 12px 14px; min-height: 44px; color: var(--code-dim); border-bottom: 2px solid transparent; font-size: 13px; }
.code-tabs button[aria-selected="true"] { color: #FFFFFF; border-bottom-color: var(--mango); }
.copy { border: 1px solid #2A2E36; background: transparent; color: #C9CDD4; border-radius: 6px; padding: 6px 10px; cursor: pointer; font-size: 12px; }
.code-panel pre { margin: 0; padding: 18px; font-family: var(--mono); font-size: 12.5px; line-height: 1.75; color: var(--code-fg); overflow-x: auto; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--code-line); font-size: 13px; }
.code-head span:last-child { font-family: var(--mono); font-size: 12px; color: var(--ok-on-dark); }

@media (prefers-reduced-motion: reduce) { .pulse::before { animation: none; } }

/* =====================================================================
   Bilingue : <t-en>…</t-en><t-fr>…</t-fr>. Anglais par défaut.
   ===================================================================== */
t-en, t-fr { display: inline; }
html:not([data-lang="fr"]) t-fr, html[data-lang="fr"] t-en { display: none !important; }

.lang-sw { display: inline-flex; border: 1px solid var(--field); border-radius: 999px; overflow: hidden; font-size: 12px; font-weight: 700; }
.lang-sw button { border: 0; background: var(--card); color: var(--fg-2); padding: 6px 10px; cursor: pointer; min-height: 32px; }
.lang-sw button[aria-pressed="true"] { background: var(--fg); color: var(--on-ink); }
/* Formulaires du tableau de bord */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.inp, .sel, .area { font-size: 15px; border: 1px solid var(--field); border-radius: 10px; padding: 10px 12px; background: var(--card); min-height: 44px; width: 100%; }
.area { min-height: 96px; resize: vertical; }
.inp:focus, .sel:focus, .area:focus { outline: none; border-color: var(--brand-ink); box-shadow: 0 0 0 3px var(--brand-soft); }
.help-txt { font-size: 12px; font-weight: 500; color: var(--muted); }
.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .tr { width: 40px; height: 24px; border-radius: 12px; background: var(--toggle-off); display: flex; align-items: center; padding: 3px; transition: background 0.15s; flex: none; }
.toggle .tr::after { content: ""; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; transition: transform 0.15s; }
.toggle input:checked + .tr { background: var(--brand); }
.toggle input:checked + .tr::after { transform: translateX(16px); }
.toggle input:focus-visible + .tr { outline: 2px solid var(--brand); outline-offset: 2px; }
.dropzone { border: 2px dashed var(--field); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--muted); font-size: 14px; cursor: pointer; background: var(--surface-2); }
.dropzone:hover, .dropzone.drag { border-color: var(--brand-ink); background: var(--brand-tint); }
.dropzone.done { border-style: solid; border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.tabs-line { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs-line button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs-line button[aria-selected="true"] { color: var(--brand-ink); border-bottom-color: var(--brand-ink); }
.stepper { display: flex; flex-direction: column; gap: 4px; }
.stepper button { display: flex; align-items: center; gap: 12px; text-align: left; border: 0; background: none; padding: 10px; border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--fg-2); }
.stepper button[aria-current="step"] { background: var(--brand-tint); color: var(--brand-ink); }
.stepper .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--line-2); color: var(--fg-2); flex: none; }
.stepper button[aria-current="step"] .n { background: var(--brand); color: #FFFFFF; }
.stepper .done .n { background: var(--ok); color: var(--on-ok); }
.key-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line-2); }
.key-val { font-family: var(--mono); font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; flex: 1 1 260px; min-width: 0; overflow-x: auto; white-space: nowrap; }
.modal-bg { position: fixed; inset: 0; background: rgba(11, 16, 51, 0.45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal-bg[hidden] { display: none; }
.modal { width: min(560px, 100%); max-height: 90vh; overflow-y: auto; background: var(--card); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 30px 60px rgba(11, 16, 51, 0.3); }
.modal h2 { margin: 0; font-size: 22px; }
.toast-msg { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: max(20px, env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--on-ink); padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; z-index: 60; box-shadow: 0 12px 30px rgba(11, 16, 51, 0.3); }
.toast-msg[hidden] { display: none; }
.pm-logo-s { height: 20px; width: auto; vertical-align: middle; }
.pm-chip { display: inline-flex; align-items: center; gap: 8px; }
.qr-img { width: 168px; height: 168px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #FFFFFF; }
.qr-img svg, .qr-img img { width: 100%; height: 100%; display: block; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

/* Charte PayFlow : fond, typographie et volumes du tableau de bord */
h1, h2, h3, .page-title { letter-spacing: -.03em; }
.panel, .card { border-color: var(--line); box-shadow: 0 1px 2px #12141f0a, 0 10px 30px -14px #4453e029; }
.btn { border-radius: .8rem; }

/* Documentation : même bloc bleu que les pages du site */
#introduction .sec-head { background: #4453E0; color: #fff; border-radius: 28px; padding: clamp(24px, 3vw, 40px); }
#introduction .sec-head h1 { color: #fff; }
#introduction .sec-head .eyebrow { color: #C7CDF8; }
#introduction .sec-head .intro-lead { color: #DADCFF; }

/* Téléphones : tableaux en fiches (tables.js), champs à 16 px pour éviter le zoom d'iOS, zones tactiles confortables */
@media (max-width: 640px) {
  table.pf-stack, table.pf-stack tbody, table.pf-stack tr { display: block; width: 100% !important; min-width: 0 !important; }
  table.pf-stack thead { display: none; }
  table.pf-stack tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.pf-stack tr:last-child { border-bottom: 0; }
  table.pf-stack td, table.pf-stack tbody th { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 14px; width: auto !important; min-width: 0 !important; padding: 3px 0 !important; border: 0 !important; text-align: right; white-space: normal !important; overflow-wrap: anywhere; }
  table.pf-stack td::before, table.pf-stack tbody th::before { content: attr(data-label); flex: none; max-width: 46%; color: var(--muted); font-size: .78rem; font-weight: 500; text-align: left; }
  table.pf-stack td:first-child, table.pf-stack tbody th:first-child { justify-content: flex-start; font-weight: 700; text-align: left; }
  table.pf-stack td:first-child::before, table.pf-stack tbody th:first-child::before, table.pf-stack td[data-label=""]::before { display: none; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px !important; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) { min-height: 42px; }
  summary { min-height: 44px; }
  code { overflow-wrap: anywhere; }
}

/* Titres : même format que le site (partie en gras, partie en italique bleu) */
.text-accent-serif { display: block; font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; color: var(--brand-ink); letter-spacing: -.01em; }
#introduction .sec-head .text-accent-serif { color: #C7CDF8; }
.sec-title { flex-wrap: wrap; row-gap: 0; }
.sec-title .text-accent-serif { flex-basis: 100%; }

/* Tableau de bord : menu du design A, bloc de solde du design B */
.shell { position: relative; display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { position: sticky; top: 0; align-self: flex-start; flex: 1 1 248px; max-width: 100%; height: 100vh; overflow-y: auto; padding: 22px 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 22px; }
.merchant { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0 8px; color: var(--fg); }
.merchant:hover { color: var(--fg); }
.merchant svg { flex: none; width: 36px; height: 36px; }
.merchant > span { min-width: 0; }
.merchant b { display: block; overflow: hidden; font-size: 15px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.merchant small { display: block; font-size: 13px; color: var(--muted); }
/* Badge « Compte Pro vérifié » (PFApp.verifiedName et l'admin) : rosette bleue à la taille du texte, centrée sur la ligne,
   collée au dernier mot (pf-nowrap) ou, sur une ligne coupée par des points de suspension, à côté du nom (pf-vline).
   Les tracés et les couleurs sont dans le SVG : lisibles sur les thèmes clair et sombre. */
.pf-nowrap { white-space: nowrap; }
.pf-verified { display: inline-block; flex: none; width: 1em; height: 1em; margin-left: .28em; vertical-align: -.14em; line-height: 0; }
.pf-verified > .pf-vsvg { display: block; width: 100%; height: 100%; overflow: visible; }
.pf-vline { display: inline-flex; align-items: center; gap: .28em; min-width: 0; max-width: 100%; vertical-align: bottom; }
.pf-vline-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-vline > .pf-verified { margin-left: 0; }
.merchant b .pf-vline { display: flex; }
.facts b .pf-nowrap { color: inherit; }
.menu { display: flex; flex-direction: column; gap: 4px; font-size: 15px; font-weight: 600; }
.menu a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--fg-2); }
.menu a svg { flex: none; width: 20px; height: 20px; }
.menu a:hover { color: var(--brand-ink); }
.menu a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }
.menu .group { margin: 14px 12px 4px; font-size: 13px; font-weight: 500; color: var(--muted); }
.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.content { width: 100%; padding-block: 26px 36px; padding-left: 32px; padding-right: max(32px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 18px; }
.content > .page-title:first-child { min-height: 48px; padding-right: 250px; }
.page-title h1 { font-size: 30px; line-height: 1.1; }
.page-title p { font-size: 15px; }
.topbar { position: absolute; z-index: 30; top: 26px; right: max(32px, env(safe-area-inset-right, 0px)); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.mode-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.mode-pill i { width: 8px; height: 8px; border-radius: 50%; }
.mode-pill[data-mode="test"] { background: var(--warn-soft); color: var(--warn); }
.mode-pill[data-mode="test"] i { background: var(--warn-strong); }
.mode-pill[data-mode="live"] { background: var(--ok-soft); color: var(--ok); }
.mode-pill[data-mode="live"] i { background: var(--ok); }
.user-menu { position: relative; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--fg); color: var(--on-ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.user-pop { position: absolute; top: calc(100% + 8px); right: 0; width: 220px; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 18px 40px -16px #0b0f2a59; display: flex; flex-direction: column; gap: 2px; }
.user-pop .lang-sw { align-self: flex-start; margin: 4px 8px 6px; }
.user-pop a, .user-pop > button { display: flex; align-items: center; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: var(--fg-2); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.user-pop a:hover, .user-pop > button:hover { background: var(--bg); color: var(--fg); }
.tabbar { display: none; }

/* Notifications du compte : la cloche et sa liste */
.notif-menu { position: relative; }
.notif-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--fg-2); cursor: pointer; }
.notif-btn:hover, .notif-btn[aria-expanded="true"] { color: var(--fg); border-color: var(--brand-ink); }
.notif-count { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border: 2px solid var(--bg); border-radius: 999px; background: var(--brand); color: #FFFFFF; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }
.notif-pop { position: absolute; top: calc(100% + 8px); right: 0; width: 380px; max-height: min(560px, calc(100vh - 110px)); display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 18px 40px -16px #0b0f2a59; overflow: hidden; }
.notif-pop[hidden] { display: none; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.notif-all, .notif-more { border: 0; background: none; color: var(--brand-ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; padding: 6px 0; }
.notif-all:hover, .notif-more:hover { text-decoration: underline; }
.notif-all { flex: none; white-space: nowrap; }
.notif-head b { min-width: 0; }
.notif-list { overflow-y: auto; overscroll-behavior: contain; }
.notif-empty { margin: 0; padding: 28px 16px; color: var(--muted); font-size: 14px; text-align: center; }
.notif-item { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif-item.fresh { background: var(--brand-tint); }
.notif-dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--brand-ink); }
.notif-item.lvl-success .notif-dot { background: var(--ok); }
.notif-item.lvl-warning .notif-dot { background: var(--warn); }
.notif-item.lvl-critical .notif-dot { background: var(--danger); }
.notif-item h3 { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--fg); overflow-wrap: anywhere; }
.notif-item h3 a { color: inherit; text-decoration: none; }
.notif-item h3 a:hover { color: var(--brand-ink); text-decoration: underline; }
/* Notification non lue sans lien : son titre l'ouvre et la marque lue. Une lue garde son point en gris. */
.notif-read { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.notif-read:hover { color: var(--brand-ink); text-decoration: underline; }
.notif-item:not(.fresh) .notif-dot { background: var(--line); }
.notif-item p { margin: 4px 0 0; font-size: 14px; line-height: 1.45; color: var(--fg-2); white-space: pre-line; overflow-wrap: anywhere; }
.notif-meta { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.notif-meta b { color: var(--brand-ink); }
.notif-more { display: block; width: 100%; padding: 12px 16px; text-align: center; }

/* Réglages : une carte seule sur sa ligne, et une ligne réglage + interrupteur */
.set-row.set-row-single { grid-template-columns: minmax(0, 1fr); }
.pref-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pref-line b { font-size: 14px; }
.pref-line .hint { margin: 2px 0 0; }

/* Changement d'onglet : la nouvelle page remplace l'ancienne en un fondu très court, le menu reste en place. */
@view-transition { navigation: auto; }
.side { view-transition-name: pf-side; }
.tabbar { view-transition-name: pf-tabbar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.12s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

.hello-name { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; color: var(--brand-ink); letter-spacing: -.01em; }
.home-row { display: flex; flex-wrap: wrap; gap: 14px; }
.balance-band { flex: 2 1 420px; min-width: 0; min-height: 190px; padding: 24px 28px; border-radius: 24px; background: var(--band); color: #FFFFFF; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; }
.band-label, .band-note { color: var(--band-text); }
.band-amount { margin-top: 6px; font-size: clamp(38px, 4.4vw, 60px); line-height: 1; font-weight: 800; letter-spacing: -.04em; overflow-wrap: anywhere; }
.band-amount:empty { min-height: 60px; }
.band-amount span { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.band-note { margin-top: 10px; }
.band-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.band-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border-radius: 13px; background: #FFFFFF; color: #12141F; font-weight: 700; }
.band-btn:hover { background: var(--brand-soft); color: var(--fg); }
.band-btn.ink { background: #12141F; color: #FFFFFF; }
.band-btn.ink:hover { background: #000000; color: #FFFFFF; }
/* Rien n'est encore retirable (fonds en attente) : le bouton reste visible mais grisé. */
.band-btn[aria-disabled="true"] { opacity: .45; pointer-events: none; cursor: not-allowed; }
.stat { flex: 1 1 210px; min-width: 0; padding: 18px 20px; display: flex; flex-direction: column; justify-content: center; }
.stat-label { font-size: 14px; color: var(--muted); }
.stat-value { margin-top: 6px; font-size: 28px; font-weight: 800; letter-spacing: -.03em; overflow-wrap: anywhere; }
.stat-note { margin-top: 2px; font-size: 14px; color: var(--muted); }
.split { display: flex; height: 8px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: var(--mango); }
.split i { background: var(--brand); }
.split-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; margin-top: 6px; font-size: 13px; color: var(--fg-2); }
.chart-card { flex: 2 1 470px; min-width: 0; padding: 18px 20px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chart-head h2 { margin: 0; font-size: 16px; }
.chart-head span { font-size: 14px; color: var(--muted); }
.chart-area { position: relative; margin-top: 10px; }
.chart { height: 170px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: var(--muted); }
.axis { margin-top: 6px; }
.start-card { flex: 1 1 260px; min-width: 0; padding: 18px 20px; display: flex; flex-direction: column; gap: 11px; }
.start-card h2 { margin: 0; font-size: 16px; }
.steps { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.steps .dot { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); font-size: 13px; font-weight: 700; }
.steps .done { color: var(--fg); }
.steps .done .dot { background: var(--ok); color: var(--on-ok); }
.steps .now { color: var(--fg); font-weight: 600; }
.steps .now .dot { background: var(--brand); color: #FFFFFF; }
.start-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: auto; border-radius: 12px; background: var(--fg); color: var(--on-ink); font-weight: 600; }
.start-btn:hover { background: var(--ink-hover); color: var(--on-ink); }
.panel-head h2 { font-size: 16px; }
.panel-head { padding: 16px 20px; border-bottom: 0; }

.pay-table th { padding: 10px 12px; background: var(--bg); font-size: 14px; font-weight: 600; }
.pay-table th:first-child, .pay-table td:first-child { padding-left: 20px; }
.pay-table th:last-child, .pay-table td:last-child { padding-right: 20px; }
.pay-table td { padding: 9px 12px; border-top: 1px solid var(--line); }
.pay-who a { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 600; }
.pay-logo { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--bg); color: var(--brand-ink); }
.pay-logo img { width: 24px; height: 18px; object-fit: contain; }
.pay-amount { color: var(--fg) !important; font-weight: 700; font-variant-numeric: tabular-nums; }
.pay-ref, .pay-customer { font-family: var(--mono); font-size: 13px; }
.pay-date { color: var(--muted) !important; }
.badge { font-size: 13px; font-weight: 600; }
.b-ok { color: var(--ok); }
.b-fail { color: var(--danger); }

.link-result { display: flex; flex-direction: column; gap: 14px; }
.link-url { padding: 10px 12px; border: 1px dashed var(--mango); border-radius: 12px; background: var(--bg); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.link-qr { width: 168px; height: 168px; }
.link-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; padding: 12px 20px; border-top: 1px solid var(--line); }
.link-row:first-child { border-top: 0; }
.link-main { flex: 1 1 220px; min-width: 0; }
.link-main b { display: block; overflow-wrap: anywhere; }
.link-main span { font-size: 14px; color: var(--muted); }
.link-side { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

@media (max-width: 800px) {
  .shell { flex-direction: column; flex-wrap: nowrap; }
  .side { position: static; flex: none; width: 100%; height: auto; overflow: visible; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .merchant { padding: 0; min-height: 40px; margin-right: 238px; }
  .merchant svg { width: 32px; height: 32px; }
  .side .menu { display: none; }
  .side.open .menu { position: fixed; z-index: 45; left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); display: flex; max-height: calc(100vh - 110px); overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 24px 60px -20px #0b0f2a73; }
  .topbar { top: 12px; right: 16px; }
  .top-actions { gap: 8px; }
  .mode-pill { min-height: 40px; padding: 0 10px; font-size: 13px; }
  .notif-pop { position: fixed; z-index: 46; top: 62px; left: 12px; right: 12px; width: auto; max-height: calc(100vh - 160px); }
  .content { padding: 16px 16px calc(100px + env(safe-area-inset-bottom, 0px)); gap: 12px; }
  .content > .page-title:first-child { min-height: 0; padding-right: 0; }
  .page-title h1 { font-size: 26px; }
  .tabbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 6px 8px max(10px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--card); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
  .tabbar svg { width: 21px; height: 21px; }
  .tabbar [aria-current="page"], .tabbar [aria-expanded="true"] { color: var(--brand-strong); }
  .toast-msg { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 640px) {
  .balance-band { flex-basis: 100%; min-height: 0; padding: 20px 18px; border-radius: 22px; }
  .band-amount { font-size: 42px; }
  .band-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .stat { flex: 1 1 40%; padding: 13px 14px; }
  .stat-value { font-size: 21px; letter-spacing: -.02em; }
  .chart { height: 110px; }
  .chart-card, .start-card { flex-basis: 100%; padding: 14px 16px; }
  .panel-head { padding: 12px 16px; }
  .pay-table, .pay-table tbody { display: block; }
  .pay-table thead { display: none; }
  .pay-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; padding: 10px 16px; border-top: 1px solid var(--line); }
  .pay-table td { display: block; padding: 0 !important; border: 0; white-space: normal; }
  .pay-who { grid-column: 1; grid-row: 1 / span 2; }
  .pay-amount { grid-column: 2; grid-row: 1; text-align: right; }
  .pay-status { grid-column: 2; grid-row: 2; text-align: right; }
  .pay-ref, .pay-customer { display: none !important; }
  .pay-date { display: none !important; }
  .link-row { padding: 12px 16px; }
}

@media print {
  .side, .tabbar, .topbar, .page-actions, .toast-msg { display: none !important; }
  .shell, .main, .content { display: block; width: 100%; max-width: none; padding: 0; margin: 0; }
  body { background: var(--card); }
  .report-block { break-inside: avoid; box-shadow: none; margin-bottom: 16px; }
}

/* ==========================================================================
   Espace client : pleine largeur, mêmes briques sur chaque onglet.
   Indigo pour le Mobile Money, vert pour la crypto.
   ========================================================================== */
:root, .theme-light { --mm: #4453E0; --mm-soft: #ECEEFC; --mm-ink: #3241C8; --crypto: #0F7B5F; --crypto-soft: #E2F3EC; --crypto-ink: #0B6048; }
.content { gap: 16px; }
.notice { padding: 14px 18px; border-radius: 14px; background: var(--brand-tint); font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.bad { background: var(--danger-soft); color: var(--danger); }
.notice.good { background: var(--ok-soft); color: var(--ok); }
.form-err { margin: 0; color: var(--danger); font-size: 14px; }
.hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.mono { font-size: 13px; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* minmax(0, 1fr) : une colonne implicite s'étirerait à la largeur du contenu et ferait déborder la page. */
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.stack:empty { display: none; }
/* Rôles de l'équipe : ce qui est au propriétaire disparaît pour les autres rôles ; [data-perm] est réglé par app-shell.js. */
[data-role]:not([data-role="owner"]) .owner-only { display: none !important; }
[data-perm][hidden] { display: none !important; }
/* Un bloc [data-perm="…"] n'apparaît que si la page porte cette permission (data-perms, posé par app-shell.js d'après /me). */
html:not([data-perms~="home"]) [data-perm="home"],
html:not([data-perms~="payments.read"]) [data-perm="payments.read"],
html:not([data-perms~="balances.read"]) [data-perm="balances.read"],
html:not([data-perms~="withdrawals.create"]) [data-perm="withdrawals.create"],
html:not([data-perms~="links.read"]) [data-perm="links.read"],
html:not([data-perms~="links.write"]) [data-perm="links.write"],
html:not([data-perms~="store.read"]) [data-perm="store.read"],
html:not([data-perms~="store.write"]) [data-perm="store.write"],
html:not([data-perms~="customers.read"]) [data-perm="customers.read"],
html:not([data-perms~="reports.read"]) [data-perm="reports.read"],
html:not([data-perms~="api.read"]) [data-perm="api.read"],
html:not([data-perms~="api.write"]) [data-perm="api.write"],
html:not([data-perms~="support"]) [data-perm="support"],
html:not([data-perms~="account.manage"]) [data-perm="account.manage"] { display: none !important; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btn svg { width: 17px; height: 17px; flex: none; }
.num-right { text-align: right; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.grid-main { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.grid-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.metric { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 1px 2px #12141f0a, 0 10px 30px -14px #4453e029; }
.metric span { font-size: 14px; color: var(--muted); }
.metric b { font-size: clamp(22px, 2vw, 28px); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.metric small { font-size: 13px; color: var(--muted); }

.balance-band { min-height: 176px; }
.balance-band.is-crypto { background: var(--crypto); }
.is-crypto .band-label, .is-crypto .band-note { color: #EAF8F1; }
.is-crypto .band-btn:hover { background: #D5F0E6; }
.band-amount { font-size: clamp(34px, 3.4vw, 54px); }

.tabs { display: flex; gap: 2px; padding: 0 12px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.tabs button:hover { color: var(--fg); }
.tabs button[aria-selected="true"] { color: var(--mm-ink); border-bottom-color: var(--brand-ink); }
.tabs .count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--bg); color: var(--fg-2); font-size: 12px; text-align: center; }
.tabs button[aria-selected="true"] .count { background: var(--brand-soft); color: var(--mm-ink); }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.toolbar .fld { flex: 0 1 150px; min-width: 120px; }
.toolbar .inp, .toolbar .sel { width: 100%; height: 44px; min-height: 44px; padding-block: 0; }
.toolbar .search-fld { flex: 1 1 280px; }
.search-box { position: relative; display: block; }
.search-box svg { position: absolute; top: 13px; left: 12px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-box .inp { padding-left: 38px; }
.filter-toggle { display: none; }
.pay-table tr[data-href] { cursor: pointer; }
.pay-table tr[data-href]:hover td { background: var(--surface-2); }
.pay-table .num-right { text-align: right; }
.empty-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 56px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.empty-card svg { width: 30px; height: 30px; color: var(--brand-ink); }
.empty-card b { color: var(--fg); font-size: 16px; }

.side-card { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; min-width: 0; }
.side-card h2 { margin: 0; font-size: 16px; }
.side-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.side-head span { font-size: 13px; color: var(--muted); }
.rank { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.rank li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; font-size: 14px; }
.rank .logo-box { grid-row: span 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--bg); }
.rank .logo-box img { width: 21px; height: 16px; object-fit: contain; }
.rank b { font-weight: 600; }
.rank .bar { grid-column: 2 / -1; height: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.rank .bar i { display: block; height: 100%; border-radius: inherit; background: var(--mm); }
.rank .bar i.crypto { background: var(--crypto); }
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.quick a { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--fg); font-size: 14px; font-weight: 600; }
.quick a:hover { border-color: var(--brand-ink); color: var(--mm-ink); }
.quick svg { flex: none; width: 18px; height: 18px; color: var(--brand-ink); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; background: var(--mm); }
.legend i.crypto { background: var(--crypto); }
.mini-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.mini-row:first-of-type { border-top: 0; }
.mini-row b { font-variant-numeric: tabular-nums; }
.gauge { display: grid; gap: 8px; font-size: 14px; }
.bar { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; }

.pay-card { display: flex; flex-direction: column; gap: 16px; padding: 22px 24px; min-width: 0; scroll-margin-top: 16px; }
.pay-card-head { display: flex; align-items: center; gap: 12px; }
.pay-card-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.pay-card-head p { margin: 0; font-size: 13px; color: var(--muted); }
.method-ic { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--mm-soft); color: var(--mm-ink); }
.crypto .method-ic { background: var(--crypto-soft); color: var(--crypto-ink); }
.dest-box { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg); font-size: 14px; }
.dest-box span { color: var(--muted); font-size: 13px; }
.dest-box b { font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }
.btn-crypto { background: var(--crypto); border-color: var(--crypto); color: #FFFFFF; }
.btn-crypto:hover { background: var(--crypto-ink); color: #FFFFFF; }
details.fold { border-top: 1px solid var(--line-2); padding-top: 12px; }
details.fold summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--fg-2); list-style-position: inside; }
details.fold[open] summary { margin-bottom: 12px; }
.amount-in { color: var(--ok); font-weight: 600; }
.amount-out { color: var(--fg); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--mm-soft); color: var(--mm-ink); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.crypto { background: var(--crypto-soft); color: var(--crypto-ink); }
.chip.grey { background: var(--bg); color: var(--fg-2); }

.shop-hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px 28px; border-radius: 24px; background: var(--band); color: #FFFFFF; min-width: 0; }
.shop-hero h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.shop-hero p { margin: 6px 0 0; color: var(--band-text); font-size: 14px; max-width: 58ch; }
.shop-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; flex: 1 1 auto; }
.shop-url { padding: 11px 14px; border-radius: 12px; background: rgba(255, 255, 255, .14); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.shop-hero .fld { color: var(--band-text); min-width: 110px; }
.shop-hero .row-actions { align-items: flex-end; }
.shop-hero .band-btn { min-height: 44px; }
.shop-hero .sel { min-height: 44px; height: 44px; padding-block: 0; }
.shop-qr { flex: none; width: 164px; height: 164px; padding: 10px; border-radius: 18px; background: #FFFFFF; }
.link-title b { display: block; overflow-wrap: anywhere; }
.link-title span { font-size: 13px; color: var(--muted); }
.icon-actions { display: flex; justify-content: flex-end; gap: 6px; }
.icon-btn2 { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--fg-2); cursor: pointer; }
.icon-btn2:hover { border-color: var(--brand-ink); color: var(--mm-ink); }
.icon-btn2 svg { width: 17px; height: 17px; }
.preview-pay { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px; border-radius: 14px; background: var(--bg); text-align: center; }
.preview-pay small { color: var(--muted); }
.preview-pay b { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }

.key-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 16px 20px; border-top: 1px solid var(--line-2); }
.key-row:first-child { border-top: 0; }
.key-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); }
.key-row .method-ic { grid-row: span 2; }
.key-row b { font-size: 15px; }
.key-row code { display: block; font-family: var(--mono); font-size: 13px; color: var(--fg-2); overflow-wrap: anywhere; }
.key-row .key-side { grid-row: span 2; grid-column: 3; display: flex; align-items: center; gap: 12px; }
.key-row small { color: var(--muted); font-size: 13px; }
.reveal { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: #12141F; color: #FFFFFF; }
.reveal p { margin: 0; color: #C7CDF8; font-size: 14px; }
.reveal code { display: block; padding: 12px 14px; border-radius: 11px; background: #23273B; font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }
.code-box { position: relative; margin: 0; padding: 14px 16px; border-radius: 13px; background: var(--code-bg); color: var(--code-fg); font-family: var(--mono); font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-row { display: flex; align-items: center; gap: 8px; }
.copy-row code { flex: 1 1 auto; min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }

.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; padding: 18px 20px; list-style: none; }
.stepper li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; text-align: center; }
.stepper li::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.stepper li:first-child::before { display: none; }
.stepper li.done::before, .stepper li.now::before { background: var(--brand); }
.stepper .dot { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--line-2); color: var(--fg-2); font-size: 13px; font-weight: 700; }
.stepper .dot svg { width: 16px; height: 16px; }
.stepper .done { color: var(--fg); }
.stepper .done .dot { background: var(--ok); color: var(--on-ok); }
.stepper .now { color: var(--fg); font-weight: 600; }
.stepper .now .dot { background: var(--brand); color: #FFFFFF; }
.form-section { display: flex; flex-direction: column; gap: 14px; padding: 20px 24px; border-top: 1px solid var(--line-2); }
.form-section:first-child { border-top: 0; }
.form-section h3 { margin: 0; font-size: 15px; font-weight: 700; }
.form-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--line-2); }
.drops { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.drop { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px dashed var(--mango); border-radius: 14px; background: var(--surface-2); cursor: pointer; min-width: 0; }
.drop:hover, .drop:focus-within { border-color: var(--brand-ink); }
.drop.filled { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop .method-ic { width: 38px; height: 38px; }
.drop b { display: block; font-size: 14px; }
.drop small { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.status-card { display: flex; align-items: center; gap: 16px; padding: 22px 24px; }
.status-card .method-ic { width: 52px; height: 52px; border-radius: 16px; }
.status-card.ok .method-ic { background: var(--ok-soft); color: var(--ok); }
.status-card.wait .method-ic { background: var(--warn-soft); color: var(--warn); }
.status-card h2 { margin: 0; font-size: 19px; font-weight: 700; }
.status-card p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.ticks { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.ticks li { display: flex; gap: 10px; }
.ticks svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--ok); }

.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--mm-ink); font-size: 13px; font-weight: 700; }
.person b { display: block; overflow-wrap: anywhere; }
.person span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.seats { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--fg-2); }
.seats .bar { width: 120px; }
.seats .bar i { background: var(--brand); }
.role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.role-card { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; }
.role-card h3 { margin: 0; font-size: 15px; font-weight: 700; }
.role-card .role-sum { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.role-card ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; color: var(--fg-2); }

.set-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.set-card { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px; min-width: 0; }
.set-card h2 { margin: 0; font-size: 16px; font-weight: 700; }
.set-card .lead-text { margin: -8px 0 0; font-size: 14px; color: var(--muted); }
.tab-panel { display: flex; flex-direction: column; gap: 16px; }
.facts { display: grid; gap: 0; }
.facts div { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.facts div:first-child { border-top: 0; padding-top: 0; }
.facts span { color: var(--muted); }
.facts b { font-weight: 600; overflow-wrap: anywhere; }
.logo-row { display: flex; align-items: center; gap: 18px; }
.logo-preview { display: flex; align-items: center; justify-content: center; flex: none; width: 72px; height: 72px; border-radius: 18px; overflow: hidden; background: var(--brand-soft); color: var(--mm-ink); font-size: 22px; font-weight: 700; }
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }
.logo-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tf-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tf-setup { display: flex; gap: 20px; align-items: flex-start; }
.tf-setup .qr-img { flex: none; }
.tf-steps { display: flex; flex-direction: column; gap: 12px; min-width: 0; font-size: 14px; }
.tf-key { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.tf-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 14px; list-style: none; border: 1px dashed var(--line); border-radius: 12px; }
.device-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.device-row:first-child { border-top: 0; }

.report { display: flex; flex-direction: column; gap: inherit; }
.report-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line-2); border-bottom: 1px solid var(--line-2); }
.report-stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 24px; background: var(--card); }
.report-stat span { font-size: 13px; color: var(--muted); }
.report-stat b { font-size: clamp(18px, 1.9vw, 22px); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.link-button { padding: 0; border: 0; background: none; color: var(--mm-ink); font-weight: 600; cursor: pointer; text-align: left; }
.link-button:hover { text-decoration: underline; }
.modal-wide { width: min(780px, 100%); }
.customer-facts { display: grid; gap: 8px; }
.section-title { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }

.balance-band { flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: space-between; gap: 18px; }
.band-actions { justify-content: flex-start; }
.band-btn { border: 0; cursor: pointer; }
.content > .page-title:first-child { align-items: flex-start; }
.key-row code { padding: 0; background: none; }
.inp:disabled { background: var(--bg); color: var(--muted); }

:root, .theme-light { --cards: #7B2FBE; --cards-soft: #F1E8FA; --cards-ink: #5E1F96; }
.balances { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: stretch; }
.balance-band.is-card { background: var(--cards); }
.is-card .band-label, .is-card .band-note { color: #EBDDF8; }
.is-card .band-btn:hover { background: #EBDDF8; }
.card .method-ic { background: var(--cards-soft); color: var(--cards-ink); }
.btn-card { background: var(--cards); border-color: var(--cards); color: #FFFFFF; }
.btn-card:hover { background: var(--cards-ink); color: #FFFFFF; }
.status-card.bad .method-ic { background: var(--danger-soft); color: var(--danger); }
.wizard { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.wiz-side { position: sticky; top: 16px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.wiz-progress { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.wiz-progress .bar i { background: var(--cards); width: 0; }
.wiz-steps { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.wiz-steps button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 8px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.wiz-steps button:disabled { cursor: default; }
.wiz-steps .dot { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--line-2); color: var(--fg-2); font-size: 12px; }
.wiz-steps .dot svg { width: 14px; height: 14px; }
.wiz-steps .done button { color: var(--fg); }
.wiz-steps .done .dot { background: var(--ok); color: var(--on-ok); }
.wiz-steps .now button { background: var(--cards-soft); color: var(--cards-ink); }
.wiz-steps .now .dot { background: var(--cards); color: #FFFFFF; }
.wiz-form { min-width: 0; }
.wiz-step { display: flex; flex-direction: column; gap: 16px; min-width: 0; margin: 0; padding: 22px 24px; border: 0; }
.wiz-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.wiz-head p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.fld.full { grid-column: 1 / -1; }
.area { width: 100%; padding: 10px 12px; resize: vertical; font-family: inherit; }
.owners { display: grid; gap: 8px; }
.owner-row { display: grid; grid-template-columns: minmax(0, 2fr) 90px minmax(0, 1.4fr) 38px; gap: 8px; align-items: center; }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--fg-2); cursor: pointer; }
.check-line input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--cards); }

@media (max-width: 1100px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .set-layout { grid-template-columns: minmax(0, 1fr); }
}
.mini-empty { display: flex; flex: 1 1 auto; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 8px 0; color: var(--muted); font-size: 14px; text-align: center; }
.mini-empty svg { width: 24px; height: 24px; color: var(--brand-ink); }
/* Accueil : deux colonnes continues qui finissent à la même hauteur, quel que soit le contenu. */
@media (min-width: 1101px) {
  .home-columns { align-items: stretch; }
  .home-columns .chart-card, .home-columns .home-recent { display: flex; flex: 1 1 auto; flex-direction: column; }
  .home-columns .chart-area { display: flex; flex: 1 1 auto; flex-direction: column; }
  .home-columns .chart { flex: 1 1 auto; height: auto; min-height: 170px; }
  .home-columns #recent, .home-columns #withdrawals { display: flex; flex: 1 1 auto; flex-direction: column; }
  .home-columns .empty-card { flex: 1 1 auto; justify-content: center; }
  .home-columns .start-card { flex: 0 0 auto; }
  .home-columns .grid-stack > .panel:last-child { flex: 1 1 auto; }
}
/* En une colonne, les cadres gardent leur ordre de lecture. */
@media (max-width: 1100px) {
  .home-columns > .grid-stack { display: contents; }
  .home-columns .panel { order: 4; }
  .home-columns .chart-card { order: 1; }
  .home-columns .home-ops { order: 2; }
  .home-columns .home-recent { order: 3; }
}
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .wizard { grid-template-columns: minmax(0, 1fr); }
  .wiz-side { position: static; }
  .wiz-steps { display: none; }
}
@media (max-width: 640px) {
  .wiz-step { padding: 16px; }
  .owner-row { grid-template-columns: minmax(0, 1fr) 80px; }
  .owner-row [data-o="nationality"] { grid-column: 1; }
  .owner-row .icon-btn2 { grid-column: 2; justify-self: end; }
  .is-card .band-actions { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric { padding: 12px 14px; }
  .balance-band { min-height: 0; }
  .band-amount { font-size: 38px; }
  .toolbar { padding: 12px 14px; }
  .filter-toggle { display: inline-flex; }
  .filter-more { display: none; flex: 1 1 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .toolbar.open .filter-more { display: grid; }
  .filter-more .fld { min-width: 0; }
  .pay-card, .set-card { padding: 16px; }
  .shop-hero { flex-direction: column; align-items: stretch; padding: 18px; border-radius: 22px; }
  .shop-qr { align-self: center; }
  .stepper { padding: 14px 8px; font-size: 13px; }
  .stepper li { font-size: 12px; }
  .form-section, .form-foot { padding: 14px 16px; }
  .key-row { grid-template-columns: 38px minmax(0, 1fr); padding: 14px 16px; }
  .key-row .method-ic { grid-row: auto; width: 38px; height: 38px; }
  .key-row > div:not(.key-side) { grid-column: 1 / -1; order: 1; }
  .key-row .key-side { grid-column: 1 / -1; grid-row: auto; order: 2; justify-content: space-between; flex-wrap: wrap; }
  .key-row small { display: block; }
  .is-crypto .band-actions { grid-template-columns: minmax(0, 1fr); }
  .tf-setup { flex-direction: column; align-items: center; }
  .tf-steps { width: 100%; }
  .logo-row { align-items: flex-start; }
  .panel-head { flex-wrap: wrap; }
  .page-actions { width: 100%; }
  .page-actions .sel { flex: 1 1 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .report-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-stat { padding: 14px 16px; }
  .set-card .btn { width: 100%; }
}
.filter-more { display: contents; }
@media (max-width: 640px) { .filter-more { display: none; } .toolbar.open .filter-more { display: grid; } }

/* Pages de Réglages : des rangées de cadres à hauteur égale, le bas de chaque cadre aligné */
.set-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.set-row.wide-left { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.set-row.thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.set-row.fours { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.set-row > * { min-width: 0; }
.set-card > .form { flex: 1; }
.set-card > .form.tight { flex: none; }
.set-card > .form > :last-child:not(.form-err) { margin-top: auto; }
.set-foot { margin-top: auto; }
.set-rule { width: 100%; margin: 4px 0; border: 0; border-top: 1px solid var(--line-2); }
.set-label { font-size: 14px; font-weight: 700; }
.form-inline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 14px; align-items: end; }
.id-band { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; padding: 24px 28px; border-radius: 20px; background: var(--band); color: #FFFFFF; min-width: 0; }
.id-avatar { flex: none; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: #FFFFFF; color: #4453E0; font-size: 26px; font-weight: 800; }
.id-main { flex: 1 1 240px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.id-main b { font-size: 24px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.id-main > span { font-size: 15px; color: var(--band-text); overflow-wrap: anywhere; }
.id-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.id-stats { display: flex; flex-wrap: wrap; gap: 14px 36px; }
.id-stats div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.id-stats span { font-size: 13px; color: var(--band-text); }
.id-stats b { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.perm-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.perm-list li { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.perm-list li.ok { color: var(--fg); }
.perm-list i { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--line-2); font-size: 12px; font-style: normal; font-weight: 800; }
.perm-list .ok i { background: var(--brand-soft); color: var(--brand-ink); }
.set-tile { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--fg); min-width: 0; }
.set-tile:hover { border-color: var(--brand-ink); }
.set-tile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-tile b { font-size: 15px; font-weight: 700; }
.set-tile small { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.pay-mock-card { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); text-align: center; min-width: 0; }
.pay-mock-card b { font-size: 16px; overflow-wrap: anywhere; }
.pay-mock-card strong { font-size: 30px; font-weight: 800; letter-spacing: -.03em; overflow-wrap: anywhere; }
.pay-mock-btn { align-self: stretch; padding: 12px; border-radius: 12px; background: var(--brand); color: #FFFFFF; font-size: 15px; font-weight: 700; }
.meter-box { display: grid; gap: 6px; }
.meter { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.method-row { display: grid; grid-template-columns: auto minmax(0, 2fr) minmax(0, 1.4fr) 290px; gap: 14px 20px; align-items: center; padding: 20px 24px; border-top: 1px solid var(--line-2); }
.method-row:first-child { border-top: 0; }
.method-text { min-width: 0; }
.method-text h2 { margin: 0; font-size: 17px; font-weight: 700; }
.method-text p { margin: 3px 0 0; font-size: 14px; color: var(--muted); }
.method-month { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.method-month span, .method-month small { font-size: 13px; color: var(--muted); }
.method-month b { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.method-state { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
.set-links { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.set-links a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--bg); color: var(--fg); }
.set-links a:hover { background: var(--brand-soft); }
.set-links b { font-size: 15px; font-weight: 600; }
.set-links small { font-size: 13px; color: var(--muted); }
.how-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: how; font-size: 14px; color: var(--fg-2); }
.how-list li { display: flex; align-items: flex-start; gap: 10px; counter-increment: how; }
.how-list li::before { content: counter(how); flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); font-size: 13px; font-weight: 700; }
.device-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 10px; }
.device-grid .device-row { padding: 12px 14px; border: 0; border-radius: 12px; background: var(--bg); min-width: 0; }
.score-band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: 16px 28px; align-items: center; padding: 22px 28px; border: 1px solid var(--line); border-radius: 20px; background: #171A2B; color: #FFFFFF; }
.score-band[data-level="high"] { background: var(--crypto); }
.score-band[data-level="good"] { background: var(--brand); }
.score-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.score-main span { font-size: 14px; color: #E2E6FB; }
.score-main b { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.score-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; margin: 0; padding: 0; list-style: none; font-size: 14px; font-weight: 600; }
.score-list li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.score-list i { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; color: #171A2B; font-size: 13px; font-style: normal; font-weight: 800; }
.pin-input { letter-spacing: .3em; font-weight: 700; }
.inp[aria-invalid="true"], .inp[aria-invalid="true"]:focus { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.lang-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lang-tiles button { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2px 12px; min-height: 64px; padding: 8px 18px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--fg); font: inherit; cursor: pointer; min-width: 0; }
.lang-tiles button:disabled { cursor: not-allowed; opacity: .6; }
.lang-tiles b { font-size: 16px; }
.lang-tiles span { font-size: 13px; font-weight: 600; color: var(--muted); }
.lang-tiles button[aria-pressed="true"] { border-color: var(--brand-ink); background: var(--brand-soft); }
.cur-lines { display: grid; gap: 10px; }
.cur-lines div { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--bg); min-width: 0; }
.cur-lines span { font-size: 14px; color: var(--fg-2); }
.cur-lines b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }

/* Retrait : le bouton et le changement de destination côte à côte, puis le popup de confirmation */
.wd-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.wd-actions .btn { flex: 1 1 180px; }
/* Retrait impossible pour l'instant : grisé, mais un clic dit pourquoi. */
.wd-actions .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.dest-setup { display: flex; flex-direction: column; gap: 12px; }
.proof-or { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.proof-or::before, .proof-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

@media (max-width: 1180px) {
  .set-row.fours { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .set-row.thirds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .set-row.thirds > :last-child { grid-column: 1 / -1; }
  .method-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .method-month { grid-column: 2 / -1; grid-row: 2; }
}
@media (max-width: 900px) {
  .score-band { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .set-row, .set-row.wide-left, .set-row.thirds { grid-template-columns: minmax(0, 1fr); }
  .set-row.thirds > :last-child { grid-column: auto; }
  .score-list { grid-template-columns: minmax(0, 1fr); }
  .form-inline { grid-template-columns: minmax(0, 1fr); }
  .form-inline .btn { width: 100%; }
}
@media (max-width: 640px) {
  .id-band { padding: 20px; gap: 14px; }
  .id-avatar { width: 60px; height: 60px; font-size: 20px; }
  .id-stats { width: 100%; justify-content: space-between; gap: 12px 20px; }
  .score-band { padding: 20px; }
  .method-row { grid-template-columns: auto minmax(0, 1fr); padding: 16px; }
  .method-month { grid-column: 1 / -1; grid-row: auto; }
  .method-state { grid-column: 1 / -1; justify-content: space-between; min-width: 0; }
  .set-card .method-state .btn, .method-state .btn { width: auto; }
  .set-row.fours { grid-template-columns: minmax(0, 1fr); }
  .lang-tiles { grid-template-columns: minmax(0, 1fr); }
  .device-grid .device-row { flex-wrap: wrap; }
  .addr-row .btn { width: 100%; }
}

/* Compteur d'un onglet du menu (réponses du support non lues). */
.menu a .nav-badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--brand); color: #FFFFFF; font-size: 12px; font-weight: 700; text-align: center; }

/* Vérification d'identité : la pièce se choisit en cartes selon le pays, puis chaque face a sa case d'envoi. */
/* Sur grand écran, les deux colonnes finissent à la même hauteur et le pied du formulaire reste en bas. */
@media (min-width: 1101px) {
  .verify-cols { align-items: stretch; }
  .verify-cols > div.grid-stack > .panel, .verify-cols > aside > .panel:last-child { flex: 1 1 auto; }
  .verify-cols form.panel { display: flex; flex-direction: column; }
  .verify-cols .form-foot { margin-top: auto; }
}

/* Choix du thème : trois cases côte à côte, nom au-dessus, précision dessous */
.theme-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; }
.theme-tiles button { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 8px 14px; }
.theme-sw button { display: inline-grid; place-items: center; padding: 6px 9px; }
.theme-sw svg { width: 16px; height: 16px; }

/* Compte suspendu, bloqué ou fermé : plus de bouton Sandbox / Réel, un seul message à la place du contenu. */
.pf-stopped #pf-mode { display: none; }
.pf-locked-page .content > :not(#pf-locked) { display: none !important; }
.pf-locked-page .content { flex: 1; justify-content: center; align-items: center; min-height: calc(100vh - 140px); min-height: calc(100dvh - 140px); }
.pf-locked { flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 560px; padding: 36px 32px; text-align: center; }
.pf-locked > div { display: flex; flex-direction: column; align-items: center; }
.pf-locked p { margin-top: 8px; line-height: 1.55; }
.pf-locked .pf-locked-reason { margin-top: 10px; color: var(--fg); font-weight: 600; }
.pf-locked-actions { display: flex; justify-content: center; margin-top: 20px; }
@media (max-width: 900px) { .pf-locked-page .content { min-height: calc(100vh - 230px); min-height: calc(100dvh - 230px); } }
@media (max-width: 560px) { .pf-locked { padding: 28px 20px; } .pf-locked-actions, .pf-locked-actions .btn { width: 100%; } }

/* Très petits écrans : la barre du haut (mode, jour/nuit, cloche, compte) prend la place, le logo reste seul. */
@media (max-width: 359px) {
  .merchant > span { display: none; }
}

/* Accueil d'un membre de l'équipe : son rôle et ses raccourcis (dashboard.html). */
.role-welcome { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; }
.role-welcome[hidden] { display: none; }
.role-welcome .rw-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.role-welcome .rw-head p { margin: 0; flex: 1 1 280px; color: var(--fg-2); font-size: 14px; line-height: 1.5; }
.role-welcome .rw-links { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
