/* =============================================================================
   admin.css — FEUILLE DE STYLE UNIQUE de l'administration EVYA.
   Consolidation (Vague 0, iso-fonctionnelle) des 6 CSS globaux, dans l'ordre de
   cascade d'origine : tokens → cs-foundation → app → sidebar-fix → design-system
   → admin-rail. Objectif : UN seul fichier maintenable, chargé UNE fois (moins de
   requêtes = moins de charge serveur). Les refontes suivantes se font ICI :
   on modifie une valeur (token/composant) et ça se répercarte partout.
   NE PAS recharger les 6 fichiers d'origine en plus de celui-ci.
   ============================================================================= */

/**
 * tokens.css — Design tokens partagés entre toutes les apps EVYA.
 *
 * Objectif : centraliser les valeurs sémantiques (couleurs alertes, espacements,
 * tailles tactiles, contraste) sans toucher aux palettes brand de chaque app.
 *
 * Chaque layout (client/driver/admin/website) garde ses variables locales
 * (--brand, --accent, --site-*, --cs-*) ; seules les valeurs UTILISÉES PARTOUT
 * sont déclarées ici, en :root.
 *
 * Importé en premier dans chaque layout pour servir de base.
 *
 * Ne PAS supprimer/écraser de tokens existants — additif uniquement.
 */
:root {
    /* ──────────────────────────────────────────────────────────────────
       BRAND EVYA — palette bleu nuit profond (verrouillée 2026-05-25)
       Cohérente avec la maquette de référence : sobre, premium, business.
       ────────────────────────────────────────────────────────────────── */
    --ev-primary-50:  #F2F2F7;      /* hover sur surface blanche, backgrounds très clairs */
    --ev-primary-100: #E0E0EC;      /* badges info, sections highlighted */
    --ev-primary-200: #B8B8D0;      /* borders accent, tags */
    --ev-primary-300: #5D5D8C;      /* placeholder, disabled foreground */
    --ev-primary-400: #3D3D6B;      /* hover sur fond clair */
    --ev-primary-500: #2A2A50;      /* hover sur surfaces primary */
    --ev-primary-600: #1C1C3A;      /* PRIMARY EVYA — violet vif maquette (CTA) */
    --ev-primary-700: #13132C;      /* primary pressed */
    --ev-primary-900: #0A0A1F;      /* dark backgrounds */
    --ev-on-primary:  #FFFFFF;      /* texte/icône sur fond primary */

    /* ──────────────────────────────────────────────────────────────────
       NEUTRES — surfaces, textes, borders
       ────────────────────────────────────────────────────────────────── */
    --ev-white:       #FFFFFF;
    --ev-gray-50:     #FAFAFC;      /* page background */
    --ev-gray-100:    #F4F4F7;      /* section backgrounds */
    --ev-gray-200:    #E5E5EA;      /* borders subtiles */
    --ev-gray-300:    #D1D1D6;      /* borders inputs */
    --ev-gray-400:    #A1A1AA;      /* placeholder */
    --ev-gray-500:    #71717A;      /* muted text */
    --ev-gray-700:    #3F3F46;      /* body text secondary */
    --ev-gray-900:    #18181B;      /* body text primary */

    /* ──────────────────────────────────────────────────────────────────
       DARK MODE — driver app (cohérent avec primary)
       ────────────────────────────────────────────────────────────────── */
    --ev-dark-bg:           #0A0A1F;    /* page bg = primary-900 */
    --ev-dark-surface:      #13132C;    /* cards = primary-700 */
    --ev-dark-surface-2:    #1C1C3A;    /* cards hover = primary-600 */
    --ev-dark-border:       rgba(255, 255, 255, 0.08);
    --ev-dark-border-strong:rgba(255, 255, 255, 0.16);
    --ev-dark-text:         #FFFFFF;
    --ev-dark-text-muted:   #9CA0B5;    /* contraste AA conservé sur dark-bg */
    --ev-dark-accent:       #FFFFFF;    /* CTA dark = inversion : blanc sur sombre */
    --ev-dark-accent-soft:  #2A2A50;    /* CTA secondaire dark */

    /* ── Couleurs sémantiques universelles (états, alertes) ────────────── */
    --evya-success: #15803d;        /* vert : confirmations, statut OK */
    --evya-success-bg: #dcfce7;
    --evya-success-border: #86efac;
    --evya-danger: #dc2626;         /* rouge : erreurs, suppressions */
    --evya-danger-bg: #fee2e2;
    --evya-danger-border: #fca5a5;
    --evya-warning: #d97706;        /* orange : attention, en attente */
    --evya-warning-bg: #fef3c7;
    --evya-warning-border: #fde68a;
    --evya-info: #0369a1;           /* bleu : info, neutre */
    --evya-info-bg: #dbeafe;
    --evya-info-border: #93c5fd;

    /* ── Échelle d'espacement (0.25rem step) ───────────────────────────── */
    --evya-space-1: 4px;
    --evya-space-2: 8px;
    --evya-space-3: 12px;
    --evya-space-4: 16px;
    --evya-space-5: 20px;
    --evya-space-6: 24px;
    --evya-space-8: 32px;

    /* ── Rayons de bordure normalisés ──────────────────────────────────── */
    --evya-radius-sm: 6px;
    --evya-radius-md: 10px;
    --evya-radius-lg: 14px;
    --evya-radius-pill: 999px;

    /* ── Tailles tactiles (WCAG 2.5.5 = 44x44 ; cible EVYA = 48-56) ───── */
    --evya-touch-min: 48px;         /* hauteur minimum de tout bouton/lien tappable */
    --evya-touch-cta: 56px;         /* CTA primaires (Réserver, Accepter, etc.) */
    --evya-touch-critical: 64px;    /* actions vitales en course (Démarrer, Terminer) */

    /* ── Échelle typographique ────────────────────────────────────────── */
    --evya-text-xs: 12px;           /* legal, footer (lisible mais discret) */
    --evya-text-sm: 13px;           /* labels, méta */
    --evya-text-base: 15px;         /* body cible mobile (relevé de 14 à 15) */
    --evya-text-lg: 17px;           /* sous-titres */
    --evya-text-xl: 22px;           /* titres section */
    --evya-text-2xl: 28px;          /* titres écran */

    /* ── Contraste textes muted (>= 4.5:1 sur fond blanc) ──────────────── */
    --evya-muted: #475569;          /* slate-600 = ratio 8.6:1 sur blanc */
    --evya-muted-soft: #64748b;     /* slate-500 = ratio 7.2:1 sur blanc */
    --evya-muted-on-dark: rgba(255, 255, 255, 0.85); /* nav/footer dark */

    /* ── Ombres normalisées ───────────────────────────────────────────── */
    --evya-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --evya-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --evya-shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);
    --evya-shadow-cta: 0 6px 18px rgba(245, 158, 11, 0.25); /* CTA primaire */

    /* ── Z-index normalisés ───────────────────────────────────────────── */
    --evya-z-nav: 50;
    --evya-z-sticky: 60;
    --evya-z-overlay: 998;
    --evya-z-sheet: 999;
    --evya-z-toast: 1100;

    /* ── Animations standard ──────────────────────────────────────────── */
    --evya-transition-fast: 0.12s ease;
    --evya-transition-base: 0.18s ease;
    --evya-transition-slow: 0.32s cubic-bezier(.32, .72, 0, 1);

    /* ── Focus clavier (WCAG 2.4.7) ────────────────────────────────────
       Couleur d'anneau de focus par défaut. Bleu-600 : contraste >= 3:1
       aussi bien sur fond blanc (admin) que sur le bleu nuit du site, et
       l'outline-offset place l'anneau sur le FOND DE PAGE, jamais sur les
       boutons dorés (dont le contraste propre serait insuffisant). Une
       surface peut la surcharger localement si besoin. */
    --evya-focus-ring: #2563eb;
}

/* ──────────────────────────────────────────────────────────────────────
   Utility classes : peuvent être ajoutées aux composants existants
   pour bénéficier des tokens sans toucher à leur CSS local.
   ────────────────────────────────────────────────────────────────────── */

/* Bouton accessible : à appliquer sur n'importe quel CTA pour garantir 48px+. */
.evya-touch       { min-height: var(--evya-touch-min); }
.evya-touch-cta   { min-height: var(--evya-touch-cta); }
.evya-touch-critical { min-height: var(--evya-touch-critical); font-size: var(--evya-text-lg); }

/* Texte muted accessible (remplace les rgba(.5) trop pâles). */
.evya-muted       { color: var(--evya-muted); }
.evya-muted-soft  { color: var(--evya-muted-soft); }

/* Focus visible accessible (clavier) : applicable sur n'importe quel bouton. */
.evya-focusable:focus-visible,
button.evya-focusable:focus-visible,
a.evya-focusable:focus-visible {
    outline: 3px solid var(--evya-info);
    outline-offset: 2px;
    border-radius: var(--evya-radius-sm);
}

/* ──────────────────────────────────────────────────────────────────────
   Focus clavier GLOBAL (WCAG 2.4.7 Focus Visible).
   Avant : liens et boutons n'avaient AUCUN indicateur défini et retombaient
   sur l'anneau par défaut du navigateur, souvent invisible sur les fonds
   sombres/dorés du site. On pose un anneau net et cohérent sur tous les
   éléments réellement interactifs, uniquement au clavier (:focus-visible) —
   la souris ne le déclenche pas.
   Ciblage au niveau élément (spécificité suffisante) pour ne pas être annulé
   par les `outline:none` des champs, qui conservent par ailleurs leur
   box-shadow de focus. On ne touche pas au border-radius pour ne pas
   déformer les composants au focus. ────────────────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible,
[role="button"]:focus-visible,
[role="link"]:focus-visible,
[role="tab"]:focus-visible,
[role="menuitem"]:focus-visible,
[role="menuitemcheckbox"]:focus-visible,
[role="menuitemradio"]:focus-visible,
[role="option"]:focus-visible,
[role="switch"]:focus-visible,
[role="checkbox"]:focus-visible,
[role="radio"]:focus-visible {
    outline: 3px solid var(--evya-focus-ring);
    outline-offset: 2px;
}

/* Lien d'évitement (WCAG 2.4.1 Bypass Blocks) : invisible tant qu'il n'a pas
   le focus clavier, puis glisse en haut à gauche. À poser en tout premier
   enfant de <body>, pointant vers l'ancre du contenu principal (#main-content).
   z-index au-dessus des barres fixes du site (site-nav = 1000). */
.evya-skip-link {
    position: absolute;
    left: 8px;
    top: -80px;
    z-index: 2000;
    padding: 10px 16px;
    background: var(--ev-primary-600, #1C1C3A);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    transition: top 0.15s ease;
}
.evya-skip-link:focus {
    top: 0;
    outline: 3px solid var(--evya-focus-ring);
    outline-offset: 2px;
}

/* Région visually-hidden pour lecteurs d'écran (pas de display:none qui exclut). */
.evya-sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

/* Respect du prefers-reduced-motion : tous les composants animés héritent. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   EVYA DESIGN SYSTEM v2 — couche canonique (verrouillée 2026-08-06)
   Seeds : bleu nuit #081A45 · crème #F7F4EC · or #C9A353 (accent RARE).
   ADDITIF — n'écrase AUCUN token hérité au-dessus (--ev-primary-*, --evya-*,
   --cs-*, --ds-* restent valables). Les composants migrent vers ces rôles v2
   `--evya-*` surface par surface, dans leur session dédiée.
   Clair par défaut + vrai mode sombre (fond nuit chaud, jamais noir pur).
   Spécification complète : docs/design-system/README.md
   Maquette validée : artifact EVYA — Design System v2.
   ════════════════════════════════════════════════════════════════════════ */
:root {
    /* ── Rampes tonales (référence ; préférer les rôles ci-dessous) ──────── */
    --ev-navy-50:#EDF0F9;  --ev-navy-100:#DCE2F1; --ev-navy-200:#C9D2E8;
    --ev-navy-300:#9AA8CE; --ev-navy-400:#6B7DAE; --ev-navy-500:#33487F;
    --ev-navy-600:#24386F; --ev-navy-700:#12224F; --ev-navy-800:#0C1E4C;
    --ev-navy-900:#081A45;
    --ev-gold-50:#FBF6EA;  --ev-gold-100:#F3E7CB; --ev-gold-200:#E7D2A3;
    --ev-gold-300:#D8B978; --ev-gold-400:#C9A353; --ev-gold-500:#B4863A;
    --ev-gold-600:#8A6E2E; --ev-gold-700:#6E5620; --ev-gold-900:#4A3712;
    --ev-neutral-0:#FFFFFF;  --ev-neutral-50:#F5F2EA;  --ev-neutral-100:#EEEADF;
    --ev-neutral-200:#DED8C9; --ev-neutral-300:#C6BFAC; --ev-neutral-500:#71768A;
    --ev-neutral-700:#4C5165; --ev-neutral-900:#12172B;

    /* ── Rôles sémantiques (API v2 — CIBLER CEUX-CI) · thème CLAIR ───────── */
    --evya-bg:#F5F2EA;            /* fond vitrine / apps (crème) */
    --evya-bg-clean:#FBFAF6;      /* fond admin (blanc cassé, écrans denses) */
    --evya-surface:#FFFFFF;
    --evya-surface-2:#FCFAF4;
    --evya-surface-variant:#EEEADF;
    --evya-on-surface:#12172B;
    --evya-on-surface-med:#4C5165;
    --evya-on-surface-muted:#71768A;
    --evya-outline:#DED8C9;
    --evya-outline-strong:#C6BFAC;
    --evya-primary:#081A45;
    --evya-on-primary:#FFFFFF;
    --evya-primary-hover:#122352;
    --evya-primary-container:#DCE2F1;
    --evya-on-primary-container:#0A1330;
    --evya-accent:#B4863A;        /* or lisible sur crème (texte / bordure) */
    --evya-accent-bright:#C9A353; /* or plein (fond CTA premium uniquement) */
    --evya-on-accent:#2A2003;     /* encre foncée sur l'or (contraste AA ~7:1 ; PAS de blanc) */
    --evya-accent-container:#F3E7CB;
    --evya-on-accent-container:#4A3712;

    /* ── Élévation v2 (ombres teintées navy, discrètes) ─────────────────── */
    --evya-e1:0 1px 2px rgba(8,26,69,.05), 0 1px 3px rgba(8,26,69,.04);
    --evya-e2:0 2px 6px rgba(8,26,69,.07), 0 1px 2px rgba(8,26,69,.05);
    --evya-e3:0 8px 20px rgba(8,26,69,.10), 0 2px 6px rgba(8,26,69,.06);
    --evya-e4:0 18px 40px rgba(8,26,69,.14), 0 4px 10px rgba(8,26,69,.07);

    /* ── Mouvement (Material motion — discret) ──────────────────────────── */
    --evya-dur-fast:120ms; --evya-dur-base:200ms; --evya-dur-slow:320ms;
    --evya-ease-standard:cubic-bezier(.2,0,0,1);
    --evya-ease-emphasized:cubic-bezier(.3,0,0,1);
    --evya-ease-decelerate:cubic-bezier(0,0,0,1);

    /* ── Familles typographiques (auto-hébergées, RGPD) ─────────────────── */
    --evya-font-ui:"EvyaInter","Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
    --evya-font-display:"EvyaCormorant","Cormorant Garamond",Georgia,"Times New Roman",serif;
}

/* ── Rôles v2 · thème SOMBRE (auto selon l'OS, sauf surface forcée claire) ── */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --evya-bg:#0A0F20; --evya-bg-clean:#0A0F20;
        --evya-surface:#0E1428; --evya-surface-2:#141B33; --evya-surface-variant:#1A2340;
        --evya-on-surface:#E9EBF2; --evya-on-surface-med:#B4BACB; --evya-on-surface-muted:#8A90A4;
        --evya-outline:rgba(233,235,242,.14); --evya-outline-strong:rgba(233,235,242,.26);
        --evya-primary:#AEBBE4; --evya-on-primary:#0A1330; --evya-primary-hover:#C3CDEC;
        --evya-primary-container:#24386F; --evya-on-primary-container:#DCE2F1;
        --evya-accent:#E7D2A3; --evya-accent-bright:#E7D2A3; --evya-on-accent:#2A2003;
        --evya-accent-container:#4A3712; --evya-on-accent-container:#F3E7CB;
        --evya-success:#4ADE80; --evya-success-bg:#12331E; --evya-success-border:#1E5631;
        --evya-danger:#F87171;  --evya-danger-bg:#3A1616;  --evya-danger-border:#7F2A2A;
        --evya-warning:#FBBF24; --evya-warning-bg:#3A2A08; --evya-warning-border:#7A5A12;
        --evya-info:#60A5FA;    --evya-info-bg:#0C2740;    --evya-info-border:#1E4E7A;
        --evya-e1:0 1px 2px rgba(0,0,0,.4);  --evya-e2:0 2px 8px rgba(0,0,0,.45);
        --evya-e3:0 10px 24px rgba(0,0,0,.5); --evya-e4:0 20px 44px rgba(0,0,0,.55);
        --evya-focus-ring:#7AA0FF;
    }
}
/* Mode sombre EXPLICITE (surface qui pose data-theme="dark", ex. apps) — gagne toujours */
:root[data-theme="dark"] {
    --evya-bg:#0A0F20; --evya-bg-clean:#0A0F20;
    --evya-surface:#0E1428; --evya-surface-2:#141B33; --evya-surface-variant:#1A2340;
    --evya-on-surface:#E9EBF2; --evya-on-surface-med:#B4BACB; --evya-on-surface-muted:#8A90A4;
    --evya-outline:rgba(233,235,242,.14); --evya-outline-strong:rgba(233,235,242,.26);
    --evya-primary:#AEBBE4; --evya-on-primary:#0A1330; --evya-primary-hover:#C3CDEC;
    --evya-primary-container:#24386F; --evya-on-primary-container:#DCE2F1;
    --evya-accent:#E7D2A3; --evya-accent-bright:#E7D2A3; --evya-on-accent:#2A2003;
    --evya-accent-container:#4A3712; --evya-on-accent-container:#F3E7CB;
    --evya-success:#4ADE80; --evya-success-bg:#12331E; --evya-success-border:#1E5631;
    --evya-danger:#F87171;  --evya-danger-bg:#3A1616;  --evya-danger-border:#7F2A2A;
    --evya-warning:#FBBF24; --evya-warning-bg:#3A2A08; --evya-warning-border:#7A5A12;
    --evya-info:#60A5FA;    --evya-info-bg:#0C2740;    --evya-info-border:#1E4E7A;
    --evya-e1:0 1px 2px rgba(0,0,0,.4);  --evya-e2:0 2px 8px rgba(0,0,0,.45);
    --evya-e3:0 10px 24px rgba(0,0,0,.5); --evya-e4:0 20px 44px rgba(0,0,0,.55);
    --evya-focus-ring:#7AA0FF;
}


/* ===== [cs-foundation.css] ===== */
/**
 * cs-foundation.css — Composants base de la refonte UI EVYA 2026 (admin).
 *
 * Préfixe `ev-*` (≠ `cs-*` legacy) pour distinguer les nouvelles classes
 * modernisées des anciennes. Migration progressive : les pages anciennes
 * continuent d'utiliser `cs-*`, les pages refondues passent à `ev-*`.
 *
 * Dépend de tokens.css (variables `--ev-*`).
 * Charger APRÈS tokens.css, AVANT app.css (pour éviter conflits cs-btn etc.).
 *
 * Ne contient que les composants base de la Foundation (Phase A) :
 *   • Boutons (ev-btn + variantes)
 *   • Cartes (ev-card + variantes)
 *   • Inputs (ev-field + ev-label + ev-hint)
 *   • Badges (ev-badge + variantes)
 *   • Flash messages (ev-flash + variantes)
 *   • Rangées de liste (ev-row)
 *   • KPI cards (ev-kpi)
 *   • Section titles (ev-section-title)
 *
 * Les composants spécifiques (sidebar, table, etc.) restent dans app.css
 * jusqu'à leur refonte (Phase B+).
 */

/* ══════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════ */

.ev-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--evya-radius-md);
    font-size: var(--evya-text-base);
    font-weight: 700;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--evya-transition-fast),
                color var(--evya-transition-fast),
                transform var(--evya-transition-fast),
                box-shadow var(--evya-transition-fast);
    user-select: none;
    white-space: nowrap;
}
.ev-btn:disabled,
.ev-btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}
.ev-btn ion-icon,
.ev-btn svg {
    font-size: 18px;
    flex-shrink: 0;
}

/* Variants */
.ev-btn--primary {
    background: var(--ev-primary-600);
    color: var(--ev-on-primary);
    box-shadow: var(--evya-shadow-sm);
}
.ev-btn--primary:hover { background: var(--ev-primary-500); }
.ev-btn--primary:active { background: var(--ev-primary-700); transform: scale(.98); }

.ev-btn--secondary {
    background: var(--ev-white);
    color: var(--ev-primary-600);
    border: 1.5px solid var(--ev-gray-300);
}
.ev-btn--secondary:hover {
    border-color: var(--ev-primary-600);
    background: var(--ev-primary-50);
}

.ev-btn--ghost {
    background: transparent;
    color: var(--ev-gray-700);
}
.ev-btn--ghost:hover { background: var(--ev-gray-100); }

.ev-btn--danger {
    background: var(--evya-danger);
    color: #fff;
}
.ev-btn--danger:hover { filter: brightness(.92); }

.ev-btn--success {
    background: var(--evya-success);
    color: #fff;
}
.ev-btn--success:hover { filter: brightness(.92); }

/* Sizes */
.ev-btn--sm { height: 32px; padding: 0 12px; font-size: var(--evya-text-sm); }
.ev-btn--lg { height: 48px; padding: 0 20px; font-size: var(--evya-text-lg); }
.ev-btn--block { width: 100%; }

/* ══════════════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════════════ */

.ev-card {
    background: var(--ev-white);
    border-radius: var(--evya-radius-lg);
    padding: var(--evya-space-4);
    box-shadow: var(--evya-shadow-sm);
}
.ev-card--hero {
    padding: var(--evya-space-6);
    border-radius: 20px;
    box-shadow: var(--evya-shadow-md);
}
.ev-card--filled {
    background: var(--ev-gray-100);
    box-shadow: none;
    border: 1px solid var(--ev-gray-200);
}
.ev-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--evya-space-4);
    padding-bottom: var(--evya-space-3);
    border-bottom: 1px solid var(--ev-gray-200);
}
.ev-card__title {
    margin: 0;
    font-size: var(--evya-text-lg);
    font-weight: 800;
    color: var(--ev-gray-900);
}
.ev-card__title-sm {
    margin: 0;
    font-size: var(--evya-text-base);
    font-weight: 700;
    color: var(--ev-gray-900);
}

/* ══════════════════════════════════════════════════════════════════════
   INPUTS / LABELS / HINTS
   ══════════════════════════════════════════════════════════════════════ */

.ev-field {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    min-height: var(--evya-touch-min);
    border: 1.5px solid var(--ev-gray-300);
    border-radius: var(--evya-radius-md);
    font-size: var(--evya-text-base);
    font-family: inherit;
    color: var(--ev-gray-900);
    background: var(--ev-white);
    outline: none;
    transition: border-color var(--evya-transition-fast),
                box-shadow var(--evya-transition-fast);
}
.ev-field::placeholder { color: var(--ev-gray-400); }
.ev-field:hover { border-color: var(--ev-primary-300); }
.ev-field:focus {
    border-color: var(--ev-primary-600);
    box-shadow: 0 0 0 3px rgba(28, 28, 58, 0.15);
}
.ev-field:disabled { background: var(--ev-gray-100); cursor: not-allowed; opacity: .7; }
.ev-field--error { border-color: var(--evya-danger); }
.ev-field--error:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15); }

textarea.ev-field { resize: vertical; min-height: 80px; padding: 12px 14px; }

.ev-label {
    display: block;
    font-size: var(--evya-text-sm);
    font-weight: 700;
    color: var(--ev-gray-900);
    margin-bottom: 6px;
}
.ev-label .ev-required { color: var(--evya-danger); margin-left: 2px; }

.ev-hint {
    display: block;
    font-size: var(--evya-text-xs);
    color: var(--ev-gray-500);
    margin-top: 6px;
    line-height: 1.4;
}
.ev-hint--error { color: var(--evya-danger); }

.ev-form-group { display: flex; flex-direction: column; }
.ev-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--evya-space-4);
}
.ev-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--evya-space-3);
    margin-top: var(--evya-space-4);
    padding-top: var(--evya-space-4);
    border-top: 1px solid var(--ev-gray-200);
}

/* ══════════════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════════════ */

.ev-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--evya-radius-pill);
    font-size: var(--evya-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.4;
    white-space: nowrap;
}
.ev-badge--neutral { background: var(--ev-gray-100); color: var(--ev-gray-700); }
.ev-badge--primary { background: var(--ev-primary-100); color: var(--ev-primary-700); }
.ev-badge--success { background: var(--evya-success-bg); color: var(--evya-success); }
.ev-badge--warning { background: var(--evya-warning-bg); color: var(--evya-warning); }
.ev-badge--danger  { background: var(--evya-danger-bg);  color: var(--evya-danger); }
.ev-badge--info    { background: var(--evya-info-bg);    color: var(--evya-info); }

/* ══════════════════════════════════════════════════════════════════════
   FLASH MESSAGES (success/error/warning/info)
   ══════════════════════════════════════════════════════════════════════ */

.ev-flash {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 16px;
    border-radius: var(--evya-radius-md);
    border-left: 4px solid;
    font-size: var(--evya-text-sm);
    line-height: 1.45;
}
.ev-flash--success { background: var(--evya-success-bg); border-color: var(--evya-success); color: #14532D; }
.ev-flash--warning { background: var(--evya-warning-bg); border-color: var(--evya-warning); color: #78350F; }
.ev-flash--danger  { background: var(--evya-danger-bg);  border-color: var(--evya-danger);  color: #7F1D1D; }
.ev-flash--info    { background: var(--evya-info-bg);    border-color: var(--evya-info);    color: #1E3A8A; }

/* ══════════════════════════════════════════════════════════════════════
   LIST ROWS (cliquables)
   ══════════════════════════════════════════════════════════════════════ */

.ev-row {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    background: var(--ev-white);
    border-radius: var(--evya-radius-md);
    box-shadow: var(--evya-shadow-sm);
    margin-bottom: 8px;
    cursor: pointer;
    min-height: var(--evya-touch-min);
    transition: background var(--evya-transition-fast),
                transform var(--evya-transition-fast);
}
.ev-row:hover { background: var(--ev-primary-50); }
.ev-row:active { transform: scale(0.99); }
.ev-row__icon {
    font-size: 22px;
    color: var(--ev-primary-600);
    flex-shrink: 0;
}
.ev-row__content { flex: 1; min-width: 0; }
.ev-row__title { font-size: var(--evya-text-base); font-weight: 700; color: var(--ev-gray-900); }
.ev-row__subtitle { font-size: var(--evya-text-xs); color: var(--ev-gray-500); margin-top: 2px; }
.ev-row__arrow { color: var(--ev-gray-400); font-size: 18px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════════
   KPI CARDS (dashboards)
   ══════════════════════════════════════════════════════════════════════ */

.ev-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--evya-space-3);
}
.ev-kpi {
    background: var(--ev-white);
    border-radius: var(--evya-radius-lg);
    padding: var(--evya-space-4);
    box-shadow: var(--evya-shadow-sm);
    border: 1px solid var(--ev-gray-200);
    position: relative;
    overflow: hidden;
}
.ev-kpi__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ev-gray-500);
    font-weight: 700;
    margin: 0 0 6px 0;
}
.ev-kpi__value {
    font-size: 26px;
    font-weight: 800;
    color: var(--ev-gray-900);
    line-height: 1.1;
}
.ev-kpi__trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--evya-text-xs);
    font-weight: 700;
    margin-top: 6px;
}
.ev-kpi__trend--up   { color: var(--evya-success); }
.ev-kpi__trend--down { color: var(--evya-danger); }
.ev-kpi--accent {
    background: linear-gradient(135deg, var(--ev-primary-600) 0%, var(--ev-primary-500) 100%);
    color: var(--ev-on-primary);
    border-color: var(--ev-primary-600);
}
.ev-kpi--accent .ev-kpi__label { color: rgba(255, 255, 255, 0.75); }
.ev-kpi--accent .ev-kpi__value { color: var(--ev-on-primary); }

/* ══════════════════════════════════════════════════════════════════════
   SECTION TITLES
   ══════════════════════════════════════════════════════════════════════ */

.ev-section-title {
    font-size: var(--evya-text-sm);
    font-weight: 800;
    color: var(--ev-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: var(--evya-space-6) 0 var(--evya-space-3) 0;
}
.ev-page-title {
    font-size: var(--evya-text-2xl);
    font-weight: 800;
    color: var(--ev-gray-900);
    margin: 0 0 var(--evya-space-4) 0;
    line-height: 1.2;
}

/* ══════════════════════════════════════════════════════════════════════
   UTILITY (responsive helpers, spacing)
   ══════════════════════════════════════════════════════════════════════ */

.ev-stack { display: flex; flex-direction: column; gap: var(--evya-space-3); }
.ev-stack-sm { display: flex; flex-direction: column; gap: var(--evya-space-2); }
.ev-stack-lg { display: flex; flex-direction: column; gap: var(--evya-space-6); }
.ev-row-flex { display: flex; align-items: center; gap: var(--evya-space-3); }
.ev-spacer { flex: 1; }

/* Muted text */
.ev-muted-text { color: var(--ev-gray-500); }

/* Hidden helpers */
@media (max-width: 639px) { .ev-hide-sm { display: none !important; } }
@media (min-width: 640px) { .ev-only-sm { display: none !important; } }

/* ===== [app.css] ===== */
/* ════════════════════════════════════════════════════════════════
   EVYA Back-office — app.css
   Mobile-first: base = mobile, min-width:768px = tablet/desktop
   ════════════════════════════════════════════════════════════════ */

/* ── Variables ────────────────────────────────────────────────── */
:root {
    /* ══════════════════════════════════════════════════════════════
       DESIGN SYSTEM v2 — ces tokens historiques `--cs-*` sont désormais
       de simples ALIAS des rôles canoniques `--evya-*` (tokens.css).
       Ne PAS y remettre de hex brut : modifier la fondation `--evya-*`.
       Aliasing effectué en Vague 1 (Session 4 admin). Les valeurs
       structurelles divergentes (rayons, transitions) restent littérales.
       ══════════════════════════════════════════════════════════════ */
    /* Backgrounds */
    --cs-bg:            var(--evya-bg-clean);   /* fond admin = blanc cassé propre */
    --cs-surface:       var(--evya-surface-2);
    --cs-card:          var(--evya-surface);

    /* Sidebar — bleu nuit v2 (#081A45) */
    --cs-sidebar:       var(--evya-primary);
    --cs-sidebar-soft:  var(--evya-primary-hover);
    --cs-sidebar-w:     264px;
    --cs-header-h:      56px;

    /* Brand & accent v2 */
    --cs-primary:       var(--evya-primary);
    --cs-primary-dark:  var(--evya-primary-hover);
    --cs-primary-light: var(--evya-primary-container);
    --cs-accent:        var(--evya-accent-bright);   /* or #C9A353 (accent RARE) */

    /* Semantic */
    --cs-success:       var(--evya-success);
    --cs-success-bg:    var(--evya-success-bg);
    --cs-danger:        var(--evya-danger);
    --cs-danger-bg:     var(--evya-danger-bg);
    --cs-warning:       var(--evya-warning);
    --cs-warning-bg:    var(--evya-warning-bg);
    --cs-info:          var(--evya-info);
    --cs-info-bg:       var(--evya-info-bg);

    /* Typography */
    --cs-text:          var(--evya-on-surface);
    --cs-text-soft:     var(--evya-on-surface-med);
    --cs-muted:         var(--evya-on-surface-muted);
    --cs-muted-light:   var(--evya-on-surface-muted);

    /* Borders & shadows */
    --cs-border:        var(--evya-outline);
    --cs-border-soft:   var(--evya-outline);
    --cs-radius:        14px;
    --cs-radius-sm:     8px;
    --cs-radius-lg:     20px;
    --cs-shadow:        var(--evya-e1);
    --cs-shadow-md:     var(--evya-e2);
    --cs-shadow-lg:     var(--evya-e3);

    /* Transitions */
    --cs-transition:    .15s cubic-bezier(.4,0,.2,1);
    --cs-transition-md: .25s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* iOS Safari : pas de grossissement auto du texte (auto-inflation) quand un
   bloc déborde en largeur — évitait des champs/textes « qui grossissent ». */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Pas de zoom d'écran (décision du dirigeant, 2026-10-08) : double appui coupé.
   Le pincement est bloqué par evya-no-zoom.js, le zoom au toucher d'un champ
   par les champs à 16px (section responsive). Un élément qui pose son propre
   touch-action (carte, recadrage) garde le sien, plus restrictif. */
html, body { touch-action: manipulation; }

body {
    margin: 0;
    background: var(--cs-bg);
    color: var(--cs-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Ionicons global ──────────────────────────────────────────── */
ion-icon {
    display: inline-flex;
    width: 1em;
    height: 1em;
    font-size: 1.1em;
    line-height: 1;
    vertical-align: middle;
    pointer-events: none;
    flex-shrink: 0;
}

.has-dynamic-icon {
    display: inline-flex;
    align-items: center;
    gap: .4em;
}

.has-dynamic-icon ion-icon {
    font-size: 1.1em;
    line-height: 1;
}

a {
    color: var(--cs-primary);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════
   MOBILE HEADER  (visible uniquement sous 768px)
   ══════════════════════════════════════════════════════════════ */
.cs-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--cs-header-h);
    padding: 0 16px;
    background: var(--cs-sidebar);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    box-shadow: 0 1px 0 rgba(255,255,255,.06);
}

.cs-mobile-logo {
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0;
}
.cs-mobile-logo span { color: var(--evya-accent-bright); }

.cs-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: rgba(255,255,255,.1);
    color: #fff;
    cursor: pointer;
    padding: 0;
    transition: background .15s;
    flex-shrink: 0;
}
.cs-menu-toggle:hover { background: rgba(255,255,255,.18); }
.cs-menu-toggle ion-icon { width: 22px; height: 22px; font-size: 22px; }

/* Hamburger lines (for browsers that don't render SVG inline well) */
.cs-menu-toggle .bar {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    margin: 3px auto;
    transition: all .25s;
}

/* ══════════════════════════════════════════════════════════════
   OVERLAY (mobile sidebar backdrop)
   ══════════════════════════════════════════════════════════════ */
.cs-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 299;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: fadeIn .2s ease;
}
.cs-overlay.is-visible { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ══════════════════════════════════════════════════════════════
   LAYOUT GRID
   ══════════════════════════════════════════════════════════════ */

/* MOBILE: single column, main pushed below header */
.cs-admin {
    display: block;
    min-height: 100vh;
}

/* DESKTOP: sidebar + main side by side */
@media (min-width: 768px) {
    .cs-admin {
        display: grid;
        grid-template-columns: var(--cs-sidebar-w) 1fr;
    }
    .cs-mobile-header { display: none; }
    .cs-overlay       { display: none !important; }
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════ */
.cs-sidebar {
    background: var(--cs-sidebar);   /* bleu nuit v2, aplat sobre (pas de dégradé décoratif) */
    color: #fff;
    padding: 20px 14px;

    /* Mobile: fixed, off-screen by default */
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--cs-sidebar-w);
    z-index: 300;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 32px rgba(0,0,0,.35);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.12) transparent;
}
.cs-sidebar::-webkit-scrollbar { width: 4px; }
.cs-sidebar::-webkit-scrollbar-track { background: transparent; }
.cs-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

/* Open state (toggled by JS) */
.cs-sidebar.is-open {
    transform: translateX(0);
}

/* Desktop: always visible, static */
@media (min-width: 768px) {
    .cs-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        transform: none !important;
        box-shadow: none;
        overflow-y: auto;
        padding: 24px 18px;
    }
}

