/* ==========================================================================
   Jujitsu Hallines Manager — feuille de styles
   Thème clair / sombre, mobile d'abord, sans dépendance externe.
   ========================================================================== */

@font-face {
    font-family: "Manrope";
    src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
    font-weight: 200 800;
    font-display: swap;
}
@font-face {
    font-family: "Barlow Condensed";
    src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2");
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: "Barlow Condensed";
    src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}

/* ---------- Couleurs ---------- */
:root {
    --bg: #f6f4f1;
    --surface: #fffefb;
    --surface-2: #f1eee7;
    --text: #14161a;
    --text-2: #5d6068;
    --border: #e3dfd5;
    --primary: #9b0b0b;
    --primary-hover: #7e0808;
    --primary-soft: #f7e4e2;
    --on-primary: #ffffff;
    --success: #28704a; /* contraste ≥ 4,5:1 sur --success-soft (accessibilité) */
    --success-soft: #e3f2e8;
    --warning: #865b00; /* contraste ≥ 4,5:1 sur --warning-soft */
    --warning-soft: #fbf0d4;
    --danger: #b3261e;
    --danger-soft: #fbe4e2;
    --info: #2f6f8f;
    --info-soft: #e2eff5;
    --sidebar: #1d1d1b;
    --sidebar-text: rgba(255, 255, 255, .72);
    --focus: #b3120f;
    --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 4px 16px rgba(20, 22, 26, .05);
    --shadow-lg: 0 12px 40px rgba(20, 22, 26, .18);
    --radius: 14px;
    --radius-sm: 9px;
    --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --sidebar-w: 264px;
    color-scheme: light;
}

:root.theme-dark {
    --bg: #0c0d10;
    --surface: #15171c;
    --surface-2: #1d2026;
    --text: #f1eee7;
    --text-2: #a2a5ae;
    --border: #2a2e37;
    --primary: #ff5c50;
    --primary-hover: #ff7a70;
    --primary-soft: #3a1414;
    --on-primary: #1a0505;
    --success: #6cc58c;
    --success-soft: #16301f;
    --warning: #e0ac3a;
    --warning-soft: #352a10;
    --danger: #ff7b72;
    --danger-soft: #3b1a18;
    --info: #5aa9cc;
    --info-soft: #132a35;
    --sidebar: #08090b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) {
        --bg: #0c0d10;
        --surface: #15171c;
        --surface-2: #1d2026;
        --text: #f1eee7;
        --text-2: #a2a5ae;
        --border: #2a2e37;
        --primary: #ff5c50;
        --primary-hover: #ff7a70;
        --primary-soft: #3a1414;
        --on-primary: #1a0505;
        --success: #6cc58c;
        --success-soft: #16301f;
        --warning: #e0ac3a;
        --warning-soft: #352a10;
        --danger: #ff7b72;
        --danger-soft: #3b1a18;
        --info: #5aa9cc;
        --info-soft: #132a35;
        --sidebar: #08090b;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3);
        --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
        color-scheme: dark;
    }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0 0 .75rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Liens au milieu d'un texte : soulignés, pour ne pas dépendre de la seule couleur (accessibilité). */
:is(p, dd, li, small, .breadcrumb, .callout, .field__hint) a:not(.btn):not(.link-more):not(.nav__link):not(.tabbar__link) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
/* left/top : sans eux, Safari compte ces textes invisibles dans la largeur de la page (débordement sur iPad). */
.sr-only { position: absolute; left: 0; top: 0; 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: -999px; top: 8px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: .5rem 1rem; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }

