/* =====================================================================
   PEACE AND HOPE · CSDI · EBENEZER MINISTRY
   CSS pur, « mobile first » : les styles de base visent le téléphone,
   les @media (min-width) ajoutent la tablette puis l'ordinateur.
   Chaque organisation a sa couleur : body[data-org="pah|csdi|ebenezer"].
   ===================================================================== */

/* ---------- 1. Couleurs et mesures ---------- */
:root {
    --primary: #2f30e3;        /* PAH : bleu du logo (paix) */
    --primary-dark: #1f227c;
    --primary-deep: #13144a;
    --primary-soft: #eef0ff;
    --accent: #6b8e23;         /* vert olive des rameaux */

    --ink: #0f172a;
    --text: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --success: #15803d;
    --danger: #b91c1c;

    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-head: 'Poppins', var(--font-body);

    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 8px 24px rgb(15 23 42 / 6%);
    --shadow-lg: 0 12px 40px rgb(15 23 42 / 14%);
    --container: 1180px;
    --gutter: 1.25rem;
    --header-h: 64px;
}

[data-org="pah"] {
    --primary: #2f30e3;
    --primary-dark: #1f227c;
    --primary-deep: #13144a;
    --primary-soft: #eef0ff;
    --accent: #6b8e23;
}

[data-org="csdi"] {
    --primary: #15803d;        /* CSDI : vert (écosystème) */
    --primary-dark: #166534;
    --primary-deep: #052e16;
    --primary-soft: #ecfdf3;
    --accent: #a16207;
}