/* ── Brand ─── */
.cs-brand { margin-bottom: 28px; padding-top: 4px; }
.cs-brand-title   { font-size: 22px; font-weight: 800; }
.cs-brand-subtitle { margin-top: 4px; color: rgba(255,255,255,.6); font-size: 13px; }

/* ── Nav ─── */
.cs-nav { display: grid; gap: 3px; }

.cs-nav a {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: 10px;
    color: rgba(255,255,255,.72);
    font-weight: 600;
    font-size: 13.5px;
    transition: background var(--cs-transition), color var(--cs-transition), box-shadow var(--cs-transition);
    text-decoration: none;
    gap: 9px;
}
.cs-nav a:hover {
    background: rgba(255,255,255,.09);
    color: #fff;
    text-decoration: none;
}
.cs-nav a.is-active {
    background: rgba(255,255,255,.12);
    color: #fff;
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--evya-accent-bright);   /* liseré or : accent RARE, item actif uniquement */
}

.cs-nav-divider {
    height: 1px;
    background: rgba(255,255,255,.07);
    margin: 10px 4px;
}

.cs-nav-group { display: grid; gap: 2px; }

.cs-nav-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 10px;
    color: #94a3b8;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-size: inherit;
    gap: 8px;
    transition: background var(--cs-transition), color var(--cs-transition);
}
.cs-nav-group-toggle:hover    { background: rgba(255,255,255,.09); color: #e2e8f0; }
.cs-nav-group-toggle.is-open  { background: rgba(255,255,255,.09); color: #e2e8f0; }
.cs-nav-group-toggle .cs-chevron { transition: transform .22s; flex-shrink: 0; opacity: .5; }
.cs-nav-group-toggle.is-open .cs-chevron { transform: rotate(90deg); }

.cs-nav-group-children {
    display: none;
    padding-left: 10px;
    border-left: 2px solid rgba(255,255,255,.08);
    margin-left: 14px;
    margin-top: 2px;
    gap: 1px;
}
.cs-nav-group-children.is-open { display: grid; }
.cs-nav-group-children a {
    font-size: 13px;
    padding: 8px 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
}
.cs-nav-group-children a:hover  { color: #cbd5e1; }
.cs-nav-group-children a.is-active { color: #fff; background: rgba(28,28,58,.3); }

/* Ion-icon in nav */
.cs-nav-icon { display: inline-flex; align-items: center; gap: 9px; flex: 1; }
.cs-nav-icon ion-icon, .cs-nav a > ion-icon, .cs-nav-group-children a > ion-icon {
    font-size: 17px;
    opacity: .85;
    flex-shrink: 0;
}
.cs-nav a.is-active ion-icon,
.cs-nav-group-toggle.is-open .cs-nav-icon ion-icon { opacity: 1; }
.cs-nav-group-children a > ion-icon { font-size: 15px; }

.cs-nav-section { margin-top: 16px; }
.cs-nav-section-label {
    padding: 0 12px 5px;
    font-size: 10px; font-weight: 800;
    letter-spacing: .1em; text-transform: uppercase;
    color: #475569;
}

/* ══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════ */
.cs-main {
    /* Mobile: account for fixed header */
    padding: 16px;
    padding-top: calc(var(--cs-header-h) + 16px);
    min-width: 0; /* prevent grid blowout */
}

@media (min-width: 768px) {
    .cs-main {
        padding: 28px;
        padding-top: 28px;
    }
}

/* ── Topbar ─── */
.cs-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px;
    background: var(--evya-surface);
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-radius);
    margin-bottom: 22px;
    flex-wrap: wrap;
    box-shadow: var(--cs-shadow);
}
.cs-topbar h1 {
    margin: 0;
    font-size: clamp(15px, 2.5vw, 19px);
    font-weight: 800;
    color: var(--cs-text);
    letter-spacing: 0;
}
.cs-topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cs-topbar-user  { display: flex; align-items: center; gap: 8px; }
.cs-topbar-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-primary-dark));
    color: #fff; font-weight: 900; font-size: 14px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cs-topbar-user-name { font-size: 13px; font-weight: 700; color: var(--evya-on-surface); line-height: 1.2; }
.cs-topbar-user-role { font-size: 11px; color: var(--evya-on-surface-muted); text-transform: capitalize; }
.cs-topbar-logout {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px;
    color: var(--evya-on-surface-muted); text-decoration: none; transition: all .15s;
}
.cs-topbar-logout:hover { background: var(--evya-danger-bg); color: var(--evya-danger); }

/* Hide user text on very small screens */
.cs-topbar-user-info { display: none; }
@media (min-width: 480px) { .cs-topbar-user-info { display: block; } }

.cs-topbar-bell-wrap { position: relative; }
.cs-topbar-bell {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px;
    color: var(--evya-on-surface-muted); text-decoration: none; transition: all .15s; position: relative;
}
.cs-topbar-bell:hover { background: var(--evya-surface-variant); color: var(--evya-on-surface); }
.cs-bell-badge {
    position: absolute; top: 3px; right: 3px;
    background: var(--evya-danger); color: #fff; font-size: 9px; font-weight: 900;
    min-width: 16px; height: 16px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px; border: 2px solid var(--evya-surface);
}
.cs-topbar-user { cursor: pointer; border-radius: 10px; padding: 4px 8px; transition: background .15s; }
.cs-topbar-user:hover { background: var(--evya-surface-variant); }

/* ══════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════ */
.cs-card {
    background: var(--cs-card);
    border: 1px solid var(--cs-border);
    border-radius: 16px;                 /* aligné apps (.ds-card) */
    box-shadow: var(--cs-shadow);
    padding: 16px;
    margin-bottom: 16px;
    transition: box-shadow var(--cs-transition), transform var(--cs-transition);
}
/* v2 : l'élévation ne monte au survol que si la carte est cliquable */
a.cs-card:hover,
.cs-card--clickable:hover,
.cs-card[role="button"]:hover { box-shadow: var(--cs-shadow-md); transform: translateY(-1px); }
@media (min-width: 768px) {
    .cs-card { padding: 22px; margin-bottom: 22px; }
}

.cs-card-header {
    display: flex; align-items: center;
    justify-content: space-between; gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.cs-card-title { font-size: 17px; font-weight: 800; color: var(--cs-text); margin: 0; }

/* ══════════════════════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════════════════════ */
.cs-alert {
    padding: 12px 14px;
    border-radius: var(--evya-radius-md);
    margin-bottom: 16px;
    font-weight: 700;
    font-size: 14px;
    border: 1px solid transparent;
}
.cs-alert-success { background: var(--evya-success-bg); color: var(--evya-success); border-color: var(--evya-success-border); }
.cs-alert-error   { background: var(--evya-danger-bg);  color: var(--evya-danger);  border-color: var(--evya-danger-border); }
.cs-alert-warning { background: var(--evya-warning-bg); color: var(--evya-warning); border-color: var(--evya-warning-border); }
.cs-alert-info    { background: var(--evya-info-bg);    color: var(--evya-info);    border-color: var(--evya-info-border); }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.cs-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 48px;       /* v2 : pilule h48 */
    padding: 0 18px;
    border: 1px solid var(--cs-border);
    border-radius: var(--evya-radius-pill);
    background: var(--cs-card);
    color: var(--cs-text);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: border-color .15s, background .15s, transform .15s;
}
.cs-btn:hover { border-color: var(--cs-primary); text-decoration: none; }
.cs-btn:active { transform: scale(0.98); }
.cs-btn:disabled,
.cs-btn[aria-disabled="true"] { opacity: .4; box-shadow: none; cursor: not-allowed; pointer-events: none; }

.cs-btn-primary { background: var(--cs-primary); border-color: var(--cs-primary); color: #fff; box-shadow: 0 6px 18px rgba(8,26,69,.22); }
.cs-btn-primary:hover { background: var(--cs-primary-dark); color: #fff; }

.cs-btn-danger  { color: var(--cs-danger); }
.cs-btn-danger:hover { border-color: var(--cs-danger); background: var(--cs-danger-bg); }

.cs-btn-warning { background: var(--cs-warning-bg); color: var(--cs-warning); border: 1px solid var(--evya-warning-border); }
.cs-btn-warning:hover { filter: brightness(.97); text-decoration: none; }

.cs-btn-success { background: var(--cs-success-bg); color: var(--cs-success); border: 1px solid var(--evya-success-border); }
.cs-btn-success:hover { filter: brightness(.97); text-decoration: none; }

/* or — PREMIUM uniquement (accent RARE) */
.cs-btn-gold { background: var(--evya-accent-bright); color: var(--evya-on-accent); border-color: var(--evya-accent-bright); }
.cs-btn-gold:hover { filter: brightness(.96); text-decoration: none; }

.cs-btn-sm {
    min-height: 38px;       /* v2 : pilule sm 38 */
    padding: 0 14px;
    font-size: 12px;
    border-radius: var(--evya-radius-pill);
    gap: 5px;
}
.cs-btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border-radius: var(--cs-radius-sm); border: 1px solid var(--cs-border);
    background: var(--cs-card); cursor: pointer; font-size: 14px;
    text-decoration: none; transition: background .12s;
}
.cs-btn-icon:hover { background: var(--evya-surface-variant); }

/* ══════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════ */
.cs-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0 0 var(--cs-radius) var(--cs-radius);
}

.cs-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;   /* triggers horizontal scroll before breaking */
    font-variant-numeric: tabular-nums;
}
.cs-table th {
    text-align: left;
    background: var(--evya-surface-variant);
    color: var(--cs-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
.cs-table th,
.cs-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--cs-border);
    vertical-align: middle;
}
.cs-table tbody tr:hover { background: var(--evya-surface-2); }
/* chiffres : alignés à droite, chasse tabulaire (opt-in par cellule) */
.cs-table th.num, .cs-table td.num,
.cs-table th[data-num], .cs-table td[data-num] { text-align: right; font-variant-numeric: tabular-nums; }

@media (min-width: 768px) {
    .cs-table { min-width: 760px; }
    .cs-table th, .cs-table td { padding: 13px 12px; vertical-align: top; }
}

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */
.cs-form { display: grid; gap: 16px; }

.cs-form-grid {
    display: grid;
    grid-template-columns: 1fr;   /* mobile: 1 col */
    gap: 14px;
}
@media (min-width: 600px) {
    .cs-form-grid {
        grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
        gap: 18px;
    }
}

.cs-field label,
.cs-field > span {
    display: block;
    margin-bottom: 7px;
    color: var(--cs-text);
    font-weight: 700;
}

/* Native form elements — v2 : champ h52, radius md, bordure outline-strong */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="tel"],
select,
textarea {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: 1.5px solid var(--evya-outline-strong);
    border-radius: var(--evya-radius-md);
    background: var(--cs-card);
    color: var(--cs-text);
    font: inherit;
    font-size: 16px;    /* prevents iOS auto-zoom */
    transition: border-color .15s, box-shadow .15s;
}
@media (min-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    input[type="tel"],
    select,
    textarea { font-size: inherit; }
}

textarea { min-height: 110px; resize: vertical; }

/* focus souris = halo primary 18 % (le clavier garde l'anneau global de tokens.css) */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--cs-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--evya-primary) 18%, transparent);
}

input[type="checkbox"],
input[type="radio"] {
    width: 20px !important; height: 20px !important;
    min-width: 20px !important; min-height: 20px !important;
    margin: 0 !important; padding: 0 !important;
    accent-color: var(--cs-primary);
}

.cs-check { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }

/* Named input classes — v2 : champ h52, radius md, bordure outline-strong */
.cs-input, .cs-select {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: 1.5px solid var(--evya-outline-strong);
    border-radius: var(--evya-radius-md);
    background: var(--cs-card);
    color: var(--cs-text);
    font: inherit;
    font-size: 16px;
    transition: border-color .15s, box-shadow .15s;
}
@media (min-width: 768px) {
    .cs-input, .cs-select { font-size: 14px; }
}
.cs-input:focus, .cs-select:focus {
    outline: none;
    border-color: var(--cs-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--evya-primary) 18%, transparent);
}
/* variante remplie sur surface calme */
.cs-input--filled, .cs-select--filled { background: var(--evya-surface-variant); border-color: transparent; }
.cs-input--filled:focus, .cs-select--filled:focus { background: var(--cs-card); }
/* état erreur */
.cs-input--error, .cs-select--error, .cs-input.is-invalid, .cs-select.is-invalid { border-color: var(--cs-danger); }
.cs-input--error:focus, .cs-select--error:focus,
.cs-input.is-invalid:focus, .cs-select.is-invalid:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--evya-danger) 18%, transparent); }

.cs-label { display: block; font-size: 13px; font-weight: 700; color: var(--cs-text); margin-bottom: 5px; }
.cs-required { color: var(--cs-danger); }
.cs-hint { font-size: 11px; color: var(--cs-muted); display: block; margin-top: 3px; }

.cs-form-group { display: flex; flex-direction: column; gap: 5px; }
.cs-form-group--full { grid-column: 1 / -1; }

.cs-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border-top: 1px solid var(--cs-border);
    padding-top: 16px;
    margin-top: 4px;
}
@media (min-width: 600px) {
    .cs-form-actions { justify-content: flex-end; }
}

fieldset  { border: 1px solid var(--cs-border); border-radius: var(--cs-radius); padding: 18px; }
legend    { padding: 0 8px; font-weight: 850; }

/* ══════════════════════════════════════════════════════════════
   KPI / STATS GRIDS
   ══════════════════════════════════════════════════════════════ */
.cs-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 640px) {
    .cs-stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; }
}

.cs-stat {
    background: var(--evya-surface);
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-radius);
    padding: 16px;
    box-shadow: var(--cs-shadow);
}
@media (min-width: 768px) { .cs-stat { padding: 20px; } }

.cs-stat-value { font-size: 26px; font-weight: 850; }
@media (min-width: 768px) { .cs-stat-value { font-size: 30px; } }
.cs-stat-label { margin-top: 6px; color: var(--cs-muted); font-weight: 700; }

.cs-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 640px) {
    .cs-kpi-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
}

.cs-kpi-card {
    display: flex; align-items: center; gap: 12px;
    background: var(--evya-surface); border: 1.5px solid var(--evya-outline);
    border-radius: 16px; padding: 14px 12px;
    border-left-width: 4px;
}
@media (min-width: 768px) { .cs-kpi-card { padding: 18px 16px; gap: 14px; } }

.cs-kpi-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cs-kpi-icon svg, .cs-kpi-icon ion-icon { width: 18px; height: 18px; }
@media (min-width: 768px) { .cs-kpi-icon { width: 40px; height: 40px; } .cs-kpi-icon svg, .cs-kpi-icon ion-icon { width: 20px; height: 20px; } }