/* ---------- Structure ---------- */
.shell { min-height: 100vh; }
.main { min-width: 0; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.content { padding: 1rem; max-width: 1200px; margin: 0 auto; outline: none; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 60;
    width: min(var(--sidebar-w), 86vw);
    background: var(--sidebar); color: #fff;
    display: flex; flex-direction: column;
    padding: 1rem .85rem calc(1rem + env(safe-area-inset-bottom));
    transform: translateX(-102%); transition: transform .25s ease;
    overflow-y: auto;
}
.sidebar.is-open { transform: none; box-shadow: var(--shadow-lg); }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .5); }
.sidebar__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; padding: 0 .35rem; }
.sidebar__close { color: #fff; }

.brand { display: flex; align-items: center; gap: .75rem; color: #fff; }
.brand:hover { text-decoration: none; }
.brand__mark {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
    background: var(--primary); color: var(--on-primary);
    font: 700 1.25rem/1 var(--font-display); letter-spacing: .02em;
}
/* Logo du club : posé sur un disque blanc pour rester lisible sur les fonds sombres (menu, thème sombre),
   car ses parties noires (texte, samouraï) s'y confondraient. */
.brand__logo { width: 44px; height: 44px; object-fit: contain; flex: none; background: #fff; border-radius: 50%; padding: 4px; }
.brand__logo.brand__mark--lg { width: 160px; height: 160px; padding: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
.brand__mark--lg { width: 64px; height: 64px; border-radius: 18px; font-size: 2rem; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__text strong { font: 700 1.15rem var(--font-display); text-transform: uppercase; letter-spacing: .03em; }
.brand__text small { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3em; opacity: .55; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav__link {
    display: flex; align-items: center; gap: .75rem; min-height: 44px; padding: 0 .75rem;
    border-radius: 10px; color: var(--sidebar-text); font-weight: 600; font-size: .92rem;
    transition: background .15s, color .15s;
}
.nav__link:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.nav__link.is-active { background: var(--primary); color: var(--on-primary); }

.sidebar__foot { display: flex; align-items: center; gap: .5rem; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: .85rem; margin-top: 1rem; }
.sidebar__foot .icon-btn { color: var(--sidebar-text); }
.sidebar__foot .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.me { flex: 1; display: flex; align-items: center; gap: .65rem; min-width: 0; color: #fff; padding: .35rem; border-radius: 10px; }
.me:hover, .me.is-active { background: rgba(255, 255, 255, .08); text-decoration: none; }
.me__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me__text strong { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me__text small { font-size: .75rem; opacity: .6; }

.avatar {
    display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #9b0b0b, #2a2a28); color: #fff; font-weight: 800; font-size: .8rem;
}
.avatar--sm { width: 32px; height: 32px; font-size: .72rem; }

.topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: .5rem;
    padding: calc(.6rem + env(safe-area-inset-top)) 1rem .6rem;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid var(--border);
}
.topbar__title { flex: 1; font: 700 1.45rem var(--font-display); text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { display: flex; gap: .25rem; }

.icon-btn {
    display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px;
    background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon--dark { display: none; }
:root.theme-dark .icon--light { display: none; }
:root.theme-dark .icon--dark { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .icon--light { display: none; }
    :root:not(.theme-light) .icon--dark { display: block; }
}

.tabbar {
    position: fixed; inset: auto 0 0 0; z-index: 50;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
}
.tabbar__link {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 58px; border: 0; background: none; color: var(--text-2);
    font: 600 .68rem var(--font); cursor: pointer; padding: 0 .25rem; text-align: center;
}
.tabbar__link span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar__link .icon { width: 22px; height: 22px; }
.tabbar__link.is-active { color: var(--primary); }
.tabbar__link:hover { text-decoration: none; color: var(--text); }

@media (min-width: 1024px) {
    .sidebar { transform: none; width: var(--sidebar-w); }
    .sidebar__close, .topbar__menu, .scrim, .tabbar { display: none !important; }
    .main { margin-left: var(--sidebar-w); padding-bottom: 2rem; }
    .content { padding: 1.75rem 2rem; }
    .topbar { padding: .9rem 2rem; }
}

/* ---------- Composants ---------- */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.25rem; box-shadow: var(--shadow); min-width: 0;
}
.card--flush { padding: 0; overflow: hidden; }
.card--narrow { max-width: 560px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card__head--pad { padding: 1.25rem 1.25rem 0; flex-direction: column; align-items: flex-start; gap: .25rem; }
.card__title { font-size: 1rem; font-weight: 800; }
.link-more { font-size: .85rem; font-weight: 700; }

.grid-2 { display: grid; gap: 1rem; margin-bottom: 1rem; }
@media (min-width: 900px) {
    .grid-2 { grid-template-columns: 1fr 1fr; align-items: start; }
    .grid-2--wide { grid-template-columns: 3fr 2fr; }
}
.stack { display: grid; gap: 1rem; }
.stack--sm { gap: .5rem; }

.hero { margin: .25rem 0 1.25rem; }
.hero__kicker { font-size: .8rem; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .2rem; }
.hero__title { font: 700 2.2rem/1.05 var(--font-display); text-transform: uppercase; }
.hero__sub { color: var(--text-2); margin-top: .35rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stat {
    display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon value" "label label";
    gap: .4rem .75rem; align-items: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1rem 1.1rem; color: var(--text); box-shadow: var(--shadow);
    transition: transform .15s, border-color .15s;
}
.stat:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-1px); }
.stat__icon { grid-area: icon; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.stat__value { grid-area: value; font: 700 2rem/1 var(--font-display); text-align: right; }
.stat__label { grid-area: label; font-size: .82rem; font-weight: 600; color: var(--text-2); }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
.timeline li { display: grid; grid-template-columns: 10px 1fr; gap: .75rem; }
.timeline__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: .45rem; }
.timeline__title { font-weight: 700; font-size: .9rem; margin: 0; }
.timeline__meta { font-size: .8rem; color: var(--text-2); margin: 0; overflow-wrap: anywhere; }
.timeline--compact { margin-top: 1rem; gap: .6rem; }

.roadmap { margin: .5rem 0 0; padding-left: 1.25rem; display: grid; gap: .35rem; font-size: .9rem; }
.roadmap li { color: var(--text-2); }
.roadmap li.is-done { color: var(--success); }
.roadmap li.is-done::marker { content: "✓  "; }

/* Boutons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    min-height: 42px; padding: 0 1.1rem; border-radius: 10px; border: 1px solid transparent;
    font: 700 .9rem var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger-ghost { background: transparent; border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.btn--danger-ghost:hover { background: var(--danger-soft); }
.btn--link { background: none; color: var(--primary); padding: 0 .5rem; }
.btn--block { width: 100%; }
.btn .icon { width: 16px; height: 16px; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
    content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid currentColor; border-color: var(--on-primary) var(--on-primary) transparent transparent;
    animation: spin .7s linear infinite;
}
.btn--ghost.is-loading::after { border-color: var(--text) var(--text) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Badges */
.badge {
    display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px;
    font-size: .74rem; font-weight: 700; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--muted { background: var(--surface-2); color: var(--text-2); }
.badge--neutral { background: var(--info-soft); color: var(--info); }

/* Messages */
.toasts { display: grid; gap: .5rem; margin-bottom: 1rem; }
.toasts:empty { display: none; }
.toast, .callout {
    display: flex; align-items: flex-start; gap: .65rem; padding: .8rem 1rem; border-radius: var(--radius-sm);
    border: 1px solid transparent; font-size: .9rem;
}
.toast { animation: slide-in .25s ease; }
.toast p, .callout p { margin: 0 0 .35rem; flex: 1; }
.toast p:last-child, .callout p:last-child { margin: 0; }
.callout > div { flex: 1; min-width: 0; }
.toast .icon, .callout > .icon { margin-top: 2px; }
.toast--success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.toast--warning, .callout--warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.toast--error, .callout--danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.toast--info, .callout--info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.callout { margin-bottom: 1rem; }
.callout code { background: rgba(0, 0, 0, .06); }
.toast__close { border: 0; background: none; color: inherit; cursor: pointer; padding: 2px; opacity: .7; }
.toast__close:hover { opacity: 1; }
.toast.is-leaving { opacity: 0; transform: translateY(-4px); transition: all .2s; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-4px); } }

/* Formulaires */
.form { display: grid; gap: 1rem; }
.form-row { display: grid; gap: 1rem; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.form-actions--sticky {
    position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 10;
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    padding: .75rem 0; margin: .5rem 0 1rem;
}
@media (min-width: 1024px) { .form-actions--sticky { bottom: 0; } }
.form-section { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin: .5rem 0 -.25rem; }
.fieldset-plain { border: 0; margin: 0; padding: 0; min-width: 0; }
.fieldset-plain:disabled { opacity: .85; }

.field { display: grid; gap: .35rem; }
.field label, .field .label { font-size: .85rem; font-weight: 700; }
.field--inline { gap: .2rem; }
.field--inline label { font-size: .75rem; color: var(--text-2); }
.req { color: var(--primary); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input:not([type]), input[type="password"], input[type="search"], input[type="date"], input[type="time"], input[type="datetime-local"], select, textarea {
    width: 100%; min-height: 44px; padding: .55rem .8rem;
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text);
    font: 500 16px var(--font); /* 16px : évite le zoom automatique sur iPhone */
    transition: border-color .15s, box-shadow .15s;
}
/* Listes déroulantes : même apparence dans tous les navigateurs (Safari ignorait hauteur, bord et marges). */
select { -webkit-appearance: none; appearance: none; padding-right: 2.2rem; background-image: url("../img/chevron.svg"); background-repeat: no-repeat; background-position: right .8rem center; background-size: 12px 8px; }
select[multiple] { padding-right: .8rem; background-image: none; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
input[readonly] { background: var(--surface-2); }
.has-error input, .has-error select { border-color: var(--danger); }
.field__hint { font-size: .8rem; color: var(--text-2); margin: 0; }
.field__error { font-size: .82rem; color: var(--danger); font-weight: 600; margin: 0; }

.choice-list { display: grid; gap: .5rem; }
@media (min-width: 640px) { .choice-list { grid-template-columns: 1fr 1fr; } }
.choice {
    display: flex; gap: .65rem; align-items: flex-start; padding: .7rem .8rem;
    border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s;
}
.choice:hover { background: var(--surface-2); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice input { margin-top: .2rem; accent-color: var(--primary); width: 18px; height: 18px; flex: none; }
.choice span { display: flex; flex-direction: column; font-size: .88rem; }
.choice small { color: var(--text-2); font-size: .78rem; }

.copy { display: flex; gap: .5rem; margin: .4rem 0; }
.copy input { font-size: .85rem; }

/* Barre d'outils, filtres, recherche */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.toolbar > .muted { margin: 0; flex: 1 1 280px; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; flex: 1 1 auto; }
.filters select { width: auto; min-width: 150px; }
/* Filtres sur plusieurs lignes : grille (une rangée flexible qui se replie faisait déborder la page dans Safari). */
.filters--wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-items: end; }
.filters--wrap > select { width: 100%; min-width: 0; }
/* Safari : une option longue (« Ceinture noire 4e stade ») débordait de la liste et élargissait la page. */
.filters select { overflow: hidden; }
.filters--wrap > .search { grid-column: 1 / -1; }
@media (min-width: 640px) { .filters--wrap { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } .filters--wrap > .search { grid-column: span 2; } }
.filters-card { margin-bottom: 1rem; padding: 1rem; }
.search { position: relative; flex: 1 1 220px; display: block; }
.search .icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.search input { padding-left: 2.4rem; }

/* Tableaux (transformés en cartes sur téléphone) */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); padding: .75rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table td, .table tbody th { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; text-align: left; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table td > .badge { justify-self: start; }
.person { display: flex; align-items: center; gap: .65rem; color: var(--text); }
.person:hover { text-decoration: none; }
.person:hover strong { color: var(--primary); }
.person > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.person small { color: var(--text-2); font-size: .8rem; overflow-wrap: anywhere; }

@media (max-width: 760px) {
    .table:not(.perm-table) thead { display: none; }
    .table:not(.perm-table), .table:not(.perm-table) tbody, .table:not(.perm-table) tr, .table:not(.perm-table) td { display: block; width: 100%; }
    .table:not(.perm-table) tr { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
    .table:not(.perm-table) td { border: 0; padding: .2rem 0; display: grid; grid-template-columns: 9rem 1fr; gap: .5rem; }
    .table:not(.perm-table) td::before { content: attr(data-label); font-size: .75rem; font-weight: 700; color: var(--text-2); }
    .table:not(.perm-table) td[data-label="Nom"] { grid-template-columns: 1fr; }
    .table:not(.perm-table) td[data-label="Nom"]::before { display: none; }
}

.perm-table th[scope="row"] { min-width: 210px; }
.perm-table th[scope="row"] strong { display: block; font-size: .9rem; }
.perm-table th[scope="row"] small { display: block; font-weight: 500; color: var(--text-2); font-size: .76rem; text-transform: none; letter-spacing: 0; }
.perm-table td { min-width: 112px; }
.perm-select { min-height: 36px; padding: .3rem .5rem; font-size: 14px; border-radius: 8px; }
.perm-select--tout { border-color: var(--success); background: var(--success-soft); color: var(--success); font-weight: 700; }
.perm-select--propre { border-color: var(--info); background: var(--info-soft); color: var(--info); font-weight: 700; }

.mini-table { width: 100%; border-collapse: collapse; font-size: .8rem; margin-top: .5rem; }
.mini-table th, .mini-table td { padding: .3rem .5rem; border-bottom: 1px solid var(--border); text-align: left; overflow-wrap: anywhere; }
.changes summary { cursor: pointer; font-size: .8rem; font-weight: 700; color: var(--primary); margin-top: .25rem; }

.empty { display: grid; place-items: center; gap: .5rem; text-align: center; padding: 3rem 1rem; color: var(--text-2); }
.empty .icon { width: 32px; height: 32px; opacity: .6; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.pager__links { display: flex; gap: .5rem; }

.breadcrumb { font-size: .85rem; color: var(--text-2); margin-bottom: 1rem; }

.dl { display: grid; grid-template-columns: minmax(8rem, auto) 1fr; gap: .5rem 1rem; margin: 0 0 1rem; font-size: .9rem; }
.dl dt { color: var(--text-2); font-weight: 600; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.dl--compact { font-size: .85rem; }

.plain-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .4rem; }

/* Rôles */
.role-grid { display: grid; gap: .75rem; }
@media (min-width: 760px) { .role-grid { grid-template-columns: 1fr 1fr; } }
.role-card {
    display: flex; align-items: center; gap: 1rem; padding: 1.1rem; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    transition: border-color .15s, transform .15s;
}
.role-card:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-1px); }
.role-card__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); flex: none; }
.role-card__body { flex: 1; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.role-card__body small { color: var(--text-2); }
.role-card__meta { font-size: .78rem; color: var(--text-2); }
.role-card__chevron { color: var(--text-2); }

/* Diagnostic */
.checks { list-style: none; margin: 0; padding: .5rem 0; }
.check { display: flex; align-items: center; gap: .75rem; padding: .6rem 1.25rem; border-bottom: 1px solid var(--border); font-size: .88rem; }
.check:last-child { border-bottom: 0; }
.check > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.check small { color: var(--text-2); overflow-wrap: anywhere; }
.check--ok > .icon { color: var(--success); }
.check--warn > .icon { color: var(--warning); }
.check--ko > .icon { color: var(--danger); }
.check__state { font-size: .75rem; font-weight: 800; }
.check--ok .check__state { color: var(--success); }
.check--warn .check__state { color: var(--warning); }
.check--ko .check__state { color: var(--danger); }
.checks--compact .check { padding: .45rem 0; }
.checks-summary { margin-bottom: 1rem; font-size: .9rem; }
.checks-summary summary { cursor: pointer; font-weight: 700; }

/* Fenêtre de confirmation */
.modal {
    border: 0; padding: 0; border-radius: var(--radius); background: var(--surface); color: var(--text);
    width: min(440px, calc(100vw - 2rem)); box-shadow: var(--shadow-lg);
}
.modal::backdrop { background: rgba(10, 10, 12, .55); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .18s ease; }
.modal__body { padding: 1.5rem; display: grid; gap: .75rem; }
.modal__title { font-size: 1.1rem; font-weight: 800; }
.modal__text { color: var(--text-2); }
.modal__actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }

/* Page d'erreur */
.error-page { text-align: center; padding: 3rem 1rem; display: grid; justify-items: center; gap: .5rem; }
.error-page__code { font: 700 4.5rem/1 var(--font-display); color: var(--primary); margin: 0; }
.error-page__title { font-size: 1.4rem; font-weight: 800; }
.error-page__text { color: var(--text-2); max-width: 32rem; }
.error-page__detail { text-align: left; white-space: pre-wrap; font-size: .8rem; background: var(--surface-2); padding: 1rem; border-radius: var(--radius-sm); max-width: 100%; overflow-x: auto; }
.error-page .btn { margin-top: 1rem; }

/* ---------- Pages hors connexion ---------- */
.auth-body { background: var(--bg); }
.auth { min-height: 100vh; display: grid; }
.auth__brand { display: none; }
.auth__panel { display: grid; place-items: center; padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom)); }
.auth__card { width: 100%; max-width: 440px; }
.auth__logo-mobile { display: flex; align-items: center; gap: .65rem; margin-bottom: 2rem; font: 700 1.2rem var(--font-display); text-transform: uppercase; }
.auth__title { font: 700 2.3rem/1.05 var(--font-display); text-transform: uppercase; margin-bottom: .4rem; }
.auth__lead { color: var(--text-2); margin-bottom: 1.5rem; }
.auth__footer { margin-top: 1.25rem; text-align: center; font-size: .9rem; }
.auth .error-page { padding: 1rem 0; }

@media (min-width: 960px) {
    .auth { grid-template-columns: 1.1fr 1fr; }
    .auth__brand {
        display: flex; align-items: flex-end; padding: 3.5rem; color: #fff;
        background:
            radial-gradient(circle at 18% 22%, rgba(155, 11, 11, .75), transparent 50%),
            radial-gradient(circle at 85% 85%, rgba(155, 11, 11, .25), transparent 40%),
            repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 22px),
            #1d1d1b;
    }
    .auth__kicker { margin: 2rem 0 .5rem; font-size: .78rem; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; opacity: .6; }
    .auth__headline { font: 700 4rem/0.95 var(--font-display); text-transform: uppercase; margin-bottom: 1rem; }
    .auth__sub { opacity: .7; max-width: 26rem; }
    .auth__logo-mobile { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
    .sidebar, .topbar, .tabbar, .toasts, .form-actions { display: none !important; }
    .main { margin: 0; padding: 0; }
    .card { box-shadow: none; break-inside: avoid; }
}

/* ==========================================================================
   Phase 3 : adhérents, saisons, grades, recherche
   ========================================================================== */
.toolbar__actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn--sm { min-height: 34px; padding: 0 .75rem; font-size: .82rem; border-radius: 8px; }
.icon-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }
.badges { display: inline-flex; flex-wrap: wrap; gap: .3rem; margin: 0; }
.subhead { font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin: 1.25rem 0 .6rem; }

.avatar--photo { object-fit: cover; background: var(--surface-2); }
.avatar--xl { width: 96px; height: 96px; font-size: 1.8rem; }

.swatch { width: 14px; height: 14px; flex: none; color: var(--text); vertical-align: -2px; }
.grade { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }

/* Recherche globale de l'en-tête */
.topbar__search { flex: 0 1 260px; display: none; }
.search--compact input { min-height: 38px; padding-top: .3rem; padding-bottom: .3rem; font-size: .9rem; }
@media (min-width: 700px) { .topbar__search { display: block; } }
.search--large { flex: 1 1 320px; }

/* Fiche adhérent */
.profile { display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.25rem; align-items: center; margin-bottom: 1rem; }
.profile__name { font: 700 1.9rem/1 var(--font-display); text-transform: uppercase; letter-spacing: .01em; margin-bottom: .35rem; }
.profile__meta { color: var(--text-2); margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .25rem .4rem; align-items: center; }
.profile__actions { grid-column: 1 / -1; display: flex; gap: .5rem; flex-wrap: wrap; }
@media (min-width: 760px) {
    .profile { grid-template-columns: auto 1fr auto; }
    .profile__actions { grid-column: auto; justify-content: flex-end; }
}
.card__title .icon { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; margin-right: .2rem; color: var(--primary); }
.card--private { border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); background: color-mix(in srgb, var(--warning-soft) 35%, var(--surface)); }
.card--danger { border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }
.timeline__row { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; flex: 1; }
.contact-row + .contact-row { border-top: 1px dashed var(--border); padding-top: .75rem; margin-top: .25rem; }
@media (min-width: 640px) { .form-row--3 { grid-template-columns: 1.3fr 1fr 1fr; } }

.note { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.note__body { margin: 0 0 .35rem; white-space: normal; overflow-wrap: anywhere; }
.note__meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .78rem; color: var(--text-2); }
.card--private textarea { margin-top: .75rem; }

.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.doc { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.doc__icon { color: var(--primary); display: grid; }
.doc__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc__body small { color: var(--text-2); font-size: .78rem; }
.doc__actions { display: flex; align-items: center; gap: .15rem; }
.upload-form { margin-top: .5rem; }
input[type="file"] { padding: .55rem; background: var(--surface-2); cursor: pointer; }

/* Grades (édition en ligne) */
.grade-edit { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.grade-edit__name { flex: 1 1 180px; width: auto; }
.grade-edit__order { width: 6rem; }
.grade-edit__count { font-size: .8rem; color: var(--text-2); min-width: 6.5rem; }
.color-input { width: 46px; height: 40px; padding: 3px; cursor: pointer; flex: none; }
.check-inline { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 600; }
.check-inline input { width: auto; min-height: 0; }
.table__actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }

.result-list { list-style: none; margin: 0; padding: .5rem 0; }
.result-list li a { padding: .6rem 1.25rem; }
.result-list li a:hover { background: var(--surface-2); }
.card--flush + .card--flush { margin-top: 1rem; }
.grid-2 > .card--flush + .card--flush { margin-top: 0; }

@media (max-width: 760px) {
    .table:not(.perm-table) td[data-label="Adhérent"], .table:not(.perm-table) td[data-label="Grade"][colspan] { grid-template-columns: 1fr; }
    .table:not(.perm-table) td[data-label="Adhérent"]::before, .table:not(.perm-table) td[data-label="Grade"][colspan]::before { display: none; }
    .table__actions { justify-content: flex-start; }
}
.section-gap { margin-top: 1rem; }
.grade-rows { list-style: none; margin: 0; padding: 0; }
.grade-row { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
.grade-row:last-child { border-bottom: 0; }
.grade-row.is-inactive { color: var(--text-2); background: var(--surface-2); }
.grade-row .grade-edit { flex: 1; }
.grade-row__spacer { width: 40px; flex: none; }
.grade-edit__order-label { font-size: .8rem; color: var(--text-2); font-weight: 600; }
.card > p.badges { display: flex; margin-bottom: .9rem; }
/* Champs : alignés en haut même si le voisin a une aide sur deux lignes */
.field { align-content: start; }
.form-row { align-items: start; }
.form .card { display: grid; gap: 1rem; align-content: start; }
.form .card > .card__head { margin-bottom: 0; }
.card .form + .form, .card > .form { margin-top: .5rem; }
.choice-list--stack { grid-template-columns: 1fr !important; }
/* Liste des grades : champs compacts sur une ligne */
.grade-edit input.grade-edit__name { flex: 1 1 200px; width: auto; }
.grade-edit input.grade-edit__order { width: 5.5rem; flex: none; }

/* ==========================================================================
   Phase 4 : familles
   ========================================================================== */
.section-gap-bottom { margin-bottom: 1rem; }
.member-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.member-item { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.member-item .person { flex: 1 1 200px; }
.member-item .badges { flex: 0 1 auto; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.inline-form select { flex: 1 1 220px; width: auto; }
.avatar .icon { width: 18px; height: 18px; }
.avatar--xl .icon { width: 40px; height: 40px; }
.profile__meta .icon { width: 15px; height: 15px; }
.guardian { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.guardian:first-of-type { padding-top: 0; }
.guardian__head { display: flex; gap: .65rem; align-items: flex-start; }
.guardian__body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.guardian__body small { color: var(--text-2); overflow-wrap: anywhere; }
.guardian__edit { margin: .5rem 0 0 2.6rem; }
.guardian__edit summary { cursor: pointer; font-size: .85rem; font-weight: 700; color: var(--primary); }
.guardian__edit .form { margin: .75rem 0 .5rem; gap: .75rem; }
.check-inline + .check-inline { margin-left: 1rem; }
@media (max-width: 760px) {
    .table:not(.perm-table) td[data-label="Famille"] { grid-template-columns: 1fr; }
    .table:not(.perm-table) td[data-label="Famille"]::before { display: none; }
}

/* ==========================================================================
   Phase 5 : planning et présences
   ========================================================================== */
.segmented { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented__item { padding: .45rem .9rem; border-radius: 8px; font-weight: 700; font-size: .88rem; color: var(--text-2); }
.segmented__item:hover { text-decoration: none; color: var(--text); }
.segmented__item.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.month-title { font: 700 1.2rem var(--font-display); text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin: 1.25rem 0 .6rem; }
.session-list { display: grid; gap: .6rem; }
.session-card { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); }
.session-card.is-cancelled { background: var(--surface-2); } /* pas d'opacité : le texte doit rester lisible */
.session-card.is-cancelled .session-card__title a { text-decoration: line-through; }
.session-card__date { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); flex: none; line-height: 1; }
.session-card__date:hover { text-decoration: none; }
.session-card__day { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.session-card__num { font: 700 1.6rem var(--font-display); }
.session-card__body { flex: 1 1 240px; min-width: 0; }
.session-card__title { font-size: 1rem; font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 0 .2rem; }
.session-card__title a { color: var(--text); }
.session-card__meta { color: var(--text-2); font-size: .88rem; margin: 0; }
.session-card__counts { display: flex; gap: .5rem; flex-wrap: wrap; align-self: center; color: var(--text); }
.session-card__counts:hover { text-decoration: none; }
.count { display: inline-flex; align-items: baseline; gap: .25rem; padding: .3rem .6rem; border-radius: 8px; font-size: .8rem; background: var(--surface-2); color: var(--text-2); }
.count strong { font-size: 1rem; color: var(--text); }
.count--yes { background: var(--success-soft); color: var(--success); }
.count--yes strong { color: var(--success); }
.count--none { background: var(--warning-soft); color: var(--warning); }
.count--none strong { color: var(--warning); }
.counts-line { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .75rem 0 0; }

.rsvp-list { display: grid; gap: .5rem; margin-top: .6rem; }
.rsvp { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.rsvp__name { font-weight: 700; min-width: 5rem; }
.rsvp__name:empty { display: none; }
.rsvp__form { display: flex; gap: .4rem; }
.rsvp__btn {
    display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: 0 .9rem; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: 700 .85rem var(--font); cursor: pointer;
}
.rsvp__btn .icon { width: 16px; height: 16px; }
.rsvp__btn:hover { background: var(--surface-2); color: var(--text); }
.rsvp__btn--yes.is-selected { background: var(--success); border-color: var(--success); color: #fff; }
.rsvp__btn--no.is-selected { background: var(--text-2); border-color: var(--text-2); color: var(--surface); }

.date-badge { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 22px; background: var(--primary); color: #fff; line-height: 1; }
.date-badge span { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; opacity: .8; }
.date-badge strong { font: 700 2.6rem var(--font-display); }
.stat__icon--ok { background: var(--success-soft) !important; color: var(--success) !important; }

.call { display: flex; flex-wrap: wrap; gap: .3rem; }
.call__opt { position: relative; cursor: pointer; }
.call__opt input { position: absolute; opacity: 0; pointer-events: none; }
.call__opt span { display: inline-block; padding: .4rem .7rem; border-radius: 8px; border: 1px solid var(--border); font-size: .82rem; font-weight: 700; color: var(--text-2); background: var(--surface); }
.call__opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.call__opt--present input:checked + span { background: var(--success); border-color: var(--success); color: #fff; }
.call__opt--absent input:checked + span { background: var(--danger); border-color: var(--danger); color: #fff; }
.call__opt--excuse input:checked + span { background: var(--info); border-color: var(--info); color: #fff; }
.call__opt--none input:checked + span { background: var(--surface-2); color: var(--text); }
.call-footer { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.call-footer .field { flex: 1 1 260px; }
.note-below { margin-top: .75rem; }
@media (max-width: 760px) {
    .table:not(.perm-table) td[data-label="Présence réelle"] { grid-template-columns: 1fr; gap: .4rem; }
}

.meter { display: inline-flex; align-items: center; gap: .5rem; min-width: 9rem; }
.meter svg { width: 6rem; height: 8px; }
.meter__bg { fill: var(--surface-2); }
.meter__fill { fill: var(--success); }
.att-row { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
code { font-size: .85em; background: var(--surface-2); padding: .1rem .35rem; border-radius: 5px; }

/* ---------------------------------------------------------------- Phase 6 : cotisations et formulaires */
.stat__value--money { font-size: 1.45rem; white-space: nowrap; }
.block { display: block; }
.lead { margin: 0 0 1rem; }
.pay-list { list-style: none; margin: 0; padding: 0 1.25rem 1.25rem; display: grid; gap: .5rem; }
.pay-item { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .5rem .75rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.pay-item__main { display: flex; flex-direction: column; gap: .1rem; min-width: 0; font-size: .88rem; }
.pay-item__main strong { font-size: 1rem; }
.pay-item__actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .35rem; }
.pay-item__cancel { color: var(--danger); font-weight: 600; }
.pay-item.is-cancelled { background: var(--surface-2); }
.pay-item.is-cancelled .pay-item__main strong { text-decoration: line-through; }
.pay-item__more[open] { flex-basis: 100%; }
.pay-item__more summary { list-style: none; cursor: pointer; }
.pay-item__more summary::-webkit-details-marker { display: none; }
.pay-item__more .form { margin-top: .6rem; }
.fee-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.fee-card .card__head { margin-bottom: .5rem; }
.doc { flex-wrap: wrap; }
.doc.is-muted { background: var(--surface-2); }
.doc__edit { flex-basis: 100%; }
.doc__edit summary { cursor: pointer; color: var(--primary); font-weight: 700; }
.doc__edit .form { margin-top: .6rem; }
.td-money { white-space: nowrap; }
.profile__body { min-width: 0; }
.profile .badge { white-space: normal; max-width: 100%; }
.text-danger { color: var(--danger); }

/* ---------------------------------------------------------------- Phase 7 : comptabilité et relances */
.meter__fill--out { fill: var(--danger); }
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.bar-list li { display: grid; grid-template-columns: minmax(7rem, 1.2fr) 2fr auto; align-items: center; gap: .75rem; font-size: .88rem; }
.bar-list__bar svg { width: 100%; height: 8px; display: block; }
.bar-list__value { font-weight: 700; white-space: nowrap; text-align: right; }
.num { text-align: right; white-space: nowrap; }
.table th.num { text-align: right; }
.amount-in { color: var(--success); font-weight: 700; }
.amount-out { color: var(--danger); font-weight: 700; }
.table tr.is-cancelled td { color: var(--text-2); background: var(--surface-2); }
.table tr.is-cancelled .amount-in, .table tr.is-cancelled .amount-out { text-decoration: line-through; }
.form--inline { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .5rem 1rem; }
.form--inline .field { flex: 1 1 200px; margin: 0; }
.form--inline > .btn { margin-top: 1.55rem; }
.reminder-body { white-space: pre-wrap; font-family: inherit; font-size: .9rem; background: var(--surface-2); border-radius: var(--radius-sm); padding: .9rem 1rem; margin: 0; }
textarea.reminder-edit { min-height: 16rem; font-family: inherit; }
.cat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.cat-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .75rem; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.cat-item:last-child { border-bottom: 0; }
.cat-item.is-muted { color: var(--text-2); background: var(--surface-2); }
.cat-item__form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; flex: 1 1 260px; }
.cat-item__form input[name="name"] { flex: 1 1 140px; min-width: 0; }
@media (max-width: 760px) {
    .toolbar > .filters { min-width: 0; max-width: 100%; }
    .filters select { min-width: 0; max-width: 100%; }
    .filters--wrap > * { min-width: 0; max-width: 100%; }
}
@media (max-width: 760px) {
    .dl { grid-template-columns: minmax(6rem, 38%) 1fr; }
}

/* ---------- Phase 8 : examens ---------- */
.text-warning { color: var(--warning); }
.pre-line { white-space: pre-line; margin: 0 0 .5rem; }
.exam-pass { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-weight: 700; margin: 0 0 .75rem; }
.exam-head { margin-top: .25rem; }
.exam-bar {
    position: sticky; top: .5rem; z-index: 5; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem;
    padding: .6rem 1rem; margin-bottom: 1rem; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow); font-size: .88rem;
}
.exam-bar__save { color: var(--text-2); }
.exam-bar__save[data-state="saving"] { color: var(--text-2); }
.exam-bar__save[data-state="ok"] { color: var(--success); }
.exam-bar__save[data-state="offline"], .exam-bar__save[data-state="error"] { color: var(--danger); font-weight: 700; }
.exam-group + .exam-group { margin-top: 1rem; }
.exam-group .card__head { padding: 1rem 1.25rem 0; }
.exam-rows { list-style: none; margin: 0; padding: 0; }
.exam-row { position: relative; display: grid; gap: .5rem; padding: .85rem 1.25rem; border-top: 1px solid var(--border); }
.exam-row:first-child { border-top: 0; }
.exam-row__score { border: 0; margin: 0; padding: 0; min-width: 0; }
.exam-row__name { font-weight: 700; padding: 0; margin-bottom: .45rem; padding-right: 1.5rem; }
.exam-row__notes { display: grid; gap: .4rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .exam-row__notes { grid-template-columns: 1fr 1fr; } }
.exam-row__notes input { font-size: .88rem; padding: .45rem .6rem; }
.input-private { background: var(--warning-soft); border-style: dashed; }
.exam-row__state { position: absolute; top: .95rem; right: 1.25rem; width: .7rem; height: .7rem; border-radius: 50%; }
.exam-row[data-state="dirty"] .exam-row__state { background: var(--warning); }
.exam-row[data-state="saved"] .exam-row__state { background: var(--success); }
.exam-row[data-state="error"] .exam-row__state { background: var(--danger); }
.score-picker { display: flex; flex-wrap: wrap; gap: .35rem; }
.score { position: relative; }
.score input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.score span {
    display: inline-block; padding: .45rem .75rem; border: 1px solid var(--border); border-radius: 999px;
    font-size: .84rem; font-weight: 700; color: var(--text-2); background: var(--surface); cursor: pointer; min-height: 2.25rem; line-height: 1.3;
}
.score input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.score:hover span { background: var(--surface-2); color: var(--text); }
.score input:checked + span { color: #fff; border-color: transparent; }
.score--none input:checked + span { background: var(--text-2); color: var(--surface); }
.score--0 input:checked + span { background: var(--danger); }
.score--1 input:checked + span { background: var(--warning); }
.score--2 input:checked + span { background: var(--success); }
.score--3 input:checked + span { background: #1f5f3a; }
.score-badge--0 { background: var(--danger-soft); color: var(--danger); }
.score-badge--1 { background: var(--warning-soft); color: var(--warning); }
.score-badge--2, .score-badge--3 { background: var(--success-soft); color: var(--success); }
.exam-row--read { grid-template-columns: 1fr auto; align-items: center; }
.exam-row--read .exam-row__name { margin: 0; padding: 0; font-weight: 600; }
.exam-row__comment { grid-column: 1 / -1; margin: 0; font-size: .85rem; color: var(--text-2); }
.exam-row__private { background: var(--warning-soft); color: var(--text); padding: .35rem .55rem; border-radius: var(--radius-sm); }
.exam-row__private .icon, .private-box .icon, .field__hint .icon { width: 14px; height: 14px; vertical-align: -2px; }
.private-box { background: var(--warning-soft); border: 1px dashed var(--warning); border-radius: var(--radius-sm); padding: .25rem .9rem .5rem; margin-top: 1rem; }
.exam-card { color: inherit; display: block; }
.exam-card:hover { text-decoration: none; border-color: var(--primary); }
.exam-card p { margin: .4rem 0 0; }
.prog-list { list-style: none; margin: 0; padding: 0; }
.prog-list li + li { border-top: 1px solid var(--border); }
.prog-list__link { display: flex; align-items: center; gap: .75rem; padding: .85rem 1.25rem; color: inherit; }
.prog-list__link:hover { text-decoration: none; background: var(--surface-2); }
.prog-list__link .grade { flex: 1; font-weight: 700; }
.prog-list__link.is-inactive { opacity: .6; }
.prog-list__chev { width: 16px; height: 16px; color: var(--text-2); }
.tech-list { list-style: none; margin: 0; padding: .5rem 1.25rem 1rem; }
.tech-item { display: flex; align-items: flex-end; gap: .5rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.tech-item:last-child { border-bottom: 0; }
.tech-item.is-inactive { opacity: .6; }
.tech-edit { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .75rem; flex: 1; min-width: 0; }
.tech-edit .field { margin: 0; }
.tech-edit label:not(.check-inline) { font-size: .75rem; }
.tech-edit__cat { flex: 1 1 140px; }
.tech-edit__name { flex: 3 1 220px; }
.tech-edit__order { flex: 0 0 4.5rem; }
.tech-edit .check-inline { padding-bottom: .55rem; }
.tech-delete { padding-bottom: .1rem; }
@media (max-width: 760px) {
    .exam-bar { top: 0; border-radius: 0; margin-inline: -1rem; }
    .exam-row { padding: .85rem 1rem; }
    .tech-item { align-items: flex-start; }
}
fieldset.field { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
fieldset.field > legend { padding: 0; font-weight: 700; font-size: .88rem; margin-bottom: .4rem; }
.field__hint .icon { display: inline-block; }
.exam-row__private .icon, .private-box .icon { display: inline-block; margin-right: .2rem; }
.private-box + .form-actions, .pre-line + .form-actions { margin-top: 1rem; }

/* ===== Phase 9 : annonces et notifications ===== */
.bell { position: relative; }
.bell.is-active { color: var(--primary); background: var(--primary-soft); }
.bell__count {
    position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--primary); color: var(--on-primary); font-size: .68rem; font-weight: 800; line-height: 18px; text-align: center;
}
.banner {
    display: flex; align-items: center; gap: .75rem; padding: .65rem .75rem .65rem 1rem; margin-bottom: 1rem;
    border-radius: var(--radius-sm); border: 1px solid; font-size: .9rem;
}
.banner > .icon { flex: none; }
.banner p { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.banner a { font-weight: 700; margin-left: .35rem; color: inherit; text-decoration: underline; }
.banner--info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.banner--danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.banner__close { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.banner__close:hover { background: rgba(0, 0, 0, .06); }
.banner__close .icon { width: 16px; height: 16px; }

.ann-list { display: grid; gap: 1rem; }
.ann-card.is-unread { border-left: 4px solid var(--primary); }
.ann-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.ann-card__title { margin: 0 0 .35rem; font-size: 1.1rem; }
.ann-card__title a { color: inherit; }
.ann-card__event { display: flex; align-items: center; gap: .4rem; margin: 0 0 .5rem; font-weight: 700; font-size: .9rem; }
.ann-card__event .icon { width: 16px; height: 16px; }
.ann-card__excerpt { margin: 0 0 .5rem; color: var(--text-2); overflow-wrap: anywhere; }
.ann-full__title { margin: .25rem 0 .5rem; font-size: 1.35rem; overflow-wrap: anywhere; }
.ann-full__body { line-height: 1.6; overflow-wrap: anywhere; }
.stack-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.stack-actions form { margin: 0; }
.target-detail { margin-top: 1rem; }
form:has(#t-all:checked) .target-detail { display: none; }
.pick-grid { display: grid; gap: .25rem .75rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.pick-grid--scroll { max-height: 15rem; overflow: auto; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pick { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; font-size: .9rem; cursor: pointer; }
.pick-grid--wide { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.pick input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.news-list li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem .75rem; }
.news-list a { color: inherit; overflow-wrap: anywhere; }

.notif-list { list-style: none; margin: 0; padding: 0; }
.notif + .notif { border-top: 1px solid var(--border); }
.notif form { margin: 0; }
.notif__btn {
    display: flex; gap: .85rem; width: 100%; padding: .85rem 1.25rem; border: 0; background: transparent;
    color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.notif__btn:hover { background: var(--surface-2); }
.notif.is-unread .notif__btn { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.notif.is-unread .notif__btn:hover { background: var(--primary-soft); }
.notif__icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); }
.notif.is-unread .notif__icon { background: var(--primary); color: var(--on-primary); }
.notif__icon .icon { width: 18px; height: 18px; }
.notif__text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.notif__text strong { overflow-wrap: anywhere; }
.notif__body { color: var(--text-2); font-size: .88rem; overflow-wrap: anywhere; }
.notif__new { color: var(--primary); font-weight: 700; }
.push-box [data-push-status][data-state="on"] { color: var(--success); font-weight: 700; }
.push-box .form-actions { margin: .5rem 0; }
.push-box .form-actions:not(:has(button:not([hidden]))) { display: none; }
.device-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.device-list form { margin: 0; flex: none; }
@media (max-width: 760px) {
    .notif__btn { padding: .8rem 1rem; }
    .banner { align-items: flex-start; }
}
.notif-card > .card__head, .card--flush.ann-deliveries > .card__head { padding: 1rem 1.25rem; margin: 0; border-bottom: 1px solid var(--border); }

/* ===== Phase 10 : sauvegardes et RGPD ===== */
.backup-card > .card__head { padding: 1rem 1.25rem; margin: 0; border-bottom: 1px solid var(--border); }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; justify-content: flex-end; }
.row-actions form { margin: 0; }
.steps { padding-left: 1.25rem; display: grid; gap: .4rem; margin: .5rem 0 1rem; }
.form-row--end { align-items: flex-end; }
.form-row--end .form-actions { margin: 0 0 1rem; }
.consent { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.consent p { margin: 0 0 .5rem; }
.consent__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.policy { max-width: 760px; line-height: 1.6; }
.policy h2 { margin-top: 0; }
.policy h3 { margin: 1.5rem 0 .4rem; font-size: 1rem; }
.policy ul { padding-left: 1.25rem; }
.policy li + li { margin-top: .35rem; }

/* ---------- Texte du sondage de présence ---------- */
.placeholders dt code { font-size: .85rem; }
.poll-link { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.poll-preview { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; background: var(--surface-2, var(--bg)); }
.poll-preview__title { font-weight: 600; margin: 0 0 .4rem; }
.poll-preview__body { margin: 0; font-size: .92rem; overflow-wrap: anywhere; }