[data-org="ebenezer"] {
    --primary: #9f1239;        /* EBENEZER : bordeaux, accent or */
    --primary-dark: #881337;
    --primary-deep: #4c0519;
    --primary-soft: #fff1f2;
    --accent: #c99a06;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-head);
    color: var(--ink);
    line-height: 1.2;
    margin: 0 0 .6em;
}
h1 { font-size: clamp(1.9rem, 6vw, 3.2rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
ul { padding: 0; margin: 0; list-style: none; }
code { background: var(--bg-alt); padding: .1em .35em; border-radius: 4px; font-size: .9em; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

[hidden] { display: none !important; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: -9999px; top: .5rem; z-index: 100;
    background: #fff; padding: .5rem 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.skip-link:focus { left: .5rem; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 780px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.mt-lg { margin-top: 2.5rem; }
.note { margin-top: 1.5rem; font-size: .9rem; color: var(--muted); }
.note i { color: var(--primary); }

/* ---------- 3. Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .7rem 1.2rem; border-radius: 999px; border: 2px solid transparent;
    font-family: var(--font-body); font-weight: 600; font-size: .95rem; line-height: 1.2;
    text-decoration: none; cursor: pointer; transition: background .2s, color .2s, transform .15s, box-shadow .2s;
    min-height: 44px; /* cible tactile confortable */
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; box-shadow: var(--shadow); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary-soft); }
.btn-light { background: #fff; color: var(--primary-dark); }
.btn-light:hover { background: var(--primary-soft); color: var(--primary-deep); }
.btn-ghost { border-color: rgb(255 255 255 / 55%); color: #fff; background: transparent; }
.btn-ghost:hover { background: rgb(255 255 255 / 12%); color: #fff; }
.btn-lg { padding: .9rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------- 4. En-tête : barre du réseau + barre de l'organisation ---------- */
.site-header { position: sticky; top: 0; z-index: 50; }

.network-bar { background: var(--primary-deep); color: #fff; font-size: .8rem; }
.network-inner { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 40px; }
.network-links { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.network-links::-webkit-scrollbar { display: none; }
.network-link {
    display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
    padding: .35rem .75rem; border-radius: 999px; color: rgb(255 255 255 / 80%);
    text-decoration: none; font-weight: 600; letter-spacing: .02em;
}
.network-link:hover { color: #fff; background: rgb(255 255 255 / 10%); }
.network-link.is-active { background: #fff; color: var(--primary-deep); }
.lang-switch {
    color: #fff; text-decoration: none; font-weight: 600; white-space: nowrap;
    padding: .35rem .6rem; border-radius: 999px; border: 1px solid rgb(255 255 255 / 35%);
}
.lang-switch:hover { color: #fff; background: rgb(255 255 255 / 10%); }

.org-bar { background: rgb(255 255 255 / 96%); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); }
.org-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 1rem; position: relative; }

.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-logo { width: 44px; height: auto; }
.brand-icon {
    display: grid; place-items: center; width: 42px; height: 42px; flex: none;
    border-radius: 12px; background: var(--primary); color: #fff; font-size: 1.2rem;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-family: var(--font-head); font-weight: 800; font-size: 1rem; color: var(--primary-deep); letter-spacing: .01em; }
.brand-text small { color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }

.menu-toggle {
    display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
    border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
    font-size: 1.15rem; cursor: pointer;
}

/* Menu mobile : panneau déroulant */
.org-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
    padding: .75rem var(--gutter) 1.25rem; display: none;
}
.org-nav.is-open { display: block; }
.org-nav ul { display: flex; flex-direction: column; gap: .25rem; }
.org-nav a:not(.btn) {
    display: block; padding: .75rem .9rem; border-radius: var(--radius-sm);
    color: var(--ink); text-decoration: none; font-weight: 500;
}
.org-nav a:not(.btn):hover { background: var(--bg-alt); }
.org-nav a.is-active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.btn-donate { margin-top: .5rem; width: 100%; }

/* ---------- 5. Héros, sections, en-têtes de page ---------- */
.hero {
    position: relative; overflow: hidden; color: #fff;
    background:
        radial-gradient(1200px 500px at 100% 0%, rgb(255 255 255 / 10%), transparent 60%),
        linear-gradient(135deg, var(--primary-deep), var(--primary-dark) 55%, var(--primary));
    padding: 3.5rem 0 4rem;
}
.hero h1 { color: #fff; }
.hero .lead { color: rgb(255 255 255 / 88%); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.hero-motto { margin-top: 1.75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; color: rgb(255 255 255 / 75%); }
.hero-verse { font-style: italic; color: rgb(255 255 255 / 85%); font-size: 1.05rem; }
.hero-visual { display: flex; justify-content: center; }
.hero-logo { width: min(260px, 70vw); background: #fff; border-radius: 28px; padding: 1.5rem; box-shadow: var(--shadow-lg); }
.hero-emblem {
    display: grid; place-items: center; width: min(220px, 55vw); aspect-ratio: 1;
    border-radius: 50%; background: rgb(255 255 255 / 12%); border: 2px solid rgb(255 255 255 / 30%);
    font-size: clamp(4rem, 18vw, 7rem); color: #fff;
}
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .75rem; }
.hero .eyebrow { color: rgb(255 255 255 / 75%); }
.lead { font-size: 1.1rem; }
.lead-sm { font-size: 1.05rem; color: var(--text); }

.section { padding: 3rem 0; }
.section-alt { background: var(--bg-alt); }
.section-title { margin-bottom: 1.25rem; }
.section-title i { color: var(--primary); margin-right: .25rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1.25rem; }
.section-head .section-title { margin: 0; }
.link-more { font-weight: 600; text-decoration: none; }

.page-header {
    background: linear-gradient(180deg, var(--primary-soft), #fff);
    border-bottom: 1px solid var(--line); padding: 2.5rem 0 2rem;
}
.page-header h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); }

/* ---------- 6. Cartes et grilles ---------- */
.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.5rem; box-shadow: var(--shadow);
}
.card-soft { background: var(--primary-soft); border-color: transparent; box-shadow: none; }
.card-soft h2, .card-soft h3 { color: var(--primary-deep); }
.card-soft h2 i, .card-soft h3 i { color: var(--primary); }

.card-grid { display: grid; gap: 1rem; }
.feature-grid { display: grid; gap: 1rem; }

.card-program { position: relative; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.card-program:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-program p { color: var(--text); flex: 1; }
.card-icon {
    display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 1rem;
    border-radius: 14px; background: var(--primary-soft); color: var(--primary); font-size: 1.4rem;
}
.card-code { font-size: .75rem; font-weight: 700; letter-spacing: .1em; color: var(--muted); margin: 0 0 .25rem; }
.card-program h3 a { color: var(--ink); text-decoration: none; }
.card-more { font-weight: 600; color: var(--primary); font-size: .9rem; }
.stretched::after { content: ""; position: absolute; inset: 0; } /* toute la carte est cliquable */

.feature { text-align: left; padding: 1.25rem; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.feature-icon {
    display: inline-grid; place-items: center; width: 48px; height: 48px; margin-bottom: .75rem;
    border-radius: 50%; background: var(--primary); color: #fff; font-size: 1.2rem;
}
.feature p { margin: 0; font-size: .95rem; }

.split { display: grid; gap: 1.5rem; align-items: start; }

.quote {
    margin: 0; padding: 1.75rem; border-left: 4px solid var(--accent);
    background: var(--bg-alt); border-radius: 0 var(--radius) var(--radius) 0;
}
.quote p { font-size: 1.05rem; font-style: italic; margin: 0; }
.motto { margin-top: 1rem; }

.cta {
    display: grid; gap: 1.25rem; align-items: center;
    padding: 2rem 1.5rem; border-radius: calc(var(--radius) * 1.5); color: #fff;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}
.cta h2 { color: #fff; margin-bottom: .4rem; }
.cta p { margin: 0; color: rgb(255 255 255 / 85%); }

.network-cards { display: grid; gap: .75rem; margin-top: 1.5rem; }
.network-card {
    display: flex; flex-direction: column; gap: .25rem; padding: 1.1rem 1.25rem; text-decoration: none;
    border-radius: var(--radius); background: #fff; border: 1px solid var(--line); border-left: 5px solid #2f30e3;
    color: var(--ink);
}
.network-card[data-theme="csdi"] { border-left-color: #15803d; }
.network-card[data-theme="ebenezer"] { border-left-color: #9f1239; }
.network-card span { color: var(--muted); font-size: .9rem; }
.network-card:hover { box-shadow: var(--shadow); color: var(--ink); }

.prose p { font-size: 1.05rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

/* ---------- 7. Dons ---------- */
.pay-card { display: flex; flex-direction: column; gap: .25rem; }
.pay-label { font-weight: 700; color: var(--primary-deep); margin: 0; }
.pay-number { display: flex; align-items: center; gap: .5rem; font-size: 1.3rem; font-weight: 700; color: var(--ink); margin: .25rem 0; font-variant-numeric: tabular-nums; }
.pay-currencies { font-size: .8rem; color: var(--muted); margin: 0; }
.pay-details { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; margin: .5rem 0 0; font-size: .95rem; }
.pay-details dt { color: var(--muted); }
.pay-details dd { margin: 0; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: .4rem; word-break: break-all; }
.copy-btn {
    border: 1px solid var(--line); background: #fff; color: var(--primary); border-radius: 8px;
    width: 34px; height: 34px; display: inline-grid; place-items: center; cursor: pointer; flex: none;
}
.copy-btn.is-copied { background: var(--success); color: #fff; border-color: var(--success); }

/* ---------- 8. Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 1rem; }
.field label, .form label { display: block; font-weight: 600; font-size: .9rem; color: var(--ink); margin-bottom: .35rem; }
input[type="text"], input[type="number"], input[type="date"], input[type="search"], input[type="email"], input[type="tel"], input[type="password"], input:not([type]), select, textarea {
    width: 100%; font: inherit; color: var(--ink); background: #fff;
    border: 1px solid #cbd5e1; border-radius: var(--radius-sm); padding: .7rem .85rem; min-height: 46px;
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 140px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-error { color: var(--danger); font-size: .85rem; margin: .35rem 0 0; }
.grid-2 { display: grid; gap: 1rem; }
.form-status { padding: .8rem 1rem; border-radius: var(--radius-sm); margin: 0; font-size: .95rem; }
.form-status.is-success { background: #ecfdf3; color: var(--success); }
.form-status.is-error { background: #fef2f2; color: var(--danger); }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-info p { margin-bottom: 1.25rem; }
.contact-info i { color: var(--primary); width: 1.25rem; }

.alert { padding: .9rem 1rem; border-radius: var(--radius-sm); margin: 1rem 0; }
.alert ul { list-style: disc; padding-left: 1.25rem; }
.alert-info { background: var(--primary-soft); color: var(--primary-deep); }
.alert-success { background: #ecfdf3; color: var(--success); }
.alert-error { background: #fef2f2; color: var(--danger); }

/* ---------- 9. Pied de page ---------- */
.site-footer { background: var(--primary-deep); color: rgb(255 255 255 / 75%); margin-top: 2rem; }
.footer-grid { display: grid; gap: 2rem; padding-top: 3rem; padding-bottom: 2rem; }
.footer-brand { font-family: var(--font-head); font-weight: 800; color: #fff; font-size: 1.2rem; margin-bottom: .25rem; }
.footer-motto { color: #fff; font-weight: 600; letter-spacing: .06em; }
.footer-title { color: #fff; font-weight: 700; margin-bottom: .75rem; }
.footer-links li { margin-bottom: .45rem; }
.footer-links a, .site-footer a { color: rgb(255 255 255 / 80%); text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-muted { font-size: .9rem; }
.footer-bottom { border-top: 1px solid rgb(255 255 255 / 12%); padding: 1.25rem 0; font-size: .8rem; }
.footer-bottom p { margin: 0; }

/* ---------- 10. Pages d'erreur, installateur, chargement ---------- */
.error-code { font-family: var(--font-head); font-size: 5rem; font-weight: 800; color: var(--primary); margin: 0; line-height: 1; }
.install { background: var(--bg-alt); }
.install .card { margin: 2rem 0; }
.install-logo { width: 90px; margin-bottom: 1rem; }
.checklist li { padding: .25rem 0; }
.checklist .ok { color: var(--success); }
.checklist .ko { color: var(--danger); font-weight: 600; }
.steps { list-style: decimal; padding-left: 1.25rem; }

#page-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 200;
    background: var(--accent); transition: width .3s ease, opacity .4s ease; pointer-events: none;
}
#page-progress.is-loading { width: 70%; }
#page-progress.is-done { width: 100%; opacity: 0; }

/* =====================================================================
   Tablette (≥ 640px)
   ===================================================================== */
@media (min-width: 640px) {
    :root { --gutter: 1.5rem; }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .network-cards { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
    .cta { grid-template-columns: 1fr auto; padding: 2.5rem; }
    .brand-text small { max-width: none; }
}

/* =====================================================================
   Ordinateur (≥ 960px)
   ===================================================================== */
@media (min-width: 960px) {
    :root { --header-h: 76px; }
    .section { padding: 4.5rem 0; }
    .hero { padding: 5rem 0 5.5rem; }
    .hero-grid { grid-template-columns: 1.3fr 1fr; }
    .card-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
    .feature-grid { grid-template-columns: repeat(4, 1fr); }
    .split { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
    .split-wide { grid-template-columns: 2fr 1fr; }
    .page-header { padding: 3.5rem 0 3rem; }

    .menu-toggle { display: none; }
    .org-nav {
        position: static; display: block; background: none; border: 0; box-shadow: none; padding: 0;
    }
    .org-nav ul { flex-direction: row; align-items: center; gap: .15rem; }
    .org-nav a:not(.btn) { padding: .55rem .8rem; font-size: .95rem; }
    .btn-donate { margin: 0 0 0 .5rem; width: auto; }
}

/* Impression : pas de menu ni de pied de page. */
@media print {
    .site-header, .site-footer, .cta, .btn { display: none !important; }
    body { color: #000; }
}

/* Mouvements réduits pour les personnes sensibles. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* =====================================================================
   Administration
   ===================================================================== */
.btn-danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; color: var(--danger); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.grid-3 { display: grid; gap: 1rem; }
.fieldset { border: 1px solid var(--line); margin: 0; }
.fieldset legend { font-weight: 700; color: var(--primary-deep); padding: 0 .4rem; }
.fieldset .field + .field { margin-top: 1rem; }
.narrow-form { max-width: 760px; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .5rem; }
.inline-checks { display: flex; gap: 1.5rem; }
.check { display: inline-flex !important; align-items: center; gap: .5rem; font-weight: 500 !important; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.check-big { align-self: end; padding-bottom: .75rem; }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { font-weight: 600; font-size: .9rem; color: var(--ink); margin-bottom: .5rem; }

.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; margin-left: .35rem; vertical-align: middle; }
.badge-on { background: #dcfce7; color: #166534; }
.badge-off { background: #f1f5f9; color: #475569; }

.admin { background: var(--bg-alt); }
.admin-top { position: sticky; top: 0; z-index: 40; background: var(--primary-deep); color: #fff; }
.admin-top-inner { display: flex; align-items: center; gap: .75rem; padding: .5rem var(--gutter); min-height: 56px; }
.admin-brand { display: flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font-family: var(--font-head); font-weight: 700; }
.admin-brand img { background: #fff; border-radius: 8px; padding: 2px; }
.admin-brand span { display: none; }
.admin-orgs { margin-left: auto; display: flex; gap: .25rem; }
.admin-orgs a { color: rgb(255 255 255 / 80%); text-decoration: none; font-size: .78rem; font-weight: 700; padding: .4rem .65rem; border-radius: 999px; }
.admin-orgs a.is-active { background: #fff; color: var(--primary-deep); }
.admin-menu-toggle { background: transparent; color: #fff; border-color: rgb(255 255 255 / 30%); }

.admin-shell { display: block; }
.admin-nav { position: fixed; top: 56px; left: 0; right: 0; bottom: 0; overflow-y: auto; z-index: 30; padding: 1rem var(--gutter); }
.admin-nav i { width: 1.25rem; color: var(--primary); }
.admin-org-name { font-family: var(--font-head); font-weight: 700; color: var(--primary-deep); margin: 0 0 .75rem; }
.admin-user { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.admin-main { padding: 1.25rem var(--gutter) 3rem; outline: none; }
.admin-title { font-size: clamp(1.4rem, 4vw, 1.9rem); margin-bottom: 1rem; }

.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .25rem; }
.stat-icon { color: var(--primary); font-size: 1.2rem; }
.stat-value { font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; color: var(--ink); line-height: 1; }
.stat-label { font-size: .85rem; color: var(--muted); }

.admin-section { margin-top: 2rem; }
.admin-section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.admin-section-head h2 { margin: 0; font-size: 1.2rem; }
.admin-section-head p { margin: 0; }
.admin-list { display: flex; flex-direction: column; gap: .75rem; }
.admin-row { display: flex; flex-direction: column; gap: .75rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.admin-row-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.admin-row-actions form { margin: 0; }

.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary-deep), var(--primary)); padding: 1rem; }
.login-box { width: 100%; max-width: 420px; }
.login-box .card { text-align: left; }
.login-logo { margin: 0 auto 1rem; }
.login-box h1 { text-align: center; font-size: 1.6rem; margin-bottom: .25rem; }
.login-box > .card > .muted { text-align: center; font-size: .85rem; }
.login-foot { text-align: center; margin: 1.25rem 0 0; font-size: .9rem; }

@media (min-width: 640px) {
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .admin-brand span { display: inline; }
    .admin-row { flex-direction: row; align-items: center; justify-content: space-between; }
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 960px) {
    .admin-menu-toggle { display: none; }
    .admin-shell { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 56px); }
    .admin-nav { display: block !important; position: sticky; top: 56px; height: calc(100vh - 56px); box-shadow: none; border-right: 1px solid var(--line); border-bottom: 0; }
    .admin-nav ul { flex-direction: column !important; align-items: stretch !important; }
    .admin-main { padding: 2rem 2.5rem 4rem; }
}

/* =====================================================================
   Lot 2 : Mobile Money, articles, messages, double authentification,
   registre des bénéficiaires
   ===================================================================== */

/* ---------- Pastilles des opérateurs Mobile Money ---------- */
.op-badge {
    flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
    font-family: var(--font-head); font-weight: 800; font-size: .62rem; line-height: 1.05; text-align: center;
    letter-spacing: -.01em; color: #fff; background: #64748b; overflow: hidden; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 6%);
}
.op-badge-lg { width: 56px; height: 56px; font-size: .78rem; border-radius: 14px; }
.op-badge i { font-size: 1.3em; }
.op-badge-lg i { font-size: 1.6rem; }
.op-airtel { background: #e40000; text-transform: lowercase; font-size: .7rem; }
.op-badge-lg.op-airtel { font-size: .86rem; }
.op-orange { background: #000; color: #ff7900; text-transform: lowercase; position: relative; }
.op-orange::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 28%; background: #ff7900; }
.op-mpesa { background: #00a651; font-size: .56rem; }
.op-badge-lg.op-mpesa { font-size: .7rem; }
.op-afrimoney { background: linear-gradient(135deg, #6d28d9, #c026d3); font-size: .55rem; }
.op-badge-lg.op-afrimoney { font-size: .68rem; }
.op-logo { background: #fff; border: 1px solid var(--line); box-shadow: none; padding: 4px; }
.op-logo img { width: 100%; height: 100%; object-fit: contain; }

.pay-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .25rem; }
.row-with-badge { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.logo-preview { display: flex; align-items: center; gap: 1rem; }

/* ---------- Petits éléments communs ---------- */
.small { font-size: .85rem; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-info { background: var(--primary-soft); color: var(--primary-deep); }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-warning a { color: inherit; font-weight: 700; }
.card-warning { border: 2px solid #f59e0b; background: #fffbeb; }
.nav-count { margin-left: auto; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; min-width: 1.4rem; padding: .05rem .45rem; border-radius: 999px; text-align: center; }
.nav-dot { margin-left: auto; width: .55rem; height: .55rem; border-radius: 50%; background: #f59e0b; }
.admin-nav a { display: flex; align-items: center; gap: .35rem; }
.stat-link { display: flex; flex-direction: column; gap: .25rem; color: inherit; text-decoration: none; }
.stat:has(.stat-link):hover { border-color: var(--primary); }
.btn-sm { padding: .35rem .6rem; font-size: .85rem; min-height: 0; }
.danger-zone { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px dashed #fecaca; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.toolbar-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.details-grid { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: .45rem 1rem; margin: 0; }
.details-grid dt { color: var(--muted); font-size: .9rem; }
.details-grid dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }

/* ---------- Onglets et pagination ---------- */
.tabs { display: flex; gap: .35rem; margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .5rem .9rem; border-radius: 999px; text-decoration: none; color: var(--text); background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.tabs a.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1.75rem; }
.pager-info { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Boîte de réception ---------- */
.message-row { padding: 0; }
.message-link { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem; color: inherit; text-decoration: none; width: 100%; }
.message-link:hover { background: var(--bg-alt); }
.message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.message-meta .badge { margin-left: 0; }
.message-meta time { margin-left: auto; font-size: .82rem; }
.message-excerpt { color: var(--muted); font-size: .92rem; }
.message-row.is-unread { border-left: 4px solid var(--primary); }
.message-row.is-unread strong { color: var(--ink); }
.message-body { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); white-space: normal; }
.form-actions form { margin: 0; }

/* ---------- Articles ---------- */
.row-thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 8px; flex: none; }
.row-thumb-empty { display: grid; place-items: center; background: var(--bg-alt); color: var(--muted); border: 1px solid var(--line); }
.cover-preview { display: block; max-width: 320px; width: 100%; border-radius: var(--radius-sm); margin-bottom: .5rem; }
.card-post { padding: 0; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.post-thumb { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--bg-alt); }
.post-thumb-empty { display: grid; place-items: center; color: var(--primary); font-size: 2rem; background: var(--primary-soft); }
.card-post-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.card-post-body h3 { font-size: 1.1rem; margin: 0; }
.card-post-body h3 a { color: var(--ink); text-decoration: none; }
.card-post:hover h3 a { color: var(--primary); }
.card-post-body p { margin: 0; color: var(--text); }
.card-post .card-more { margin-top: auto; }
.post-date { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.article-meta { color: var(--muted); }
.article-meta a { color: inherit; }
.article-cover { width: 100%; border-radius: var(--radius); margin: 0 0 1.5rem; box-shadow: var(--shadow); }
.lead-text { font-size: 1.2rem !important; color: var(--ink); font-weight: 500; }
.page-header .eyebrow a { color: inherit; }

/* ---------- Double authentification ---------- */
.code-input { font-size: 1.5rem !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.secret-key { letter-spacing: .04em; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: 1.15rem; font-weight: 700; background: var(--bg-alt); border: 1px dashed var(--line); padding: .75rem 1rem; border-radius: var(--radius-sm); word-break: break-all; }
.setup-steps { display: grid; gap: 1rem; margin-top: 1rem; list-style: none; padding: 0; max-width: 820px; }
.setup-steps h2 { font-size: 1.1rem; display: flex; align-items: center; gap: .6rem; }
.step-num { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--primary); color: #fff; font-size: .95rem; flex: none; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin: 1rem 0; font-size: 1.05rem; font-weight: 700; }
.recovery-codes li { background: #fff; border: 1px solid #fde68a; border-radius: var(--radius-sm); padding: .5rem .75rem; text-align: center; }
.status-line { margin-top: 0; }
.status-line .badge { margin-left: 0; font-size: .85rem; }

/* ---------- Registre des bénéficiaires ---------- */
.filter-bar { display: grid; gap: .75rem; margin: 1.25rem 0; }
.filter-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-empty { display: inline-grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 1.2rem; }
.person-link { color: inherit; text-decoration: none; width: 100%; }
.person-link:hover strong { color: var(--primary); }
.dossier-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; margin-bottom: 1.25rem; }
.dossier-head h2 { margin: .1rem 0 .4rem; font-size: 1.5rem; }
.dossier-head .badge { margin: 0 .35rem .35rem 0; }
.dossier-photo { width: 120px; height: 120px; border-radius: 18px; object-fit: cover; flex: none; font-size: 2.5rem; }
.dossier-section { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.dossier-section h3 { font-size: 1.05rem; }
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1rem; }
.photo-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; display: flex; flex-direction: column; gap: .25rem; }
.photo-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.photo-item p { margin: 0; }
.photo-actions { display: flex; gap: .35rem; margin-top: auto; }
.history { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; color: var(--muted); }
.history time { font-variant-numeric: tabular-nums; }

@media (min-width: 640px) {
    .filter-bar { grid-template-columns: 2fr 1fr 1fr; }
    .filter-actions { grid-column: 1 / -1; }
    .photo-grid { grid-template-columns: repeat(3, 1fr); }
    .recovery-codes { grid-template-columns: repeat(5, 1fr); }
    .message-link { flex-direction: column; }
}

@media (min-width: 960px) {
    .filter-bar { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; }
    .filter-actions { grid-column: auto; }
    .photo-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Fiche imprimée : uniquement le contenu, sans menu d'administration. */
@media print {
    .admin-top, .admin-nav, .no-print, .skip-link, .alert { display: none !important; }
    .admin-shell { display: block !important; }
    .admin-main { padding: 0 !important; }
    .card { box-shadow: none !important; border: 0 !important; }
    .recovery-codes li { border: 1px solid #000; }
}

/* =====================================================================
   Lot 3 : vidéo, commentaires, identification et programmes
   ===================================================================== */
.video-preview, .article-video { display: block; width: 100%; max-height: 70vh; background: #000; border-radius: var(--radius); margin: .5rem 0 1rem; }
.article-video { margin: 0 0 1.5rem; box-shadow: var(--shadow); }
.video-progress { width: 100%; height: .6rem; accent-color: var(--primary); }
.video-status { margin: .5rem 0; font-weight: 600; }
.video-status.is-error { color: var(--danger); }
.video-status.is-success { color: #15803d; }
.post-play { position: absolute; top: .75rem; right: .75rem; z-index: 1; width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center; background: rgb(0 0 0 / 60%); color: #fff; font-size: .95rem; pointer-events: none; }

/* Commentaires */
.comments .section-title .muted { font-weight: 500; font-size: .8em; }
.comment-list { display: flex; flex-direction: column; gap: 1rem; margin: 1.25rem 0 2rem; padding: 0; list-style: none; }
.comment, .comment-admin { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.comment-head time { font-size: .85rem; }
.comment-avatar { width: 2.3rem; height: 2.3rem; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 800; flex: none; }
.comment-body { margin-top: .5rem; overflow-wrap: anywhere; }
.comment-body p { margin: .4rem 0; }
.comment-reply { margin: .75rem 0 0 1rem; padding: .75rem 1rem; border-left: 4px solid var(--primary); background: var(--primary-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.comment-reply p { margin: .3rem 0; }
.comment-reply-head { color: var(--primary-deep); font-size: .9rem; }
.comment-form h3 { margin-top: 0; }
.comment-admin-list { display: flex; flex-direction: column; gap: 1rem; list-style: none; padding: 0; }
.reply-form { margin-top: .75rem; }
.reply-form label { font-weight: 600; font-size: .9rem; }

/* Identification et programmes */
.category-block { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.category-block-title { font-size: 1rem; margin: 0 0 .5rem; color: var(--primary-deep); }
.field-label { font-weight: 600; margin: 0 0 .5rem; }
.check-grid { display: grid; gap: .5rem; margin-bottom: 1rem; }
.check-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .75rem; background: #fff; align-items: flex-start; }
.check-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.enrollment-list { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .6rem; }
.enrollment { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.enrollment.is-ended { opacity: .7; }
.enrollment-form, .inline-form { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.enrollment-form select, .inline-form select, .inline-form input { width: auto; min-width: 0; }
.inline-form select { flex: 1 1 14rem; }
.program-chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .25rem; margin-bottom: 1rem; }
.program-chips a { white-space: nowrap; padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--text); font-weight: 600; font-size: .88rem; }
.program-chips a.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-count { display: inline-block; min-width: 1.3rem; padding: 0 .35rem; margin-left: .2rem; border-radius: 999px; background: rgb(0 0 0 / 8%); font-size: .78rem; text-align: center; }
.program-chips a.is-active .chip-count { background: rgb(255 255 255 / 25%); }
.program-banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; }
.program-banner h2 { margin: .1rem 0 .25rem; }
.program-banner p { margin: 0; }

/* Carte de bénéficiaire : 85,6 × 54 mm */
.id-card { width: 85.6mm; height: 54mm; border-radius: 3mm; overflow: hidden; background: #fff; border: 1px solid #cbd5e1; display: flex; flex-direction: column; font-size: 7.2pt; color: #0f172a; box-shadow: var(--shadow); margin: 1rem 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.id-card-head { display: flex; align-items: center; gap: 2mm; padding: 1.6mm 3mm; background: var(--primary); color: #fff; }
.id-card-head img { width: 6.5mm; height: 6.5mm; background: #fff; border-radius: 50%; padding: .4mm; }
.id-card-head strong { display: block; font-size: 8pt; letter-spacing: .02em; }
.id-card-head span { font-size: 6.5pt; opacity: .9; }
.id-card-body { flex: 1; display: flex; gap: 3mm; padding: 2mm 3mm; }
.id-card-photo { width: 20mm; height: 25mm; object-fit: cover; border-radius: 1.2mm; border: 1px solid #cbd5e1; flex: none; }
.id-card-nophoto { display: grid; place-items: center; color: #94a3b8; background: #f1f5f9; }
.id-card dl { display: grid; grid-template-columns: auto 1fr; gap: .5mm 2mm; margin: 0; align-content: start; }
.id-card dt { color: #64748b; }
.id-card dd { margin: 0; font-weight: 600; }
.id-card-name { font-size: 8pt; }
.id-card-foot { display: flex; justify-content: space-between; align-items: flex-end; padding: 1mm 3mm 1.6mm; font-size: 6pt; color: #475569; }
.id-card-sign { border-top: 1px solid #94a3b8; padding-top: .5mm; min-width: 24mm; text-align: center; }

@media (min-width: 640px) {
    .check-grid { grid-template-columns: repeat(2, 1fr); }
}

@media print {
    .id-card { box-shadow: none; margin: 0; }
    .program-banner { margin-top: 0; }
    .admin-list .admin-row { break-inside: avoid; }
}

/* =====================================================================
   Lot 4 : utilisateurs et fonctions
   ===================================================================== */
.my-roles h2 { margin-top: 0; }
.role-list { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .75rem; }
.role-list li { display: flex; gap: .75rem; align-items: flex-start; }
.role-icon { width: 2.4rem; height: 2.4rem; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.role-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.role-tag { font-size: .78rem; padding: .15rem .5rem; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--line); }
.admin-row.is-disabled { opacity: .55; }
.roles-help { margin-bottom: 1rem; }
.roles-help summary { cursor: pointer; font-weight: 600; }
.roles-legend { display: grid; gap: .25rem .75rem; margin: 1rem 0 0; }
.roles-legend dt { font-weight: 700; }
.roles-legend dd { margin: 0 0 .5rem; color: var(--muted); }
.role-matrix { display: grid; gap: 1rem; }
.role-org h3 { font-size: 1rem; margin: 0 0 .5rem; color: var(--primary-deep); }
.role-org .check-card { margin-bottom: .4rem; }
.welcome-box { display: flex; flex-direction: column; gap: .75rem; align-items: flex-start; }
.welcome-text { white-space: pre-wrap; font-family: var(--font-mono, ui-monospace, monospace); font-size: .9rem; background: #fff; border: 1px solid #fde68a; border-radius: var(--radius-sm); padding: .9rem 1rem; margin: 0; width: 100%; overflow-wrap: anywhere; }
@media (min-width: 960px) {
    .role-matrix { grid-template-columns: repeat(3, 1fr); }
    .roles-legend { grid-template-columns: 14rem 1fr; }
    .roles-legend dd { margin: 0; }
}
.mt-sm { margin-top: .5rem; }

/* =====================================================================
   Lot 6 : membres adhérents et cotisations
   ===================================================================== */
.fee-line { margin-top: 0; }
.stat-money { font-size: 1.25rem !important; }
.stat.stat-danger { border-color: #fecaca; background: #fef2f2; }
.stat.stat-danger .stat-value, .stat.stat-danger .stat-icon { color: #b91c1c; }
.admin-row.is-late { border-left: 4px solid #dc2626; }
.dues-pill { flex: none; font-size: .82rem; font-weight: 700; padding: .3rem .65rem; border-radius: 999px; white-space: nowrap; }
.dues-pill.is-debt { background: #fee2e2; color: #b91c1c; }
.dues-pill.is-ok { background: #dcfce7; color: #166534; }
.debt-alert { display: flex; gap: .85rem; align-items: flex-start; padding: 1rem 1.15rem; margin-bottom: 1rem; border-radius: var(--radius); background: #dc2626; color: #fff; box-shadow: 0 6px 20px rgb(220 38 38 / 25%); }
.debt-alert > i { font-size: 1.6rem; margin-top: .1rem; }
.debt-alert strong { font-size: 1.15rem; }
.debt-alert p { margin: .2rem 0 0; }
.ok-alert { padding: .85rem 1.1rem; margin-bottom: 1rem; border-radius: var(--radius); background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.ledger-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin: 0 0 1rem; }
.ledger-summary > div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .8rem; }
.ledger-summary dt { font-size: .8rem; color: var(--muted); }
.ledger-summary dd { margin: .15rem 0 0; font-weight: 700; color: var(--ink); }
.ledger-summary .is-debt { background: #fee2e2; border-color: #fca5a5; }
.ledger-summary .is-debt dd { color: #b91c1c; }
.ledger-summary .is-ok { background: #dcfce7; border-color: #86efac; }
.month-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.month { border-radius: var(--radius-sm); padding: .45rem .55rem; display: flex; flex-direction: column; font-size: .8rem; border: 1px solid transparent; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.month-name { font-weight: 700; }
.month-paid { background: #dcfce7; color: #166534; border-color: #86efac; }
.month-partial { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.month-unpaid { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.month-free { background: var(--bg-alt); color: var(--muted); }
.month-amount { font-size: .72rem; }
.payment-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.payment { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .7rem .9rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.payment.is-cancelled { opacity: .65; }
.payment.is-cancelled strong:first-child { text-decoration: line-through; }
.payment-actions { display: flex; gap: .35rem; align-items: flex-start; flex-wrap: wrap; }
.cancel-box summary { list-style: none; cursor: pointer; }
.cancel-box summary::-webkit-details-marker { display: none; }
.cancel-box[open] { flex-basis: 100%; }
.cancel-box form { margin-top: .4rem; }
.text-danger { color: #b91c1c; }
.is-readonly { background: var(--bg-alt) !important; color: var(--muted) !important; }
.receipt { max-width: 640px; background: #fff; border: 1px solid #cbd5e1; border-radius: var(--radius); padding: 1.5rem; }
.receipt-head { display: flex; align-items: center; gap: 1rem; padding-bottom: 1rem; border-bottom: 2px solid var(--primary); margin-bottom: 1rem; }
.receipt-head > div:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.receipt-head > div:nth-child(2) span { font-size: .85rem; color: var(--muted); }
.receipt-no { text-align: right; display: flex; flex-direction: column; }
.receipt-no span { font-size: .75rem; letter-spacing: .15em; color: var(--muted); }
.receipt-amount { font-size: 1.4rem; font-weight: 800; color: var(--primary-deep); }
.receipt-foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 2.5rem; font-size: .85rem; color: var(--muted); }
@media (min-width: 640px) {
    .ledger-summary { grid-template-columns: repeat(5, 1fr); }
    .month-grid { grid-template-columns: repeat(6, 1fr); }
}
@media print {
    .debt-alert { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .receipt { border: 0; padding: 0; }
}
@media (min-width: 960px) {
    .filter-bar-wide { grid-template-columns: 2fr 1fr; }
    .filter-bar-wide .filter-actions { grid-column: 1 / -1; }
}

/* =====================================================================
   Lot 7 : apparence des organisations, deux pages de connexion, espace membre
   ===================================================================== */
.branding-grid { display: grid; gap: 1rem; margin-top: 1rem; }
.branding-preview { display: flex; align-items: center; gap: .75rem; padding: .9rem; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-deep); margin-bottom: 1rem; flex-wrap: wrap; }
.branding-logo { width: 56px; height: 56px; border-radius: 14px; background: #fff; display: grid; place-items: center; overflow: hidden; color: var(--primary); font-size: 1.5rem; flex: none; border: 1px solid var(--line); }
.branding-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.branding-swatches { display: flex; gap: .3rem; margin-left: auto; }
.branding-swatches span { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.color-row { display: flex; gap: .5rem; align-items: center; }
.color-row input[type="color"] { width: 3.5rem; height: 46px; padding: 2px; border: 1px solid #cbd5e1; border-radius: var(--radius-sm); background: #fff; cursor: pointer; }
.color-hex { max-width: 8rem; }
.admin-logo { object-fit: contain; background: #fff; border-radius: 6px; }
.brand-logo { object-fit: contain; }
.login-switch { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .9rem; text-align: center; }
.nav-login { display: inline-flex; align-items: center; gap: .35rem; color: #fff; text-decoration: none; font-size: .85rem; font-weight: 600; padding: .35rem .7rem; border-radius: 999px; border: 1px solid rgb(255 255 255 / 35%); }
.nav-login:hover { background: rgb(255 255 255 / 12%); }
.network-tools { display: flex; align-items: center; gap: .5rem; }
@media (min-width: 960px) {
    .branding-grid { grid-template-columns: repeat(3, 1fr); }
}
.branding-mini { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.branding-mini li { display: flex; align-items: center; gap: .75rem; padding: .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.branding-mini .branding-logo { width: 44px; height: 44px; border-radius: 10px; font-size: 1.1rem; }
.branding-dot { margin-left: auto; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--primary); border: 3px solid var(--primary-soft); }
.access-box h2 { font-size: 1.05rem; margin-top: 0; }
@media (min-width: 960px) { .branding-mini { grid-template-columns: repeat(3, 1fr); } }
/* Téléphone : bouton Connexion réduit à son icône pour garder les 3 organisations lisibles. */
@media (max-width: 639px) {
    .nav-login { padding: .35rem .55rem; }
    .nav-login span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* =====================================================================
   Lot 8 : application installable (Android, iPhone)
   ===================================================================== */
.app-install { display: flex; gap: .35rem; margin: 0 auto; }
.app-btn { display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-size: .8rem; font-weight: 600; color: #fff; background: rgb(255 255 255 / 10%); border: 1px solid rgb(255 255 255 / 30%); border-radius: 999px; padding: .3rem .65rem; cursor: pointer; }
.app-btn i { font-size: 1rem; }
.app-btn:hover, .app-btn:focus-visible { background: rgb(255 255 255 / 22%); }
/* Sur téléphone : uniquement le bouton de son système ; rien quand l'application est déjà ouverte. */
.is-ios .app-btn-android, .is-android .app-btn-ios { display: none; }
.is-standalone .app-install, .is-standalone .app-banner { display: none !important; }

.app-banner { position: fixed; left: .75rem; right: .75rem; bottom: .75rem; z-index: 60; display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; background: #fff; border-radius: var(--radius); box-shadow: 0 12px 40px rgb(15 23 42 / 25%); border: 1px solid var(--line); }
.app-banner img { border-radius: 12px; flex: none; }
.app-banner p { margin: 0; flex: 1; font-size: .85rem; line-height: 1.35; color: var(--text); }
.app-banner strong { color: var(--ink); }
.app-banner-close { background: none; border: 0; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; padding: .25rem .4rem; }
.app-dialog { border: 0; border-radius: var(--radius); padding: 1.25rem 1.25rem 1rem; max-width: 26rem; width: calc(100% - 2rem); box-shadow: 0 20px 60px rgb(15 23 42 / 35%); }
.app-dialog::backdrop { background: rgb(15 23 42 / 55%); }
.app-dialog h2 { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; margin: 0 0 .75rem; }
.app-dialog h2 img { border-radius: 10px; }
.app-dialog ol { margin: .25rem 0 1rem 1.1rem; padding: 0; display: grid; gap: .35rem; }
@media (max-width: 639px) {
    .app-btn { padding: .35rem .5rem; }
    .app-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (min-width: 640px) {
    .app-banner { left: auto; right: 1.25rem; bottom: 1.25rem; max-width: 26rem; }
}
@media print { .app-install, .app-banner { display: none !important; } }