.cs-kpi-value { font-size: 20px; font-weight: 900; color: var(--evya-on-surface); line-height: 1; }
@media (min-width: 768px) { .cs-kpi-value { font-size: 22px; } }
.cs-kpi-label { font-size: 10px; color: var(--evya-on-surface-muted); margin-top: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

/* teintes catégorielles (accent décoratif KPI, pas de rôle d'état v2 — cf. badges) */
.cs-kpi-emerald { border-left-color: #10b981; }
.cs-kpi-emerald .cs-kpi-icon { background: #d1fae5; color: #059669; }
.cs-kpi-blue    { border-left-color: #3b82f6; }
.cs-kpi-blue    .cs-kpi-icon { background: #dbeafe; color: #2563eb; }
.cs-kpi-teal    { border-left-color: #14b8a6; }
.cs-kpi-teal    .cs-kpi-icon { background: #ccfbf1; color: #0d9488; }
.cs-kpi-violet  { border-left-color: #8b5cf6; }
.cs-kpi-violet  .cs-kpi-icon { background: #ede9fe; color: #7c3aed; }
.cs-kpi-indigo  { border-left-color: #6366f1; }
.cs-kpi-indigo  .cs-kpi-icon { background: #e0e7ff; color: #4338ca; }
.cs-kpi-orange  { border-left-color: #f97316; }
.cs-kpi-orange  .cs-kpi-icon { background: #ffedd5; color: #ea580c; }

/* ══════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════ */
.cs-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: var(--evya-radius-pill);
    background: var(--evya-surface-variant); color: var(--evya-on-surface-med);
    font-size: 12px; font-weight: 800;
    white-space: nowrap;
}
.cs-badge-success { background: var(--cs-success-bg); color: var(--cs-success); }
.cs-badge-danger  { background: var(--cs-danger-bg);  color: var(--cs-danger); }
.cs-badge-warning { background: var(--cs-warning-bg); color: var(--cs-warning); }
.cs-badge-info    { background: var(--cs-info-bg);    color: var(--cs-info); }
.cs-badge-muted   { background: var(--evya-surface-variant); color: var(--evya-on-surface-muted); }
.cs-badge-neutral { background: var(--evya-surface-variant); color: var(--evya-on-surface-muted); } /* = muted, mais AVEC pastille (parité ds-badge--neutral, badges dynamiques _status-filter) */
.cs-badge-orange  { background: #ffedd5; color: #ea580c; } /* catégoriel legacy (pas de rôle v2) */
.cs-badge-violet  { background: #ede9fe; color: #7c3aed; } /* catégoriel legacy (pas de rôle v2) */
.cs-badge-teal    { background: #ccfbf1; color: #0d9488; } /* catégoriel legacy (pas de rôle v2) */
.cs-badge-primary { background: var(--evya-primary-container); color: var(--evya-primary); }
.cs-badge-gold    { background: var(--evya-accent-container); color: var(--evya-on-accent-container); } /* premium / certifié uniquement */
/* pastille d'état (point coloré avant le libellé) */
.cs-badge-success::before, .cs-badge-danger::before, .cs-badge-warning::before,
.cs-badge-info::before, .cs-badge-gold::before, .cs-badge-neutral::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   FILTER TABS
   ══════════════════════════════════════════════════════════════ */
.cs-filter-tabs {
    /* Une seule ligne qui défile latéralement (surtout mobile), jamais de retour à la ligne. */
    display: flex; gap: 4px; flex-wrap: nowrap;
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
    background: var(--evya-surface-variant); border-radius: var(--evya-radius-md); padding: 3px;
}
.cs-filter-tabs::-webkit-scrollbar { height: 5px; }
.cs-filter-tabs::-webkit-scrollbar-thumb { background: var(--cs-border); border-radius: 4px; }
.cs-filter-tab {
    flex: 0 0 auto;
    padding: 7px 12px; border-radius: var(--cs-radius-sm);
    font-size: 13px; font-weight: 600; color: var(--cs-muted);
    text-decoration: none; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all .15s;
}
.cs-filter-tab:hover { color: var(--cs-text); text-decoration: none; }
.cs-filter-tab.is-active {
    background: var(--cs-card); color: var(--cs-primary);
    box-shadow: var(--cs-shadow);
}
.cs-filter-count {
    background: var(--evya-surface-variant); color: var(--cs-muted); font-size: 11px; font-weight: 700;
    min-width: 18px; height: 18px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}
.cs-filter-tab.is-active .cs-filter-count { background: var(--cs-primary-light); color: var(--cs-primary); }

/* ══════════════════════════════════════════════════════════════
   TABS
   ══════════════════════════════════════════════════════════════ */
.cs-tabs {
    /* Onglets : UNE seule ligne qui défile latéralement (jamais de retour à la
       ligne), pour ne pas empiler les onglets sur plusieurs rangées. */
    display: flex; gap: 4px; flex-wrap: nowrap;
    border-bottom: 1px solid var(--cs-border);
    margin-bottom: 20px;
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.cs-tabs::-webkit-scrollbar { height: 5px; }
.cs-tabs::-webkit-scrollbar-thumb { background: var(--cs-border); border-radius: 4px; }
.cs-tab {
    flex: 0 0 auto;                 /* garde sa largeur : le rail d'onglets défile */
    padding: 10px 16px; border-radius: 0;
    font-weight: 700; color: var(--cs-muted); cursor: pointer;
    border: none; background: none; font-size: 13px;
    margin-bottom: -1px; border-bottom: 3px solid transparent;   /* v2 : soulignement primary 3px */
    white-space: nowrap;
    transition: color .15s, border-color .15s;
}
.cs-tab:hover { color: var(--cs-primary); }
.cs-tab.is-active { color: var(--cs-primary); border-bottom-color: var(--cs-primary); background: transparent; }
.cs-tab-panel { display: none; }
.cs-tab-panel.is-active { display: block; }

/* ══════════════════════════════════════════════════════════════
   DETAIL / SHOW LAYOUT
   ══════════════════════════════════════════════════════════════ */
.cs-detail-grid {
    display: grid;
    grid-template-columns: 1fr;  /* mobile: stack */
    gap: 16px;
    align-items: start;
}
@media (min-width: 900px) {
    .cs-detail-grid { grid-template-columns: 2fr 1fr; gap: 20px; }
}

.cs-detail-section {
    background: var(--evya-surface-variant); border: 1px solid var(--evya-outline);
    border-radius: 12px; padding: 14px; margin-bottom: 12px;
}
.cs-detail-section-title {
    font-size: 11px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .06em; color: var(--evya-on-surface-muted); margin-bottom: 10px;
}
.cs-detail-row {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--evya-outline); font-size: 13px;
}
.cs-detail-row:last-child { border-bottom: none; }
.cs-detail-key { color: var(--evya-on-surface-med); flex-shrink: 0; }
.cs-detail-val { font-weight: 600; color: var(--evya-on-surface); text-align: right; }

/* ══════════════════════════════════════════════════════════════
   TIMELINE
   ══════════════════════════════════════════════════════════════ */
.cs-timeline { position: relative; padding-left: 20px; }
.cs-timeline::before {
    content: ''; position: absolute;
    left: 6px; top: 0; bottom: 0;
    width: 2px; background: var(--evya-outline);
}
.cs-timeline-item { position: relative; padding-bottom: 18px; }
.cs-timeline-item::before {
    content: ''; position: absolute;
    left: -17px; top: 4px;
    width: 10px; height: 10px;
    border-radius: 50%; background: var(--evya-outline); border: 2px solid var(--evya-surface);
}
.cs-timeline-item.is-done::before     { background: var(--evya-success); }
.cs-timeline-item.is-current::before  { background: var(--cs-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--evya-primary) 20%, transparent); }
.cs-timeline-item.is-cancelled::before{ background: var(--evya-danger); }
.cs-timeline-label { font-size: 13px; font-weight: 700; color: var(--evya-on-surface); }
.cs-timeline-date  { font-size: 11px; color: var(--evya-on-surface-muted); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════
   SECTION TITLE
   ══════════════════════════════════════════════════════════════ */
.cs-section-title {
    font-size: 15px; font-weight: 800;
    margin: 20px 0 12px;
    padding-bottom: 8px; border-bottom: 1px solid var(--cs-border);
    color: var(--cs-text);
}
.cs-section-title:first-child { margin-top: 0; }

/* ══════════════════════════════════════════════════════════════
   MISC UTILITIES
   ══════════════════════════════════════════════════════════════ */
.cs-muted    { color: var(--cs-muted); }
.cs-row      { display: flex; align-items: center; gap: 12px; }

.cs-code {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 13px; background: var(--evya-surface-variant);
    border: 1px solid var(--cs-border); border-radius: 8px;
    padding: 8px 12px; overflow-wrap: anywhere;
}

.cs-order-doc {
    background: #f8fafc; border: 1px solid var(--cs-border);
    border-radius: 12px; padding: 16px;
}
.cs-order-doc-title {
    font-weight: 800; margin-bottom: 10px; font-size: 13px;
    text-transform: uppercase; letter-spacing: .04em; color: var(--cs-muted);
}

.cs-page-content { min-height: 300px; font-family: inherit; resize: vertical; }

.cs-color-preview {
    display: inline-block; width: 32px; height: 32px;
    border-radius: 8px; border: 1px solid var(--cs-border);
    vertical-align: middle; margin-left: 8px;
}

/* ══════════════════════════════════════════════════════════════
   TOGGLE SWITCH
   ══════════════════════════════════════════════════════════════ */
.cs-toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.cs-toggle input { opacity: 0; width: 0 !important; height: 0 !important; min-width: 0 !important; min-height: 0 !important; }
.cs-toggle-slider {
    position: absolute; inset: 0; background: var(--evya-outline-strong);
    border-radius: 999px; cursor: pointer; transition: background .2s;
}
.cs-toggle-slider::before {
    content: ''; position: absolute;
    width: 18px; height: 18px; left: 3px; top: 3px;
    background: var(--evya-surface); border-radius: 50%;
    transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.cs-toggle input:checked + .cs-toggle-slider          { background: var(--cs-primary); }
.cs-toggle input:checked + .cs-toggle-slider::before  { transform: translateX(20px); }

/* ══════════════════════════════════════════════════════════════
   MEDIA LIBRARY
   ══════════════════════════════════════════════════════════════ */
.cs-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}
@media (min-width: 768px) {
    .cs-media-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
}

.cs-media-item {
    border: 2px solid var(--cs-border); border-radius: 12px;
    overflow: hidden; background: #f8fafc; cursor: pointer; position: relative;
}
.cs-media-item:hover      { border-color: var(--cs-primary); }
.cs-media-item img        { width: 100%; height: 110px; object-fit: cover; display: block; }
.cs-media-placeholder     { width: 100%; height: 110px; display: flex; align-items: center; justify-content: center; font-size: 32px; background: #e2e8f0; }
.cs-media-item-info       { padding: 6px 8px; font-size: 11px; color: var(--cs-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-media-item.is-selected{ border-color: var(--cs-primary); box-shadow: 0 0 0 3px rgba(28,28,58,.2); }
.cs-media-item .cs-media-check {
    position: absolute; top: 8px; right: 8px;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--cs-primary); color: #fff;
    display: none; align-items: center; justify-content: center; font-size: 13px;
}
.cs-media-item.is-selected .cs-media-check { display: flex; }

.cs-upload-zone {
    border: 2px dashed var(--cs-border); border-radius: var(--cs-radius);
    padding: 32px 16px; text-align: center; color: var(--cs-muted);
    cursor: pointer; transition: border-color .15s, background .15s;
}
.cs-upload-zone:hover, .cs-upload-zone.is-drag {
    border-color: var(--cs-primary); background: #eff6ff; color: var(--cs-primary);
}
.cs-upload-zone input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer;
    width: 100%; min-height: unset;
}
.cs-upload-zone-inner { position: relative; }

.cs-media-picker-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cs-media-picker-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cs-media-picker-input-row > input,
.cs-media-picker-input-row > select {
    flex: 1;
    min-width: 0;
}

.cs-media-field-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 148px;
    min-height: 82px;
    border: 1px solid var(--cs-border);
    border-radius: 8px;
    background: #f8fafc;
    overflow: hidden;
}

.cs-media-field-preview.is-empty {
    display: none;
}

.cs-media-field-preview img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    display: block;
}

.cs-media-picker-open {
    overflow: hidden;
}

.cs-media-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, .62);
}

.cs-media-picker-modal[hidden] {
    display: none;
}

.cs-media-picker-dialog {
    width: min(1040px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
    background: var(--cs-surface);
    border: 1px solid var(--cs-border);
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
    overflow: hidden;
}

.cs-media-picker-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--cs-border);
}

.cs-media-picker-header h2 {
    margin: 0;
    font-size: 18px;
}

.cs-media-picker-header p {
    margin: 4px 0 0;
    color: var(--cs-muted);
    font-size: 13px;
}

.cs-media-picker-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--cs-muted);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.cs-media-picker-close:hover {
    background: var(--evya-surface-variant);
    color: var(--cs-text);
}

.cs-media-picker-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px 22px;
    border-bottom: 1px solid var(--cs-border);
}

.cs-media-picker-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    border: 1px solid var(--cs-border);
    border-radius: 8px;
    padding: 0 10px;
    background: #fff;
}

.cs-media-picker-search input {
    min-height: 38px;
    border: 0;
    padding: 0;
}

.cs-media-picker-upload {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cs-media-picker-upload input[type="file"] {
    max-width: 230px;
    min-height: 38px;
}

.cs-media-picker-status {
    min-height: 20px;
    padding: 8px 22px 0;
    color: var(--cs-muted);
    font-size: 13px;
}

.cs-media-picker-status[data-type="error"] {
    color: #dc2626;
}

.cs-media-picker-status[data-type="success"] {
    color: #16a34a;
}

.cs-media-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    padding: 16px 22px 22px;
    overflow: auto;
}

.cs-media-picker-item {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 2px solid var(--cs-border);
    border-radius: 10px;
    background: #f8fafc;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.cs-media-picker-item:hover,
.cs-media-picker-item:focus {
    border-color: var(--cs-primary);
    outline: none;
}

.cs-media-picker-item img {
    width: 100%;
    height: 118px;
    object-fit: cover;
    background: #e2e8f0;
}

.cs-media-picker-item.is-broken img {
    display: none;
}

.cs-media-picker-name,
.cs-media-picker-meta {
    display: block;
    padding: 7px 9px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.cs-media-picker-meta {
    padding-top: 2px;
    padding-bottom: 8px;
    color: var(--cs-muted);
    font-size: 11px;
}

@media (max-width: 720px) {
    .cs-media-picker-modal {
        padding: 0;
        align-items: stretch;
    }

    .cs-media-picker-dialog {
        max-height: 100vh;
        border-radius: 0;
    }

    .cs-media-picker-toolbar {
        grid-template-columns: 1fr;
    }

    .cs-media-picker-upload {
        flex-wrap: wrap;
    }

    .cs-media-picker-input-row {
        align-items: stretch;
        flex-direction: column;
    }
}

/* ══════════════════════════════════════════════════════════════
   PRICE BADGE (reservations form live calc)
   ══════════════════════════════════════════════════════════════ */
.cs-price-badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.cs-price-badge-auto    { background: #d1fae5; color: #059669; }
.cs-price-badge-loading { background: #fef9c3; color: #92400e; }

/* Fix nav public */
.site-nav {
    background: #000 !important;
}


/* === PAGE circuits CSS MIGRATED === */
.circuits-page {
    padding-top: 80px;
    background: var(--site-surface, #fff);
}

.circuits-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

.circuits-hero {
    background: linear-gradient(135deg, var(--site-hero-start, #060b18) 60%, var(--site-hero-end, #0f1f3d) 100%);
    padding: 72px 0;
    text-align: center;
}

.circuits-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gold, #c9a353);
    margin: 0 0 12px;
}

.circuits-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: var(--text, #fff);
    margin: 0 0 16px;
}

.circuits-hero p {
    color: var(--muted, rgba(255, 255, 255, .65));
    font-size: 1.1rem;
    max-width: 720px;
    margin: 0 auto 28px;
    line-height: 1.7;
}

.circuits-main-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gold, #c9a353);
    color: var(--site-button-text, #060b18);
    padding: 14px 32px;
    border-radius: var(--radius, 6px);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
}

.circuits-list-section {
    padding: 60px 0;
    background: var(--site-section-light, #f8f9fa);
}

.circuits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

.circuit-card {
    background: var(--site-surface, #fff);
    border-radius: 14px;
    padding: 28px 22px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    border: 1px solid var(--site-border, rgba(6,11,24,.06));
}

.circuit-card-icon {
    font-size: 30px;
    margin-bottom: 14px;
}

.circuit-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--site-ink, #060b18);
    margin: 0 0 8px;
}

.circuit-card-text {
    font-size: .92rem;
    color: var(--site-muted, #6b7280);
    margin: 0 0 16px;
    line-height: 1.6;
}

.circuit-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.circuit-card-meta span {
    font-size: 13px;
    color: var(--site-muted, #6b7280);
    background: var(--site-surface-alt, #f2f4f7);
    border-radius: 999px;
    padding: 7px 10px;
}

.circuit-card-link {
    font-size: 13px;
    font-weight: 800;
    color: var(--gold, #c9a353);
    text-decoration: none;
}

.circuits-cta {
    background: var(--dark, #060b18);
    padding: 64px 0;
    text-align: center;
}

.circuits-cta h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--text, #fff);
    margin: 0 0 12px;
}

.circuits-cta p {
    color: var(--muted, rgba(255,255,255,.62));
    margin: 0 0 28px;
}


/* === PAGE transferts CSS MIGRATED === */
.transfers-page {
    padding-top: 80px;
    background: var(--site-surface, #fff);
}

.transfers-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

.transfers-hero {
    background: linear-gradient(135deg, var(--site-hero-start, #060b18) 60%, var(--site-hero-end, #0f1f3d) 100%);
    padding: 72px 0;
    text-align: center;
}

.transfers-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gold, #c9a353);
    margin: 0 0 12px;
}

.transfers-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: var(--text, #fff);
    margin: 0 0 16px;
}

.transfers-hero p {
    color: var(--muted, rgba(255, 255, 255, .65));
    font-size: 1.1rem;
    max-width: 720px;
    margin: 0 auto 28px;
    line-height: 1.7;
}

.transfers-main-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gold, #c9a353);
    color: var(--site-button-text, #060b18);
    padding: 14px 32px;
    border-radius: var(--radius, 6px);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
}

.transfers-intro {
    padding: 54px 0 26px;
    text-align: center;
}

.transfers-intro h2,
.transfers-section-heading h2,
.transfers-cta h2 {
    font-size: clamp(1.45rem, 3vw, 2.1rem);
    color: var(--site-ink, #060b18);
    margin: 0 0 12px;
}

.transfers-intro p {
    color: var(--site-muted, #6b7280);
    max-width: 760px;
    margin: 0 auto;
    line-height: 1.7;
}

.transfers-list-section {
    padding: 42px 0 60px;
    background: var(--site-section-light, #f8f9fa);
}

.transfers-list-section-alt {
    background: var(--site-surface, #fff);
}

.transfers-section-heading {
    margin-bottom: 24px;
}

.transfers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

.transfer-card {
    background: var(--site-surface, #fff);
    border-radius: 14px;
    padding: 28px 22px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    border: 1px solid var(--site-border, rgba(6,11,24,.06));
}

.transfers-list-section-alt .transfer-card {
    background: var(--site-section-light, #f8f9fa);
}

.transfer-card-icon {
    font-size: 30px;
    margin-bottom: 14px;
}

.transfer-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--site-ink, #060b18);
    margin: 0 0 8px;
}

.transfer-card-route {
    font-size: .85rem;
    color: var(--site-muted, #6b7280);
    margin: 0 0 10px;
    font-weight: 700;
}

.transfer-card-text {
    font-size: .92rem;
    color: var(--site-muted, #6b7280);
    margin: 0 0 16px;
    line-height: 1.6;
}

.transfer-card-price {
    font-weight: 800;
    color: var(--site-ink, #060b18);
    margin: 0 0 14px;
}

.transfer-card-link {
    font-size: 13px;
    font-weight: 800;
    color: var(--gold, #c9a353);
    text-decoration: none;
}

.transfers-cta {
    background: var(--dark, #060b18);
    padding: 64px 0;
    text-align: center;
}

.transfers-cta h2 {
    color: var(--text, #fff);
}

.transfers-cta p {
    color: var(--muted, rgba(255,255,255,.62));
    margin: 0 0 28px;
}

/* === FIX GLOBAL NAV PUBLIC === */
.site-nav {
    background: var(--site-nav-bg, #060b18) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.site-nav a,
.site-nav .nav-link,
.site-nav .brand,
.site-nav .nav-brand {
    color: var(--text, #fff) !important;
}

.site-nav a:hover,
.site-nav .nav-link:hover {
    color: var(--gold, #c9a353) !important;
}

/* =========================================================
   Mobile navigation independent final fix
   ========================================================= */

.evya-mobile-toggle,
.evya-mobile-drawer,
.evya-mobile-overlay {
  display: none;
}

@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .evya-mobile-hide-reserve {
    display: none !important;
  }

  .evya-mobile-toggle {
    position: fixed !important;
    top: 14px !important;
    right: 14px !important;
    z-index: 99999 !important;
    display: inline-flex !important;
    width: 46px !important;
    height: 46px !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 5px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 14px !important;
    border: 1px solid rgba(var(--gold-rgb, 201, 163, 83), 0.5) !important;
    background: color-mix(in srgb, var(--site-nav-bg, #060b18) 96%, transparent) !important;
    box-shadow: 0 10px 28px rgba(0,0,0,0.28) !important;
    cursor: pointer !important;
  }

  .evya-mobile-toggle span {
    display: block !important;
    width: 22px !important;
    height: 2px !important;
    border-radius: 99px !important;
    background: var(--text, #ffffff) !important;
  }

  .evya-mobile-drawer {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 99998 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: min(84vw, 340px) !important;
    height: 100dvh !important;
    padding: 96px 22px 24px !important;
    background: var(--site-nav-bg, #060b18) !important;
    border-left: 1px solid rgba(var(--gold-rgb, 201, 163, 83),0.22) !important;
    box-shadow: -24px 0 70px rgba(0,0,0,0.55) !important;
    transform: translateX(105%) !important;
    transition: transform 220ms ease !important;
  }

  body.evya-menu-open .evya-mobile-drawer {
    transform: translateX(0) !important;
  }

  .evya-mobile-drawer a {
    display: block !important;
    width: 100% !important;
    padding: 14px 15px !important;
    border-radius: 14px !important;
    color: var(--text, #ffffff) !important;
    background: rgba(255,255,255,0.055) !important;
    text-decoration: none !important;
    font-size: 17px !important;
    font-weight: 800 !important;
  }

  .evya-mobile-drawer a:hover {
    color: var(--gold, #c9a353) !important;
    background: rgba(var(--gold-rgb, 201, 163, 83),0.14) !important;
  }

  .evya-mobile-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99997 !important;
    display: block !important;
    background: rgba(0,0,0,0.48) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 220ms ease !important;
  }

  body.evya-menu-open .evya-mobile-overlay {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body.evya-menu-open {
    overflow: hidden !important;
  }
}

@media (min-width: 769px) {
  .evya-mobile-toggle,
  .evya-mobile-drawer,
  .evya-mobile-overlay {
    display: none !important;
  }
}


/* =========================================================
   Ionicons v7 display layer
   ========================================================= */

.has-dynamic-icon,
.cs-btn,
.ev-btn,
.dv-btn,
.btn,
.cs-link-small,
.cs-alert-link,
.cs-quick-btn,
.sidebar-link,
.login-btn,
.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: .45em;
}

.cs-btn ion-icon,
.ev-btn ion-icon,
.dv-btn ion-icon,
.btn ion-icon,
.cs-link-small ion-icon,
.cs-alert-link ion-icon,
.sidebar-link ion-icon,
.login-btn ion-icon,
.logout-btn ion-icon {
  color: currentColor;
  font-size: 1.1em;
}

.cs-btn-icon ion-icon,
.cs-activity-edit ion-icon {
  color: currentColor;
  font-size: 18px;
}

.cs-menu-toggle ion-icon,
.cs-topbar-bell ion-icon,
.cs-topbar-logout ion-icon {
  font-size: 20px;
}

.cs-nav .cs-chevron {
  width: 14px;
  height: 14px;
  font-size: 14px;
}

.cs-kpi-icon ion-icon,
.cs-quick-btn ion-icon {
  width: 20px;
  height: 20px;
  font-size: 20px;
}

.ev-empty-icon ion-icon,
.dv-empty-icon ion-icon {
  color: currentColor;
}

.footer-social-link ion-icon {
  width: 16px;
  height: 16px;
  font-size: 16px;
}

.icon-circle {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  background: rgba(var(--gold-rgb, 201, 163, 83), 0.12);
  color: var(--gold, #c9a353);
  font-size: 1.25rem;
  margin-right: 0;
}

.icon-css,
.icon-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

/* =========================================================
   EVYA mobile UX hardening
   Shared admin/franchise + public guardrails
   ========================================================= */

.cs-alert-danger { background: var(--evya-danger-bg); color: var(--evya-danger); border-color: var(--evya-danger-border); }
.cs-field-full { grid-column: 1 / -1; }

.cs-main,
.cs-card,
.cs-table-wrap,
.cs-detail-val,
.cs-detail-row,
.cs-form,
.cs-row {
  min-width: 0;
}

.cs-main img,
.cs-main video,
.cs-main iframe {
  max-width: 100%;
  height: auto;
}

.cs-main .card {
  background: var(--cs-card);
  border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius);
  box-shadow: var(--cs-shadow);
  overflow: hidden;
  margin-bottom: 16px;
}

.cs-main .card-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--cs-border);
}

.cs-main .card-header h1,
.cs-main .card-header h2,
.cs-main .card-header h3 {
  margin: 0;
}

.cs-main .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cs-main .table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
  font-variant-numeric: tabular-nums;
}

.cs-main .table th,
.cs-main .table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--cs-border);
  vertical-align: top;
}

.cs-main .table th {
  text-align: left;
  background: var(--evya-surface-variant);
  color: var(--cs-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.cs-main .table tbody tr:hover { background: var(--evya-surface-2); }

/* v2 : pilule h48 */
.cs-main .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--cs-border);
  border-radius: var(--evya-radius-pill);
  background: var(--cs-card);
  color: var(--cs-text);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.cs-main .btn:hover { text-decoration: none; border-color: var(--cs-primary); }
.cs-main .btn:disabled,
.cs-main .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; pointer-events: none; }
.cs-main .btn-primary { background: var(--cs-primary); border-color: var(--cs-primary); color: #fff; }
.cs-main .btn-secondary { background: var(--evya-surface-variant); color: var(--evya-on-surface); border-color: var(--cs-border); }
.cs-main .btn-danger { background: var(--cs-danger-bg); border-color: var(--evya-danger-border); color: var(--cs-danger); }

/* v2 : champ h52, radius md, bordure outline-strong */
.cs-main .form-control {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1.5px solid var(--evya-outline-strong);
  border-radius: var(--evya-radius-md);
  background: var(--cs-card);
  color: var(--cs-text);
  font: inherit;
  font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.cs-main .form-control:focus {
  outline: none;
  border-color: var(--cs-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--evya-primary) 18%, transparent);
}
.cs-main .form-control.is-invalid { border-color: var(--cs-danger); }

.cs-detail-val,
.cs-table td,
.cs-code,
.cs-card-title,
.cs-topbar h1 {
  overflow-wrap: anywhere;
}

/* ── Filet de sécurité responsive des tableaux ─────────────────────────────
   Sous 767px, `.cs-main { overflow-x: hidden }` (plus bas) tronquait toute
   table plus large que l'écran non convertie en cartes (`.ds-table`,
   `.data-table`, `.fin-tbl`, tables brutes) : les colonnes de droite
   devenaient invisibles ET non-scrollables. hydrateResponsiveTables() (layout
   admin.php) enveloppe désormais en JS chaque table non déjà scrollable dans
   ce conteneur, qui rétablit un scroll horizontal propre à toutes les tailles.
   Inerte pour les tables converties en cartes (elles passent en display:block). */
.cs-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 767px) {
  .cs-main {
    padding: 12px;
    padding-top: calc(var(--cs-header-h) + 12px);
    overflow-x: hidden;
  }

  .cs-mobile-header {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-top: env(safe-area-inset-top);
    height: calc(var(--cs-header-h) + env(safe-area-inset-top));
  }

  .cs-menu-toggle,
  .cs-mobile-header a {
    min-width: 44px;
    min-height: 44px;
  }

  .cs-sidebar {
    width: min(86vw, var(--cs-sidebar-w));
    padding-top: calc(18px + env(safe-area-inset-top));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .cs-nav a,
  .cs-nav-group-toggle,
  .cs-nav-group-children a {
    min-height: 42px;
  }

  .cs-topbar {
    padding: 10px 12px;
    margin-bottom: 14px;
    border-radius: 12px;
    box-shadow: none;
  }

  .cs-topbar-right {
    display: none;
  }

  .cs-topbar h1 {
    font-size: 17px;
    line-height: 1.25;
  }

  .cs-alert {
    overflow-wrap: anywhere;
  }

  .cs-alert a {
    margin-left: 0 !important;
  }

  .cs-card {
    padding: 14px;
    margin-bottom: 14px;
    border-radius: 12px;
  }

  .cs-card-header {
    align-items: flex-start;
  }

  .cs-actions,
  .cs-form-actions,
  .cs-row {
    align-items: stretch;
  }

  .cs-btn,
  .cs-btn-sm,
  .cs-btn-icon,
  .cs-filter-tab,
  .cs-tab {
    min-height: 44px;
  }

  .cs-btn,
  .cs-btn-sm {
    white-space: normal;
    text-align: center;
    line-height: 1.25;
  }

  .cs-btn-icon {
    width: 44px;
    height: 44px;
  }

  .cs-form-actions .cs-btn,
  .cs-actions .cs-btn {
    flex: 1 1 auto;
  }

  .cs-stats,
  .cs-kpi-grid {
    grid-template-columns: 1fr;
  }

  .cs-detail-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .cs-detail-val {
    text-align: left;
  }

  .cs-table-wrap {
    overflow-x: visible;
    border-radius: 0;
  }

  .cs-main table.cs-table,
  .cs-main table.table {
    min-width: 0 !important;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .cs-main table.cs-table thead,
  .cs-main table.table thead {
    display: none;
  }

  .cs-main table.cs-table tbody,
  .cs-main table.cs-table tr,
  .cs-main table.cs-table td,
  .cs-main table.table tbody,
  .cs-main table.table tr,
  .cs-main table.table td {
    display: block;
    width: 100%;
  }

  .cs-main table.cs-table tr,
  .cs-main table.table tr {
    background: var(--cs-card);
    border: 1px solid var(--cs-border);
    border-radius: 12px;
    box-shadow: var(--cs-shadow);
    overflow: hidden;
  }

  .cs-main table.cs-table td,
  .cs-main table.table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--cs-border-soft);
    white-space: normal !important;
    text-align: left !important;
  }

  .cs-main table.cs-table td:last-child,
  .cs-main table.table td:last-child {
    border-bottom: 0;
  }

  .cs-main table.cs-table td::before,
  .cs-main table.table td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    max-width: 42%;
    color: var(--cs-muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .cs-main table.cs-table td[colspan],
  .cs-main table.table td[colspan] {
    display: block;
  }

  .cs-main table.cs-table td[colspan]::before,
  .cs-main table.table td[colspan]::before {
    content: none;
  }

  .cs-main table.cs-table td > *,
  .cs-main table.table td > * {
    min-width: 0;
  }

  .cs-main table.cs-table td .cs-actions,
  .cs-main table.table td .cs-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .cs-main [style*="grid-template-columns:1fr 1fr"],
  .cs-main [style*="grid-template-columns: 1fr 1fr"],
  .cs-main [style*="grid-template-columns:repeat(2"],
  .cs-main [style*="grid-template-columns: repeat(2"],
  .cs-main [style*="grid-template-columns:repeat(3"],
  .cs-main [style*="grid-template-columns: repeat(3"],
  .cs-main [style*="grid-template-columns:repeat(4"],
  .cs-main [style*="grid-template-columns: repeat(4"],
  .cs-main [style*="grid-template-columns:"][style*="px"] {
    grid-template-columns: 1fr !important;
  }

  .cs-main [style*="grid-column:span 2"],
  .cs-main [style*="grid-column: span 2"] {
    grid-column: 1 / -1 !important;
  }

  .cs-main [style*="width:300px"],
  .cs-main [style*="width: 300px"],
  .cs-main [style*="max-width:300px"],
  .cs-main [style*="max-width: 300px"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  .cs-main [style*="width:240px"],
  .cs-main [style*="width: 240px"] {
    width: 100% !important;
  }

  .cs-main [style*="position:fixed"][style*="z-index:9999"] {
    padding: 14px !important;
    align-items: flex-start !important;
    overflow-y: auto !important;
  }

  .cs-main [style*="position:fixed"][style*="z-index:9999"] > div {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: max(18px, env(safe-area-inset-top)) !important;
  }

  fieldset {
    padding: 14px;
  }
}

@media (max-width: 768px) {
  .site-mobile-toggle {
    display: none !important;
  }

  .site-nav {
    padding: 10px 0 !important;
    background: color-mix(in srgb, var(--site-nav-bg, #060b18) 96%, transparent) !important;
    box-shadow: 0 1px 0 rgba(var(--gold-rgb, 201, 163, 83), .14);
  }

  .nav-inner {
    gap: 12px !important;
  }

  .nav-logo {
    min-width: 0;
  }

  .nav-logo-text {
    min-width: 0;
  }

  .nav-logo-name,
  .nav-logo-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
  }

  .nav-cta,
  .nav-links,
  .nav-phone {
    display: none !important;
  }

  .nav-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(var(--gold-rgb, 201, 163, 83), .35);
    background: rgba(255,255,255,.06);
  }

  .nav-toggle span {
    width: 22px;
    margin: 3px 0;
  }

  .nav-mobile {
    display: flex !important;
    left: auto !important;
    width: min(86vw, 340px) !important;
    padding: calc(76px + env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom)) !important;
    border-left: 1px solid rgba(var(--gold-rgb, 201, 163, 83), .22);
    box-shadow: -24px 0 70px rgba(0,0,0,.5);
    transform: translateX(104%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s ease, visibility .22s ease;
  }

  .nav-mobile.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  body.public-menu-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 998;
    background: rgba(0,0,0,.5);
  }

  .nav-mobile a {
    min-height: 48px;
    display: flex;
    align-items: center;
    border-bottom: 0 !important;
    border-radius: 12px;
    background: rgba(255,255,255,.055);
    overflow-wrap: anywhere;
  }

  .nav-mobile .nav-mobile-cta {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 10px !important;
    margin-top: 10px !important;
  }

  .nav-mobile .btn,
  main .btn,
  main button,
  main input[type="submit"] {
    min-height: 48px;
    justify-content: center;
    text-align: center;
  }

  .circuits-container,
  .transfers-container {
    padding-left: 18px;
    padding-right: 18px;
  }

  .circuits-page,
  .transfers-page {
    padding-top: 58px;
  }

  .circuits-hero,
  .transfers-hero {
    padding: 48px 0;
  }

  .circuits-grid,
  .transfers-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .circuit-card,
  .transfer-card {
    padding: 22px 18px;
  }
}

/* ============================================================
   Header mobile compact + menu au premier plan  (2026-08-30)
   Le header vitrine est construit en widgets CMS ; l'ancien
   responsive ciblait d'anciennes classes. On masque la nav /
   la langue / le bouton réservation DANS le header sur mobile
   (tout est déjà dans le tiroir #nav-mobile), et on remet le
   tiroir en surimpression (position fixed + z-index) au 1er plan.
   ============================================================ */
@media (max-width: 768px) {
  .site-nav [data-cms-widget-type="nav_menu"],
  .site-nav .evya-language-selector,
  .site-nav [data-cms-widget-type="reservation_button"] { display: none !important; }

  .nav-mobile {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 100dvh !important;
    z-index: 100000 !important;
  }
  body.public-menu-open::after { z-index: 99990 !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONVERGENCE cs-* — variantes manquantes (miroir des ds-* à résorber).
   Ajouté 2026-09-22 (Vague 0 de la convergence ds-*→cs-*). Tokens var(--evya-*)
   / var(--cs-*) uniquement. Ces classes donnent à cs-* la parité fonctionnelle
   avec ds-* pour que la migration du markup soit 1:1 sans perte visuelle.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Boutons : variantes MD3 (← ds-btn--secondary/--outlined/--tonal/--text/--ghost/--block/--lg) ── */
.cs-btn-secondary, .cs-btn-outline {
    background: transparent;
    color: var(--cs-primary);
    border-color: var(--evya-outline-strong);
}
.cs-btn-secondary:hover, .cs-btn-outline:hover {
    border-color: var(--cs-primary);
    background: var(--evya-surface-variant);
    text-decoration: none;
}
.cs-btn-tonal {
    background: var(--evya-primary-container);
    color: var(--evya-on-primary-container);
    border-color: transparent;
}
.cs-btn-tonal:hover { background: color-mix(in srgb, var(--evya-primary) 14%, var(--evya-surface)); text-decoration: none; }
.cs-btn-text, .cs-btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--cs-primary);
}
.cs-btn-text:hover, .cs-btn-ghost:hover { background: var(--evya-surface-variant); text-decoration: none; }
.cs-btn-block { width: 100%; }
.cs-btn-lg {
    min-height: 56px; padding: 0 var(--evya-space-6); font-size: 17px;
    border-radius: var(--evya-radius-pill);
}
/* Variante « plein rouge » (← ds-btn--danger) — à réserver aux actions destructrices principales. */
.cs-btn-danger-solid { background: var(--cs-danger); color: #fff; border-color: var(--cs-danger); }
.cs-btn-danger-solid:hover { filter: brightness(.94); text-decoration: none; }

/* ── ACTIONS DE LIGNE (CRUD) : ICÔNES SEULES, partout (refonte 2026-10-08) ──────
   Contrat : un groupe d'actions sur UN élément (cellule Actions d'un tableau,
   pied de carte de liste, notification…) porte .cs-actions--icons. Les cellules
   d'actions des tableaux sont marquées automatiquement (hydrateResponsiveTables,
   layout) ; evya-dynamic-icons.js donne à chaque bouton l'icône canonique de son
   action, son infobulle (title) et son aria-label. Le texte reste dans le DOM
   (lecteurs d'écran) mais n'est plus affiché. Une seule règle : boutons carrés
   neutres, icône colorée selon le sens (rouge supprimer, orange désactiver, vert
   activer, bleu marine sinon) ; en COLONNE sur ordinateur, en LIGNE sur mobile.
   Gardent leur texte : le bouton d'envoi d'un formulaire de saisie (champs
   visibles) et un bouton sans icône sûre ([data-crud-text], posé par le JS).
   Aucun conteneur n'est forcé visible : on ne touche qu'à l'orientation des
   groupes déjà flex et au rendu des boutons et formulaires non cachés.
   NE JAMAIS mettre .cs-actions--icons sur .cs-form-actions. */
.cs-btn-label { display: inline; }
.cs-main .cs-actions--icons :is(.cs-btn, .btn, .cs-btn-icon):where(:not([data-crud-text]):not(form:has(input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([hidden]), select:not([hidden]), textarea:not([hidden])) *)) {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  /* !important : certaines vues posent padding/taille de texte en style intégré. */
  width: 36px !important; min-width: 36px !important; height: 36px !important; min-height: 36px !important;
  padding: 0 !important; gap: 0 !important;
  border: 1px solid var(--cs-border, #DED8C9); border-radius: 10px;
  background: var(--cs-card, #fff); color: var(--cs-primary, #081A45); box-shadow: none;
  font-size: 0 !important; line-height: 0 !important; letter-spacing: 0; text-decoration: none; white-space: nowrap;
}
.cs-main .cs-actions--icons :is(.cs-btn, .btn, .cs-btn-icon):where(:not([data-crud-text]):not(form:has(input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([hidden]), select:not([hidden]), textarea:not([hidden])) *)) :is(ion-icon, svg, img) {
  font-size: 18px; width: 18px; height: 18px; margin: 0; flex: none; color: currentColor;
}
.cs-main .cs-actions--icons :is(.cs-btn, .btn, .cs-btn-icon):where(:not([data-crud-text]):not(form:has(input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([hidden]), select:not([hidden]), textarea:not([hidden])) *)) .cs-btn-label { display: none; }
.cs-main .cs-actions--icons :is(.cs-btn, .btn, .cs-btn-icon):hover { background: var(--evya-surface-variant, #EEEADF); }
.cs-main .cs-actions--icons :is(.cs-btn-danger, [data-tone="danger"]) { color: var(--evya-danger, #DC2626); }
.cs-main .cs-actions--icons :is(.cs-btn-warning, [data-tone="warning"]) { color: var(--evya-warning, #B45309); }
.cs-main .cs-actions--icons :is(.cs-btn-success, [data-tone="success"]) { color: var(--evya-success, #15803D); }
.cs-main .cs-actions--icons form { margin: 0; }
.cs-main .cs-actions--icons :is(a, button, form, div, span)[hidden] { display: none !important; }

/* Ordinateur : boutons empilés en COLONNE, alignés à droite. */
@media (min-width: 768px) {
  /* La cellule redevient une vraie cellule (certaines vues la passaient en flex),
     au plus juste de ses boutons. */
  .cs-main td.cs-actions--icons:not([hidden]):not([style*="display:none"]):not([style*="display: none"]):not(:has(input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([hidden]), select:not([hidden]), textarea:not([hidden]))) { display: table-cell !important; width: 1%; }
  /* Groupes déjà en flex (et leurs sous-blocs) : orientation en colonne. */
  .cs-main .cs-actions--icons:not(:has(input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([hidden]), select:not([hidden]), textarea:not([hidden]))),
  .cs-main .cs-actions--icons:not(:has(input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([hidden]), select:not([hidden]), textarea:not([hidden]))) :is(div, span, form, .cs-actions, .cs-inline) {
    flex-direction: column !important; flex-wrap: nowrap !important; align-items: flex-end !important; gap: 6px;
  }
  /* Boutons et formulaires non cachés : en bloc, donc empilés et calés à droite
     même quand le groupe n'est pas flex (cellule de tableau, formulaire inline). */
  .cs-main .cs-actions--icons:not(:has(input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([hidden]), select:not([hidden]), textarea:not([hidden]))) form:not([hidden]):not([style*="display:none"]):not([style*="display: none"]) { display: block; }
  .cs-main .cs-actions--icons:not(:has(input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([hidden]), select:not([hidden]), textarea:not([hidden]))) :is(.cs-btn, .btn, .cs-btn-icon):where(:not([data-crud-text]):not([hidden])) {
    display: flex; margin: 0 0 0 auto;
  }
  .cs-main td.cs-actions--icons:not(:has(input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([hidden]), select:not([hidden]), textarea:not([hidden]))) > :is(.cs-btn, .btn, .cs-btn-icon, form) + :is(.cs-btn, .btn, .cs-btn-icon, form) { margin-top: 6px; }
}
/* Mobile : boutons en LIGNE, 44 px, alignés à droite (pied de carte) ; jusqu’à
   7 boutons tiennent sur une ligne en se resserrant (32 px minimum). */
@media (max-width: 767px) {
  .cs-main .cs-actions--icons :is(.cs-btn, .btn, .cs-btn-icon):where(:not([data-crud-text]):not(form:has(input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([hidden]), select:not([hidden]), textarea:not([hidden])) *)) {
    flex: 0 1 44px !important; width: 44px !important; min-width: 32px !important; height: 44px !important; min-height: 44px !important;
  }
  .cs-main .cs-actions--icons:not(:has(input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([hidden]), select:not([hidden]), textarea:not([hidden]))),
  .cs-main .cs-actions--icons:not(:has(input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([hidden]), select:not([hidden]), textarea:not([hidden]))) :is(div, span, form, .cs-actions, .cs-inline) {
    flex-direction: row !important; flex-wrap: nowrap !important; align-items: center !important;
    justify-content: flex-end !important; gap: 6px; min-width: 0; text-align: right;
  }
  .cs-main .cs-actions--icons:not(:has(input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([hidden]), select:not([hidden]), textarea:not([hidden]))) form:not([hidden]):not([style*="display:none"]):not([style*="display: none"]) { display: inline-flex; }
}

/* ── Cartes : modificateurs manquants (← ds-card__subtitle / --flat / --hero / --primary) ── */
.cs-card-subtitle { margin: 4px 0 0; font-size: 13px; color: var(--cs-muted); }
.cs-card--flat    { box-shadow: none; }
.cs-card--hero    { padding: var(--evya-space-6); border-radius: 20px; box-shadow: var(--cs-shadow-md); }
.cs-card--primary { background: var(--cs-primary); color: #fff; border: 0; box-shadow: 0 6px 18px rgba(8, 26, 69, .22); }

/* ── Entête de page hors carte (← ds-page-head + title/subtitle/actions, 42 usages) ── */
.cs-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--evya-space-4); margin-bottom: var(--evya-space-5); flex-wrap: wrap; }
.cs-page-title { margin: 0; font-size: 28px; font-weight: 800; color: var(--cs-text); letter-spacing: -.02em; }
.cs-page-subtitle { margin: 4px 0 0; font-size: 13px; color: var(--cs-muted); }
.cs-page-actions { display: flex; align-items: center; gap: var(--evya-space-2); flex-wrap: wrap; }
@media (max-width: 767px) { .cs-page-title { font-size: 22px; } }

/* ── Badge plein primary (← ds-badge--primary-fill) ── */
.cs-badge-primary-fill { background: var(--cs-primary); color: #fff; }

/* ── Label uppercase + hint erreur (← ds-label--uppercase / ds-hint--error) ── */
.cs-label--uppercase { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--cs-muted); }
.cs-hint--error { color: var(--cs-danger); }

/* ── Utilitaires de mise en page (← ds-stack / ds-spacer / ds-divider) ── */
.cs-stack    { display: flex; flex-direction: column; gap: var(--evya-space-3); }
.cs-stack-sm { display: flex; flex-direction: column; gap: var(--evya-space-2); }
.cs-spacer   { flex: 1; }
.cs-divider  { height: 1px; background: var(--cs-border); margin: var(--evya-space-3) 0; }

/* ── Barre de progression (élément natif progress, ex. reprise FEC) ── */
.cs-progressbar { display: block; width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: var(--evya-surface-variant); color: var(--cs-primary); appearance: none; -webkit-appearance: none; }
.cs-progressbar::-webkit-progress-bar { background: var(--evya-surface-variant); border-radius: 999px; }
.cs-progressbar::-webkit-progress-value { background: var(--cs-primary); border-radius: 999px; transition: width .3s ease; }
.cs-progressbar::-moz-progress-bar { background: var(--cs-primary); border-radius: 999px; }

/* ── Chevron du <select> (← parité select.ds-input) ── */
select.cs-select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3e%3cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2371717A' stroke-width='1.5' stroke-linecap='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}

/* ── Coupure de mots propre — JAMAIS une lettre par ligne sur mobile ──────────
   overflow-wrap est HÉRITÉE : posée sur .cs-main, elle cascade sur TOUT le
   contenu admin (y compris les écrans hors cs-*, ex. agents IA ai-*). Un mot
   n'est cassé QUE s'il ne tient pas (emails, slugs, URLs longues) — jamais
   caractère par caractère (on bannit word-break:break-all). hyphens:auto ajoute
   une césure douce sur mobile (le layout est lang=fr). */
.cs-main { overflow-wrap: break-word; }
@media (max-width: 767px) {
    .cs-main :where(p, .cs-detail-val, .cs-hint, .cs-muted, .cs-card-subtitle, .cs-page-subtitle) { hyphens: auto; }
}

/* ===== [sidebar-fix.css] ===== */

/* Fix visibilité menus sidebar */
.cs-sidebar,
.cs-sidebar nav,
.cs-sidebar .cs-nav,
.cs-sidebar a {
    visibility: visible !important;
    opacity: 1 !important;
}

.cs-sidebar a {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.cs-sidebar .cs-nav-section,
.cs-sidebar .cs-nav-group,
.cs-sidebar .cs-nav-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.cs-sidebar ion-icon,
.cs-sidebar i {
    display: inline-flex !important;
    min-width: 20px;
}

/* ===== [design-system.css] ===== */
/**
 * Design System EVYA Admin — version CSS pure (PHP/Twig n'a pas SCSS).
 *
 * Source : maquettes officielles fournies par user le 03/06/2026.
 * Branche : rebuild-from-maquettes-2026-06-03.
 *
 * Mirror du _design-system.scss des apps mobile.
 * Mode clair, navy #1C1C3A, blanc, gris clair.
 *
 * À inclure dans le <head> des layouts admin via :
 *   <link rel="stylesheet" href="/assets/css/design-system.css">
 *
 * ⚠ Synchronisé manuellement avec client/src/theme/design-system.scss
 *    et chauffeur/src/theme/design-system.scss.
 */

:root {
  /* ══════════════════════════════════════════════════════════════
     DESIGN SYSTEM v2 — ces tokens `--ds-*` sont désormais des ALIAS
     des rôles canoniques `--evya-*` (tokens.css). Ne PAS y remettre de
     hex brut : modifier la fondation `--evya-*`. Aliasing Vague 1
     (Session 4 admin). Les échelles structurelles divergentes (rayons
     8/12/16/20, tailles typo, cibles tactiles, transitions) restent
     littérales pour préserver la géométrie exacte des écrans denses.
     ══════════════════════════════════════════════════════════════ */
  /* ── Colors ── */
  --ds-bg:           var(--evya-surface);
  --ds-bg-soft:      var(--evya-surface-variant);
  --ds-surface:      var(--evya-surface);
  --ds-border:       var(--evya-outline);
  --ds-border-soft:  var(--evya-surface-variant);
  --ds-text:         var(--evya-on-surface);
  --ds-text-muted:   var(--evya-on-surface-med);
  --ds-text-soft:    var(--evya-on-surface-muted);

  --ds-primary:      var(--evya-primary);
  --ds-primary-dk:   var(--evya-primary-hover);
  --ds-primary-50:   var(--evya-primary-container);
  --ds-primary-100:  var(--ev-navy-100);
  --ds-primary-200:  var(--ev-navy-200);
  --ds-primary-500:  var(--ev-navy-600);
  --ds-on-primary:   var(--evya-on-primary);

  --ds-success:      var(--evya-success);
  --ds-success-bg:   var(--evya-success-bg);
  --ds-warning:      var(--evya-warning);
  --ds-warning-bg:   var(--evya-warning-bg);
  --ds-danger:       var(--evya-danger);
  --ds-danger-bg:    var(--evya-danger-bg);
  --ds-info:         var(--evya-info);
  --ds-info-bg:      var(--evya-info-bg);

  /* ── Spacing (8-points scale) → alias v2 (valeurs identiques) ── */
  --ds-space-1:  var(--evya-space-1);
  --ds-space-2:  var(--evya-space-2);
  --ds-space-3:  var(--evya-space-3);
  --ds-space-4:  var(--evya-space-4);
  --ds-space-5:  var(--evya-space-5);
  --ds-space-6:  var(--evya-space-6);
  --ds-space-8:  var(--evya-space-8);
  --ds-space-10: 40px;   /* pas d'équivalent v2 */

  /* ── Radius (géométrie propre à l'admin — littérale) ── */
  --ds-radius-sm:   8px;
  --ds-radius:      12px;
  --ds-radius-lg:   16px;
  --ds-radius-xl:   20px;
  --ds-radius-pill: var(--evya-radius-pill);

  /* ── Shadows → alias élévation v2 (ombres teintées navy) ── */
  --ds-shadow-xs: var(--evya-e1);
  --ds-shadow-sm: var(--evya-e2);
  --ds-shadow:    var(--evya-e2);
  --ds-shadow-lg: var(--evya-e3);
  --ds-shadow-primary: 0 6px 18px rgba(8, 26, 69, 0.22);

  /* ── Typography ── */
  --ds-text-xs:   11px;
  --ds-text-sm:   13px;
  --ds-text-base: 15px;
  --ds-text-md:   17px;
  --ds-text-lg:   20px;
  --ds-text-xl:   24px;
  --ds-text-2xl:  28px;
  --ds-text-3xl:  32px;

  --ds-touch-min:      44px;
  --ds-touch-cta:      52px;
  --ds-transition:     180ms ease-out;
  --ds-transition-fast: 120ms ease-out;
}

/* ════════════════════════════════════════════════════════════════════════
   DARK MODE TOKENS
   Activés via <html data-theme="dark"> (toggle utilisateur, géré JS).
   Pattern : seules les variables couleur changent ; la structure
   (spacing/radius/shadows/typography) reste identique au light mode.

   Source : maquette admin.png, maquette dashboard.png, image sombre.png
   (toutes fournies par user, stockées sur /Users/quentinalem/Desktop/).
   ════════════════════════════════════════════════════════════════════════ */

[data-theme="dark"] {
  /* ── Backgrounds ── */
  --ds-bg:           #0F0F26;   /* fond global très foncé */
  --ds-bg-soft:      #14143A;   /* zone secondaire / sidebar */
  --ds-surface:      #1C1C3A;   /* cards (navy de la palette officielle) */
  --ds-border:       #2A2A50;   /* bordures discrètes */
  --ds-border-soft:  #232348;

  /* ── Text ── */
  --ds-text:         #F4F4F7;   /* texte principal */
  --ds-text-muted:   #A1A1B5;
  --ds-text-soft:    #6E6E85;

  /* ── Primary (CTA) — bleu/violet clair pour ressortir sur fond dark ── */
  --ds-primary:      #6366F1;   /* indigo vif visible sur fond navy */
  --ds-primary-dk:   #4F46E5;
  --ds-primary-50:   #232348;   /* fond doux (= ds-border-soft) */
  --ds-primary-100:  #2D2D5C;
  --ds-primary-200:  #4F4F8A;
  --ds-primary-500:  #818CF8;
  --ds-on-primary:   #FFFFFF;

  /* ── Status — adaptés contraste fond dark ── */
  --ds-success:      #4ADE80;
  --ds-success-bg:   rgba(34, 197, 94, 0.18);
  --ds-warning:      #FBBF24;
  --ds-warning-bg:   rgba(245, 158, 11, 0.18);
  --ds-danger:       #F87171;
  --ds-danger-bg:    rgba(220, 38, 38, 0.18);
  --ds-info:         #60A5FA;
  --ds-info-bg:      rgba(37, 99, 235, 0.18);

  /* ── Shadows — opacité plus forte pour rester visibles sur fond dark ── */
  --ds-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.30);
  --ds-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --ds-shadow:    0 4px 12px rgba(0, 0, 0, 0.40);
  --ds-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.50);
  --ds-shadow-primary: 0 6px 18px rgba(99, 102, 241, 0.35);

  /* Base color-scheme browser hint (scrollbars, form controls) */
  color-scheme: dark;
}

/* ⚠️ PAS de @media (prefers-color-scheme: dark) automatique.
   Décision user 2026-06-05 : V1 = light PAR DÉFAUT, indépendamment du
   système. Le mode dark s'active UNIQUEMENT via un setting admin
   "theme_mode" (light / dark / auto) dans Paramètres généraux, qui pose
   <html data-theme="..."> au boot du layout.
   L'option "auto" sera implémentée plus tard avec un JS qui détecte
   prefers-color-scheme et pose data-theme="dark" si applicable. */

/* ════════════════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════════════════ */

/* v2 : pilule h48 (sm 38 / lg 56), variantes MD3 filled/tonal/outlined/text/gold/danger */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  min-height: 48px;
  padding: 0 var(--ds-space-5);
  border: 1.5px solid transparent;
  border-radius: var(--evya-radius-pill);
  font-size: var(--ds-text-base);
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--ds-transition-fast),
              color var(--ds-transition-fast),
              border-color var(--ds-transition-fast),
              box-shadow var(--ds-transition-fast),
              transform var(--ds-transition-fast);
  user-select: none;
}
.ds-btn:focus-visible { outline: 3px solid var(--evya-focus-ring); outline-offset: 2px; }
.ds-btn:disabled,
.ds-btn[aria-disabled="true"] { opacity: 0.4; box-shadow: none; cursor: not-allowed; pointer-events: none; }

/* filled — action principale */
.ds-btn--primary,
.ds-btn--filled {
  background: var(--evya-primary);
  color: var(--evya-on-primary);
  border-color: var(--evya-primary);
}
.ds-btn--primary:hover:not(:disabled),
.ds-btn--filled:hover:not(:disabled) { background: var(--evya-primary-hover); border-color: var(--evya-primary-hover); }
.ds-btn--primary:active:not(:disabled),
.ds-btn--filled:active:not(:disabled) { transform: scale(0.98); }

/* tonal */
.ds-btn--tonal {
  background: var(--evya-primary-container);
  color: var(--evya-on-primary-container);
}
.ds-btn--tonal:hover:not(:disabled) { background: var(--ev-navy-200); }

/* outlined (alias historique : --secondary) */
.ds-btn--outlined,
.ds-btn--secondary {
  background: transparent;
  color: var(--evya-primary);
  border-color: var(--evya-outline-strong);
}
.ds-btn--outlined:hover:not(:disabled),
.ds-btn--secondary:hover:not(:disabled) {
  border-color: var(--evya-primary);
  background: var(--evya-surface-variant);
}

/* text (alias historique : --ghost) */
.ds-btn--text,
.ds-btn--ghost { background: transparent; color: var(--evya-primary); }
.ds-btn--text:hover:not(:disabled),
.ds-btn--ghost:hover:not(:disabled) { background: var(--evya-surface-variant); }

/* gold — PREMIUM uniquement (accent RARE) */
.ds-btn--gold {
  background: var(--evya-accent-bright);
  color: var(--evya-on-accent);
  border-color: var(--evya-accent-bright);
}
.ds-btn--gold:hover:not(:disabled) { filter: brightness(0.96); }

/* danger */
.ds-btn--danger { background: var(--evya-danger); color: #fff; border-color: var(--evya-danger); }
.ds-btn--danger:hover:not(:disabled) { filter: brightness(0.94); }

.ds-btn--block { width: 100%; }
.ds-btn--lg    { min-height: 56px; font-size: var(--ds-text-md); padding: 0 var(--ds-space-6); }
.ds-btn--sm    { min-height: 38px; font-size: var(--ds-text-sm); padding: 0 var(--ds-space-4); }

/* ════════════════════════════════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════════════════════════════════ */

.ds-card {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg);
  padding: var(--ds-space-5);
  box-shadow: var(--ds-shadow-xs);   /* v2 : élévation e1 au repos */
}
.ds-card--flat { border: 1px solid var(--ds-border); box-shadow: none; }
.ds-card--hero { padding: var(--ds-space-6); border-radius: var(--ds-radius-xl); box-shadow: var(--ds-shadow); }
/* v2 : plus de dégradé décoratif — aplat primary */
.ds-card--primary {
  background: var(--evya-primary);
  border: 0;
  color: var(--evya-on-primary);
  box-shadow: var(--ds-shadow-primary);
}
/* Élévation qui monte au survol UNIQUEMENT si la carte est cliquable */
a.ds-card,
.ds-card--clickable,
.ds-card[role="button"] { cursor: pointer; transition: box-shadow var(--ds-transition), transform var(--ds-transition); }
a.ds-card:hover,
.ds-card--clickable:hover,
.ds-card[role="button"]:hover { box-shadow: var(--ds-shadow); transform: translateY(-1px); }

.ds-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--ds-space-3);
  padding-bottom: var(--ds-space-3);
  border-bottom: 1px solid var(--ds-border-soft);
  margin-bottom: var(--ds-space-4);
}
.ds-card__title    { margin: 0; font-size: var(--ds-text-md); font-weight: 800; color: var(--ds-text); }
.ds-card__subtitle { margin: 4px 0 0 0; font-size: var(--ds-text-sm); color: var(--ds-text-muted); }

/* ════════════════════════════════════════════════════════════════════════
   INPUTS / FORMS
   ════════════════════════════════════════════════════════════════════════ */

.ds-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 52px;                                  /* v2 : champ h52 */
  padding: 14px;
  background: var(--evya-surface);
  border: 1.5px solid var(--evya-outline-strong);
  border-radius: var(--evya-radius-md);
  font-size: var(--ds-text-base);
  font-family: inherit;
  color: var(--ds-text);
  outline: none;
  transition: border-color var(--ds-transition-fast),
              box-shadow var(--ds-transition-fast);
}
.ds-input::placeholder { color: var(--ds-text-soft); }
.ds-input:hover:not(:disabled) { border-color: var(--evya-primary); }
.ds-input:focus {
  border-color: var(--evya-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--evya-primary) 18%, transparent);
}
.ds-input:disabled { background: var(--evya-surface-variant); cursor: not-allowed; opacity: 0.6; }
/* variante remplie sur surface calme */
.ds-input--filled { background: var(--evya-surface-variant); border-color: transparent; }
.ds-input--filled:focus { background: var(--evya-surface); }
.ds-input--error { border-color: var(--evya-danger); }
.ds-input--error:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--evya-danger) 18%, transparent); }

textarea.ds-input { min-height: 80px; resize: vertical; }

select.ds-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3e%3cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2371717A' stroke-width='1.5' stroke-linecap='round'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.ds-label {
  display: block;
  font-size: var(--ds-text-sm);
  font-weight: 700;
  color: var(--ds-text);
  margin-bottom: var(--ds-space-2);
}
.ds-label--uppercase {
  font-size: var(--ds-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ds-text-muted);
}

.ds-hint {
  display: block;
  margin-top: 6px;
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
  line-height: 1.4;
}
.ds-hint--error { color: var(--ds-danger); }

.ds-field-group { display: flex; flex-direction: column; gap: var(--ds-space-4); }

/* ════════════════════════════════════════════════════════════════════════
   BADGES / TAGS
   ════════════════════════════════════════════════════════════════════════ */

.ds-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--ds-radius-pill);
  font-size: var(--ds-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
  white-space: nowrap;
}
.ds-badge--neutral { background: var(--ds-bg-soft);     color: var(--ds-text-muted); }
.ds-badge--primary { background: var(--ds-primary-50);  color: var(--ds-primary); }
.ds-badge--primary-fill { background: var(--ds-primary); color: var(--ds-on-primary); }
.ds-badge--success { background: var(--ds-success-bg);  color: var(--ds-success); }
.ds-badge--warning { background: var(--ds-warning-bg);  color: var(--ds-warning); }
.ds-badge--danger  { background: var(--ds-danger-bg);   color: var(--ds-danger); }
.ds-badge--info    { background: var(--ds-info-bg);     color: var(--ds-info); }
.ds-badge--gold    { background: var(--evya-accent-container); color: var(--evya-on-accent-container); } /* premium / certifié */
.ds-badge--violet  { background: #EDE9FE;               color: #7C3AED; }
.ds-badge--muted   { background: var(--ds-bg-soft);     color: var(--ds-text-muted); }
/* pastille d'état (pilule + point coloré + libellé) */
.ds-badge--success::before,
.ds-badge--warning::before,
.ds-badge--danger::before,
.ds-badge--info::before,
.ds-badge--gold::before,
.ds-badge--neutral::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════════════
   TABLE (admin)
   ════════════════════════════════════════════════════════════════════════ */

/* Wrap autour des tables : permet le scroll horizontal sur mobile/tablet
   quand le contenu dépasse la largeur de l'écran. Fix audit responsive
   2026-06-07 — sans ce wrap, les colonnes de droite étaient invisibles
   et inaccessibles (cs-main { overflow-x: hidden } les coupait). */
.ds-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--ds-radius-lg);
}
.ds-table-wrap > .ds-table {
  margin: 0;
}

.ds-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg);
  overflow: hidden;
  font-size: var(--ds-text-sm);
}
/* Sur petit écran, autorise la table à dépasser la largeur de son wrap
   pour préserver la lisibilité des colonnes (le wrap gère le scroll-x). */
@media (max-width: 768px) {
  .ds-table { min-width: 640px; }
}
.ds-table thead { background: var(--ds-bg-soft); }
.ds-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--ds-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--ds-text-xs);
  border-bottom: 1px solid var(--ds-border);
}
.ds-table td {
  padding: 14px 16px;
  color: var(--ds-text);
  border-bottom: 1px solid var(--ds-border-soft);
}
.ds-table tbody tr:last-child td { border-bottom: 0; }
.ds-table tbody tr:hover { background: var(--ds-bg-soft); }
.ds-table .ds-table__actions { text-align: right; white-space: nowrap; }

/* ════════════════════════════════════════════════════════════════════════
   KPI CARDS (dashboard admin)
   ════════════════════════════════════════════════════════════════════════ */

.ds-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--ds-space-4);
}

.ds-kpi {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg);
  padding: var(--ds-space-4);
  box-shadow: var(--ds-shadow-sm);
  display: flex;
  align-items: center;
  gap: var(--ds-space-4);
}
.ds-kpi__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--ds-radius);
  background: var(--ds-primary-50);
  color: var(--ds-primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 28px;
}
.ds-kpi__body { flex: 1; min-width: 0; }
.ds-kpi__label { font-size: var(--ds-text-sm); color: var(--ds-text-muted); margin: 0; }
.ds-kpi__value { font-size: var(--ds-text-2xl); font-weight: 900; color: var(--ds-text); line-height: 1.1; margin: 4px 0 2px; letter-spacing: -0.5px; }
.ds-kpi__trend { font-size: var(--ds-text-xs); color: var(--ds-text-muted); }
.ds-kpi__trend--up   { color: var(--ds-success); font-weight: 700; }
.ds-kpi__trend--down { color: var(--ds-danger); font-weight: 700; }

/* ════════════════════════════════════════════════════════════════════════
   TITLES
   ════════════════════════════════════════════════════════════════════════ */

.ds-page-title {
  margin: 0 0 var(--ds-space-4) 0;
  font-size: var(--ds-text-xl);
  font-weight: 800;
  color: var(--ds-text);
  letter-spacing: -0.4px;
}
.ds-page-subtitle {
  margin: -8px 0 var(--ds-space-5) 0;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-muted);
  line-height: 1.5;
}
.ds-section-title {
  font-size: var(--ds-text-xs);
  font-weight: 800;
  color: var(--ds-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: var(--ds-space-6) 0 var(--ds-space-2) 0;
}

/* ════════════════════════════════════════════════════════════════════════
   TABS (utilisé pour regroupements admin)
   ════════════════════════════════════════════════════════════════════════ */

.ds-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--ds-border);
  margin-bottom: var(--ds-space-4);
  overflow-x: auto;
}
.ds-tabs__tab {
  padding: 12px 18px;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;   /* v2 : soulignement primary 3px */
  color: var(--ds-text-muted);
  font-size: var(--ds-text-sm);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: color var(--ds-transition-fast),
              border-color var(--ds-transition-fast);
}
.ds-tabs__tab:hover { color: var(--ds-text); }
.ds-tabs__tab.is-active {
  color: var(--ds-primary);
  border-bottom-color: var(--ds-primary);
}

/* ════════════════════════════════════════════════════════════════════════
   TABS BAR — Barre d'onglets de groupe injectée par le layout admin
   sous le topbar. Sticky, reste visible quand on change d'onglet pour
   donner l'impression de rester sur la même page (rebuild 2026-06-03).
   ════════════════════════════════════════════════════════════════════════ */

.cs-tabs-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: stretch;
  gap: var(--ds-space-4);
  background: var(--ds-surface);
  border-bottom: 1px solid var(--ds-border);
  padding: 0 var(--ds-space-6);
  margin: 0 calc(var(--ds-space-6) * -1) var(--ds-space-5);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.cs-tabs-bar__group {
  display: flex; align-items: center;
  padding: 14px 0;
  font-size: var(--ds-text-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-text-muted);
  white-space: nowrap;
  border-right: 1px solid var(--ds-border);
  padding-right: var(--ds-space-4);
}
.cs-tabs-bar__list {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: thin;
}
.cs-tabs-bar__list::-webkit-scrollbar { height: 4px; }
.cs-tabs-bar__list::-webkit-scrollbar-thumb { background: var(--ds-border); border-radius: 2px; }

.cs-tabs-bar__tab {
  display: inline-flex; align-items: center;
  padding: 14px 16px;
  font-size: var(--ds-text-sm);
  font-weight: 700;
  color: var(--ds-text-muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;   /* v2 : soulignement primary 3px sur l'onglet actif */
  white-space: nowrap;
  transition: color var(--ds-transition-fast),
              border-color var(--ds-transition-fast),
              background var(--ds-transition-fast);
}
.cs-tabs-bar__tab:hover {
  color: var(--ds-text);
  background: var(--ds-bg-soft);
}
.cs-tabs-bar__tab.is-active {
  color: var(--ds-primary);
  border-bottom-color: var(--ds-primary);
  background: transparent;
}

@media (max-width: 768px) {
  .cs-tabs-bar {
    padding: 0 var(--ds-space-4);
    margin: 0 calc(var(--ds-space-4) * -1) var(--ds-space-4);
    /* Le header mobile est position:fixed (z-index 200, hauteur --cs-header-h
       + safe-area). Sans cet offset, la barre d'onglets sticky collait à
       top:0 DERRIÈRE le header et disparaissait au scroll. On la colle donc
       juste SOUS le header. z-index relevé (mais < 200) pour rester au-dessus
       du contenu tout en passant sous le header. */
    top: calc(var(--cs-header-h, 56px) + env(safe-area-inset-top));
    z-index: 190;
  }
  .cs-tabs-bar__group { display: none; } /* trop étroit, le titre de la page le suffit */
}

/* Barre d'onglets de FICHE (2e niveau : Liste → fiche → onglets internes).
   Non collante — la barre d'onglets de HUB au-dessus reste la seule sticky —
   et légèrement en retrait pour se distinguer visuellement du 1er niveau. */
.cs-tabs-bar--fiche {
  position: static;
  top: auto;
  z-index: auto;
  margin-top: 0;
  background: var(--ds-bg-soft, transparent);
}

/* ════════════════════════════════════════════════════════════════════════
   PAGE HEADER — Titre + actions, intégré sous la barre d'onglets
   ════════════════════════════════════════════════════════════════════════ */

.ds-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--ds-space-4);
  margin-bottom: var(--ds-space-5);
  flex-wrap: wrap;
}
.ds-page-head__title {
  margin: 0;
  font-size: var(--ds-text-2xl);
  font-weight: 800;
  color: var(--ds-text);
  letter-spacing: -0.02em;
}
.ds-page-head__subtitle {
  margin: 4px 0 0;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-muted);
  font-weight: 500;
}
.ds-page-head__actions {
  display: flex; align-items: center; gap: var(--ds-space-2);
  flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════════════════════
   UTILITIES
   ════════════════════════════════════════════════════════════════════════ */

.ds-stack    { display: flex; flex-direction: column; gap: var(--ds-space-3); }
.ds-stack-sm { display: flex; flex-direction: column; gap: var(--ds-space-2); }
.ds-stack-lg { display: flex; flex-direction: column; gap: var(--ds-space-6); }
.ds-row-h    { display: flex; align-items: center; gap: var(--ds-space-3); }
.ds-spacer   { flex: 1; }
.ds-divider  { height: 1px; background: var(--ds-border); margin: var(--ds-space-3) 0; }

/* ════════════════════════════════════════════════════════════════════════
   FEEDBACK & CHARGEMENT — Système d'états EVYA (LOT 0, back-office)
   Miroir des primitives des apps (design-system.scss). Skeleton, spinner,
   bouton en chargement, overlay, progression à étapes, état vide/erreur.
   Consomment les tokens --ds-* ; respectent prefers-reduced-motion.
   ════════════════════════════════════════════════════════════════════════ */

:root {
  --ds-skeleton-sheen: rgba(255, 255, 255, 0.55);
  --ds-scrim:          rgba(12, 17, 40, 0.32);
}
[data-theme="dark"] {
  --ds-skeleton-sheen: rgba(255, 255, 255, 0.06);
  --ds-scrim:          rgba(4, 7, 18, 0.55);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ds-skeleton-sheen: rgba(255, 255, 255, 0.06);
    --ds-scrim:          rgba(4, 7, 18, 0.55);
  }
}

.ds-skeleton { position: relative; overflow: hidden; display: block; background: var(--ds-bg-soft); border-radius: var(--ds-radius-sm); }
.ds-skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent 0, var(--ds-skeleton-sheen) 50%, transparent 100%); animation: ds-skeleton-sweep 1.35s ease-in-out infinite; }
.ds-skeleton--text    { height: 12px; margin: 5px 0; border-radius: 999px; }
.ds-skeleton--title   { height: 18px; width: 55%; margin: 6px 0; border-radius: 6px; }
.ds-skeleton--line    { height: 12px; width: 100%; border-radius: 999px; }
.ds-skeleton--line-70 { width: 70%; }
.ds-skeleton--line-40 { width: 40%; }
.ds-skeleton--circle  { border-radius: 50%; width: 44px; height: 44px; }
.ds-skeleton--row     { height: 44px; border-radius: var(--ds-radius); }
.ds-skeleton--card    { height: 88px; border-radius: var(--ds-radius-lg); }
.ds-skeleton-group    { display: flex; flex-direction: column; gap: var(--ds-space-2); }
@keyframes ds-skeleton-sweep { to { transform: translateX(100%); } }

.ds-spinner { display: inline-block; width: 20px; height: 20px; border: 2.5px solid currentColor; border-right-color: transparent; border-bottom-color: transparent; border-radius: 50%; animation: ds-spin 0.7s linear infinite; flex-shrink: 0; vertical-align: middle; }
.ds-spinner--sm { width: 15px; height: 15px; border-width: 2px; }
.ds-spinner--lg { width: 30px; height: 30px; border-width: 3px; }
@keyframes ds-spin { to { transform: rotate(360deg); } }

.ds-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.ds-btn.is-loading > * { visibility: hidden; }
.ds-btn.is-loading::after { content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 2.5px solid var(--ds-on-primary); border-right-color: transparent; border-bottom-color: transparent; border-radius: 50%; animation: ds-spin 0.7s linear infinite; }
.ds-btn--secondary.is-loading::after, .ds-btn--ghost.is-loading::after { border-color: var(--ds-primary); border-right-color: transparent; border-bottom-color: transparent; }

.ds-overlay { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--ds-space-3); padding: var(--ds-space-5); text-align: center; background: var(--ds-scrim); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: ds-fade-in var(--ds-transition); }
.ds-overlay--fixed { position: fixed; z-index: 10000; }
.ds-overlay--solid { background: var(--ds-bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
.ds-overlay__card { background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-lg); padding: var(--ds-space-6) var(--ds-space-5); display: flex; flex-direction: column; align-items: center; gap: var(--ds-space-4); max-width: 300px; }
.ds-overlay__spinner { color: var(--ds-primary); }
.ds-overlay__msg { font-size: var(--ds-text-base, 15px); font-weight: 700; color: var(--ds-text); margin: 0; }
.ds-overlay__sub { font-size: var(--ds-text-sm); color: var(--ds-text-muted); margin: 0; line-height: 1.4; }
@keyframes ds-fade-in { from { opacity: 0; } to { opacity: 1; } }

.ds-progress { display: flex; flex-direction: column; gap: var(--ds-space-3); max-width: 280px; text-align: left; }
.ds-progress__step { display: flex; align-items: center; gap: var(--ds-space-3); font-size: var(--ds-text-sm); color: var(--ds-text-soft); transition: color var(--ds-transition); }
.ds-progress__dot { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; border: 1.5px solid var(--ds-border); background: var(--ds-surface); }
.ds-progress__step.is-active { color: var(--ds-text); font-weight: 600; }
.ds-progress__step.is-active .ds-progress__dot { border-color: var(--ds-primary); }
.ds-progress__step.is-active .ds-progress__dot::after { content: ""; width: 9px; height: 9px; border: 2px solid var(--ds-primary); border-right-color: transparent; border-bottom-color: transparent; border-radius: 50%; animation: ds-spin 0.7s linear infinite; }
.ds-progress__step.is-done { color: var(--ds-text-muted); }
.ds-progress__step.is-done .ds-progress__dot { border-color: var(--ds-success); background: var(--ds-success-bg); color: var(--ds-success); font-size: 12px; font-weight: 800; }
.ds-progress__step.is-done .ds-progress__dot::after { content: "\2713"; line-height: 1; }

.ds-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--ds-space-3); padding: var(--ds-space-8) var(--ds-space-5); }
.ds-empty__icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--ds-bg-soft); color: var(--ds-text-muted); font-size: 26px; }
.ds-empty__title { margin: 0; font-size: var(--ds-text-md); font-weight: 700; color: var(--ds-text); }
.ds-empty__text  { margin: 0; font-size: var(--ds-text-sm); color: var(--ds-text-muted); line-height: 1.5; max-width: 320px; }
.ds-empty__action { margin-top: var(--ds-space-2); }
.ds-empty--error .ds-empty__icon { background: var(--ds-danger-bg); color: var(--ds-danger); }

@media (prefers-reduced-motion: reduce) {
  .ds-skeleton::after { animation: ds-skeleton-pulse 1.6s ease-in-out infinite; transform: none; background: var(--ds-skeleton-sheen); }
  .ds-overlay { animation: none; }
  .ds-spinner, .ds-btn.is-loading::after, .ds-progress__step.is-active .ds-progress__dot::after { animation-duration: 1.1s; }
}
@keyframes ds-skeleton-pulse { 0%, 100% { opacity: .3; } 50% { opacity: .65; } }

/* ===== [admin-rail.css] ===== */
/* ══════════════════════════════════════════════════════════════════════════
   EVYA admin — Rail (niveau 1) + panneau latéral coulissant (niveau 2)
   Pattern validé (vidéo UX @clea_ux) : rail d'icônes PERMANENT + panneau qui
   glisse PAR-DESSUS le contenu au clic, regroupé par catégories.

   Le rail est identique sur MOBILE et DESKTOP (« la même sidebar que sur le
   bureau, juste adaptée au mobile ») : colonne d'icônes toujours visible, pas
   de tiroir hamburger. Taper une icône ouvre un panneau PARTIEL (pas plein
   écran) avec un voile ; taper le voile (à côté) le referme.
   Desktop : rail 78px, panneau 290px depuis le haut.
   Mobile  : rail 64px, panneau ~68vw sous le header fixe (le header mobile —
             logo + langue + cloche + déconnexion — reste en place).

   Additif + isolé → retrait = supprimer ce fichier du <head> et le bloc rail
   de admin.php (et remettre app.css tel quel pour le tiroir mobile).
   ══════════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════════════
   1) LAYOUT — rail permanent à toutes les tailles (neutralise le tiroir mobile
      hamburger défini dans app.css).
   ══════════════════════════════════════════════════════════════════════════ */
.cs-admin{
  --cs-sidebar-w:64px;                 /* rail étroit mobile (desktop = 78px plus bas) */
  display:grid; grid-template-columns:var(--cs-sidebar-w) 1fr;
  padding-top:var(--cs-header-h,56px); /* dégage le header mobile fixe */
  min-height:100vh;
}
.cs-menu-toggle{ display:none !important; }  /* rail permanent → plus de hamburger */
.cs-overlay{ display:none !important; }       /* plus de tiroir → plus d'overlay */

.cs-sidebar{
  position:sticky; top:var(--cs-header-h,56px); left:auto; align-self:start;
  height:calc(100vh - var(--cs-header-h,56px)); width:auto;
  transform:none !important; box-shadow:none;
  display:flex; flex-direction:column;
  padding:12px 6px; overflow-y:auto; overflow-x:visible; z-index:100;
}
.cs-sidebar.is-open{ transform:none !important; }   /* neutralise l'ancien état tiroir */
.cs-sidebar::-webkit-scrollbar{ width:4px; }
.cs-sidebar::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.15); border-radius:4px; }
.cs-brand{ display:none; }              /* logo dans le header mobile ; rail = icônes */
.cs-main{ padding:16px; padding-top:16px; min-width:0; }

.cs-sidebar .cs-nav{ display:flex; flex-direction:column; gap:3px; flex:1 1 auto; min-height:0; }

/* ── Items du rail : icône au-dessus, court label dessous (mobile ET desktop) ── */
.cs-nav .rl-item{
  position:relative;
  display:flex !important; flex-direction:column; align-items:center; gap:5px;
  padding:9px 3px 7px; border-radius:10px; text-align:center;
  color:#9FAAC6; font-weight:600; font-size:13.5px;
  text-decoration:none; cursor:pointer; background:none; border:0; width:100%;
  font-family:inherit; transition:background .15s, color .15s;
}
.cs-nav .rl-item:hover{ background:rgba(255,255,255,.06); color:#fff; }
.cs-nav .rl-item ion-icon{ font-size:20px; opacity:1; flex-shrink:0; }
.cs-nav .rl-item.is-active{ background:rgba(201,163,83,.15); }
.cs-nav .rl-item.is-active::before{
  content:""; position:absolute; left:-6px; top:9px; bottom:7px; width:3px;
  border-radius:0 3px 3px 0; background:var(--evya-accent-bright,#C9A353);
}
.cs-nav .rl-item.is-active ion-icon{ color:#fff; }
.cs-nav .rl-item:focus-visible{ outline:2px solid var(--evya-accent-bright,#C9A353); outline-offset:-2px; }
.rl-lab{ display:none; }                /* le label long ne s'affiche jamais (rail étroit) */
.rl-short{ display:block; font-size:9.5px; font-weight:500; letter-spacing:.02em;
  color:rgba(255,255,255,.55); line-height:1.1; max-width:100%;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cs-nav .rl-item:hover .rl-short{ color:rgba(255,255,255,.82); }
.cs-nav .rl-item.is-active .rl-short{ color:var(--evya-accent-bright,#E0C583); }
.rl-tip{ display:none; }                 /* info-bulle : desktop seulement (plus bas) */

/* ══════════════════════════════════════════════════════════════════════════
   2) PANNEAU (niveau 2) — structure interne, PARTAGÉE mobile + desktop
   ══════════════════════════════════════════════════════════════════════════ */
.rl-fly-head{ display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:18px 18px 13px; border-bottom:1px solid rgba(255,255,255,.09); }
.rl-fly-title{ margin:0; font-family:inherit; font-size:19px; font-weight:700; letter-spacing:-.01em; color:#fff; }
.rl-fly-close{ flex:none; width:34px; height:34px; border:0; border-radius:8px; cursor:pointer;
  background:none; color:#9FAAC6; display:grid; place-items:center; }
.rl-fly-close:hover{ background:rgba(255,255,255,.09); color:#fff; }
.rl-fly-close ion-icon{ font-size:20px; }

.rl-fly-body{ flex:1; overflow-y:auto; padding:8px 14px 24px; }
.rl-fly-body::-webkit-scrollbar{ width:5px; }
.rl-fly-body::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.16); border-radius:4px; }
.rl-cat{ font-size:11px; font-weight:800; letter-spacing:.11em; text-transform:uppercase;
  color:rgba(224,197,131,.85); padding:16px 12px 8px; }
.rl-cat:first-child{ padding-top:8px; }
.rl-link{ display:flex; align-items:center; gap:10px; width:100%;
  padding:12px 12px; border-radius:9px; text-decoration:none;
  color:rgba(255,255,255,.78); font-size:15px; font-weight:500;
  transition:background .14s, color .14s; }
.rl-link .rl-dot{ width:5px; height:5px; border-radius:50%; background:currentColor; opacity:.4; flex:none; }
.rl-link:hover{ background:#183067; color:#fff; }
.rl-link:hover .rl-dot{ opacity:.85; }
.rl-link.is-active{ background:rgba(201,163,83,.16); color:var(--evya-accent-bright,#E0C583); }
.rl-link.is-active .rl-dot{ background:var(--evya-accent-bright,#C9A353); opacity:1; }
.rl-link:focus-visible{ outline:2px solid var(--evya-accent-bright,#C9A353); outline-offset:-2px; }

/* ── VOILE + PANNEAU partiels (mobile : sous le header ; taper à côté = fermer) ── */
.rl-scrim{
  position:fixed; inset:var(--cs-header-h,56px) 0 0 var(--cs-sidebar-w); z-index:250;
  background:rgba(8,15,28,.42); backdrop-filter:blur(1.5px);
  opacity:0; visibility:hidden; transition:opacity .28s, visibility .28s;
}
.cs-admin.rl-open .rl-scrim{ opacity:1; visibility:visible; }

.rl-flyout{
  display:flex; flex-direction:column; position:fixed;
  top:var(--cs-header-h,56px); bottom:0; left:var(--cs-sidebar-w);
  width:min(68vw, 300px); max-width:calc(100vw - var(--cs-sidebar-w));
  z-index:260; background:#0F2456; color:#fff;
  border-right:1px solid rgba(255,255,255,.12);
  /* Fermé : décalé de sa largeur ENTIÈRE + le décalage du rail, sinon un bout
     du panneau dépasserait par-dessus le rail (left = largeur du rail). */
  transform:translateX(calc(-100% - var(--cs-sidebar-w) - 8px));
  transition:transform .3s cubic-bezier(.32,.72,0,1);
  overflow:hidden;
}
.rl-flyout.is-open{ transform:translateX(0); }

/* ══════════════════════════════════════════════════════════════════════════
   3) DESKTOP ≥ 768px — rail plus large, logo dans le rail, panneau depuis le haut
   ══════════════════════════════════════════════════════════════════════════ */
@media (min-width:768px){
  .cs-admin{ --cs-sidebar-w:78px; padding-top:0; }

  .cs-sidebar{ top:0; height:100vh; padding:14px 8px 12px; }

  /* Marque : logo dans le rail (le header mobile est masqué en desktop) */
  .cs-brand{ display:flex; justify-content:center; margin-bottom:14px; }
  .cs-brand-subtitle{ display:none; }
  .cs-brand-link{ display:grid; place-items:center; padding:6px 4px; border-radius:10px; }
  .cs-brand-link:hover{ background:rgba(255,255,255,.08); }
  .cs-brand-word{ height:auto; width:52px; max-width:100%; }

  .cs-main{ padding:28px; }

  .rl-short{ font-size:10px; max-width:66px; }

  /* Info-bulle latérale au survol (masquée quand un panneau est ouvert) */
  .rl-tip{
    display:block; position:absolute; left:calc(100% + 10px); top:50%; transform:translateY(-50%) translateX(-6px);
    background:#0F2456; color:#fff; font-size:12.5px; font-weight:500; white-space:nowrap;
    padding:6px 11px; border-radius:8px; pointer-events:none; opacity:0;
    box-shadow:0 8px 22px -10px rgba(0,0,0,.6); border:1px solid rgba(255,255,255,.09);
    transition:opacity .16s, transform .16s; z-index:320;
  }
  .rl-tip::before{ content:""; position:absolute; right:100%; top:50%; transform:translateY(-50%);
    border:5px solid transparent; border-right-color:#0F2456; }
  .cs-admin:not(.rl-open) .cs-nav .rl-item:hover .rl-tip{ opacity:1; transform:translateY(-50%) translateX(0); }

  /* Voile + panneau : depuis le haut (pas de header mobile en desktop) */
  .rl-scrim{ inset:0 0 0 78px; background:rgba(8,15,28,.30); }
  .rl-flyout{
    top:0; left:78px; width:min(290px, calc(100vw - 78px)); max-width:none;
    transition:transform .32s cubic-bezier(.32,.72,0,1);
    /* transform (fermé) hérité de la base : translateX(-100% - largeur rail) */
  }
  .rl-flyout.is-open{ transform:translateX(0); }

  /* Densité desktop du contenu du panneau (souris) */
  .rl-fly-body{ padding:8px 12px 18px; }
  .rl-cat{ font-size:10.5px; padding:14px 10px 7px; }
  .rl-link{ padding:9px 11px; font-size:13.5px; color:rgba(255,255,255,.74); }
  .rl-fly-close{ width:30px; height:30px; }
  .rl-fly-close ion-icon{ font-size:18px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   4) MOBILE < 768px — le RAIL redevient un TIROIR (drawer) hors écran
   ────────────────────────────────────────────────────────────────────────
   Correctif : la base ci-dessus (sans media query) rend le rail PERMANENT à
   TOUTES les tailles (`.cs-admin{grid-template-columns:64px 1fr}`,
   `.cs-menu-toggle{display:none!important}`, `.cs-overlay{display:none!important}`,
   `.cs-sidebar{position:sticky;transform:none!important}`). Sur MOBILE cette
   colonne de 64px réservée au rail écrasait le contenu. Sous 768px on restaure
   donc le comportement TIROIR d'origine (celui d'app.css) : contenu pleine
   largeur + burger + overlay assombri, le rail glissant PAR-DESSUS le contenu.
   Le DESKTOP (bloc `@media (min-width:768px)` ci-dessus) n'est PAS touché, et
   le JS openSidebar()/closeSidebar() (admin.php) reste inchangé. `!important`
   uniquement là où la base l'emploie (transform / display de l'overlay).
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width:767px){
  /* 1) UNE seule colonne : le contenu (.cs-main) occupe 100% de la largeur,
        aucune colonne réservée au rail. padding-top = header fixe (+ encoche). */
  .cs-admin{
    display:block;
    padding-top:calc(var(--cs-header-h,56px) + env(safe-area-inset-top));
  }

  /* 5) Le burger (masqué par la base « rail permanent ») redevient visible. */
  .cs-menu-toggle{ display:flex !important; }

  /* 2+3) La sidebar redevient un TIROIR : fixe, hors écran par défaut, par-
        dessus le contenu, largeur lisible, défilement vertical si besoin.
        transform !important pour battre `.cs-sidebar{transform:none!important}`
        de la base ; `.is-open` le fait glisser en place. */
  .cs-sidebar{
    position:fixed;
    top:var(--cs-header-h,56px); left:0; bottom:0; height:auto;
    width:min(86vw,300px);
    z-index:260;
    padding:12px 10px calc(14px + env(safe-area-inset-bottom));
    box-shadow:4px 0 32px rgba(0,0,0,.35);
    overflow-y:auto; overflow-x:hidden;
    transform:translateX(-100%) !important;
    transition:transform .28s cubic-bezier(.4,0,.2,1);
  }
  .cs-sidebar.is-open{ transform:translateX(0) !important; }

  /* 4) Overlay (backdrop) : caché par défaut, visible (.is-visible) quand le
        tiroir est ouvert ; z-index juste SOUS la sidebar ; démarre sous le
        header pour laisser le burger cliquable (re-fermeture). `!important`
        pour battre le `.cs-overlay{display:none!important}` de la base. */
  .cs-overlay{ position:fixed; inset:var(--cs-header-h,56px) 0 0 0; z-index:250; }
  .cs-overlay.is-visible{ display:block !important; }

  /* 6) Dans le tiroir : VRAI menu = icône + LIBELLÉ long, en ligne (le format
        « colonne + court label » du rail ne vaut que pour le desktop étroit). */
  .cs-nav .rl-item{
    flex-direction:row; align-items:center; justify-content:flex-start;
    gap:12px; text-align:left; padding:12px; font-size:14.5px;
  }
  .cs-nav .rl-item ion-icon{ font-size:21px; }
  .rl-lab{ display:block; font-weight:600; line-height:1.2; }
  .rl-short{ display:none; }

  /* Sous-navigation (niveau 2) : le panneau d'un hub couvre le tiroir en pleine
     largeur (son « ✕ » — JS existant — ramène à la liste des hubs). Les
     formules de la base référencent la largeur du rail (64px) ; on les
     recale ici sur un tiroir left:0. */
  .rl-scrim{ inset:var(--cs-header-h,56px) 0 0 0; z-index:265; }
  .rl-flyout{
    top:var(--cs-header-h,56px); left:0; bottom:0;
    width:min(86vw,300px); max-width:100vw; z-index:270;
    transform:translateX(-100%);
  }
  .rl-flyout.is-open{ transform:translateX(0); }
}

/* ══════════════════════════ Topbar : recherche globale + logo cliquable ═════ */
.cs-topbar-search{
  display:flex; align-items:center; gap:9px; flex:1; max-width:420px;
  height:38px; padding:0 12px; border-radius:10px;
  background:var(--evya-surface-variant,#F3F0E7); border:1px solid var(--evya-border,#E6E1D3);
  color:var(--evya-on-surface-muted,#6A7285);
}
.cs-topbar-search ion-icon{ font-size:17px; flex:none; }
.cs-topbar-search input{ flex:1; min-width:0; border:0; background:none; outline:0;
  font:inherit; font-size:13.5px; color:var(--evya-on-surface,#1B2537); }
.cs-topbar-search input::placeholder{ color:var(--evya-on-surface-muted,#6A7285); }
.cs-topbar-search kbd{ font-family:inherit; font-size:10.5px; color:var(--evya-on-surface-muted,#6A7285);
  border:1px solid var(--evya-border,#E6E1D3); border-radius:5px; padding:2px 6px;
  background:var(--evya-surface,#fff); }
@media (max-width:680px){ .cs-topbar-search kbd{ display:none; } }
@media (max-width:520px){ .cs-topbar-search{ display:none; } }

/* Respecte prefers-reduced-motion */
@media (prefers-reduced-motion:reduce){
  .rl-flyout, .rl-scrim, .rl-tip{ transition:none !important; }
}

/* =============================================================================
   [Vague 1] TAB BAR iOS — mobile uniquement (< 768px). Navigation « application »
   sur téléphone ; masquée sur ordinateur (SaaS = rail latéral). Additive : ne
   modifie aucun écran, ne retire aucune navigation (bouton « Menu » = rail complet).
   ============================================================================= */
.cs-tabbar { display: none; }
@media (max-width: 767px) {
  /* Aligné PIXEL pour PIXEL sur la barre des apps client/chauffeur
     (app-bottom-tabs) : surface blanche, ombre haute, icône en PILULE quand
     active + indicateur en haut, libellé 10px/700. Même feel « application ». */
  .cs-tabbar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 210;
    background: var(--evya-surface, #fff);
    border-top: 1px solid var(--evya-outline, #DED8C9);
    box-shadow: 0 -6px 20px rgba(8, 26, 69, .08);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .cs-tabbar__item {
    flex: 1; min-width: 0; position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 2px; min-height: 56px;
    border: 0; background: none; cursor: pointer; text-decoration: none; font-family: inherit;
    color: var(--evya-on-surface-muted, #71768A);
    font-size: 10px; font-weight: 700; letter-spacing: .005em;
    transition: color 120ms ease;
  }
  .cs-tabbar__item span {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .cs-tabbar__item ion-icon {
    width: 23px; height: 23px; font-size: 23px;
    padding: 3px 11px; border-radius: 999px;
    transition: background 120ms ease, color 120ms ease;
  }
  .cs-tabbar__item.is-active { color: var(--evya-primary, #081A45); }
  .cs-tabbar__item.is-active ion-icon { background: #EDF0F9; color: var(--evya-primary, #081A45); }
  .cs-tabbar__item.is-active::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 32px; height: 3px; border-radius: 0 0 4px 4px; background: var(--evya-primary, #081A45);
  }
  .cs-tabbar__item:focus-visible { outline: 3px solid #33487F; outline-offset: -3px; border-radius: 12px; }
  /* Le contenu respire au-dessus de la barre ET de la bulle Éva (posée 84 px
     au-dessus du bas, 54 px de haut) : aucun bouton ne reste dessous en fin de page. */
  .cs-main { padding-bottom: calc(150px + env(safe-area-inset-bottom)) !important; }
}

/* =============================================================================
   [Vague 1b] TABLES → CARTES sur mobile (< 768px), PARTOUT (refonte 2026-10-08).
   Chaque ligne devient une carte : libellé = en-tête de colonne (data-label,
   posé par hydrateResponsiveTables). Cellule simple : libellé à gauche, valeur à
   droite. Cellule riche : libellé au-dessus, contenu pleine largeur. Actions de
   ligne : rangée en pied de carte. Sur ordinateur : tableau classique inchangé.
   Aucune donnée ni colonne retirée.
   ============================================================================= */
@media (max-width: 767px) {
  /* Toute table de données à en-tête devient une
     pile de cartes (libellé = en-tête de colonne via data-label, posé par
     hydrateResponsiveTables). Exceptions : .fin-tbl (reflow dédié plus bas) et
     les grilles tableur (.fin-cash, .cohort-wrap, .cs-table--keep) qui gardent
     leur défilement horizontal. */
  .cs-main .cs-table-scroll:has(> table > thead th):not(:has(> table:is(.fin-tbl, .fin-cash, .cs-table--keep))),
  .cs-main .cs-table-scroll:has(> :is(.cs-table, .ds-table)),
  .cs-main .cs-table-wrap:has(> table),
  .cs-main .ds-table-wrap:has(> table) { overflow: visible; }

  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) {
    display: block; width: 100%; min-width: 0 !important; max-width: none;
    border: 0; box-shadow: none; background: transparent;
  }
  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) > thead { display: none; }
  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) > :is(tbody, tfoot),
  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) > :is(tbody, tfoot) > tr {
    display: block; width: 100%;
  }
  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) > :is(tbody, tfoot) > tr {
    background: var(--evya-surface, #fff);
    border: 1px solid var(--evya-outline, #DED8C9);
    border-radius: 14px; box-shadow: var(--evya-e1, 0 1px 2px rgba(8,26,69,.06));
    margin-bottom: 12px; padding: 6px 0; overflow: hidden;
  }
  /* Cellule simple : libellé à gauche, valeur à droite ; si la valeur ne tient
     pas, elle passe à la ligne entière (jamais de mot coupé lettre par lettre). */
  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) > :is(tbody, tfoot) > tr > :is(td, th) {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
    gap: 4px 12px; width: 100%; max-width: none; min-width: 0; min-height: 0;
    padding: 9px 14px; border: 0; text-align: right;
    white-space: normal; overflow-wrap: anywhere; word-break: normal;
  }
  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) > :is(tbody, tfoot) > tr > :is(td, th)::before {
    content: attr(data-label); flex: 0 1 auto; text-align: left;
    font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
    color: var(--evya-on-surface-muted, #8A90A4);
  }
  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) > :is(tbody, tfoot) > tr > :is(td, th) > * { min-width: 0; max-width: 100%; }
  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) > :is(tbody, tfoot) > tr > :is(td[data-label=""], td:not([data-label]), th)::before { display: none; }
  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) > :is(tbody, tfoot) > tr > td[colspan] { display: block; text-align: center; }

  /* Cellule riche (plusieurs éléments, blocs, sauts de ligne) : libellé AU-DESSUS,
     contenu en pleine largeur aligné à gauche, mis en page comme sur ordinateur. */
  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) > tbody > tr > td:where(:has(> :nth-child(2)), :has(> :is(div, p, ul, ol, dl, table, details, small, br))):not(:has(> .cs-who:only-child)) {
    display: block; text-align: left;
  }
  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) > tbody > tr > td:where(:has(> :nth-child(2)), :has(> :is(div, p, ul, ol, dl, table, details, small, br))):not(:has(> .cs-who:only-child))::before {
    display: block; margin-bottom: 5px; max-width: none;
  }

  /* Actions de ligne : rangée en PIED de carte, pleine largeur, texte jamais coupé. */
  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) > tbody > tr > td:is(.cs-actions, [data-label="Actions"], [data-label="Action"], :last-child:has(> :is(.cs-btn, .cs-btn-icon, .btn, button, form, .cs-actions))) {
    display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px;
    margin-top: 4px; padding: 10px 14px 8px; border-top: 1px solid var(--evya-outline, #DED8C9);
    text-align: left;
  }
  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) > tbody > tr > td:is(.cs-actions, [data-label="Actions"], [data-label="Action"], :last-child:has(> :is(.cs-btn, .cs-btn-icon, .btn, button, form, .cs-actions)))::before { display: none; }
  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) > tbody > tr > td:is(.cs-actions, [data-label="Actions"], [data-label="Action"], :last-child:has(> :is(.cs-btn, .cs-btn-icon, .btn, button, form, .cs-actions))) :is(.cs-actions, .cs-inline, form, .fr-inline),
  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) > tbody > tr > td:is(.cs-actions, [data-label="Actions"], [data-label="Action"], :last-child:has(> :is(.cs-btn, .cs-btn-icon, .btn, button, form, .cs-actions))) > div {
    display: flex; flex-wrap: wrap; gap: 8px; margin: 0; justify-content: flex-end !important;
  }
  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) > tbody > tr > td:is(.cs-actions, [data-label="Actions"], [data-label="Action"], :last-child:has(> :is(.cs-btn, .cs-btn-icon, .btn, button, form, .cs-actions))) :is(.cs-btn, .btn) {
    white-space: nowrap; min-height: 44px; flex: 0 0 auto;
  }
  .cs-main table:is(.cs-table, .ds-table, :has(> thead th)):not(.fin-tbl, .fin-cash, .cs-table--keep, .cohort-wrap table) > tbody > tr > td:is(.cs-actions, [data-label="Actions"], [data-label="Action"], :last-child:has(> :is(.cs-btn, .cs-btn-icon, .btn, button, form, .cs-actions))) .cs-btn-icon {
    min-width: 44px; min-height: 44px;
  }
}

/* =============================================================================
   [Vague 1c] MENU MOBILE = PAGE PLEIN ÉCRAN (feel application). Sous 768px, le
   rail ne s'ouvre plus en tiroir étroit à gauche : il occupe tout l'écran (comme
   l'onglet « Plus » d'une app). Ouvert par l'onglet « Menu » de la tab bar ; le
   burger de l'en-tête est retiré. Toute la navigation reste présente (rien perdu).
   ============================================================================= */
.cs-sidebar__close { display: none; }
@media (max-width: 767px) {
  .cs-sidebar { width: 100vw !important; max-width: 100vw !important; }
  .cs-sidebar.is-open { box-shadow: none; }
  .cs-sidebar__close {
    display: flex; position: absolute; top: 12px; right: 12px; z-index: 3;
    width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(255,255,255,.14); color: #fff;
    align-items: center; justify-content: center;
  }
  .cs-sidebar__close ion-icon { font-size: 24px; }
  /* Plus de burger à gauche : la tab bar (onglet « Menu ») ouvre le menu plein écran. */
  .cs-menu-toggle { display: none !important; }
  /* Cibles tactiles « app » plus généreuses. */
  .cs-nav a, .cs-nav button, .rl-link { min-height: 50px; }
}

/* =============================================================================
   [Vague 1e] MENU PLEIN ÉCRAN MOBILE façon menu des apps. Sous 768px, les items
   du rail passent en LIGNE (pastille icône + libellé COMPLET, aligné à gauche),
   actif en or clair — même grammaire que le menu latéral des apps client/chauffeur.
   Le drill-down (sous-sections) reste géré par les panneaux (flyouts) plein écran.
   ============================================================================= */
@media (max-width: 767px) {
  .cs-sidebar .cs-nav { gap: 2px; padding: 6px 10px 10px; }
  .cs-nav .rl-item {
    flex-direction: row; align-items: center; justify-content: flex-start;
    gap: 14px; text-align: left; padding: 13px 14px; border-radius: 12px;
    font-size: 15px; font-weight: 600;
  }
  .cs-nav .rl-item .rl-short, .cs-nav .rl-item .rl-tip { display: none; }
  .cs-nav .rl-item .rl-lab { display: inline; }
  .cs-nav .rl-item ion-icon { font-size: 22px; }
  .cs-nav .rl-item.is-active { color: #EAD6A6; }        /* libellé or clair (apps) */
  .cs-nav .rl-item.is-active::before { left: 0; top: 10px; bottom: 10px; } /* barre or au bord */
}

/* =============================================================================
   [Vague 1f] PAGE MENU (module=menu) — vraie page de navigation façon page
   « Compte » des apps client/chauffeur : sections + cartes-listes (pastille icône
   #EDF0F9 + libellé 15/700 + chevron). Classes dédiées (.amenu*) → zéro impact
   sur les autres écrans. Cf. evya-apps-design-language-ref.
   ============================================================================= */
.amenu { max-width: 560px; margin: 0 auto; padding: 6px 16px 28px; }
.amenu__head h1 {
  font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 12px 2px 4px;
  color: var(--evya-on-surface, #12172B);
}
.amenu__section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--evya-on-surface-muted, #71768A); margin: 22px 6px 8px;
}
.amenu__group {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--evya-surface, #fff);
  border: 1px solid var(--evya-outline, #DED8C9); border-radius: 16px;
  box-shadow: 0 1px 2px rgba(8,26,69,.05), 0 1px 3px rgba(8,26,69,.04);
}
.amenu__row {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid #EEEADF; text-decoration: none; color: inherit;
  min-height: 44px; transition: background 120ms ease;
}
.amenu__row:last-child { border-bottom: 0; }
.amenu__row:hover, .amenu__row:active { background: #EEEADF; }
.amenu__ico {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: #EDF0F9; color: var(--evya-primary, #081A45);
  display: grid; place-items: center;
}
.amenu__ico ion-icon { font-size: 20px; }
.amenu__label { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; color: var(--evya-on-surface, #12172B); }
.amenu__chev { font-size: 18px; color: #9AA0B0; flex: none; }
.amenu__logout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 22px; padding: 14px;
  background: var(--evya-surface, #fff); color: var(--evya-danger, #DC2626);
  border: 1.5px solid color-mix(in srgb, var(--evya-danger, #DC2626) 45%, transparent);
  border-radius: 12px; font-size: 15px; font-weight: 800; text-decoration: none;
}
.amenu__logout ion-icon { font-size: 20px; }
.amenu__logout:active { background: var(--evya-danger-bg, #FBE7E5); }

/* [Vague 1f] En-tête niveau 2 de la page Menu : bouton retour rond + titre centré
   (pattern en-tête des apps). */
.amenu__head--sub { display: flex; align-items: center; gap: 12px; }
.amenu__head--sub h1 { flex: 1; text-align: center; font-size: 20px; margin: 12px 0 4px; }
.amenu__back, .amenu__back-spacer { width: 38px; height: 38px; flex: none; }
.amenu__back {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--evya-surface-variant, #EEEADF); color: var(--evya-on-surface, #12172B);
  text-decoration: none;
}
.amenu__back ion-icon { font-size: 20px; }

/* =============================================================================
   [Vague 1] Agent flottant Éva : sur mobile (< 768px, là où la tab bar est
   affichée), on le REMONTE au-dessus de la barre pour qu'il ne la masque pas.
   Scopé admin (data-theme="admin") ; !important pour battre les règles
   16px/24px de evya-assistant.css quel que soit l'ordre de chargement.
   ============================================================================= */
@media (max-width: 767px) {
  .evya-assistant[data-theme="admin"] { bottom: calc(84px + env(safe-area-inset-bottom)) !important; }
}

/* =============================================================================
   ▓▓▓ FINANCE COCKPIT (module scoping .fin-*) ▓▓▓
   Résorbé depuis www/assets/css/finance-cockpit.css (convergence « un seul
   fichier admin.css », 2026-09-25). Règles RELOCALISÉES telles quelles — zéro
   changement visuel. Vocabulaire propre au pilotage financier (cockpit Fygr :
   fin-cockpit/-cash/-rail/-plan-bar/-phase 3-états/-task/-chart…), sans
   équivalent dans la famille générique cs-* → gardé scoping comme les builders.
   ============================================================================= */
/**
 * finance-cockpit.css — habillage « cockpit de trésorerie » (style Fygr) de l'aire
 * Trésorerie du module unifié « Comptabilité & RH ».
 *
 * Complète le design system admin (.ds-* / .cs-*) sans le dupliquer : n'ajoute QUE
 * les pièces spécifiques au pilotage financier que .ds-* n'a pas — cartes KPI à
 * liseré-rôle, enveloppe de graphe responsive, légende de courbe, et le vocabulaire
 * visuel des 3 états RÉEL / PRÉVISION / HYPOTHÈSE.
 *
 * RÈGLE : 100 % tokens (var(--cs-*) qui aliasent var(--evya-*)), zéro hex littéral
 * hors valeurs de repli des var(). Namespace .fin-* (aucune collision avec cs-/ds-/cxr-).
 */

/* ── Barre d'outils (période / entité / granularité / export) ───────────────── */
.fin-toolbar{
  display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end;
  background:var(--cs-card,#fff); border:1px solid var(--cs-border,#DED8C9);
  border-radius:var(--cs-radius,14px); padding:12px 14px; margin-bottom:16px;
  box-shadow:var(--cs-shadow,0 1px 2px rgba(8,26,69,.05));
}
.fin-field{display:flex; flex-direction:column; gap:4px}
.fin-field > label,.fin-field__label{
  font-size:10.5px; text-transform:uppercase; letter-spacing:.05em;
  color:var(--cs-muted,#71768A); font-weight:700;
}
.fin-toolbar__spacer{flex:1 1 auto}

/* segmented control (granularité) */
.fin-seg{display:inline-flex; background:var(--cs-surface-variant,#EEEADF); border-radius:10px; padding:3px; gap:2px}
.fin-seg a,.fin-seg button{
  border:0; background:transparent; padding:6px 12px; border-radius:7px;
  font:inherit; font-size:12.5px; font-weight:700; color:var(--cs-text-soft,#4C5165);
  cursor:pointer; text-decoration:none; line-height:1.6;
}
.fin-seg a.is-on,.fin-seg button.is-on{
  background:var(--cs-card,#fff); color:var(--cs-primary,#081A45);
  box-shadow:var(--cs-shadow,0 1px 2px rgba(8,26,69,.05));
}

/* ── Rangée de KPI ──────────────────────────────────────────────────────────── */
.fin-kpi-row{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:12px; margin-bottom:16px;
}
.fin-stat{
  --fin-accent:var(--cs-primary,#081A45);
  position:relative; overflow:hidden;
  background:var(--cs-card,#fff); border:1px solid var(--cs-border,#DED8C9);
  border-radius:var(--cs-radius,14px); box-shadow:var(--cs-shadow,0 1px 2px rgba(8,26,69,.05));
  padding:15px 15px 13px;
}
.fin-stat::before{content:""; position:absolute; inset:0 0 auto 0; height:3px; background:var(--fin-accent)}
.fin-stat--reel{--fin-accent:var(--cs-primary,#081A45)}
.fin-stat--in{--fin-accent:var(--cs-success,#15803d)}
.fin-stat--out{--fin-accent:var(--cs-danger,#dc2626)}
.fin-stat--net{--fin-accent:var(--cs-text-soft,#4C5165)}
.fin-stat--prevision{--fin-accent:var(--cs-info,#0369a1)}
.fin-stat--hypothese{--fin-accent:var(--cs-accent,#C9A353)}
.fin-stat__label{
  display:flex; align-items:center; gap:6px; margin-bottom:9px;
  font-size:11.5px; font-weight:700; color:var(--cs-muted,#71768A);
}
.fin-stat__label ion-icon{font-size:14px}
.fin-stat__value{
  font-size:clamp(22px,2.4vw,27px); font-weight:850; letter-spacing:-.02em; line-height:1;
  color:var(--cs-text,#12172B); font-variant-numeric:tabular-nums;
}
.fin-stat__sub{margin-top:8px; display:flex; align-items:center; gap:6px; font-size:11px; color:var(--cs-muted,#71768A)}
.fin-stat--breach{background:var(--cs-danger-bg,#fee2e2)}
.fin-stat--breach .fin-stat__value{color:var(--cs-danger,#dc2626)}
.fin-stat__value--neg{color:var(--cs-danger,#dc2626)}

/* ── Graphe (courbe de trésorerie) ──────────────────────────────────────────── */
.fin-chart{position:relative; width:100%; height:clamp(240px,34vw,360px)}
.fin-chart > canvas{display:block}
.fin-legend{display:flex; flex-wrap:wrap; gap:8px; margin-top:14px}
.fin-legend__chip{
  display:inline-flex; align-items:center; gap:7px; font-size:11.5px; font-weight:700;
  color:var(--cs-text-soft,#4C5165); background:var(--cs-surface,#FCFAF4);
  border:1px solid var(--cs-border,#DED8C9); padding:4px 10px; border-radius:999px;
}
.fin-legend__swatch{width:16px; height:0; border-top:3px solid var(--sw,var(--cs-primary,#081A45))}
.fin-legend__swatch--dash{border-top-style:dashed}
.fin-legend__swatch--dot{border-top-style:dotted}
.fin-legend__box{width:11px; height:11px; border-radius:3px; background:var(--sw,var(--cs-primary,#081A45))}

/* =============================================================================
   Analytique et graphiques (AdminChart + platform-analytics.js)
   Dans une carte : le graphique en haut, puis le tableau existant replié dans
   .an-detail (aucune info perdue). Grilles de cartes graphiques, carte de
   chaleur en grille CSS. Couleurs = tokens uniquement (thème clair et sombre).
   ============================================================================= */
.an-chart{position:relative; width:100%; height:clamp(220px,30vw,320px)}
.an-chart > canvas{display:block}
.an-chart--sm{height:180px}
.an-chart--lg{height:clamp(280px,38vw,420px)}
.an-chart--spark{height:40px; margin-top:8px}
.an-chart--rows{height:calc(var(--an-rows,6) * 28px + 48px)}
.an-empty{margin:0; padding:12px 0; font-size:13px; color:var(--cs-muted)}

/* Mini-courbe dans une carte chiffre */
.an-kpi-spark{display:block; width:100%; min-width:0; margin-top:6px}
.an-kpi-spark > .an-chart--spark{margin-top:0}
.an-kpi-spark:empty{display:none}

/* Détail repliable sous un graphique (fermé par défaut) */
.an-detail{margin-top:12px}
.an-detail > summary{
  display:inline-flex; align-items:center; gap:7px; cursor:pointer; list-style:none;
  font-size:13px; font-weight:700; color:var(--cs-primary); user-select:none; border-radius:6px;
}
.an-detail > summary::-webkit-details-marker{display:none}
.an-detail > summary::marker{content:""}
.an-detail > summary::after{
  content:""; width:6px; height:6px; flex:none;
  border-right:2px solid currentColor; border-bottom:2px solid currentColor;
  transform:translateY(-2px) rotate(45deg); transition:transform var(--cs-transition);
}
.an-detail[open] > summary::after{transform:translateY(2px) rotate(225deg)}
.an-detail > summary:hover{text-decoration:underline; text-underline-offset:3px}
.an-detail__body{margin-top:10px; overflow-x:auto; -webkit-overflow-scrolling:touch}

/* Grilles de cartes graphiques */
.an-chart-grid{display:grid; grid-template-columns:minmax(0,1fr); gap:16px; margin-bottom:16px}
.an-chart-grid > *{min-width:0; margin-bottom:0}
.cs-main .an-chart-grid > .card,
.analytics-page .an-chart-grid > .card{margin-bottom:0}
@media (min-width:900px){
  .an-chart-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (min-width:1200px){
  .an-chart-grid--3{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* Carte de chaleur (AdminChart::heatmap), défilement horizontal via .an-heat-wrap */
.an-heat-wrap{overflow-x:auto; -webkit-overflow-scrolling:touch; padding-bottom:4px}
.an-heat{
  --an-heat-base:var(--cs-primary);
  display:grid; grid-template-columns:minmax(36px,auto) repeat(var(--an-cols,24),minmax(12px,1fr));
  gap:2px; align-items:center; font-size:10.5px; line-height:1.2; min-width:520px;
}
.an-heat--primary{--an-heat-base:var(--cs-primary)}
.an-heat--danger{--an-heat-base:var(--cs-danger)}
.an-heat--accent{--an-heat-base:var(--cs-accent)}
.an-heat__corner{display:block}
.an-heat__col{
  text-align:center; color:var(--cs-muted); font-weight:600; padding-bottom:2px;
  font-variant-numeric:tabular-nums; white-space:nowrap;
}
.an-heat__row{color:var(--cs-muted); font-weight:600; text-align:right; padding-right:6px; white-space:nowrap}
.an-heat__c{
  position:relative; display:block; aspect-ratio:1/1; border-radius:3px;
  background:color-mix(in srgb, var(--cs-border) 45%, transparent);
}
.an-heat__c:hover{outline:1px solid var(--cs-text-soft); outline-offset:0}
.an-heat__c--0{background:color-mix(in srgb, var(--cs-border) 45%, transparent)}
.an-heat__c--1{background:color-mix(in srgb, var(--an-heat-base) 18%, transparent)}
.an-heat__c--2{background:color-mix(in srgb, var(--an-heat-base) 34%, transparent)}
.an-heat__c--3{background:color-mix(in srgb, var(--an-heat-base) 52%, transparent)}
.an-heat__c--4{background:color-mix(in srgb, var(--an-heat-base) 72%, transparent)}
.an-heat__c--5{background:color-mix(in srgb, var(--an-heat-base) 92%, transparent)}

/* Texte réservé aux lecteurs d'écran */
.sr-only{
  position:absolute !important; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* ── Page Analytique (styles de la vue, portée .analytics-page) ─────────────── */
.analytics-page { padding: 20px; max-width: 1400px; margin: 0 auto; }
.analytics-page h1 { margin: 0 0 6px; display: flex; align-items: center; gap: 10px; font-size: 24px; }
.analytics-page h1 ion-icon { font-size: 26px; color: var(--evya-primary); flex-shrink: 0; }
.analytics-page .page-intro { color: var(--evya-on-surface-med); margin: 0 0 18px; font-size: 14px; }
.analytics-page .alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 600; }
.analytics-page .alert-success { background: var(--evya-success-bg); color: var(--evya-success); border-left: 4px solid var(--evya-success); }
.analytics-page .alert-error { background: var(--evya-danger-bg); color: var(--evya-danger); border-left: 4px solid var(--evya-danger); }
.analytics-page .tabs-nav { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; border-bottom: 2px solid var(--evya-outline); margin-bottom: 20px; }
.analytics-page .tabs-nav::-webkit-scrollbar { height: 5px; }
.analytics-page .tabs-nav::-webkit-scrollbar-thumb { background: var(--evya-outline); border-radius: 4px; }
.analytics-page .tabs-nav a { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; white-space: nowrap; padding: 10px 16px; color: var(--evya-on-surface-med); text-decoration: none; font-weight: 600; font-size: 13.5px; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all .15s; }
.analytics-page .tabs-nav a ion-icon { font-size: 16px; flex-shrink: 0; }
.analytics-page .tabs-nav a:hover { color: var(--evya-on-surface); background: var(--evya-surface-variant); }
.analytics-page .tabs-nav a.is-active { color: var(--evya-primary); border-bottom-color: var(--evya-primary); }
.analytics-page .period-filter, .analytics-page .filter-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.analytics-page .period-filter label, .analytics-page .filter-bar label { font-size: 13px; color: var(--evya-on-surface-med); font-weight: 600; }
.analytics-page .period-filter select, .analytics-page .filter-bar select, .analytics-page .filter-bar input { padding: 8px 12px; border: 1px solid var(--evya-outline); border-radius: 6px; font-size: 13px; }
.analytics-page .btn-export { margin-left: auto; padding: 8px 14px; background: var(--evya-success); color: var(--evya-on-primary); border-radius: 6px; text-decoration: none; font-weight: 700; font-size: 13px; }
.analytics-page .btn-export:hover { filter: brightness(.95); }
.analytics-page .kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.analytics-page .kpi-card { background: var(--evya-surface); padding: 18px 16px; border-radius: 12px; text-align: center; box-shadow: var(--evya-e1); border-top: 3px solid var(--evya-primary); }
.analytics-page .kpi-icon { font-size: 24px; }
.analytics-page .kpi-value { font-size: 26px; font-weight: 900; color: var(--evya-on-surface); margin: 4px 0; line-height: 1.1; }
.analytics-page .kpi-label { font-size: 12px; color: var(--evya-on-surface-med); }
.analytics-page .two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 18px; }
.analytics-page .card { background: var(--evya-surface); border-radius: 12px; padding: 18px; box-shadow: var(--evya-e1); margin-bottom: 16px; }
.analytics-page .card h2 { margin: 0 0 14px; font-size: 15px; }
.analytics-page .card h3 { margin: 0 0 10px; font-size: 14px; }
.analytics-page .data-table { width: 100%; border-collapse: collapse; }
.analytics-page .data-table th { background: var(--evya-surface-variant); padding: 10px 12px; text-align: left; font-size: 11.5px; color: var(--evya-on-surface-med); border-bottom: 1px solid var(--evya-outline); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.analytics-page .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--evya-outline); font-size: 13px; vertical-align: top; }
.analytics-page .data-table.compact td { padding: 6px 12px; font-size: 12.5px; }
.analytics-page .data-table td.num, .analytics-page .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.analytics-page .data-table .muted { color: var(--evya-on-surface-muted); }
.analytics-page .data-table .small { font-size: 11.5px; }
.analytics-page .data-table code { background: var(--evya-surface-variant); padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.analytics-page .badge { display: inline-block; padding: 2px 8px; background: var(--evya-primary-container); color: var(--evya-primary); border-radius: 999px; font-size: 11px; font-weight: 700; }
.analytics-page .empty { padding: 30px; text-align: center; color: var(--evya-on-surface-muted); font-style: italic; }
.analytics-page .realtime-banner { background: var(--evya-danger); color: var(--evya-on-primary); padding: 16px 22px; border-radius: 12px; margin-bottom: 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.analytics-page .realtime-banner strong { font-size: 22px; }
.analytics-page .pulse { width: 14px; height: 14px; background: var(--evya-on-primary); border-radius: 50%; animation: an-pulse 1.4s ease-in-out infinite; }
@keyframes an-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(1.4); } }
.analytics-page .btn-refresh { margin-left: auto; background: color-mix(in srgb, var(--evya-on-primary) 20%, transparent); color: var(--evya-on-primary); border: 1px solid color-mix(in srgb, var(--evya-on-primary) 40%, transparent); border-radius: 6px; padding: 6px 12px; cursor: pointer; font-weight: 700; }
.analytics-page .funnel-card { padding: 22px; }
.analytics-page .btn-purge { padding: 8px 14px; background: var(--evya-danger); color: var(--evya-on-primary); border: 0; border-radius: 6px; font-weight: 700; cursor: pointer; }
.analytics-page .btn-purge:hover { filter: brightness(.92); }
.analytics-page .muted { color: var(--evya-on-surface-muted); }
.analytics-page .small { font-size: 12px; }
.analytics-page .purge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.analytics-page .purge-form { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--evya-outline); border-radius: 10px; background: var(--evya-surface-variant); }
.analytics-page .purge-form strong { font-size: 13px; }
.analytics-page .purge-form input, .analytics-page .purge-form select { padding: 7px 10px; border: 1px solid var(--evya-outline-strong); border-radius: 6px; font-size: 13px; }
.analytics-page .purge-form .dry { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--evya-on-surface-med); font-weight: 600; }
.analytics-page .purge-form .btn-purge { margin-top: auto; }
.analytics-page .purge-form.danger-form { border-color: var(--evya-danger-border); background: var(--evya-danger-bg); grid-column: 1 / -1; }
.analytics-page .btn-danger { background: var(--evya-danger); filter: brightness(.92); }
.analytics-page .btn-danger:hover { filter: brightness(.84); }
.analytics-page .quality-card.q-ok { border-left: 4px solid var(--evya-success); }
.analytics-page .quality-card.q-warn { border-left: 4px solid var(--evya-danger); }
.analytics-page .quality-card .q-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.analytics-page .btn-rebuild { padding: 8px 14px; background: var(--evya-primary); color: var(--evya-on-primary); border: 0; border-radius: 6px; font-weight: 700; cursor: pointer; }
.analytics-page .btn-rebuild:hover { background: var(--evya-primary-hover); }
.analytics-page .q-banner { padding: 10px 14px; border-radius: 8px; font-weight: 600; margin: 10px 0; font-size: 13px; }
.analytics-page .q-banner.ok { background: var(--evya-success-bg); color: var(--evya-success); }
.analytics-page .q-banner.warn { background: var(--evya-danger-bg); color: var(--evya-danger); }
.analytics-page .q-row-bad { background: var(--evya-danger-bg); }
.analytics-page .q-row-bad td { color: var(--evya-danger); }
.analytics-page .space-switch { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.analytics-page .space-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 2px solid var(--evya-outline); background: var(--evya-surface); color: var(--evya-on-surface-med); text-decoration: none; font-weight: 700; font-size: 14px; transition: all .15s; }
.analytics-page .space-btn:hover { border-color: var(--evya-outline-strong); color: var(--evya-on-surface); }
.analytics-page .space-btn.is-active { background: var(--evya-primary); border-color: var(--evya-primary); color: var(--evya-on-primary); }
.analytics-page .space-btn .space-ico { font-size: 18px; }
.analytics-page .section-title { font-size: 17px; margin: 4px 0 14px; }
.analytics-page .summary-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.analytics-page .sum-card { background: var(--evya-surface); border-radius: 12px; padding: 14px 16px; box-shadow: var(--evya-e1); }
.analytics-page .sum-top { display: flex; align-items: center; justify-content: space-between; }
.analytics-page .sum-ico { font-size: 18px; }
.analytics-page .sum-value { font-size: 24px; font-weight: 900; color: var(--evya-on-surface); margin: 4px 0 2px; }
.analytics-page .sum-label { font-size: 12px; color: var(--evya-on-surface-med); }
.analytics-page .delta { font-size: 12px; font-weight: 800; }
.analytics-page .delta-up { color: var(--evya-success); }
.analytics-page .delta-down { color: var(--evya-danger); }
.analytics-page .delta-flat { color: var(--evya-on-surface-muted); }
.analytics-page .cohort-wrap { overflow-x: auto; }
.analytics-page .cohort-table td, .analytics-page .cohort-table th { text-align: center; white-space: nowrap; }
.analytics-page .cohort-table .an-heat__c--4, .analytics-page .cohort-table .an-heat__c--5 { color: var(--evya-on-primary); font-weight: 700; }
@media print { .analytics-page .tabs-nav, .analytics-page .space-switch, .analytics-page .period-filter, .analytics-page .filter-bar, .analytics-page .btn-export, .analytics-page .btn-rebuild { display: none !important; } }
/* ── Incidents & sécurité ── */
.analytics-page .isec-cyber { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.analytics-page .isec-cyber-card { display: block; padding: 12px; border-radius: 10px; background: var(--evya-surface-variant); text-decoration: none; color: inherit; }
.analytics-page a.isec-cyber-card:hover { filter: brightness(.97); }
.analytics-page .isec-cyber-card .v { font-size: 22px; font-weight: 900; color: var(--evya-on-surface); }
.analytics-page .isec-cyber-card .l { font-size: 11.5px; color: var(--evya-on-surface-med); margin-top: 2px; }
.analytics-page .space-btn .space-ico { font-size: 18px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE, feel « application » sur mobile (< 768px)
   Aucune fonctionnalité retirée : les tableaux larges défilent
   horizontalement, les grilles passent en 1 colonne. Toutes les
   couleurs restent en tokens --evya-*.
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .analytics-page { padding: 14px 12px; }
    .analytics-page h1 { font-size: 21px; }
    /* Tableaux : scroll horizontal plutôt que débordement/écrasement */
    .analytics-page .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
    .analytics-page .cohort-table { white-space: nowrap; }
    /* KPI plus compacts */
    .analytics-page .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
    .analytics-page .kpi-value { font-size: 22px; }
    .analytics-page .summary-strip { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
    .analytics-page .isec-cyber { grid-template-columns: 1fr; }
    /* Boutons d'action pleine largeur au doigt */
    .analytics-page .btn-export, .analytics-page .btn-refresh { margin-left: 0; }
    .analytics-page .period-filter, .analytics-page .filter-bar { gap: 8px; }
}
@media (max-width: 640px) {
    .analytics-page .realtime-banner { padding: 14px 16px; }
    .analytics-page .realtime-banner strong { font-size: 20px; }
}

/* ── Rapports (classes rp-*, ex <style> de la vue) ────────────────────────── */
/* Filters bar */
.rp-filters {
    padding: 12px 16px;
    margin-bottom: 16px;
}
.rp-filters__periods {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.rp-chip {
    display: inline-flex; align-items: center;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px; font-weight: 600;
    color: var(--ds-text-muted);
    text-decoration: none;
    background: var(--ds-bg-soft);
    border: 1px solid transparent;
    white-space: nowrap;
    transition: color .15s, background .15s, border-color .15s;
}
.rp-chip:hover { color: var(--ds-text); background: var(--evya-surface); border-color: var(--ds-border); }
.rp-chip.is-active {
    color: var(--evya-on-primary); background: var(--ds-primary); border-color: var(--ds-primary);
}

/* KPI grid */
.rp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.rp-kpi {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--evya-surface);
    border: 1px solid var(--ds-border);
    border-radius: 12px;
    box-shadow: var(--ds-shadow-sm);
}
.rp-kpi__icon {
    flex-shrink: 0;
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    font-size: 20px;
}
.rp-kpi__icon ion-icon { font-size: 20px; }
/* Accents des KPI (tokens d'état, adaptés au thème) */
.rp-kpi__icon--emerald { background: color-mix(in srgb, var(--cs-success) 12%, transparent); color: var(--cs-success); }
.rp-kpi__icon--indigo  { background: color-mix(in srgb, var(--cs-primary) 12%, transparent); color: var(--cs-primary); }
.rp-kpi__icon--orange  { background: color-mix(in srgb, var(--cs-warning) 12%, transparent); color: var(--cs-warning); }
.rp-kpi__icon--blue    { background: color-mix(in srgb, var(--cs-info) 12%, transparent); color: var(--cs-info); }
.rp-kpi__icon--teal    { background: color-mix(in srgb, var(--cs-success) 12%, transparent); color: var(--cs-success); }
.rp-kpi__icon--violet  { background: color-mix(in srgb, var(--cs-accent) 14%, transparent); color: var(--cs-accent); }

.rp-kpi__body  { flex: 1; min-width: 0; }
.rp-kpi__value {
    font-size: 20px; font-weight: 800;
    color: var(--ds-text); line-height: 1.1;
    margin-bottom: 2px;
}
.rp-kpi__label {
    font-size: 12px;
    color: var(--ds-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Row layouts */
.rp-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 960px) {
    .rp-row { grid-template-columns: 1fr; }
}

/* Donut legend */
.rp-legend {
    list-style: none; margin: 12px 0 0; padding: 0;
}
.rp-legend__item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--ds-border);
    font-size: 13px;
}
.rp-legend__item:last-child { border-bottom: 0; }
.rp-legend__label {
    display: flex; align-items: center; gap: 8px;
    color: var(--ds-text);
}
.rp-legend__dot {
    width: 10px; height: 10px; border-radius: 50%;
    flex-shrink: 0;
}
.rp-legend__val {
    display: flex; align-items: center; gap: 12px;
    color: var(--ds-text);
}
.rp-legend__amount {
    color: var(--ds-text-muted);
    font-size: 11px;
}

/* Leaderboard rows */
.rp-board {
    display: flex; flex-direction: column;
    gap: 10px;
}
.rp-board__row { display: flex; flex-direction: column; gap: 5px; }
.rp-board__head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px;
}
.rp-board__name {
    display: flex; align-items: center; gap: 8px;
    min-width: 0;
}
.rp-board__rank {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--ds-bg-soft);
    color: var(--ds-text-muted);
    font-size: 10px; font-weight: 900;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.rp-board__metrics {
    display: flex; align-items: center; gap: 10px;
    white-space: nowrap;
}
.rp-board__metrics strong { color: var(--ds-text); font-weight: 700; }
.rp-board__sub {
    color: var(--ds-text-muted);
    font-size: 11px;
}
.rp-board__bar {
    height: 5px;
    background: var(--ds-bg-soft);
    border-radius: 999px;
    overflow: hidden;
}
.rp-board__fill {
    height: 100%;
    border-radius: 999px;
}
.rp-board__fill--primary { background: var(--ds-primary); }
.rp-board__fill--success { background: var(--ds-success, var(--cs-success)); }

/* Links */
.rp-link {
    color: var(--ds-text);
    font-weight: 700;
    text-decoration: none;
}
.rp-link:hover { text-decoration: underline; }
.rp-link--plain { font-weight: 600; }

/* Pastilles de légende (couleur = token) */
.rp-dot--success { background: var(--cs-success); }
.rp-dot--danger  { background: var(--cs-danger); }
.rp-dot--info    { background: var(--cs-info); }
.rp-dot--warning { background: var(--cs-warning); }
.rp-dot--muted   { background: var(--cs-muted); }

/* ── Tableau de bord (classes ad-*, ex <style> de la vue) ─────────────────── */
/* ════════════ Layout dashboard (grilles charts) ════════════ */
.ad-dashboard { display:flex; flex-direction:column; gap:8px; padding:16px; max-width:1180px; margin:0 auto; }
.ad-dashboard .cs-page-head { margin-bottom:20px; }
.ad-dashboard .ad-row-2 { margin-bottom:8px; }
/* Row 2 cols (activité + doughnut) */
.ad-row-2 { display:grid; grid-template-columns:2fr 1fr; gap:16px; }
@media (max-width:960px){ .ad-row-2 { grid-template-columns:1fr; } }

/* Chart head */
.ad-chart-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; gap:12px; }

/* Légende doughnut */
.ad-legend { display:flex; flex-direction:column; gap:8px; }
.ad-legend__row { display:flex; align-items:center; gap:8px; font-size:13px; }
.ad-legend__dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.ad-legend__label { flex:1; color:var(--cs-text); font-weight:600; }
.ad-legend__value { color:var(--cs-muted); font-weight:700; font-size:12.5px; }


/* Encart point bas / seuil franchi */
.fin-callout{
  display:flex; align-items:flex-start; gap:8px; margin-top:12px;
  background:var(--cs-danger-bg,#fee2e2); border:1px solid var(--cs-danger-border,#fca5a5);
  border-radius:10px; padding:9px 12px; font-size:12.5px; color:var(--cs-danger,#dc2626);
}
.fin-callout ion-icon{font-size:16px; flex:none; margin-top:1px}
.fin-callout strong{color:inherit}

/* ── Vocabulaire 3 états (badges) ───────────────────────────────────────────── */
.fin-phase{
  display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:800;
  padding:2px 9px; border-radius:999px; border:1px solid transparent; line-height:1.5;
}
.fin-phase--reel{background:var(--cs-primary-container,#DCE2F1); color:var(--cs-primary,#081A45); border-color:#c3cdea}
.fin-phase--prevision{background:var(--cs-info-bg,#dbeafe); color:var(--cs-info,#0369a1); border-color:#a8cdec}
.fin-phase--hypothese{background:var(--evya-accent-container,#F3E7CB); color:var(--evya-on-accent-container,#4A3712); border-color:#e6d3a3}

/* Badges de statut sémantiques (budgets, alertes, tva, échéances) */
.fin-badge{display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:800; padding:2px 9px; border-radius:999px; border:1px solid transparent; line-height:1.5; white-space:nowrap}
.fin-badge--ok{background:var(--cs-success-bg,#dcfce7); color:var(--cs-success,#15803d); border-color:var(--evya-success-border,#86efac)}
.fin-badge--warn{background:var(--cs-warning-bg,#fef3c7); color:var(--cs-warning,#d97706); border-color:#fcd980}
.fin-badge--danger{background:var(--cs-danger-bg,#fee2e2); color:var(--cs-danger,#dc2626); border-color:var(--evya-danger-border,#fca5a5)}
.fin-badge--info{background:var(--cs-info-bg,#dbeafe); color:var(--cs-info,#0369a1); border-color:#a8cdec}
.fin-badge--muted{background:var(--cs-surface-variant,#EEEADF); color:var(--cs-muted,#71768A)}

/* ── Accueil ergonomique « à la Apple » (partagé compta/paie/tréso) ──────────── */
/* Label de section (« À traiter », « En un coup d'œil », « Préparé automatiquement »). */
.fin-lab{font-size:11px; text-transform:uppercase; letter-spacing:.06em; font-weight:800; color:var(--cs-muted,#71768A); margin:22px 2px 10px}
.fin-lab:first-child{margin-top:4px}
/* Façade « À traiter » — une tâche = la prochaine action. */
.fin-task-list{display:flex; flex-direction:column; border-top:1px solid var(--cs-border,#DED8C9)}
.fin-task{display:flex; align-items:center; gap:14px; padding:14px 6px; border-bottom:1px solid var(--cs-border,#DED8C9); text-decoration:none; color:inherit; transition:background .12s}
.fin-task:hover{background:var(--cs-surface,#FCFAF4)}
.fin-task__ic{width:38px; height:38px; border-radius:10px; display:grid; place-items:center; flex:none}
.fin-task__ic ion-icon{font-size:19px}
.fin-task__b{flex:1; min-width:0}
.fin-task__b strong{display:block; font-weight:700; font-size:14.5px; color:var(--cs-text,#12172B)}
.fin-task__b span{font-size:12.5px; color:var(--cs-text-soft,#4C5165)}
.fin-task__go{border:1px solid var(--cs-border-strong,#C6BFAC); background:var(--cs-card,#fff); border-radius:9px; padding:7px 15px; font-size:12.5px; font-weight:700; color:var(--cs-primary,#081A45); white-space:nowrap; flex:none}
.fin-task:hover .fin-task__go{border-color:var(--cs-primary,#081A45)}
/* Pastilles d'icône par rôle. */
.fin-ic--accent{background:var(--cs-primary-container,#DCE2F1); color:var(--cs-primary,#081A45)}
.fin-ic--info{background:var(--cs-info-bg,#dbeafe); color:var(--cs-info,#0369a1)}
.fin-ic--warn{background:var(--cs-warning-bg,#fef3c7); color:var(--cs-warning,#d97706)}
.fin-ic--ok{background:var(--cs-success-bg,#dcfce7); color:var(--cs-success,#15803d)}
/* « Tout est à jour ». */
.fin-clear{display:flex; align-items:center; gap:10px; padding:15px 16px; background:var(--cs-success-bg,#dcfce7); border:1px solid var(--evya-success-border,#86efac); border-radius:12px; color:var(--cs-success,#15803d); font-weight:600; font-size:13.5px}
.fin-clear ion-icon{font-size:20px; flex:none}
/* Carte « préparé automatiquement ». */
.fin-auto{display:flex; align-items:flex-start; gap:12px; background:var(--cs-surface,#FCFAF4); border:1px solid var(--cs-border,#DED8C9); border-radius:12px; padding:15px 16px}
.fin-auto__ic{font-size:20px; color:var(--evya-accent,#B4863A); flex:none; margin-top:1px}
.fin-auto__t{font-size:13px; line-height:1.65; color:var(--cs-text-soft,#4C5165)}
.fin-auto__t strong{color:var(--cs-text,#12172B); font-weight:700}
.fin-auto__t a{color:var(--cs-primary,#081A45); font-weight:700; text-decoration:none; white-space:nowrap}
.fin-auto__t a:hover{text-decoration:underline}

/* ── Fonctions prévisionnelles inline (Plan de trésorerie, façon Fygr) ────────── */
.fin-fx-add{display:inline-flex; align-items:center; gap:3px; border:1px dashed var(--cs-border-strong,#C6BFAC); background:transparent; color:var(--cs-primary,#081A45); border-radius:7px; padding:1px 7px; font-size:11px; font-weight:700; cursor:pointer; margin-left:6px; vertical-align:middle; line-height:1.7}
.fin-fx-add:hover{background:var(--cs-primary-container,#DCE2F1); border-style:solid}
.fin-fx-add ion-icon{font-size:12px}
.fin-fx-badge{display:inline-block; background:var(--cs-primary-container,#DCE2F1); color:var(--cs-primary,#081A45); border-radius:999px; font-size:10px; font-weight:800; padding:0 6px; margin-left:4px; vertical-align:middle}
dialog.fin-modal{border:1px solid var(--cs-border,#DED8C9); border-radius:16px; padding:0; max-width:600px; width:calc(100% - 32px); box-shadow:var(--cs-shadow-lg); color:var(--cs-text,#12172B); background:var(--cs-card,#fff); flex-direction:column; max-height:calc(100dvh - 40px)}
/* ⚠ display:flex UNIQUEMENT sur [open] : un <dialog> fermé doit rester display:none. */
dialog.fin-modal[open]{display:flex}
dialog.fin-modal::backdrop{background:color-mix(in srgb, var(--cs-primary, #081A45) 34%, transparent)}
.fin-modal__head{flex:none; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:15px 18px; border-bottom:1px solid var(--cs-border,#DED8C9)}
.fin-modal__head h3{margin:0; font-size:15px; font-weight:800; display:flex; align-items:center; gap:7px}
.fin-modal__head h3 ion-icon{color:var(--cs-primary,#081A45)}
.fin-modal__close{border:0; background:transparent; cursor:pointer; font-size:22px; color:var(--cs-muted,#71768A); line-height:1; padding:0 2px}
.fin-modal__body{padding:16px 18px; flex:1 1 auto; min-height:0; overflow-y:auto}
.fin-fx-item{display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 10px; border:1px solid var(--cs-border,#DED8C9); border-radius:9px; margin-bottom:6px; font-size:12.5px}
.fin-fx-item__d{min-width:0}
.fin-fx-item__d strong{display:block; font-weight:700}
.fin-fx-item__d span{color:var(--cs-muted,#71768A); font-size:11px}

/* Montants signés */
.fin-amt{font-variant-numeric:tabular-nums; font-weight:800}
.fin-amt--in{color:var(--cs-success,#15803d)}
.fin-amt--out{color:var(--cs-danger,#dc2626)}
.fin-amt--muted{color:var(--cs-muted,#71768A); font-weight:600}

/* Delta trend chip */
.fin-delta{display:inline-flex; align-items:center; gap:3px; font-size:11px; font-weight:800; padding:2px 8px; border-radius:999px}
.fin-delta--up{background:var(--cs-success-bg,#dcfce7); color:var(--cs-success,#15803d)}
.fin-delta--down{background:var(--cs-danger-bg,#fee2e2); color:var(--cs-danger,#dc2626)}
.fin-delta--flat{background:var(--cs-surface-variant,#EEEADF); color:var(--cs-muted,#71768A)}

/* ── Dispositions ───────────────────────────────────────────────────────────── */
.fin-grid-2{display:grid; grid-template-columns:1.55fr 1fr; gap:16px; margin-top:16px}
.fin-grid-2 > *{min-width:0}
@media (max-width:860px){.fin-grid-2{grid-template-columns:1fr}}

/* Lignes de synthèse (prévision à venir) */
.fin-line{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 0; border-bottom:1px solid var(--cs-border,#DED8C9)}
.fin-line:last-child{border-bottom:0}
.fin-line__k{display:flex; align-items:center; gap:8px; color:var(--cs-text-soft,#4C5165); font-weight:600; font-size:13px}
.fin-line__k ion-icon{font-size:15px; color:var(--cs-info,#0369a1)}
.fin-line__v{font-weight:850; font-size:15px; font-variant-numeric:tabular-nums}
.fin-line--total{border-top:2px solid var(--cs-border-strong,#C6BFAC); border-bottom:0; padding-top:12px; margin-top:2px}
.fin-line--total .fin-line__k{color:var(--cs-text,#12172B); font-weight:700}

/* Barres de répartition par catégorie */
.fin-cat{margin-bottom:10px}
.fin-cat__head{display:flex; justify-content:space-between; gap:10px; font-size:13px}
.fin-cat__head strong{font-variant-numeric:tabular-nums}
.fin-cat__track{height:7px; margin-top:4px; background:var(--cs-surface-variant,#EEEADF); border-radius:4px; overflow:hidden}
.fin-cat__fill{height:100%; border-radius:4px; background:var(--cs-primary,#081A45)}
.fin-cat__fill--in{background:var(--cs-success,#15803d)}
.fin-cat__fill--out{background:var(--cs-danger,#dc2626)}

/* Note d'honnêteté (légende 3 états) */
.fin-footmeta{
  display:flex; flex-wrap:wrap; gap:6px 16px; align-items:center;
  color:var(--cs-muted,#71768A); font-size:11.5px; line-height:1.7; margin-top:16px;
}
.fin-footmeta__k{display:inline-flex; align-items:center; gap:6px}
.fin-dot{width:8px; height:8px; border-radius:50%; display:inline-block; background:var(--d,var(--cs-primary,#081A45))}

/* En-tête de section allégé (remplace « Pilotage financier — X ») */
.fin-head{display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:14px}
.fin-head__title{margin:0; font-size:19px; font-weight:800; letter-spacing:-.01em; color:var(--cs-text,#12172B)}
.fin-head__subtitle{margin:3px 0 0; font-size:12.5px; color:var(--cs-muted,#71768A)}
.fin-head__actions{display:flex; gap:8px; flex-wrap:wrap}

.fin-empty{display:flex; flex-direction:column; align-items:center; gap:8px; padding:26px 12px; color:var(--cs-muted,#71768A); text-align:center}
.fin-empty ion-icon{font-size:28px; opacity:.7}

/* ── Tableau (journal, listes) ──────────────────────────────────────────────── */
.fin-tblwrap{overflow-x:auto}
.fin-tbl{width:100%; border-collapse:collapse; font-size:13px}
.fin-tbl th{
  text-align:left; font-size:10.5px; text-transform:uppercase; letter-spacing:.04em;
  color:var(--cs-muted,#71768A); font-weight:800; padding:8px 10px;
  background:var(--cs-surface-variant,#EEEADF); border-bottom:1px solid var(--cs-border,#DED8C9);
  white-space:nowrap;
}
.fin-tbl td{padding:9px 10px; border-bottom:1px solid var(--cs-border,#DED8C9); vertical-align:middle}
.fin-tbl tbody tr:last-child td{border-bottom:0}
.fin-tbl tbody tr:hover{background:var(--cs-surface,#FCFAF4)}
.fin-tbl .fin-r{text-align:right}
.fin-tbl .fin-nowrap{white-space:nowrap}

/* Pagination */
.fin-pager{display:flex; gap:6px; justify-content:center; flex-wrap:wrap; margin-top:12px}
.fin-pager a{
  display:inline-block; padding:4px 10px; border-radius:8px; font-size:12.5px; font-weight:700;
  text-decoration:none; color:var(--cs-text-soft,#4C5165); background:var(--cs-card,#fff);
  border:1px solid var(--cs-border,#DED8C9);
}
.fin-pager a.is-on{background:var(--cs-primary,#081A45); color:#fff; border-color:var(--cs-primary,#081A45)}

/* ══ Plan de trésorerie — cockpit Okimia ═══════════════════════════════════ */
/* Barre du haut */
.fin-plan-bar{display:flex; align-items:center; gap:8px; flex-wrap:wrap; background:var(--cs-card,#fff); border:1px solid var(--cs-border,#DED8C9); border-radius:14px; padding:9px 11px; box-shadow:0 1px 2px rgba(8,26,69,.06); margin-bottom:14px}
.fin-plan-bar__spacer{flex:1 1 auto}
.fin-plan-bar__period{display:inline-flex; align-items:center; gap:4px}
.fin-plan-bar__dash{color:var(--cs-muted,#71768A)}
.fin-ctl{display:inline-flex; align-items:center; gap:6px; height:34px; padding:0 11px; background:var(--cs-card,#fff); border:1px solid var(--cs-border-strong,#C6BFAC); border-radius:8px; color:var(--cs-text,#12172B); font-size:13px; font-weight:600; cursor:pointer; font-family:inherit}
.fin-ctl:hover{background:var(--cs-surface-variant,#EEEADF)}
.fin-ctl ion-icon{font-size:15px; color:var(--cs-text-soft,#4C5165)}
.fin-ctl__caret{font-size:12px!important; color:var(--cs-muted,#71768A)!important}
.fin-ctl--static{cursor:default; font-weight:700; color:var(--cs-text-soft,#4C5165)}
.fin-ctl--static:hover{background:var(--cs-card,#fff)}
.fin-ctl--native{padding-right:8px}
.fin-ctl--date{font-weight:500}
/* Neutralise le style form global (select/textarea 100% + min-height 52px) dans la barre. */
.fin-plan-bar select.fin-ctl,.fin-plan-bar input.fin-ctl{width:auto; min-height:0; height:34px; padding:0 11px}
.fin-plan-bar select.fin-ctl{min-width:96px; max-width:230px}
.fin-plan-bar input.fin-ctl--date{width:auto; min-width:132px}
.fin-ico-btn{display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border:1px solid var(--cs-border-strong,#C6BFAC); border-radius:8px; background:var(--cs-card,#fff); cursor:pointer; color:var(--cs-primary,#081A45); text-decoration:none}
.fin-ico-btn:hover{background:var(--cs-primary-container,#DCE2F1); border-color:var(--cs-primary-container,#DCE2F1)}
.fin-ico-btn ion-icon{font-size:16px}
.fin-toggle2{display:inline-flex; background:var(--cs-surface-variant,#EEEADF); border:1px solid var(--cs-border,#DED8C9); border-radius:8px; padding:2px; gap:2px}
.fin-toggle2 button{border:0; background:transparent; cursor:pointer; width:30px; height:28px; border-radius:5px; color:var(--cs-text-soft,#4C5165); display:inline-flex; align-items:center; justify-content:center}
.fin-toggle2 button.on{background:var(--cs-primary,#081A45); color:#fff}
.fin-toggle2 button ion-icon{font-size:16px}
.fin-btn-navy{display:inline-flex; align-items:center; gap:7px; height:34px; padding:0 13px; background:var(--cs-primary,#081A45); color:#fff; border:1px solid var(--cs-primary,#081A45); border-radius:8px; font-size:13px; font-weight:700; cursor:pointer; text-decoration:none}
.fin-btn-navy:hover{background:var(--cs-primary-hover,#122352)}
.fin-btn-navy ion-icon{font-size:15px}
.fin-scn-count{display:inline-flex; align-items:center; justify-content:center; min-width:17px; height:17px; padding:0 4px; border-radius:999px; background:var(--cs-accent,#C9A353); color:var(--cs-primary,#081A45); font-size:10px; font-weight:800}

/* Cockpit : colonne principale + volet droit */
.fin-cockpit{display:flex; gap:14px; align-items:flex-start}
.fin-cockpit__main{flex:1 1 auto; min-width:0}
.fin-cockpit__rail{width:238px; flex:none; display:flex; flex-direction:column; gap:12px}
@media(max-width:960px){.fin-cockpit{flex-direction:column} .fin-cockpit__rail{width:100%; flex-direction:row}}
.fin-panel{margin-bottom:14px}

/* Tableau */
.fin-cash-wrap{overflow-x:auto}
table.fin-cash{border-collapse:separate; border-spacing:0; width:100%; font-size:12.5px}
.fin-cash th,.fin-cash td{padding:6px 12px; text-align:right; white-space:nowrap; font-weight:400}
.fin-cash thead th{position:sticky; top:0; z-index:5; background:var(--cs-surface-variant,#EEEADF); color:var(--cs-text-soft,#4C5165); font-size:11px; font-weight:700; border-bottom:1px solid var(--cs-border-strong,#C6BFAC); vertical-align:bottom}
.fin-cash__lbl{position:sticky; left:0; z-index:2; text-align:left; background:var(--cs-card,#fff); min-width:230px}
.fin-cash thead th.fin-cash__lbl{z-index:6}
.fin-cash__mo{display:block; font-weight:800; color:var(--cs-text,#12172B); font-size:11.5px}
.fin-cash__tag{display:block; font-size:9px; font-weight:600; font-style:italic; color:var(--cs-muted,#71768A)}
.fin-num{font-variant-numeric:tabular-nums}
.fin-cash td.is-fut,.fin-cash th.is-fut{background-color:color-mix(in srgb, var(--cs-accent,#C9A353) 7%, transparent)}
.fin-cash .is-today{border-left:2px solid var(--cs-primary,#081A45)}

/* Synthèse (5 lignes) */
.fin-cash-syn th,.fin-cash-syn td{border-bottom:1px solid var(--cs-hair,#F1ECDF); font-weight:600}
.fin-cash-syn .fin-cash__lbl{display:flex; align-items:center; gap:9px; font-weight:600; color:var(--cs-text,#12172B)}
.fin-cash-syn--pos .fin-cash__lbl,.fin-cash-syn--pos td{font-weight:800; color:var(--cs-text,#12172B)}
.fin-cash-syn--fin th,.fin-cash-syn--fin td{font-weight:800; color:var(--cs-primary,#081A45); background:var(--cs-primary-container,#DCE2F1)}
.fin-cash-ar{width:17px; height:17px; border-radius:5px; display:inline-flex; align-items:center; justify-content:center; flex:none}
.fin-cash-ar ion-icon{font-size:11px}
.fin-cash-ar--in{background:var(--cs-success-bg,#dcfce7); color:var(--cs-success,#15803d)}
.fin-cash-ar--out{background:var(--cs-danger-bg,#fee2e2); color:var(--cs-danger,#dc2626)}
.fin-cash-ar--var{background:var(--cs-surface-variant,#EEEADF); color:var(--cs-text-soft,#4C5165)}
.fin-cash-gap td,.fin-cash-gap th{height:9px; padding:0; border:0; background:var(--cs-card,#fff)}

/* Détail : familles + catégories */
.fin-cash-grp{cursor:pointer}
.fin-cash-grp th,.fin-cash-grp td{background:var(--cs-card,#fff); font-weight:700; color:var(--cs-text,#12172B); border-top:1px solid var(--cs-border,#DED8C9); border-bottom:1px dashed var(--cs-border,#DED8C9)}
.fin-cash-grp .fin-cash__lbl{display:flex; align-items:center; gap:7px}
.fin-cash-chev{display:inline-flex; color:var(--cs-muted,#71768A); transition:transform .15s; flex:none}
.fin-cash-chev ion-icon{font-size:13px}
.fin-cash-grp.collapsed .fin-cash-chev{transform:rotate(-90deg)}
.fin-cash-cat th,.fin-cash-cat td{border-top:1px solid var(--cs-hair,#F1ECDF); color:var(--cs-text-soft,#4C5165)}
.fin-cash-cat .fin-cash__lbl{padding-left:30px}
.fin-cash-pos{color:var(--cs-text,#12172B)}
.fin-cash-neg{color:var(--cs-danger,#dc2626)}
.fin-cash-z{color:#B7B2A4}
.fin-cash-in{display:inline-flex; align-items:center; gap:2px; justify-content:flex-end}
.fin-cash-input{width:74px; text-align:right; border:1px solid var(--cs-border-strong,#C6BFAC); border-radius:6px; padding:2px 5px; font-size:12px; background:var(--cs-card,#fff); color:var(--cs-text,#12172B); font-variant-numeric:tabular-nums}
.fin-cash-auto{display:block; font-size:9px; color:var(--cs-accent-ink,#B4863A)}
.fin-cash-foot{display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; padding:11px 14px; border-top:1px solid var(--cs-border,#DED8C9)}

/* Volet droit */
.fin-rail-card{padding:14px 15px}
.fin-rail-card__t{display:flex; align-items:center; justify-content:space-between; font-size:10.5px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; color:var(--cs-muted,#71768A)}
.fin-rail-solde{display:flex; align-items:center; gap:8px; margin-top:8px; font-size:25px; font-weight:800; letter-spacing:-.02em; color:var(--cs-text,#12172B)}
.fin-rail-bk{width:26px; height:26px; border-radius:7px; background:var(--cs-primary-container,#DCE2F1); display:inline-flex; align-items:center; justify-content:center; color:var(--cs-primary,#081A45); flex:none}
.fin-rail-bk ion-icon{font-size:15px}
.fin-rail-note{margin-top:6px; font-size:11px; color:var(--cs-muted,#71768A)}
.fin-rail-line{display:flex; align-items:center; gap:10px; padding:9px 0; border-top:1px solid var(--cs-hair,#F1ECDF)}
.fin-rail-line:first-of-type{border-top:0}
.fin-rail-ic{width:24px; height:24px; border-radius:6px; display:inline-flex; align-items:center; justify-content:center; flex:none}
.fin-rail-ic ion-icon{font-size:14px}
.fin-rail-ic--in{background:var(--cs-success-bg,#dcfce7); color:var(--cs-success,#15803d)}
.fin-rail-ic--out{background:var(--cs-danger-bg,#fee2e2); color:var(--cs-danger,#dc2626)}
.fin-rail-ic--var{background:var(--cs-primary-container,#DCE2F1); color:var(--cs-primary,#081A45)}
.fin-rail-l{font-size:11px; color:var(--cs-muted,#71768A); font-weight:600}
.fin-rail-v{margin-left:auto; font-weight:800; font-size:15px}

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE (≤960px) — rendre le cockpit financier réellement utilisable au doigt.

   CORRECTIF CLÉ (Plan de trésorerie) : sur écran empilé, le large tableau
   poussait la chaîne flex (.fin-cockpit / .fin-cockpit__main) au-delà du
   viewport ; .cs-main{overflow-x:hidden} rognait alors les mois de droite,
   invisibles ET non défilables. On borne la chaîne à 100 % (avec .cxr-body,
   borné dans admin.php) pour que .fin-cash-wrap redevienne le SEUL conteneur à
   défilement horizontal — 1re colonne (« Catégorie ») figée conservée, cases
   futures éditables tappables (la règle input globale leur donne déjà 16px,
   pas de zoom iOS au focus).
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width:960px){
  .fin-cockpit,
  .fin-cockpit__main{ max-width:100%; min-width:0; }

  /* Défilement horizontal fluide au doigt du Plan. */
  .fin-cash-wrap{ -webkit-overflow-scrolling:touch; overscroll-behavior-x:contain; }

  /* Colonne « Catégorie » figée mais COMPACTE : laisse voir ~2 mois d'un coup.
     th/td.fin-cash__lbl : spécificité (0,1,1) pour battre la base .fin-cash th
     (0,1,1, plus tôt dans la cascade) et autoriser le retour à la ligne. */
  .fin-cash th.fin-cash__lbl,
  .fin-cash td.fin-cash__lbl{ min-width:118px; width:130px; white-space:normal; }
  .fin-cash-cat .fin-cash__lbl{ padding-left:14px; }
  .fin-cash th, .fin-cash td{ padding:7px 9px; }
  /* Liseré de séparation de la colonne figée pendant le défilement. */
  .fin-cash__lbl{ box-shadow:1px 0 0 var(--cs-border,#DED8C9); }

  /* Comptabilité : tableaux .fin-tbl scrollables horizontalement (aucune
     colonne rognée). Le tableau prend sa largeur de contenu (min-width:
     max-content) et .fin-tblwrap gère le scroll ; les tables étroites gardent
     100 % (pas de scroll inutile). */
  .fin-tblwrap{ -webkit-overflow-scrolling:touch; overscroll-behavior-x:contain; }
  .fin-tbl{ min-width:max-content; }
}

/* ── Volet droit du cockpit sur petit écran (≤640px) ──────────────────────────
   Entre 640 et 960px, .fin-cockpit__rail passe en RANGÉE (row) ; sous 640px cette
   rangée devient trop étroite (soldes/lignes écrasés). On empile alors ses cartes
   verticalement, chacune en pleine largeur. */
@media (max-width:640px){
  .fin-cockpit__rail{ flex-direction:column; min-width:0; }
  .fin-cockpit__rail > *{ width:100%; min-width:0; }
}

/* ══ .fin-tbl → cartes empilées sous 767px ═══════════════════════════════════
   Les tables finance (.fin-tbl : Trésorerie/Budgets/Scénarios/Consolidation/
   Alertes/Écritures, opérations bancaires…) ne se convertissaient PAS en cartes :
   sous 767px elles restaient en scroll horizontal (min-width:max-content ci-dessus).
   On réplique EXACTEMENT le comportement de .cs-table (cf. app.css) : thead masqué,
   chaque <tr> = carte, chaque <td> = ligne libellé (data-label, hydraté par le JS
   de admin.php sur toute table de .cs-main) / valeur. Sélecteur .cs-main table.fin-tbl
   (spécificité 0,1,2) > .fin-tbl (0,1,0) : bat le min-width:max-content, DESKTOP intact
   (règles bornées à ≤767px). La grande table du Plan (.fin-cash) n'est PAS visée
   (classe distincte) : elle garde son défilement horizontal + colonne figée. */
@media (max-width:767px){
  .fin-tblwrap{ overflow-x:visible; }

  .cs-main table.fin-tbl{
    min-width:0 !important; width:100%;
    border-collapse:separate; border-spacing:0 10px;
  }
  .cs-main table.fin-tbl thead{ display:none; }
  .cs-main table.fin-tbl tbody,
  .cs-main table.fin-tbl tr,
  .cs-main table.fin-tbl td{ display:block; width:100%; }
  .cs-main table.fin-tbl tr{
    background:var(--cs-card,#fff); border:1px solid var(--cs-border,#DED8C9);
    border-radius:12px; box-shadow:var(--cs-shadow,0 1px 2px rgba(8,26,69,.05));
    overflow:hidden;
  }
  .cs-main table.fin-tbl td{
    display:flex; justify-content:space-between; align-items:flex-start; gap:14px;
    padding:10px 12px; border-bottom:1px solid var(--cs-border,#DED8C9);
    white-space:normal !important; text-align:left !important;
  }
  .cs-main table.fin-tbl td:last-child{ border-bottom:0; }
  .cs-main table.fin-tbl td::before{
    content:attr(data-label); flex:0 0 42%; max-width:42%;
    color:var(--cs-muted,#71768A); font-size:11px; font-weight:850;
    letter-spacing:0; text-transform:uppercase;
  }
  /* Lignes « vides » (colspan, ex. état vide) : bloc plein, sans libellé fantôme. */
  .cs-main table.fin-tbl td[colspan]{ display:block; }
  .cs-main table.fin-tbl td[colspan]::before{ content:none; }
  /* Les cellules montant (.fin-r) ne restent pas collées à droite du libellé. */
  .cs-main table.fin-tbl td.fin-r{ text-align:left !important; }
  .cs-main table.fin-tbl td > *{ min-width:0; }

  /* Cellules riches (opérations bancaires : select catégorie / note-details /
     upload) : passent en PILE pleine largeur sous leur libellé, lisibles au doigt. */
  .cs-main table.fin-tbl td:has(form),
  .cs-main table.fin-tbl td:has(details),
  .cs-main table.fin-tbl td:has(select){
    flex-direction:column; align-items:stretch;
  }
  .cs-main table.fin-tbl td:has(form) > form,
  .cs-main table.fin-tbl td:has(details) > details{ width:100%; max-width:none; }
  .cs-main table.fin-tbl td:has(select) select{ width:100%; max-width:none !important; }
}
/* Barre d'outils, segments et lignes finance : jamais plus larges que l'écran. */
@media (max-width:767px){
  /* Valeur faite de texte + pastille (« Compte · Banque ») : passe à la ligne au lieu d’être écrasée. */
  .cs-main table.fin-tbl td:not(:has(form, details, select)){ flex-wrap:wrap; }
  .cs-main table.fin-tbl td:not(:has(form, details, select)) > *{ min-width:min-content; }
  .cs-main table.fin-tbl td:where(:has(> :nth-child(2)), :has(> :is(div, p, small, br))):not(:has(form, details, select)){ display:block; }
  .cs-main table.fin-tbl td:where(:has(> :nth-child(2)), :has(> :is(div, p, small, br))):not(:has(form, details, select))::before{ display:block; max-width:none; margin-bottom:4px; }
  .fin-field{ min-width:0; max-width:100%; }
  .fin-seg{ max-width:100%; overflow-x:auto; scrollbar-width:none; }
  .fin-seg > *{ flex:none; }
  .fin-plan-bar__period{ flex-wrap:wrap; }
}
@media (max-width:960px){
  .fin-line, .fin-line__k, .fin-line form{ flex-wrap:wrap; min-width:0; }
}

/* =============================================================================
   ▓▓▓ ACCOUNTING COCKPIT (module scoping .acc-*) ▓▓▓
   Résorbé depuis www/assets/css/accounting-cockpit.css (convergence « un seul
   fichier admin.css », 2026-09-25). Complète le cockpit finance (.fin-*, ci-dessus)
   pour l'aire Comptabilité — écritures/journaux (.acc-e/-j/-card/-filter/-reg).
   Règles relocalisées telles quelles — zéro changement visuel.
   ============================================================================= */
/**
 * accounting-cockpit.css — complète finance-cockpit.css (.fin-*) pour l'aire
 * COMPTABILITÉ du module unifié.
 *
 * Le gabarit d'accueil (façade « à traiter », carte « préparé auto », libellés de
 * section) est désormais PARTAGÉ dans finance-cockpit.css d'evya-42 :
 * .fin-task-list / .fin-task(+__ic/__b/__go) / .fin-ic--{accent,info,warn,ok} /
 * .fin-clear / .fin-auto(+__ic/__t) / .fin-lab. Ce fichier ne garde donc QUE les
 * pièces SPÉCIFIQUES compta : le registre d'écritures dépliable + sa recherche.
 *
 * RÈGLE : 100 % tokens (var(--cs-*)/var(--evya-*)), zéro hex hors repli des var().
 * Namespace .acc-* — aucune collision avec fin-/cs-/ds-.
 */

/* ── Barre de recherche + filtres journal (registre) ──────────────────────────── */
.acc-filter{display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:6px}
.acc-filter input[type=search],.acc-filter input[type=text]{
  flex:1; min-width:180px; padding:9px 12px; border:1px solid var(--cs-border,#DED8C9);
  border-radius:10px; background:var(--cs-bg-soft,#fff); color:var(--cs-text,#12172B); font:inherit; font-size:13px;
}
.acc-jchip{
  border:1px solid var(--cs-border-strong,#C6BFAC); background:transparent; border-radius:999px;
  padding:6px 14px; font-size:12px; font-weight:700; color:var(--cs-text-soft,#4C5165); cursor:pointer;
}
.acc-jchip.is-on{background:var(--cs-primary,#081A45); color:#fff; border-color:var(--cs-primary,#081A45)}

/* ── Registre d'écritures dépliable (l'écriture = l'unité qu'on scanne) ────────── */
.acc-reg{display:flex; flex-direction:column; border-top:1px solid var(--cs-border,#DED8C9)}
.acc-e{border-bottom:1px solid var(--cs-border,#DED8C9)}
.acc-e__row{
  display:flex; align-items:center; gap:12px; padding:12px 6px; cursor:pointer;
  list-style:none; transition:background .12s;
}
.acc-e__row::-webkit-details-marker{display:none}
.acc-e__row:hover{background:var(--cs-surface,#FCFAF4)}
.acc-e__date{font-size:12px; color:var(--cs-muted,#71768A); width:44px; flex:none; font-variant-numeric:tabular-nums}
.acc-e__j{
  font-size:11px; font-weight:700; padding:2px 8px; border-radius:6px; flex:none;
  min-width:32px; text-align:center;
}
.acc-j--ve{background:var(--cs-info-bg,#dbeafe); color:var(--cs-info,#0369a1)}
.acc-j--ac{background:var(--cs-warning-bg,#fef3c7); color:var(--cs-warning,#d97706)}
.acc-j--bq{background:var(--cs-success-bg,#dcfce7); color:var(--cs-success,#15803d)}
.acc-j--od{background:var(--cs-surface-variant,#EEEADF); color:var(--cs-muted,#71768A)}
.acc-e__lab{flex:1; min-width:0; font-size:14px; font-weight:600; color:var(--cs-text,#12172B); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.acc-e__amt{font-size:14px; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; color:var(--cs-text,#12172B)}
.acc-e__ok{color:var(--cs-success,#15803d); font-size:16px; flex:none}
.acc-e__chev{color:var(--cs-muted,#71768A); font-size:15px; flex:none; transition:transform .15s}
.acc-e[open] .acc-e__chev{transform:rotate(90deg)}
.acc-e__lines{padding:2px 6px 12px}
.acc-e__l{
  display:grid; grid-template-columns:64px 1fr 104px 104px; gap:10px; padding:8px 10px; font-size:12.5px;
  background:var(--cs-surface,#FCFAF4);
}
.acc-e__l:nth-child(1){border-top-left-radius:8px; border-top-right-radius:8px}
.acc-e__l:last-of-type{border-bottom-left-radius:8px; border-bottom-right-radius:8px}
.acc-e__l + .acc-e__l{border-top:1px solid var(--cs-border,#DED8C9)}
.acc-e__l .acc-c{color:var(--cs-muted,#71768A); font-variant-numeric:tabular-nums}
.acc-e__l .acc-n{text-align:right; font-variant-numeric:tabular-nums}
.acc-e__l--head{background:transparent; color:var(--cs-muted,#71768A); font-size:10.5px; text-transform:uppercase; letter-spacing:.03em; font-weight:700; padding-bottom:2px}
.acc-e__l--tot{font-weight:700; color:var(--cs-text,#12172B)}
.acc-e__meta{font-size:11.5px; color:var(--cs-muted,#71768A); padding:8px 10px 2px}

/* ── Balance : sous-en-tête de classe comptable + total général ───────────────── */
.fin-tbl tbody tr.acc-bal-cls td{
  background:var(--cs-surface-variant,#EEEADF); font-weight:800; font-size:11px;
  color:var(--cs-text,#12172B); text-transform:uppercase; letter-spacing:.03em;
  border-bottom:1px solid var(--cs-border,#DED8C9);
}
.fin-tbl tbody tr.acc-bal-acc td{font-size:13px}
.fin-tbl tfoot tr.acc-bal-tot td{font-weight:800; font-size:13px; border-top:2px solid var(--cs-border-strong,#C6BFAC); background:var(--cs-card,#fff)}

/* ── Saisie : carte de formulaire focalisée (gabarit SAISIE) ──────────────────── */
.acc-card{background:var(--cs-card,#fff); border:1px solid var(--cs-border,#DED8C9); border-radius:12px; padding:16px 18px; margin-bottom:14px}
.acc-card__h{font-size:14px; font-weight:700; color:var(--cs-text,#12172B); margin:0 0 13px; display:flex; align-items:center; gap:7px}
.acc-card__h ion-icon{color:var(--evya-accent,#B4863A); font-size:17px}
details.acc-card > summary{list-style:none}
details.acc-card > summary::-webkit-details-marker{display:none}

/* =============================================================================
   ▓▓▓ MÉDIATHÈQUE (module scoping .mlib-*) ▓▓▓
   Résorbé depuis www/assets/css/media-library.css (convergence « un seul fichier
   admin.css », 2026-09-25). Éditeur médiathèque niveau WordPress (grille/liste/
   détail/upload) — vocabulaire propre .mlib-*, tokens --mlib-* internes + --cs-*.
   Règles relocalisées telles quelles — zéro changement visuel.
   ============================================================================= */
/* ═══════════════════════════════════════════════════════════════════════════
 * Bibliothèque média — styles dédiés (refonte médiathèque, Lane C / Session 4).
 *
 * Fichier PROPRE à l'écran « Contenu > Médias » (admin/views/modules/
 * site-vitrine/media.php + public/assets/js/admin-media-library.js).
 * NE contient PAS de styles partagés : app.css reste la source des classes
 * `.cs-*`. Ici tout est préfixé `mlib-` pour ne jamais entrer en collision.
 * Les tokens de couleur (--cs-*) sont hérités d'app.css / tokens.css.
 *
 * Accessibilité : focus visible sur tout élément interactif, contrastes AA,
 * aucun état signalé par la seule couleur (icônes + texte), cibles ≥ 32px.
 * ═══════════════════════════════════════════════════════════════════════════ */

.mlib {
    --mlib-gap: 14px;
    --mlib-border: var(--cs-border, #e2e8f0);
    --mlib-muted: var(--cs-muted, #64748b);
    --mlib-primary: var(--cs-primary, #1C1C3A);
    --mlib-radius: var(--cs-radius-sm, 8px);
    display: block;
}

/* Focus visible homogène (WCAG 2.4.7) — jamais retiré. */
.mlib :focus-visible {
    outline: 2px solid var(--mlib-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Barre d'outils ─────────────────────────────────────────────────────── */
.mlib-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--mlib-border);
    border-radius: var(--cs-radius, 14px);
    background: #fff;
    margin-bottom: 16px;
}
.mlib-toolbar__group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.mlib-toolbar__spacer { flex: 1 1 auto; }

.mlib-search {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 200px;
    flex: 1 1 220px;
}
.mlib-search ion-icon {
    position: absolute;
    left: 10px;
    font-size: 16px;
    color: var(--mlib-muted);
    pointer-events: none;
}
.mlib-search input {
    width: 100%;
    padding: 8px 10px 8px 32px;
    border: 1px solid var(--mlib-border);
    border-radius: var(--mlib-radius);
    font-size: 13px;
    color: var(--cs-text, #0f172a);
    background: #fff;
}
.mlib-select {
    padding: 8px 10px;
    border: 1px solid var(--mlib-border);
    border-radius: var(--mlib-radius);
    font-size: 13px;
    background: #fff;
    color: var(--cs-text, #0f172a);
    max-width: 100%;
}

/* Bascule grille / liste (groupe de boutons, aria-pressed). */
.mlib-viewtoggle {
    display: inline-flex;
    border: 1px solid var(--mlib-border);
    border-radius: var(--mlib-radius);
    overflow: hidden;
}
.mlib-viewtoggle button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 36px;
    border: 0;
    background: #fff;
    color: var(--mlib-muted);
    cursor: pointer;
    font-size: 18px;
}
.mlib-viewtoggle button + button { border-left: 1px solid var(--mlib-border); }
.mlib-viewtoggle button[aria-pressed="true"] {
    background: var(--mlib-primary);
    color: #fff;
}

/* ── Zone de dépôt / upload ─────────────────────────────────────────────── */
.mlib-dropzone {
    position: relative;
    border: 2px dashed var(--mlib-border);
    border-radius: var(--cs-radius, 14px);
    background: var(--cs-surface, #f8fafc);
    padding: 22px;
    text-align: center;
    color: var(--mlib-muted);
    margin-bottom: 16px;
    transition: border-color .15s ease, background .15s ease;
}
.mlib-dropzone.is-drag {
    border-color: var(--mlib-primary);
    background: #eef2ff;
    color: var(--mlib-primary);
}
.mlib-dropzone ion-icon { font-size: 34px; display: block; margin: 0 auto 6px; }
.mlib-dropzone strong { color: var(--cs-text, #0f172a); }
.mlib-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}
.mlib-dropzone .mlib-browse {
    color: var(--mlib-primary);
    font-weight: 700;
    text-decoration: underline;
}

/* File d'attente d'upload (progression / erreur par fichier). */
.mlib-uploads {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
    text-align: left;
}
.mlib-uploads:empty { display: none; }
.mlib-upload {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 6px 12px;
    padding: 8px 10px;
    border: 1px solid var(--mlib-border);
    border-radius: var(--mlib-radius);
    background: #fff;
    font-size: 12px;
}
.mlib-upload__name {
    font-weight: 600;
    color: var(--cs-text, #0f172a);
    word-break: break-word;
}
.mlib-upload__state { color: var(--mlib-muted); white-space: nowrap; }
.mlib-upload.is-error { border-color: var(--cs-danger, #b91c1c); }
.mlib-upload.is-error .mlib-upload__state { color: var(--cs-danger, #b91c1c); font-weight: 700; }
.mlib-upload.is-done .mlib-upload__state { color: #15803d; font-weight: 700; }
.mlib-upload__bar {
    grid-column: 1 / -1;
    height: 5px;
    border-radius: 3px;
    background: #e2e8f0;
    overflow: hidden;
}
.mlib-upload__bar > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--mlib-primary);
    transition: width .2s ease;
}
.mlib-upload.is-error .mlib-upload__bar > span { background: var(--cs-danger, #b91c1c); }
.mlib-upload.is-done .mlib-upload__bar > span { background: #15803d; }

/* ── Barre de sélection (actions groupées) ──────────────────────────────── */
.mlib-selbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--mlib-primary);
    border-radius: var(--mlib-radius);
    background: #eef2ff;
    margin-bottom: 14px;
}
.mlib-selbar[hidden] { display: none; }
.mlib-selbar__count { font-weight: 700; color: var(--mlib-primary); }
.mlib-selbar__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* ── Compteurs / méta ───────────────────────────────────────────────────── */
.mlib-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--mlib-muted);
    margin-bottom: 10px;
}

/* ── États (chargement / vide / erreur) ─────────────────────────────────── */
.mlib-state {
    padding: 40px 16px;
    text-align: center;
    color: var(--mlib-muted);
    border: 1px solid var(--mlib-border);
    border-radius: var(--cs-radius, 14px);
    background: #fff;
}
.mlib-state[hidden] { display: none; }
.mlib-state ion-icon { font-size: 40px; display: block; margin: 0 auto 8px; }
.mlib-state.is-error { color: var(--cs-danger, #b91c1c); border-color: var(--cs-danger, #b91c1c); }
.mlib-spinner {
    width: 30px; height: 30px; margin: 0 auto 10px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--mlib-primary);
    border-radius: 50%;
    animation: mlib-spin .7s linear infinite;
}
@keyframes mlib-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .mlib-spinner { animation-duration: 2s; }
    .mlib-upload__bar > span { transition: none; }
}

/* ── Vue GRILLE ─────────────────────────────────────────────────────────── */
.mlib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--mlib-gap);
}
.mlib-grid[hidden] { display: none; }
.mlib-card {
    position: relative;
    border: 1px solid var(--mlib-border);
    border-radius: var(--mlib-radius);
    background: #fff;
    overflow: hidden;
    text-align: left;
}
.mlib-card.is-selected {
    border-color: var(--mlib-primary);
    box-shadow: 0 0 0 3px rgba(28, 28, 58, .22);
}
.mlib-card__open {
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}
.mlib-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    overflow: hidden;
}
.mlib-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mlib-thumb__icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--mlib-muted);
    font-size: 40px;
}
.mlib-thumb__icon span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.mlib-card__name {
    padding: 6px 8px;
    font-size: 11.5px;
    color: var(--cs-text, #0f172a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Case de sélection (coin) — toujours visible au survol / focus / sélection. */
.mlib-card__check {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    width: 22px;
    height: 22px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--mlib-primary);
    opacity: 0;
    transition: opacity .12s ease;
}
.mlib-card:hover .mlib-card__check,
.mlib-card:focus-within .mlib-card__check,
.mlib-card.is-selected .mlib-card__check { opacity: 1; }
/* Pastille type (coin haut-droit) — texte, pas seulement couleur. */
.mlib-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(15, 23, 42, .82);
    color: #fff;
}

/* ── Vue LISTE ──────────────────────────────────────────────────────────── */
.mlib-listwrap { overflow-x: auto; }
.mlib-listwrap[hidden] { display: none; }
.mlib-list {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
    border: 1px solid var(--mlib-border);
    border-radius: var(--cs-radius, 14px);
}
.mlib-list th, .mlib-list td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--cs-border-soft, #f1f5f9);
    vertical-align: middle;
    white-space: nowrap;
}
.mlib-list thead th {
    color: var(--mlib-muted);
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .03em;
    position: sticky;
    top: 0;
    background: var(--cs-surface, #f8fafc);
}
.mlib-list th.mlib-sortable button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    background: none;
    cursor: pointer;
    color: inherit;
    font: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    padding: 0;
}
.mlib-list th.mlib-sortable ion-icon { font-size: 13px; opacity: .5; }
.mlib-list th.mlib-sortable[aria-sort="ascending"] ion-icon,
.mlib-list th.mlib-sortable[aria-sort="descending"] ion-icon { opacity: 1; color: var(--mlib-primary); }
.mlib-list tbody tr { cursor: pointer; }
.mlib-list tbody tr:hover { background: #f8fafc; }
.mlib-list tbody tr.is-selected { background: #eef2ff; }
.mlib-list .mlib-list__title { font-weight: 600; color: var(--cs-text, #0f172a); white-space: normal; }
.mlib-list .mlib-list__file { color: var(--mlib-muted); font-size: 12px; }
.mlib-list__thumb {
    width: 44px; height: 44px;
    border-radius: 6px;
    object-fit: cover;
    background: #f1f5f9;
    display: block;
}
.mlib-list__thumb--icon {
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: var(--mlib-muted);
}
.mlib-usage-pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 700;
    padding: 2px 8px; border-radius: 999px;
}
.mlib-usage-pill.is-used { background: #dcfce7; color: #166534; }
.mlib-usage-pill.is-free { background: #f1f5f9; color: var(--mlib-muted); }

/* ── Pagination ─────────────────────────────────────────────────────────── */
.mlib-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--mlib-muted);
}
.mlib-pager[hidden] { display: none; }

/* ── Panneau DÉTAIL (dialogue modal + drawer) ───────────────────────────── */
.mlib-detail {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
}
.mlib-detail[hidden] { display: none; }
.mlib-detail__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .5);
}
.mlib-detail__dialog {
    position: relative;
    width: min(560px, 100%);
    max-width: 100%;
    height: 100%;
    background: #fff;
    box-shadow: -12px 0 40px rgba(15, 23, 42, .22);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    animation: mlib-slidein .18s ease;
}
@keyframes mlib-slidein { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mlib-detail__dialog { animation: none; } }

.mlib-detail__head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mlib-border);
    background: #fff;
}
.mlib-detail__head h2 { margin: 0; font-size: 15px; font-weight: 800; flex: 1 1 auto; }
.mlib-detail__nav { display: flex; gap: 4px; }
.mlib-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border: 1px solid var(--mlib-border);
    border-radius: var(--mlib-radius);
    background: #fff;
    color: var(--cs-text, #0f172a);
    cursor: pointer;
    font-size: 18px;
}
.mlib-iconbtn:hover:not(:disabled) { border-color: var(--mlib-primary); }
.mlib-iconbtn:disabled { opacity: .4; cursor: not-allowed; }

.mlib-detail__body { padding: 16px; display: grid; gap: 16px; }
.mlib-detail__preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    max-height: 320px;
    border-radius: var(--mlib-radius);
    background: #0f172a;
    overflow: hidden;
}
.mlib-detail__preview img,
.mlib-detail__preview video { max-width: 100%; max-height: 320px; display: block; }
.mlib-detail__preview .mlib-thumb__icon { color: #cbd5e1; }

.mlib-fieldrow { display: grid; gap: 5px; }
.mlib-fieldrow label { font-size: 12px; font-weight: 700; color: var(--cs-text, #0f172a); }
.mlib-fieldrow .mlib-hint { font-size: 11px; color: var(--mlib-muted); font-weight: 400; }
.mlib-fieldrow input,
.mlib-fieldrow textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--mlib-border);
    border-radius: var(--mlib-radius);
    font-size: 13px;
    font-family: inherit;
    color: var(--cs-text, #0f172a);
    background: #fff;
}
.mlib-fieldrow textarea { min-height: 64px; resize: vertical; }

.mlib-specs {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 14px;
    font-size: 12.5px;
    padding: 12px;
    border: 1px solid var(--mlib-border);
    border-radius: var(--mlib-radius);
    background: var(--cs-surface, #f8fafc);
}
.mlib-specs dt { color: var(--mlib-muted); font-weight: 600; }
.mlib-specs dd { margin: 0; color: var(--cs-text, #0f172a); word-break: break-word; }

.mlib-copyrow { display: flex; gap: 6px; }
.mlib-copyrow input {
    flex: 1 1 auto;
    padding: 7px 9px;
    border: 1px solid var(--mlib-border);
    border-radius: var(--mlib-radius);
    font-size: 12px;
    color: var(--mlib-muted);
    background: var(--cs-surface, #f8fafc);
}

.mlib-usages { display: grid; gap: 6px; }
.mlib-usages li {
    list-style: none;
    font-size: 12.5px;
    padding: 6px 10px;
    border: 1px solid var(--mlib-border);
    border-radius: var(--mlib-radius);
    background: #fff;
}
.mlib-usages a { color: var(--mlib-primary); font-weight: 600; }

.mlib-detail__foot {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--mlib-border);
    background: #fff;
}
.mlib-detail__foot .mlib-status { flex: 1 1 100%; font-size: 12px; min-height: 16px; }
.mlib-status.is-ok { color: #15803d; }
.mlib-status.is-error { color: var(--cs-danger, #b91c1c); }

/* Visually-hidden mais lisible par lecteur d'écran (aria-live). */
.mlib-sr {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

/* ── Onglets Bibliothèque / Corbeille (Lane E / Session 6) ──────────────── */
.mlib-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--mlib-border);
}
.mlib-tabs__spacer { flex: 1 1 auto; }
.mlib-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 0;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--mlib-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.mlib-tab ion-icon { font-size: 16px; }
.mlib-tab.is-active {
    color: var(--mlib-primary);
    border-bottom-color: var(--mlib-primary);
}
.mlib-trash-note {
    font-size: 12px;
    color: var(--mlib-muted);
    background: var(--cs-surface, #f8fafc);
    border: 1px solid var(--mlib-border);
    border-radius: var(--mlib-radius);
    padding: 8px 12px;
    margin-bottom: 14px;
}
.mlib-trash-note[hidden] { display: none; }

/* ── Avertissement doublon à l'import ───────────────────────────────────── */
.mlib-upload--dup { border-color: #f59e0b; }
.mlib-dup {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
    margin-top: 4px;
}
.mlib-dup__msg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #b45309;
}
.mlib-dup__actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Éditeur d'image (recadrage / rotation / retournement / redim.) ─────── */
.mlib-editor {
    position: fixed;
    inset: 0;
    z-index: 1100;              /* au-dessus du panneau détail (1000) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.mlib-editor__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .6);
}
.mlib-editor__dialog {
    position: relative;
    width: min(680px, 100%);
    max-height: 100%;
    background: #fff;
    border-radius: var(--cs-radius, 14px);
    box-shadow: 0 20px 60px rgba(15, 23, 42, .35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mlib-editor__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mlib-border);
}
.mlib-editor__head h2 { margin: 0; font-size: 15px; font-weight: 800; flex: 1 1 auto; }
.mlib-editor__tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--mlib-border);
    background: var(--cs-surface, #f8fafc);
}
.mlib-editor__tools .mlib-iconbtn[aria-pressed="true"] {
    background: var(--mlib-primary);
    color: #fff;
    border-color: var(--mlib-primary);
}
.mlib-editor__resize {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
    font-size: 12px;
    color: var(--mlib-muted);
}
.mlib-editor__resize input {
    width: 78px;
    padding: 6px 8px;
    border: 1px solid var(--mlib-border);
    border-radius: var(--mlib-radius);
    font-size: 13px;
}
.mlib-editor__dims { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--cs-text, #0f172a); }
.mlib-editor__stage {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    padding: 16px;
    background: #0f172a;
    overflow: auto;
}
.mlib-editor__stage.is-cropping { cursor: crosshair; }
.mlib-editor__stage canvas {
    display: block;
    max-width: 100%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .15);
    touch-action: none;
}
.mlib-editor__cropbox {
    position: absolute;
    border: 2px dashed #fff;
    background: rgba(59, 130, 246, .22);
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, .35);
}
.mlib-editor__cropbox[hidden] { display: none; }
.mlib-editor__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--mlib-border);
}
.mlib-editor__foot .mlib-status { flex: 1 1 100%; font-size: 12px; min-height: 16px; margin: 0; }

/* ── Réactif ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .mlib-toolbar { padding: 10px; }
    .mlib-search { flex-basis: 100%; }
    .mlib-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .mlib-detail__dialog { width: 100%; }
    .mlib-editor__resize { margin-left: 0; }
    .mlib-editor__dims { margin-left: 0; }
}

/* =============================================================================
   ▓▓▓ REFONTE VISIBLE iOS/SaaS — primitives partagées (maquette validée) ▓▓▓
   2026-09-25. Réplique fidèle de la maquette « EVYA Admin · iOS » : liste
   groupée iOS (cs-group/cs-row), tuile métrique (cs-metric), pilule à point
   (cs-pill), maître-détail (cs-split). 100% tokens --cs-* et --evya-* (déjà navy/
   crème/or + dark mode). Réutilisables sur tout écran de la refonte.
   ============================================================================= */

/* ── Tuiles métriques (KPI façon iOS) ─────────────────────────────────────── */
.cs-metrics{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:24px; }
.cs-metric{ background:var(--cs-card); border:1px solid var(--cs-border); border-radius:var(--cs-radius,14px);
  padding:16px 18px; box-shadow:var(--cs-shadow); }
.cs-metric__k{ font-size:13px; color:var(--cs-muted); font-weight:600; display:flex; align-items:center; gap:7px; }
.cs-metric__ic{ width:26px; height:26px; border-radius:8px; display:grid; place-items:center; flex:none; }
.cs-metric__ic ion-icon{ font-size:15px; }
.cs-metric__v{ font-size:29px; font-weight:800; letter-spacing:-.03em; margin-top:10px; font-variant-numeric:tabular-nums;
  color:var(--cs-text); line-height:1.05; }
.cs-metric__d{ font-size:13px; font-weight:600; margin-top:3px; display:flex; align-items:center; gap:4px; color:var(--cs-muted); }
.cs-metric__d.is-up{ color:var(--cs-success); } .cs-metric__d.is-down{ color:var(--cs-danger); }

/* ── Section header (iOS grouped) ─────────────────────────────────────────── */
.cs-section-head{ font-size:13px; font-weight:700; color:var(--cs-muted); text-transform:uppercase;
  letter-spacing:.04em; margin:26px 6px 9px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.cs-section-head a{ font-size:13px; font-weight:700; color:var(--cs-primary); text-transform:none; letter-spacing:0; text-decoration:none; }
.cs-section-head a:hover{ text-decoration:underline; }

/* ── Liste groupée iOS (inset grouped list) ───────────────────────────────── */
.cs-group{ background:var(--cs-card); border:1px solid var(--cs-border); border-radius:var(--cs-radius,14px);
  overflow:hidden; box-shadow:var(--cs-shadow); }
.cs-row{ display:flex; align-items:center; gap:14px; padding:13px 16px; min-height:44px; position:relative;
  transition:background .12s; color:inherit; text-decoration:none; }
a.cs-row, .cs-row--tap{ cursor:pointer; }
.cs-row + .cs-row::before{ content:""; position:absolute; top:0; left:16px; right:0; height:1px; background:var(--cs-border); }
a.cs-row:hover, .cs-row--tap:hover{ background:var(--cs-surface); }
.cs-row__ava{ width:38px; height:38px; border-radius:11px; flex:none; display:grid; place-items:center;
  font-weight:700; font-size:15px; color:#fff; }
.cs-row__ava ion-icon{ font-size:18px; }
.cs-row__b{ min-width:0; flex:1; }
.cs-row__t{ font-size:15px; font-weight:600; letter-spacing:-.01em; color:var(--cs-text); }
.cs-row__s{ font-size:13px; color:var(--cs-muted); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cs-row__rt{ margin-left:auto; text-align:right; font-variant-numeric:tabular-nums; flex:none; }
.cs-row__amt{ font-size:15px; font-weight:700; color:var(--cs-text); }
.cs-row__chev{ color:var(--cs-muted); flex:none; display:inline-flex; }
.cs-row__chev ion-icon{ font-size:18px; }

/* ── Pilule à point (statut) ──────────────────────────────────────────────── */
.cs-pill{ display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:700; padding:3px 9px;
  border-radius:999px; letter-spacing:-.01em; white-space:nowrap; }
.cs-pill__d{ width:6px; height:6px; border-radius:50%; background:currentColor; flex:none; }
.cs-pill.is-ok{ background:var(--cs-success-bg); color:var(--cs-success); }
.cs-pill.is-warn{ background:var(--cs-warning-bg); color:var(--cs-warning); }
.cs-pill.is-danger{ background:var(--cs-danger-bg); color:var(--cs-danger); }
.cs-pill.is-info{ background:var(--cs-info-bg); color:var(--cs-info); }
.cs-pill.is-mut{ background:var(--cs-surface-variant); color:var(--cs-muted); }

/* ── Maître-détail (deux volets desktop, empilé mobile) ───────────────────── */
.cs-split{ display:grid; grid-template-columns:340px 1fr; gap:20px; align-items:start; }
.cs-split__pane{ min-width:0; }
.cs-split__detail{ position:sticky; top:78px; }
.cs-split__back{ display:none; margin-bottom:10px; }
@media (max-width:960px){ .cs-split{ grid-template-columns:1fr; gap:0; } .cs-split__detail{ position:static; }
  /* Téléphone : la fiche ouverte remplace la liste (lien retour), sans fiche la liste seule. */
  .cs-split.is-detail > .cs-split__pane{ display:none; } .cs-split.is-detail .cs-split__back{ display:inline-flex; }
  .cs-split:not(.is-detail) > .cs-split__detail{ display:none; } }

/* ── Responsive : métriques 2 col, marges écran ──────────────────────────── */
@media (max-width:860px){ .cs-metrics{ grid-template-columns:1fr 1fr; gap:12px; } }
@media (max-width:520px){ .cs-metrics{ grid-template-columns:1fr 1fr; } }

/* ── Cellule identité (avatar + nom) pour tables de données SaaS (maquette) ── */
.cs-who{ display:flex; align-items:center; gap:11px; min-width:0; }
.cs-who__ava{ width:34px; height:34px; border-radius:10px; flex:none; display:grid; place-items:center;
  color:#fff; font-weight:700; font-size:13px; background:var(--cs-primary); }
.cs-who__ava ion-icon{ font-size:17px; }
.cs-who__b{ min-width:0; }
.cs-who__t{ font-weight:600; color:var(--cs-text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cs-who__t a{ color:inherit; text-decoration:none; }
.cs-who__t a:hover{ color:var(--cs-primary); }
.cs-who__s{ font-size:12px; color:var(--cs-muted); margin-top:1px; }

/* ── État vide (liste/table sans résultat) — grammaire iOS sobre ──────────── */
.cs-empty{ display:flex; flex-direction:column; align-items:center; gap:8px; padding:40px 20px;
  text-align:center; color:var(--cs-muted); }
.cs-empty__ic{ width:52px; height:52px; border-radius:16px; display:grid; place-items:center;
  background:var(--cs-surface-variant); color:var(--cs-muted); margin-bottom:2px; }
.cs-empty__ic ion-icon{ font-size:26px; }
.cs-empty__t{ font-size:15px; font-weight:700; color:var(--cs-text); }
.cs-empty__s{ font-size:13.5px; color:var(--cs-muted); max-width:340px; }
.cs-empty a{ color:var(--cs-primary); font-weight:700; text-decoration:none; }
.cs-empty a:hover{ text-decoration:underline; }
/* Dans une cellule de table (td colspan) l'état vide reste centré. */
td > .cs-empty{ padding:34px 12px; }

/* =============================================================================
   ▓▓▓ MODALE / SHEET PARTAGÉE (cs-modal) — maquette validée ▓▓▓
   Bâtie sur <dialog> natif (focus piégé, Échap, ::backdrop gratuits). Carte
   centrée sur ordinateur, feuille qui remonte du bas sur mobile. In-place :
   ne quitte jamais la page. Ouverture : [data-cs-modal="idDialog"] ; fermeture :
   [data-cs-modal-close], clic sur le fond, ou Échap. JS: admin-modal.js.
   ============================================================================= */
dialog.cs-modal{
  border:0; padding:0; max-width:460px; width:calc(100% - 32px);
  border-radius:22px; background:var(--cs-card); color:var(--cs-text);
  box-shadow:var(--cs-shadow-lg, 0 24px 60px rgba(8,26,69,.28)); overflow:hidden;
  /* Colonne flex bornée à l'écran : l'en-tête et le pied restent visibles,
     seul le corps défile. Sans ça, sur mobile en-tête+corps+pied dépassent
     le bas de l'écran et le bouton Valider passe sous la barre d'onglets.
     ⚠ display:flex UNIQUEMENT sur [open] — sinon un <dialog> FERMÉ (display:none
     par défaut du navigateur) reste affiché en bas de page. */
  flex-direction:column; max-height:calc(100dvh - 40px);
}
dialog.cs-modal::backdrop{
  background:color-mix(in srgb, var(--evya-primary, #081A45) 34%, transparent);
  backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px);
}
dialog.cs-modal[open]{ display:flex; animation:cs-modal-pop .26s cubic-bezier(.2,.8,.2,1); }
@keyframes cs-modal-pop{ from{opacity:0; transform:scale(.94) translateY(8px)} to{opacity:1; transform:none} }
.cs-modal__grab{ display:none; }
.cs-modal__hd{ padding:20px 22px 8px; display:flex; align-items:flex-start; gap:14px; }
.cs-modal__ic{ width:46px; height:46px; border-radius:13px; flex:none; display:grid; place-items:center;
  color:#fff; background:var(--cs-primary); }
.cs-modal__ic ion-icon{ font-size:22px; }
.cs-modal__hb{ min-width:0; flex:1; }
.cs-modal__tt{ margin:0; font-size:19px; font-weight:700; letter-spacing:-.02em; color:var(--cs-text); }
.cs-modal__sub{ margin:2px 0 0; font-size:14px; color:var(--cs-muted); }
.cs-modal__x{ margin-left:auto; width:30px; height:30px; border-radius:50%; border:0;
  background:var(--cs-surface-variant); color:var(--cs-muted); cursor:pointer; display:grid; place-items:center; flex:none; }
.cs-modal__x ion-icon{ font-size:17px; }
.cs-modal__x:hover{ background:var(--cs-border-strong); color:var(--cs-text); }
.cs-modal__hd{ flex:none; }
.cs-modal__body{ padding:8px 22px 4px; flex:1 1 auto; min-height:0; overflow-y:auto; }
.cs-modal__ft{ flex:none; padding:16px 22px 22px; display:flex; gap:10px; }
.cs-modal__ft .cs-btn{ flex:1; }
.cs-modal__ft .cs-btn.cs-btn-ghost{ flex:0 0 auto; }
/* Feuille du bas sur mobile */
@media (max-width:640px){
  dialog.cs-modal{ max-width:none; width:100%; margin:auto auto 0; border-radius:22px 22px 0 0;
    max-height:calc(100dvh - 12px);
    padding-bottom:env(safe-area-inset-bottom); animation:cs-modal-up .3s cubic-bezier(.2,.8,.2,1); }
  .cs-modal__grab{ display:block; width:38px; height:5px; border-radius:3px; background:var(--cs-border-strong);
    margin:8px auto 0; }
}
@keyframes cs-modal-up{ from{transform:translateY(100%)} to{transform:none} }
@media (prefers-reduced-motion:reduce){ dialog.cs-modal[open]{ animation:none; } }
/* Un <form> qui enveloppe __body + __ft (ou tout le contenu) garde la colonne
   bornée : le corps défile, l'en-tête et le pied (Valider) restent visibles. Sans
   ça, le pied passait hors écran, sur mobile comme sur ordinateur (Promotions…). */
dialog.cs-modal > form,
dialog.fin-modal > form {
  display: flex; flex-direction: column; flex-wrap: nowrap; flex: 1 1 auto; min-height: 0; margin: 0;
  overflow-y: auto;
}
dialog.cs-modal > form > .cs-modal__hd,
dialog.cs-modal > form > .cs-modal__ft,
dialog.fin-modal > form > .fin-modal__head { flex: none; }
dialog.cs-modal > form > .cs-modal__body,
dialog.fin-modal > form > .fin-modal__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
/* Variante plein écran (aperçu de fichier, admin-doc-viewer.js) : grand panneau
   centré sur ordinateur, plein écran sur mobile (safe-area). Le corps est une
   scène qui défile : pages empilées (.cs-modal__page), message d'état
   (.cs-modal__state). */
dialog.cs-modal.cs-modal--full{ max-width:1120px; width:calc(100% - 48px); height:calc(100dvh - 48px); max-height:none; }
.cs-modal--full .cs-modal__hd{ padding:8px 8px 8px 18px; align-items:center; gap:8px; border-bottom:1px solid var(--cs-border); }
.cs-modal--full .cs-modal__tt{ font-size:16px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cs-modal--full .cs-modal__sub{ font-size:12px; }
.cs-modal--full .cs-modal__x{ width:44px; height:44px; margin-left:0; }
.cs-modal--full .cs-modal__body{ position:relative; display:flex; flex-direction:column; gap:12px; padding:12px;
  overflow:auto; overscroll-behavior:contain; touch-action:pan-x pan-y pinch-zoom; background:var(--cs-bg); }
.cs-modal__page{ flex:none; position:relative; width:100%; max-width:820px; margin:0 auto;
  background:var(--cs-card); box-shadow:var(--cs-shadow-md); }
.cs-modal__page canvas{ position:absolute; inset:0; display:block; width:100%; height:100%; }
img.cs-modal__page{ width:auto; max-width:100%; max-height:100%; margin:auto; object-fit:contain; cursor:zoom-in; }
img.cs-modal__page.is-actual{ max-width:none; max-height:none; cursor:zoom-out; }
.cs-modal__state{ margin:auto; display:flex; flex-direction:column; align-items:center; gap:12px; padding:24px;
  text-align:center; color:var(--cs-muted); }
.cs-modal__state p{ margin:0; }
@media (max-width:640px){
  /* Safe-area portée par l'en-tête et le corps (pas par le dialog : un tap dans
     sa marge serait pris pour un clic sur le fond par admin-modal.js). */
  dialog.cs-modal.cs-modal--full{ width:100%; height:100dvh; margin:0; border-radius:0; padding:0; }
  .cs-modal--full .cs-modal__hd{ gap:6px; padding:calc(8px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) 8px calc(14px + env(safe-area-inset-left)); }
  .cs-modal--full .cs-modal__hd .cs-btn{ padding:0 12px; }
  .cs-modal--full .cs-modal__hd .cs-btn > span{ display:none; }
  .cs-modal--full .cs-modal__body{ gap:8px; padding:8px calc(8px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left)); }
}

/* =============================================================================
   ▓▓▓ TOAST (confirmation d'action sans rechargement) ▓▓▓
   Retour discret pour les actions AJAX (admin-ajax.js). iOS-like, en bas.
   ============================================================================= */
.cs-toasts{ position:fixed; left:50%; bottom:calc(20px + env(safe-area-inset-bottom)); transform:translateX(-50%);
  z-index:9000; display:flex; flex-direction:column; gap:8px; align-items:center; pointer-events:none; width:max-content; max-width:calc(100% - 32px); }
.cs-toast{ display:inline-flex; align-items:center; gap:9px; background:var(--cs-primary); color:#fff;
  font-size:14px; font-weight:600; padding:11px 16px; border-radius:var(--r-pill,999px); box-shadow:var(--cs-shadow-lg,0 12px 40px rgba(8,26,69,.28));
  opacity:0; transform:translateY(10px) scale(.96); transition:opacity .22s, transform .22s; pointer-events:auto; max-width:100%; }
.cs-toast.is-in{ opacity:1; transform:none; }
.cs-toast ion-icon{ font-size:19px; flex:none; }
.cs-toast--ok ion-icon{ color:#6EE7A6; }
.cs-toast--error{ background:var(--cs-danger); } .cs-toast--error ion-icon{ color:#fff; }
.cs-toast span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media (prefers-reduced-motion:reduce){ .cs-toast{ transition:opacity .15s; transform:none; } .cs-toast.is-in{ transform:none; } }

/* Ligne en cours d'enregistrement AJAX : léger état occupé. */
.cs-ajax-busy{ opacity:.55; pointer-events:none; }

/* =============================================================================
   ▓▓▓ SÉLECTION MULTIPLE + ACTION GROUPÉE (cs-bulk*) ▓▓▓
   Cocher plusieurs lignes → barre flottante d'action groupée (admin-bulk.js).
   Applique l'action à toutes les lignes sélectionnées en AJAX, sans recharger.
   ============================================================================= */
.cs-check-col{ width:40px; text-align:center; }
.cs-bulk-check, .cs-bulk-all{ width:17px; height:17px; cursor:pointer; accent-color:var(--cs-primary); vertical-align:middle; }
tr.is-selected > td{ background:var(--cs-primary-container) !important; }

.cs-bulkbar{ position:fixed; left:50%; bottom:calc(20px + env(safe-area-inset-bottom));
  transform:translate(-50%,150%); z-index:8500; display:flex; align-items:center; gap:12px;
  background:var(--cs-primary); color:#fff; padding:9px 10px 9px 18px; border-radius:var(--r-pill,999px);
  box-shadow:var(--cs-shadow-lg,0 12px 40px rgba(8,26,69,.28)); opacity:0; pointer-events:none;
  transition:transform .28s cubic-bezier(.2,.8,.2,1), opacity .2s; max-width:calc(100% - 24px); flex-wrap:wrap; justify-content:center; }
.cs-bulkbar.is-on{ transform:translate(-50%,0); opacity:1; pointer-events:auto; }
.cs-bulkbar__count{ font-size:14px; white-space:nowrap; }
.cs-bulkbar__count b{ font-weight:800; }
.cs-bulkbar select{ background:rgba(255,255,255,.16); color:#fff; border:1px solid rgba(255,255,255,.30);
  border-radius:10px; padding:7px 10px; font:inherit; font-size:13px; max-width:190px; cursor:pointer; }
.cs-bulkbar select option{ color:var(--cs-text); }
.cs-bulkbar__apply{ background:#fff; color:var(--cs-primary); border:0; border-radius:var(--r-pill,999px);
  padding:8px 16px; font-weight:700; font-size:13.5px; cursor:pointer; display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.cs-bulkbar__apply ion-icon{ font-size:16px; }
.cs-bulkbar__apply:disabled{ opacity:.6; cursor:default; }
.cs-bulkbar__clear{ background:transparent; border:0; color:rgba(255,255,255,.78); cursor:pointer;
  display:grid; place-items:center; width:30px; height:30px; border-radius:50%; flex:none; }
.cs-bulkbar__clear ion-icon{ font-size:18px; }
.cs-bulkbar__clear:hover{ background:rgba(255,255,255,.16); color:#fff; }
@media (max-width:767px){ .cs-bulkbar{ bottom:calc(84px + env(safe-area-inset-bottom)); } }

/* =============================================================================
   ▓▓▓ LISTE UNIQUE DES OPÉRATIONS (fusion Trésorerie › Banques → Comptabilité ›
   Transactions, 2026-09-27) ▓▓▓
   Compta › Transactions : pastille de catégorie, volet
   Catégorie / Note, badges « Vérifiée » / entité, pagination.
   Trésorerie › Banques (page allégée) : cartes connexion, lien vers la liste unique,
   opérations hors comptabilité. Jetons --ds-* uniquement (thème clair/sombre).
   ============================================================================= */
.atx-dot--ok{ background:var(--ds-success); }
.atx-chip--cat{ background:var(--ds-bg-soft); color:var(--ds-text); border:1px solid var(--ds-border-soft); max-width:180px; overflow:hidden; text-overflow:ellipsis; }
.atx-chip--cat ion-icon{ font-size:11px; color:var(--ds-text-soft); flex:none; }
.atx-chip--ent{ background:var(--ds-bg-soft); color:var(--ds-text-muted); border:1px dashed var(--ds-border); }
.atx-note-banner{ display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; background:var(--ds-info-bg); color:var(--ds-text);
  border:1px solid var(--ds-border); border-radius:var(--ds-radius); padding:.6rem .9rem; margin:-.3rem 0 .9rem; font-size:13px; }
.atx-note-banner > ion-icon{ font-size:20px; color:var(--ds-info); flex:none; }
.atx-note-banner > span{ flex:1; min-width:200px; }
.atx-bulk__hint{ flex-basis:100%; font-size:11px; opacity:.85; }
.atx-pager{ padding:.2rem .9rem 1rem; }
.atx-dbadges{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.atx-dbadge{ display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:600; padding:2px 9px; border-radius:var(--ds-radius-pill,999px);
  background:rgba(255,255,255,.14); color:#fff; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.atx-dbadge--ok{ background:var(--ds-success-bg); color:var(--ds-success); }
.atx-catform{ display:flex; flex-direction:column; gap:.45rem; margin:0; }
.atx-catform__row{ display:flex; gap:.5rem; flex-wrap:wrap; align-items:flex-end; }
.atx-catform__cat{ flex:1; min-width:170px; }
.atx-catform__hint{ margin:0; display:flex; flex-wrap:wrap; gap:.35rem .5rem; align-items:center; }
.atx-src{ font-size:10.5px; font-weight:700; letter-spacing:.02em; color:var(--ds-text-soft); background:var(--ds-bg-soft); border-radius:var(--ds-radius-pill,999px); padding:1px 8px; }
.atx-entryno{ font-variant-numeric:tabular-nums; color:var(--ds-text-muted); font-size:12px; }
.atx-noteform{ display:flex; flex-direction:column; gap:.4rem; margin:0; }
.atx-noteform__txt{ resize:vertical; min-height:52px; width:100%; }
.atx-noteform .cs-btn{ align-self:flex-start; }

/* Trésorerie › Banques (page allégée) */
.bk-connect{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:0; }
.bk-connect__select{ min-width:250px; font-size:13px; flex:1; }
.bk-connect-card{ padding:24px; max-width:620px; margin:0 auto 16px; }
.bk-card-title{ font-size:15px; font-weight:700; margin-bottom:6px; display:flex; align-items:center; gap:6px; }
.bk-lead{ font-size:13px; margin-bottom:14px; }
.bk-hint{ font-size:12px; margin:6px 0 0; color:var(--ds-text-muted); }
.bk-warn{ border-left:4px solid var(--ds-warning); font-size:13px; padding:12px; }
.bk-actions{ margin-top:10px; display:flex; gap:8px; flex-wrap:wrap; }
.bk-alert{ border-left:4px solid var(--ds-danger); margin-bottom:16px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.bk-alert > ion-icon{ color:var(--ds-danger); font-size:20px; flex:none; }
.bk-alert > span{ flex:1; min-width:220px; }
.bk-grid{ margin:0 0 16px; }
.bk-stat{ align-self:flex-start; }
.bk-inline{ display:inline; margin:0; }
.bk-conns{ display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; padding-top:10px; border-top:1px solid var(--ds-border-soft); }
.bk-block{ margin-bottom:16px; }
.bk-badges{ display:flex; gap:10px; flex-wrap:wrap; }
.bk-row-actions{ display:inline-flex; gap:6px; flex-wrap:wrap; align-items:center; }
.bk-list-link{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.bk-list-link__ic{ width:42px; height:42px; border-radius:12px; display:grid; place-items:center; flex:none;
  background:var(--ds-bg-soft); border:1px solid var(--ds-border); color:var(--ds-primary); font-size:22px; }
.bk-list-link__txt{ flex:1; min-width:220px; }
.bk-list-link__txt .bk-card-title{ margin-bottom:2px; }
.bk-list-link__cta{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.bk-att{ display:inline-flex; align-items:center; gap:4px; font-size:12px; color:var(--ds-text); text-decoration:none; margin-right:8px; }
.bk-att:hover{ text-decoration:underline; }
@media (max-width:640px){ .bk-connect__select{ min-width:0; width:100%; } .bk-list-link__cta{ width:100%; } }
/* Liste unique — suite de la revue (2026-09-27) : pastille « Vérifiée », filtre d'entité
   retirable, connexions datées, édition des opérations hors comptabilité, pagination. */
.atx-chip--ver{ background:var(--ds-success-bg); color:var(--ds-success); }
.atx-chip--ver ion-icon{ font-size:11px; flex:none; }
.atx-filterchip{ text-decoration:none; cursor:pointer; margin-left:auto; margin-right:.5rem; }
.atx-filterchip:hover{ border-style:solid; color:var(--ds-text); }
.bk-conns{ flex-direction:column; align-items:stretch; }
.bk-conn{ display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.bk-conn__txt{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.bk-conn__dates{ margin:0; }
.bk-conn__name{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.bk-att-row{ display:inline-flex; align-items:center; gap:2px; margin-right:6px; }
.bk-orph-edit{ margin-top:4px; }
.bk-orph-edit > summary{ cursor:pointer; font-size:12px; color:var(--ds-text-muted); }
.bk-orph-form{ display:flex; flex-direction:column; gap:6px; margin:8px 0 0; }
.bk-orph-form textarea{ resize:vertical; min-height:48px; width:100%; }
.bk-orph-form .cs-btn{ align-self:flex-start; }
.bk-orph-form--row{ flex-direction:row; flex-wrap:wrap; align-items:center; }
.bk-orph-form--row input[type=file]{ font-size:12px; flex:1; min-width:160px; }
.bk-pager{ display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap; padding-top:10px; }
.bk-pager .bk-hint{ margin:0; }

/* =============================================================================
   ▓▓▓ LIEUX (module venues) : zones interdites aux VTC + points de rendez-vous ▓▓▓
   2026-10-11, grands lieux et détection automatique le 2026-10-14 (vn-auto,
   pastille « Auto »). Liste en cartes (vn-grid, vn-card), éditeur sur carte Leaflet
   servie en local (assets/vendor/leaflet, feuille chargée par la vue), outils
   de carte en icônes seules de 44 px, repères numérotés colorés par usage
   (vn-pin : vert prise en charge, bleu dépose, marine les deux, or centre).
   Villes le 2026-10-16 (déploiement ville par ville) : cartes d'avancement du
   parcours (vn-city), résultats du contour officiel (vn-osm), bandeau vn-banner.
   Jetons --cs-* et --evya-* uniquement (clair / sombre).
   ============================================================================= */
.vn [hidden]{ display:none !important; }
.vn-filters{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin:0 0 14px; }
.vn-filters > .cs-select{ flex:1 1 170px; width:auto; min-width:0; }
.vn-filters > .cs-btn-icon{ flex:none !important; width:44px; height:44px; color:var(--cs-muted); }
.vn-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap:14px; margin-bottom:22px; }
.vn-grid > .vn-card{ margin:0; }
.vn-card{ display:flex; align-items:flex-start; gap:12px; color:inherit; text-decoration:none; }
.vn-card:hover{ text-decoration:none; }
.vn-card.is-off{ opacity:.72; }
.vn-card__ic{ width:42px; height:42px; border-radius:12px; flex:none; display:grid; place-items:center; color:#fff; background:var(--cs-primary); }
.vn-card__ic ion-icon{ font-size:20px; }
.vn-card__ic[data-kind="airport"]{ background:var(--cs-info); }
.vn-card__ic[data-kind="hospital"]{ background:var(--cs-danger); }
.vn-card__ic[data-kind="pedestrian"]{ background:var(--cs-success); }
/* Grands lieux (2026-10-14) : sites fermés, santé et enseignement, loisirs, industrie. */
.vn-card__ic[data-kind="prison"]{ background:var(--cs-danger); }
.vn-card__ic[data-kind="military"]{ background:var(--cs-warning); }
.vn-card__ic[data-kind="cemetery"]{ background:var(--cs-muted); }
.vn-card__ic[data-kind="campus"]{ background:var(--cs-info); }
.vn-card__ic[data-kind="park"]{ background:var(--cs-success); }
.vn-card__ic[data-kind="sport"]{ background:var(--cs-success); }
.vn-card__ic[data-kind="leisure"]{ background:var(--cs-warning); }
.vn-card__ic[data-kind="industrial"]{ background:var(--cs-primary); }
.vn-card__ic[data-kind="other"]{ background:var(--cs-muted); }
/* Événement temporaire (2026-10-15) : or, accent rare. */
.vn-card__ic[data-kind="event"]{ background:var(--cs-accent); }
.vn-card__b{ display:flex; flex-direction:column; min-width:0; flex:1; }
.vn-card__t{ font-size:15px; font-weight:700; color:var(--cs-text); letter-spacing:-.01em; overflow-wrap:break-word; }
.vn-card__s{ font-size:13px; color:var(--cs-muted); margin-top:1px; }
.vn-pills{ display:flex; flex-wrap:wrap; gap:6px; margin-top:9px; }
.vn-card__chev{ color:var(--cs-muted); font-size:18px; flex:none; align-self:center; }

.vn-title{ display:flex; align-items:center; gap:12px; min-width:0; }
.vn-title > div{ min-width:0; }
.vn .cs-btn-icon{ width:44px; height:44px; flex:none; color:var(--cs-text); }
.vn .cs-btn-icon ion-icon{ font-size:20px; }
.vn .cs-btn-icon[data-tone="danger"]{ color:var(--cs-danger); }
.vn .cs-btn-icon[aria-pressed="true"]{ background:var(--cs-primary); border-color:var(--cs-primary); color:var(--evya-on-primary); }
.vn .cs-btn-icon:disabled{ opacity:.4; cursor:not-allowed; }
.vn-switch{ display:flex; align-items:center; gap:10px; min-height:52px; cursor:pointer; font-weight:600; color:var(--cs-text); }
/* Interrupteur de la détection automatique, dans l'en-tête de la liste. */
.vn-auto{ margin:0; }
.vn-auto .vn-switch{ min-height:44px; }
.vn-auto__t{ display:flex; flex-direction:column; font-size:14px; line-height:1.25; }
.vn-auto__s{ font-size:12px; font-weight:600; color:var(--cs-muted); }
.vn-pills .cs-pill ion-icon, .vn-title .cs-pill ion-icon{ font-size:13px; }
.vn-seg{ display:inline-flex; gap:2px; padding:3px; margin:0 0 12px; max-width:100%; border-radius:999px; background:var(--evya-surface-variant); }
.vn-seg label{ position:relative; display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:44px; padding:0 18px;
  border-radius:999px; font-size:14px; font-weight:700; color:var(--cs-muted); cursor:pointer; }
.vn-seg input{ position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.vn-seg label:has(input:checked){ background:var(--cs-card); color:var(--cs-text); box-shadow:var(--cs-shadow); }
.vn-seg label:has(input:focus-visible){ outline:2px solid var(--cs-primary); outline-offset:2px; }
/* Zones multiples (2026-10-15) : une pastille par zone, la zone choisie en marine
   (elle reçoit les outils), zone sans forme en tirets ; ajout et suppression en icônes. */
.vn-zones{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 12px; }
.vn-zones__list{ display:flex; flex-wrap:wrap; gap:6px; min-width:0; }
.vn-zone{ display:inline-flex; align-items:center; gap:6px; min-height:44px; padding:0 14px; border:1px solid var(--cs-border); border-radius:999px;
  background:var(--cs-card); color:var(--cs-text); font:inherit; font-size:14px; font-weight:700; cursor:pointer; }
.vn-zone ion-icon{ font-size:18px; color:var(--cs-muted); }
.vn-zone.is-on{ background:var(--cs-primary); border-color:var(--cs-primary); color:var(--evya-on-primary); }
.vn-zone.is-on ion-icon{ color:inherit; }
.vn-zone.is-empty{ border-style:dashed; }
.vn-zone:focus-visible{ outline:2px solid var(--cs-primary); outline-offset:2px; }
.vn-row{ display:flex; align-items:center; gap:8px; margin:0 0 12px; }
.vn-row > .cs-input{ flex:1 1 auto; min-width:0; }
.vn-row > input[type="number"]{ flex:0 1 150px; }
.vn-row__l{ margin:0; white-space:nowrap; }
.vn-preview{ display:flex; align-items:center; flex-wrap:wrap; gap:8px 10px; padding:10px 12px; margin:0 0 12px; border-radius:12px;
  background:var(--cs-warning-bg); color:var(--cs-text); font-size:14px; }
.vn-preview > ion-icon{ font-size:18px; color:var(--cs-warning); flex:none; }
.vn-preview > span{ flex:1 1 200px; min-width:0; }
.vn-mapwrap{ position:relative; border:1px solid var(--cs-border); border-radius:14px; overflow:hidden; }
/* z-index 0 : la carte forme son propre empilement, ses couches (jusqu'à 1000)
   ne passent plus au-dessus de la barre du haut, de la barre d'onglets ni des modales. */
.vn-map{ position:relative; z-index:0; height:min(58vh, 520px); min-height:300px; background:var(--evya-surface-variant); }
.vn-map.is-picking, .vn-map.is-picking .leaflet-interactive{ cursor:crosshair; }
.vn-tools{ position:absolute; top:10px; right:10px; z-index:1; display:flex; flex-direction:column; gap:6px; }
/* Édition du contour : sommets carrés déplaçables, petits ronds dorés pour en
   ajouter un (zone tactile de 28 et 24 px autour du repère visible). */
.vn-vx-wrap{ background:none; border:0; }
.vn-vx{ position:absolute; top:50%; left:50%; transform:translate(-50%, -50%); display:block; box-sizing:border-box; width:13px; height:13px; border-radius:3px; background:#fff; border:2px solid #081A45; box-shadow:0 1px 4px rgba(8,26,69,.4); }
.vn-vx.is-sel{ width:17px; height:17px; background:#C9A353; }
.vn-vx--mid{ width:10px; height:10px; border-radius:50%; border-color:#B4863A; background:rgba(255,255,255,.85); box-shadow:none; }
.vn-tools .cs-btn-icon{ box-shadow:var(--cs-shadow-md); }
.vn-map.leaflet-touch .leaflet-bar a{ width:44px; height:44px; line-height:44px; font-size:22px; }
.vn-hint{ margin:8px 2px 0; font-size:13px; }
.vn-legend{ display:flex; flex-wrap:wrap; gap:6px 16px; margin:8px 2px 0; font-size:13px; color:var(--cs-muted); }
.vn-legend span{ display:inline-flex; align-items:center; gap:6px; }
.vn-pin-wrap{ background:none; border:0; }
/* Repères posés sur les tuiles OSM, claires dans les deux thèmes : couleurs fixes
   du thème clair (marine, vert, bleu, or) pour garder le contraste du chiffre blanc. */
.vn-pin{ display:inline-grid; place-items:center; width:30px; height:30px; flex:none; border-radius:50%; border:2px solid #fff;
  background:#081A45; color:#fff; box-shadow:0 2px 6px rgba(8,26,69,.35); font-size:13px; font-weight:800; font-style:normal; line-height:1; }
.vn-pin--pickup{ background:#15803D; }
.vn-pin--dropoff{ background:#1D4ED8; }
.vn-pin--center{ width:28px; height:28px; background:#C9A353; }
.vn-pin--sm{ width:14px; height:14px; box-shadow:none; }
.vn-save{ display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:10px 14px; margin:0 0 22px; }
.vn-intro{ margin:0 0 12px; font-size:13px; }
.vn-intro ion-icon{ vertical-align:-3px; font-size:16px; }
/* Horaires d'un événement temporaire (2026-10-15) : fréquence en segments (vn-seg),
   jours en pastilles cochables de 44 px, champs dans des fieldsets sans cadre. */
.vn-fs{ border:0; margin:0; padding:0; min-width:0; }
.vn-days{ display:flex; flex-wrap:wrap; gap:6px; }
.vn-day{ position:relative; display:inline-flex; align-items:center; justify-content:center; min-width:52px; min-height:44px; padding:0 12px;
  border:1px solid var(--cs-border); border-radius:999px; background:var(--cs-card); color:var(--cs-text); font-size:14px; font-weight:700; cursor:pointer; }
.vn-day input{ position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.vn-day:has(input:checked){ background:var(--cs-primary); border-color:var(--cs-primary); color:var(--evya-on-primary); }
.vn-day:has(input:focus-visible){ outline:2px solid var(--cs-primary); outline-offset:2px; }
.vn-sched-grid{ margin-top:14px; }
.vn-points{ list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.vn-point{ display:grid; grid-template-columns:auto minmax(0, 1fr) auto; gap:8px 10px; align-items:start; padding:12px;
  border:1px solid var(--cs-border); border-radius:14px; background:var(--cs-card); }
.vn-point > .vn-pin{ margin-top:11px; }
.vn-point__f{ display:grid; gap:8px; min-width:0; }
.vn-point__label{ font-weight:700; }
.vn-point__warn{ margin:0; display:flex; align-items:center; gap:6px; font-size:13px; color:var(--cs-warning); }
.vn-point__undo{ grid-column:1 / -1; margin:0; display:flex; align-items:center; flex-wrap:wrap; gap:6px 8px; font-size:13px; color:var(--cs-muted); }
.vn-point__undo > ion-icon{ color:var(--cs-primary); font-size:16px; }
.vn-point__undo-b{ min-height:36px; padding:0 12px; gap:6px; }
.vn-point__act{ display:flex; flex-direction:column; gap:6px; }
/* Villes : bandeau « Créez une ville », cartes d'avancement, contours trouvés. */
.vn-banner{ display:flex; align-items:center; gap:10px; }
.vn-banner > ion-icon{ font-size:20px; flex:none; }
.vn-city{ display:flex; flex-direction:column; gap:12px; }
.vn-city.is-off{ opacity:.72; }
.vn-city__head{ display:flex; align-items:flex-start; gap:12px; }
.vn-city .vn-card__t{ margin:0; }
.vn-city__act{ display:flex; gap:6px; flex:none; }
.vn-city__act form{ margin:0; }
.vn-city__meta{ display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 12px; margin:0; font-size:13px; color:var(--cs-muted); }
.vn-city__meta a{ font-weight:600; }
.vn-osm{ list-style:none; margin:0 0 12px; padding:0; display:grid; gap:6px; }
.vn-osm__item{ display:flex; align-items:center; gap:10px; width:100%; min-height:52px; padding:8px 12px; text-align:left; cursor:pointer;
  border:1px solid var(--cs-border); border-radius:12px; background:var(--cs-card); color:var(--cs-text); font:inherit; }
.vn-osm__item > ion-icon{ font-size:20px; color:var(--cs-muted); flex:none; }
.vn-osm__item[aria-pressed="true"]{ border-color:var(--cs-primary); box-shadow:0 0 0 1px var(--cs-primary); }
.vn-osm__item:focus-visible{ outline:2px solid var(--cs-primary); outline-offset:2px; }
.vn-osm__item.is-off{ opacity:.6; }
.vn-osm__b{ display:flex; flex-direction:column; min-width:0; }
.vn-osm__t{ font-weight:700; overflow-wrap:break-word; }
.vn-osm__s{ font-size:13px; color:var(--cs-muted); }
@media (min-width:900px){
  .vn-point__f{ grid-template-columns:minmax(0, 1fr) minmax(0, 1.5fr) 220px; align-items:center; }
  /* Lieu à plusieurs zones : liste « Zone » en quatrième colonne. */
  .vn-point__f.has-zone{ grid-template-columns:minmax(0, 1fr) minmax(0, 1.5fr) 200px 140px; }
  .vn-point__warn{ grid-column:1 / -1; }
  .vn-point__act{ flex-direction:row; margin-top:4px; }
}
@media (max-width:767px){
  /* Téléphone : champs pleine largeur, actions en rangée au pied de la carte du point. */
  .vn-point{ grid-template-columns:auto minmax(0, 1fr); padding:10px; }
  .vn-point__act{ grid-column:1 / -1; flex-direction:row; justify-content:flex-end; }
  .vn-map{ height:52vh; }
  .vn-seg{ display:flex; }
  .vn-seg label{ flex:1 1 0; }
  .vn-days{ display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); }
  .vn-day{ min-width:0; padding:0; }
  .vn-save > .cs-btn{ flex:1 1 auto; }
}

/* =============================================================================
   ▓▓▓ RESPONSIVE MOBILE — garde-fous PARTAGÉS (2026-10-08) ▓▓▓
   Couche responsive finale, valable pour tous les écrans de l'admin : un
   correctif = toutes les pages. Tout est borné à < 768px (rendu ordinateur
   inchangé), sauf le conteneur des tableaux (débordement fantôme à 768px).
   Mesuré sur 228 écrans à 375 et 390px : zéro débordement horizontal.
   ============================================================================= */

/* Les textes réservés aux lecteurs d'écran (sr-only) des cellules ne s'échappent
   plus du conteneur de défilement des tableaux (la page défilait de côté). */
.cs-table-wrap, .cs-table-scroll { position: relative; }

/* Champs à 16px minimum sur téléphone ET tablette tactile : iOS ne zoome plus la
   page au toucher d'un champ. Le code de double authentification garde sa taille. */
@media (max-width: 767px), (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"]):not(.code-field),
  select, textarea { font-size: 16px !important; }
}

@media (max-width: 767px) {

  /* Texte : plus aucun mot coupé lettre par lettre dans une colonne étroite
     (overflow-wrap:anywhere réduisait la largeur minimale à un caractère). */
  .cs-main :is(.cs-detail-val, .cs-code, .cs-card-title) { overflow-wrap: break-word; }

  /* Un champ, un formulaire en ligne ou une grille de formulaire ne peut plus
     élargir la page au-delà de l'écran (largeurs minimales en dur, rangées sans
     retour à la ligne, grilles qui débordent). */
  .cs-main :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]) { max-width: 100%; min-width: 0 !important; }
  .cs-main form { flex-wrap: wrap; }
  .cs-main :is(.cs-form, .cs-form-grid) > * { min-width: 0; }
  .cs-main .cs-label { flex-wrap: wrap; }
  .cs-main .cs-label code { overflow-wrap: anywhere; }
  .cs-main .cs-check:has(> :is(strong, em, b, a, span, code, small)) { display: block; }
  .cs-main .cs-check:has(> :is(strong, em, b, a, span, code, small)) > input { margin: 0 8px 0 0; vertical-align: middle; }
  .cs-main :is([style*="display:flex"], [style*="display: flex"]) { flex-wrap: wrap; }

  /* Ligne de liste groupée : la colonne de droite (montant) se réduit à son mot
     le plus long ; une pastille de statut passe sous le titre au lieu de l'écraser. */
  .cs-row__b { flex: 1 1 0; min-width: 0; }
  .cs-row__rt { flex: 0 1 auto; min-width: min-content; max-width: 50%; white-space: normal; text-align: right; }
  .cs-row:has(> .cs-pill, > .cs-badge) { flex-wrap: wrap; row-gap: 6px; }
  .cs-row:has(> .cs-pill, > .cs-badge) > .cs-row__b { flex-basis: 60%; }
  .cs-row:has(> .cs-pill, > .cs-badge) > .cs-row__chev { order: 2; }
  .cs-row > :is(.cs-pill, .cs-badge) { order: 3; margin-left: 52px; max-width: calc(100% - 52px); white-space: normal; }

  /* Cibles tactiles : 24px minimum pour les liens isolés (nom, référence,
     fil d'Ariane, valeur de fiche) et les cases à cocher (WCAG 2.5.8) ; 44px pour
     les liens d'en-tête (« Voir tout », retour), les volets dépliables et les
     sélecteurs de fichier. */
  .cs-main :is(td, dd, .cs-detail-val, .cs-card-header, [class*="crumb"], [class*="-head"]) > a:not(.cs-btn):not(.cs-btn-icon):not(.btn) {
    display: inline-flex; align-items: center; min-height: 24px;
  }
  .cs-main td a:not(.cs-btn):not(.cs-btn-icon):not(.btn) { display: inline-flex; align-items: center; min-height: 24px; }
  .cs-main td input:is([type="checkbox"], [type="radio"]) { min-width: 24px !important; min-height: 24px !important; }
  .cs-main .cs-section-head > a:not(.cs-btn):not(.cs-btn-icon),
  .cs-main .cs-page-head > a:not(.cs-btn):not(.cs-btn-icon),
  .cs-main .cs-link-small { display: inline-flex; align-items: center; min-height: 44px; }
  .cs-main details > summary { min-height: 44px; }
  .cs-main input[type="file"] { min-height: 44px; }

  /* Médiathèque : le nom d'un fichier s'arrête par « … » dans sa vignette. */
  .mlib-card__name { display: block; min-width: 0; max-width: 100%; }

  /* FILTRES COMPACTÉS (formulaires GET des listes) : la recherche principale
     s'étire, listes déroulantes et dates vont deux par ligne, le bouton Filtrer
     se range à côté. Même fonctionnement, jusqu'à moitié moins de hauteur. */
  .cs-main form[method="get" i]:not(.fin-plan-bar, .period-filter, .fin-snap__pick, .ai-period),
  .cs-main form[method="get" i] > .cs-form-grid {
    display: flex !important; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end;
  }
  .cs-main form[method="get" i] > .cs-form-grid { flex: 1 1 100%; }
  .cs-main :is(form[method="get" i]:not(.fin-plan-bar, .period-filter, .fin-snap__pick, .ai-period), form[method="get" i] > .cs-form-grid) > :not(.cs-form-grid) {
    flex: 1 1 calc(50% - 6px); min-width: 0; margin: 0;
  }
  .cs-main :is(form[method="get" i]:not(.fin-plan-bar, .period-filter, .fin-snap__pick, .ai-period), form[method="get" i] > .cs-form-grid) > :nth-child(1 of :is(input[type="search"], input[type="text"], :has(input[type="search"]), :has(input[type="text"]))) {
    flex: 1 1 60%;
  }
  .cs-main :is(form[method="get" i]:not(.fin-plan-bar, .period-filter, .fin-snap__pick, .ai-period), form[method="get" i] > .cs-form-grid) > :is(button, a.cs-btn, .cs-btn, :has(> :is(button, .cs-btn)):not(:has(input:not([type="hidden"]), select))) {
    flex: 0 1 auto; max-width: 100%;
  }
  .cs-main :is(form[method="get" i]:not(.fin-plan-bar, .period-filter, .fin-snap__pick, .ai-period), form[method="get" i] > .cs-form-grid) > :is(p, h2, h3, h4, small, .cs-muted, ul, table) {
    flex: 1 1 100%;
  }
}

/* ── Glisser vers le bas pour actualiser (admin-pull-refresh.js, écrans tactiles) ──
   Pastille sous l'en-tête qui suit le doigt ; la flèche tourne jusqu'au seuil,
   puis anneau de chargement pendant l'actualisation. Le geste remplace le rebond
   iOS et l'actualisation native du navigateur. */
@media (pointer: coarse) {
  html, body { overscroll-behavior-y: none; }
}
.cs-ptr {
  --ptr-y: 0px; --ptr-turn: 0deg; --ptr-alpha: 0;
  position: fixed; left: 50%; top: env(safe-area-inset-top, 0px); z-index: 190;
  width: 40px; height: 40px; margin: -48px 0 0 -20px;
  pointer-events: none;
  opacity: var(--ptr-alpha);
  transform: translateY(var(--ptr-y));
  transition: transform .22s cubic-bezier(.4,0,.2,1), opacity .22s ease;
}
.cs-ptr.is-pulling:not(.is-loading) { transition: none; }
.cs-ptr.is-loading { opacity: 1; }
@media (max-width: 767px) {
  .cs-ptr { top: calc(env(safe-area-inset-top, 0px) + var(--cs-header-h)); }
}
.cs-ptr__disc {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--cs-card); color: var(--cs-primary);
  border: 1px solid var(--cs-border);
  box-shadow: var(--cs-shadow-md);
  font-size: 20px;
}
.cs-ptr__disc ion-icon { transform: rotate(var(--ptr-turn)); transition: transform .12s linear; }
.cs-ptr.is-ready .cs-ptr__disc { background: var(--cs-primary); color: var(--evya-on-primary); border-color: var(--cs-primary); }
.cs-ptr.is-loading .cs-ptr__disc ion-icon { display: none; }
.cs-ptr.is-loading .cs-ptr__disc::after {
  content: ""; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--cs-primary-light); border-top-color: var(--cs-primary);
  animation: ds-spin .8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .cs-ptr, .cs-ptr__disc ion-icon { transition: none; }
  .cs-ptr.is-loading .cs-ptr__disc::after { animation-duration: 1.6s; }
}
.cs-ptr__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
