/* =====================================================================
 * KEYME - feuille de style v3 (mobile-first vraiment, ≥ 90% mobile).
 *
 *   Breakpoints :
 *     base              0 → 599 px   téléphones
 *     sm   ≥ 600 px       petites tablettes / grands téléphones paysage
 *     md   ≥ 768 px       tablettes
 *     lg   ≥ 1024 px      desktop (sidebar apparaît, bottom-nav disparaît)
 *
 *   Stratégie :
 *     - tout est dimensionné pour le tactile (cibles ≥ 44 px)
 *     - les tables passent en MODE CARTE empilée sur mobile (data-label)
 *     - les page-header empilent verticalement leurs actions
 *     - le header montre uniquement burger + logo + user sur mobile
 *       (la recherche est dans la bottom-nav via le FAB)
 *     - paddings réduits sous 600 px
 * ===================================================================== */

:root {
    --bg:           #f6f8fb;
    --surface:      #ffffff;
    --surface-2:    #fbfcfe;
    --border:       #e2e7ee;
    --border-strong:#cfd6e0;
    --text:         #1a2233;
    --text-soft:    #475066;
    --muted:        #8892a6;

    --primary:      #2c6fc7;
    --primary-50:   #eaf2fc;
    --primary-dark: #1f5aa3;
    --accent:       #6f4dff;

    --danger:       #d93b3b;
    --warning:      #d97706;
    --success:      #1f9d55;
    --info:         #2563c4;

    --vert:   #1f9d55;
    --bleu:   #2c6fc7;
    --orange: #f59e0b;
    --rouge:  #d93b3b;
    --gris:   #8892a6;

    --radius:    12px;
    --radius-sm: 8px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
    --shadow:    0 2px 8px rgba(15,23,42,.07), 0 1px 3px rgba(15,23,42,.04);
    --shadow-lg: 0 12px 28px rgba(15,23,42,.10);

    --side-w:    240px;
    --nav-h:     56px;     /* header */
    --bottom-h:  64px;     /* bottom-nav mobile */
    --tap:       44px;     /* min target tactile */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
    font-size: 16px;                     /* iOS n'auto-zoome pas si ≥ 16 px */
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: contain;
}

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

h1, h2, h3 { color: var(--text); font-weight: 600; line-height: 1.2; }
h1 { font-size: 1.25rem; margin: 0; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }

/* SVG icons */
.icon { display: inline-block; vertical-align: -3px; flex-shrink: 0; }

img { max-width: 100%; height: auto; }

/* =====================================================================
 *  LAYOUT - shell
 * ===================================================================== */

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Header ---------- */
.app-header {
    height: var(--nav-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: .5rem;
    padding: 0 .75rem;
    position: sticky; top: 0; z-index: 50;
}
.app-header .brand {
    display: inline-flex; align-items: center; gap: .5rem;
    font-weight: 700; color: var(--text); text-decoration: none;
    font-size: 1rem;
    min-width: 0;                        /* permet ellipsis */
}
.app-header .brand img { max-height: 28px; max-width: 90px; }
.app-header .brand span {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-header .brand-mark {
    width: 30px; height: 30px; border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
    flex-shrink: 0;
}

/* La barre de recherche n'apparait qu'à partir de lg (la recherche
   mobile se fait via le bouton FAB de la bottom-nav qui mène à /search). */
.app-header .header-search { display: none; flex: 1; max-width: 420px; position: relative; }
.app-header .header-search input {
    width: 100%; padding: .5rem .75rem .5rem 2.1rem;
    border: 1px solid var(--border); border-radius: 999px;
    background: var(--surface-2);
    font: inherit; color: inherit;
}
.app-header .header-search input:focus {
    outline: none; border-color: var(--primary); background: #fff;
}
.app-header .header-search .icon {
    position: absolute; top: 50%; left: .65rem; transform: translateY(-50%);
    color: var(--muted);
}

.app-header .user {
    display: flex; align-items: center; gap: .5rem;
    margin-left: auto;
    color: var(--text-soft); font-size: .9rem;
}
.app-header .user .who { display: none; }

.app-header .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: var(--tap); height: var(--tap);
    background: transparent; border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); cursor: pointer;
}

@media (min-width: 1024px) {
    .app-header { padding: 0 1.25rem; height: 60px; }
    .app-header .menu-toggle { display: none; }
    .app-header .header-search { display: block; }
    .app-header .brand { font-size: 1.05rem; }
    .app-header .user .who { display: inline; }
}

/* ---------- Sidebar ---------- */
.app-body { display: flex; flex: 1; min-width: 0; }
.app-side {
    display: none;
    width: var(--side-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1rem .75rem;
    flex-shrink: 0;
    min-height: calc(100vh - var(--nav-h));
}
.app-side nav { display: flex; flex-direction: column; gap: 2px; }
.app-side nav a {
    display: flex; align-items: center; gap: .65rem;
    padding: .6rem .75rem;
    border-radius: var(--radius-sm);
    color: var(--text-soft); font-size: .92rem;
    min-height: var(--tap);
}
.app-side nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.app-side nav a.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.app-side .nav-group {
    margin-top: 1rem; padding: 0 .75rem;
    font-size: .7rem; font-weight: 600;
    color: var(--muted); text-transform: uppercase; letter-spacing: .08em;
}
@media (min-width: 1024px) { .app-side { display: block; } }

/* ---------- Main ---------- */
.app-main {
    flex: 1;
    padding: .75rem;
    padding-bottom: calc(.75rem + var(--bottom-h) + env(safe-area-inset-bottom, 0));
    min-width: 0;                        /* évite débordement horizontal */
    overflow-x: hidden;                  /* filet anti scroll horizontal accidentel */
}
.container { max-width: 1200px; margin: 0 auto; padding: 0; min-width: 0; }
@media (min-width: 600px) { .app-main { padding: 1rem; padding-bottom: calc(1rem + var(--bottom-h)); } }
@media (min-width: 1024px) {
    .app-main { padding: 1.5rem 1.75rem; padding-bottom: 1.5rem; }
}

/* ---------- Drawer mobile ---------- */
.app-drawer {
    position: fixed; inset: 0;
    background: rgba(15,23,42,.45);
    z-index: 90; display: none;
    -webkit-overflow-scrolling: touch;
}
.app-drawer.open { display: block; }
.app-drawer .panel {
    position: absolute; top: 0; left: 0; bottom: 0;
    width: 82%; max-width: 320px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    padding: 1rem .75rem;
    overflow-y: auto;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0));
}
.app-drawer .panel nav a {
    display: flex; align-items: center; gap: .65rem;
    padding: .8rem .75rem; border-radius: var(--radius-sm);
    color: var(--text-soft); font-size: 1rem;
    min-height: var(--tap);
}
.app-drawer .panel nav a:hover, .app-drawer .panel nav a.active {
    background: var(--primary-50); color: var(--primary); text-decoration: none;
}

/* ---------- Bottom nav (mobile only) ---------- */
.app-bottom {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 60;
    display: flex; justify-content: space-around;
    box-shadow: 0 -2px 10px rgba(15,23,42,.06);
    padding: .25rem 0 calc(.25rem + env(safe-area-inset-bottom, 0));
    height: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0));
}
.app-bottom a, .app-bottom button {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: var(--muted);
    font-size: .68rem; min-width: 56px;
    padding: .25rem .35rem;
    border-radius: 8px;
    background: none; border: none; font-family: inherit; cursor: pointer;
}
.app-bottom a.active, .app-bottom a:hover,
.app-bottom button:hover {
    color: var(--primary); text-decoration: none; background: var(--primary-50);
}
.app-bottom .fab {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; transform: translateY(-14px);
    box-shadow: var(--shadow);
    align-items: center; justify-content: center;
    min-width: 52px;
}
.app-bottom .fab.active, .app-bottom .fab:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--accent));
    color: #fff;
}
@media (min-width: 1024px) { .app-bottom { display: none; } }

/* =====================================================================
 *  COMPOSANTS
 * ===================================================================== */

/* ---------- Page header ---------- */
.page-header {
    display: flex; flex-direction: column; align-items: stretch;
    gap: .65rem; margin-bottom: 1rem;
}
.page-header h1 {
    display: flex; align-items: center; gap: .5rem;
    font-size: 1.2rem;
    flex-wrap: wrap;
}
.page-header .btn-group { width: 100%; }
.page-header .btn-group .btn {
    flex: 1; justify-content: center;
}
@media (min-width: 768px) {
    .page-header { flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; }
    .page-header h1 { font-size: 1.35rem; }
    .page-header .btn-group { width: auto; }
    .page-header .btn-group .btn { flex: initial; }
}

/* ---------- En-tête riche : fiche trousseau ---------- */
.trousseau-header { align-items: flex-start; }
.trousseau-title { display: flex; flex-direction: column; gap: .35rem; min-width: 0; flex: 1; }
.trousseau-title h1 {
    margin: 0;
    display: flex; flex-wrap: wrap; align-items: center;
    gap: .5rem;
    font-size: 1.2rem;
    line-height: 1.25;
}
.trousseau-name { word-break: break-word; }
.trousseau-chips {
    display: inline-flex; flex-wrap: wrap; gap: .35rem;
    align-items: center;
}
.trousseau-chips .pill {
    display: inline-flex; align-items: center; gap: .25rem;
    font-size: .72rem;
}
.trousseau-chips .badge { font-size: .72rem; }
.trousseau-sub {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .9rem; color: var(--text-soft);
}
.trousseau-sub a { color: var(--primary); }
@media (min-width: 768px) {
    .trousseau-title h1 { font-size: 1.4rem; }
    .trousseau-sub { font-size: .95rem; }
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .9rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: .85rem;
}
@media (min-width: 600px) { .card { padding: 1.1rem; margin-bottom: 1rem; } }

.card-title {
    display: flex; align-items: center; gap: .5rem;
    font-size: 1rem; font-weight: 600;
    color: var(--text); margin: 0 0 .75rem;
}

/* ---------- Grids ---------- */
.grid { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 600px) {
    .grid { gap: 1rem; }
    .grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
    .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
    .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
    .grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Stat cards ---------- */
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    display: flex; align-items: center; gap: .8rem;
    box-shadow: var(--shadow-sm);
    min-width: 0;                          /* anti-débordement flex */
}
.stat > div { min-width: 0; }
.stat .stat-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--primary-50); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat .value { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.stat .label {
    color: var(--muted); font-size: .8rem; margin-top: 2px;
    overflow-wrap: break-word;
}

/* =====================================================================
 *  TABLES - mode "cartes empilées" sur mobile
 *
 *  Sur mobile (< 768 px) chaque <tr> devient une carte verticale et
 *  chaque <td> affiche son libellé via `data-label="..."`. Quand le
 *  data-label est absent, on retombe sur l'affichage cellule classique.
 * ===================================================================== */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.data {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
}
table.data th, table.data td {
    padding: .7rem .85rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}
table.data th {
    background: var(--surface-2);
    font-size: .72rem; font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--surface-2); }

/* Ligne cliquable (data-href) - survol marqué */
table.data tr.row-link:hover td { background: var(--primary-50); }

/* En-têtes triables : lien occupe toute la cellule, flèches visibles */
table.data.sortable-table th { padding: 0; }
table.data.sortable-table th a.sort-link {
    display: block;
    padding: .65rem .75rem;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
table.data.sortable-table th a.sort-link:hover { background: var(--primary-50); color: var(--primary); }
table.data.sortable-table th .sort-arrow {
    display: inline-block;
    margin-left: .25rem;
    font-size: .7em;
    opacity: .35;
    transition: opacity .15s;
}
table.data.sortable-table th .sort-arrow.active { opacity: 1; color: var(--primary); }
table.data.sortable-table th a.sort-link:hover .sort-arrow { opacity: .8; }

@media (max-width: 767px) {
    /* On masque le thead et on transforme chaque ligne en carte */
    table.data thead { display: none; }
    table.data, table.data tbody, table.data tr, table.data td {
        display: block;
        width: 100%;
    }
    table.data tr {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: .75rem;
        padding: .25rem .5rem;
        box-shadow: var(--shadow-sm);
    }
    table.data tr:hover td { background: transparent; }
    table.data td {
        border: none;
        padding: .5rem .35rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: .75rem;
        min-width: 0;                   /* permet aux enfants de wrapper */
    }
    table.data td > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
    table.data td:not(:last-child) {
        border-bottom: 1px dashed var(--border);
    }
    /* Le libellé est rendu via le data-label, ou via la 1re cellule en bold */
    table.data td[data-label]::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-size: .72rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--muted);
    }
    /* Colonnes "actions" (la dernière) : on étale les boutons */
    table.data td.right {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    table.data td.right form { display: inline; }
}

/* ---------- Forms ---------- */
.form-row { margin-bottom: 1rem; }
.form-row label {
    display: block; font-weight: 600;
    margin-bottom: .35rem; font-size: .88rem;
    color: var(--text-soft);
}
.form-row input[type=text],
.form-row input[type=email],
.form-row input[type=password],
.form-row input[type=number],
.form-row input[type=color],
.form-row input[type=search],
.form-row input[type=datetime-local],
.form-row input[type=file],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: .7rem .8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit; color: inherit;
    background: #fff;
    min-height: var(--tap);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-50);
}
.form-row textarea { min-height: 90px; resize: vertical; }
.form-row .help { font-size: .8rem; color: var(--muted); margin-top: .3rem; }

/* ---------- Buttons ----------
   Action primaire (.btn) : gradient Gemini 4 couleurs (bleu Google →
   violet → rose → orange). Sans animation pour rester discret en
   usage app interne (l'animation est réservée à la landing publique).
   Couvre "+ Nouveau dossier", "+ Créer un dossier", "Rechercher",
   "Ajouter", "Téléverser", "Enregistrer", etc. */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: .4rem;
    padding: .65rem 1rem;
    min-height: var(--tap);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: linear-gradient(115deg, #4285F4 0%, #9B72CB 35%, #D96570 65%, #F4B400 100%);
    color: #fff;
    font: inherit; font-weight: 600; cursor: pointer;
    text-decoration: none;
    transition: background .2s, transform .05s, box-shadow .15s, border-color .15s;
    box-shadow:
        0 3px 10px rgba(66,133,244,.18),
        0 3px 10px rgba(217,101,112,.12);
    text-shadow: 0 1px 1px rgba(0,0,0,.10);
    white-space: nowrap;
}
.btn:hover {
    background: linear-gradient(115deg, #1A73E8 0%, #8456C7 35%, #C94B57 65%, #E89800 100%);
    text-decoration: none; color: #fff;
    box-shadow:
        0 5px 14px rgba(66,133,244,.26),
        0 5px 14px rgba(217,101,112,.18);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(66,133,244,.30); outline-offset: 2px; }

/* Bouton secondaire : fond blanc + CONTOUR gradient Gemini
   (technique : 2 backgrounds layered padding-box / border-box).
   Texte foncé pour lisibilité. Cohérent avec .lp-btn-gemini-outline
   utilisé sur la landing. */
.btn-secondary {
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(115deg, #4285F4 0%, #9B72CB 35%, #D96570 65%, #F4B400 100%) border-box;
    color: var(--text);
    border: 1.5px solid transparent;
    box-shadow: none;
    text-shadow: none;
    font-weight: 600;
}
.btn-secondary:hover {
    background:
        linear-gradient(#fafbff, #fafbff) padding-box,
        linear-gradient(115deg, #1A73E8 0%, #8456C7 35%, #C94B57 65%, #E89800 100%) border-box;
    color: var(--text);
    box-shadow: 0 4px 12px rgba(66,133,244,.12);
}
.btn-danger  { background: var(--danger); }
.btn-danger:hover  { background: #b32b2b; }

/* Bouton "ghost" : faible visuel, pour actions secondaires */
.btn-ghost {
    background: transparent; color: var(--text-soft);
    border-color: transparent; box-shadow: none;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost-danger { color: var(--danger); }
.btn-ghost-danger:hover { background: #fef2f2; color: var(--danger); }

/* Call-to-action : gradient Gemini multi-couleurs (subtil, sans animation
   pour rester discret en usage app interne. L'animation est réservée
   à la landing publique via .lp-btn-gemini). */
.btn-cta {
    padding: .95rem 1.5rem;
    font-size: 1.05rem; font-weight: 600;
    width: 100%;
    background: linear-gradient(115deg, #4285F4 0%, #9B72CB 35%, #D96570 65%, #F4B400 100%);
    color: #fff;
    border: none;
    box-shadow:
        0 6px 18px rgba(66,133,244,.22),
        0 6px 18px rgba(217,101,112,.14),
        0 2px 4px rgba(15,23,42,.08);
    text-shadow: 0 1px 2px rgba(0,0,0,.12);
    transition: background .25s, transform .1s, box-shadow .2s;
}
.btn-cta:hover {
    background: linear-gradient(115deg, #1A73E8 0%, #8456C7 35%, #C94B57 65%, #E89800 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow:
        0 10px 24px rgba(66,133,244,.30),
        0 10px 24px rgba(217,101,112,.22),
        0 2px 6px rgba(15,23,42,.10);
}
.btn-cta:active { transform: translateY(1px); }

/* Variante "succès" : reste en VERT car sémantique "validation positive"
   (Marquer comme restitué, Trousseau retrouvé, Confirmer le prêt).
   On NE veut PAS le gradient ici - un retour de prêt n'est pas un
   appel à l'action, c'est une confirmation. */
.btn-cta-success {
    background: var(--success);
    box-shadow: 0 6px 18px rgba(31,157,85,.28);
    text-shadow: none;
}
.btn-cta-success:hover {
    background: #166f3a;
    box-shadow: 0 10px 22px rgba(31,157,85,.34);
}

.btn-sm { padding: .35rem .65rem; font-size: .85rem; min-height: 36px; box-shadow: none; }
.btn-lg { padding: .9rem 1.5rem; font-size: 1rem; }

.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; }
/* Dans un btn-group, le CTA ne prend pas toute la largeur - il s'aligne
   avec les autres boutons. Sur mobile, flex-wrap les empile. */
.btn-group .btn-cta { width: auto; flex: 1; min-width: 200px; }

/* =====================================================================
 *  ACTION CARD - bloc d'action principal sur fiche trousseau
 * ===================================================================== */
.action-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}
.action-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
}
.action-card-cta::before { background: linear-gradient(180deg, var(--primary), var(--accent)); }
.action-card-loan::before { background: var(--orange); }
.action-card-lost::before { background: var(--danger); }
.action-card-warn::before { background: var(--orange); }

/* Variantes alertes : fond pastel léger + bandeau gauche coloré.
   action-card-warn (à surveiller) et action-card-loan (trousseau prêté)
   utilisent le MÊME orange pour la cohérence visuelle. */
.action-card-lost {
    background: linear-gradient(180deg, #fef2f2 0%, #fff 65%);
    border-color: #fbcaca;
}
.action-card-loan,
.action-card-warn {
    background: linear-gradient(180deg, #fef6e7 0%, #fff 65%);
    border-color: #fde2c4;
}

.action-card-head {
    display: flex; align-items: center; gap: .85rem;
    margin-bottom: .85rem;
    min-width: 0;
}
.action-card-head > div { min-width: 0; }
.action-card-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary-50); color: var(--primary);
    flex-shrink: 0;
}
.action-card-loan .action-card-icon,
.action-card-warn .action-card-icon { background: #fff3e0; color: var(--orange); }
.action-card-lost .action-card-icon { background: #fff; color: var(--danger);
                                       border: 1px solid #fbcaca; }
.action-card-lost .action-card-title { color: #9b1c1c; }
.action-card-loan .action-card-title,
.action-card-warn .action-card-title { color: #b25500; }

.action-card-label {
    font-size: .72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted);
}
.action-card-title {
    font-size: 1.15rem; font-weight: 700;
    color: var(--text); line-height: 1.25;
    margin-top: 2px;
}

.action-card-meta {
    display: flex; flex-wrap: wrap;
    gap: .25rem .75rem;
    font-size: .88rem; color: var(--text-soft);
    margin: .5rem 0 1rem;
    padding: .65rem .8rem;
    background: var(--surface-2);
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Bloc contact (téléphone + email) - boutons compacts côte à côte */
.contact-actions {
    display: flex; flex-wrap: wrap; gap: .5rem;
    margin: .85rem 0;
}
.contact-actions .btn-cta,
.contact-actions .btn-secondary {
    flex: 1; min-width: 140px;
}
.action-card-meta span { display: inline-flex; align-items: center; gap: .3rem; }

.action-secondary {
    display: flex; flex-wrap: wrap; gap: .35rem;
    margin-top: .85rem; padding-top: .85rem;
    border-top: 1px dashed var(--border);
}

.loan-form-wrap[hidden] { display: none; }

/* ---------- Badges & dots ---------- */
.badge {
    display: inline-block;
    padding: .22rem .65rem;
    border-radius: 999px;
    font-size: .72rem; font-weight: 600;
    color: #fff; background: var(--muted);
    line-height: 1.4;
}
.badge.vert   { background: var(--vert); }
.badge.bleu   { background: var(--bleu); }
.badge.orange { background: var(--orange); }
.badge.rouge  { background: var(--rouge); }
.badge.gris   { background: var(--gris); }

.pill {
    display: inline-block;
    padding: .18rem .6rem;
    border-radius: 999px;
    font-size: .72rem; font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface-2); color: var(--text-soft);
}
.pill-on     { background: #e9f7ef; color: var(--success); border-color: #b6e3c5; }
.pill-off    { background: #fef3e6; color: var(--orange);  border-color: #fde2c4; }
.pill-danger { background: #fef2f2; color: var(--danger);  border-color: #fbcaca; font-weight: 700; }

.dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 50%; background: var(--muted); margin-right: .4rem;
    vertical-align: middle;
}
.dot.vert   { background: var(--vert); }
.dot.bleu   { background: var(--bleu); }
.dot.orange { background: var(--orange); }
.dot.rouge  { background: var(--rouge); }
.dot.gris   { background: var(--gris); }

.swatch {
    display: inline-block; width: 18px; height: 18px;
    border-radius: 5px; vertical-align: middle; margin-right: .5rem;
    border: 1px solid rgba(0,0,0,.08);
}

/* ---------- Alerts (flash) ---------- */
.alert {
    padding: .8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: flex; align-items: flex-start; gap: .6rem;
    border: 1px solid transparent;
    font-size: .92rem;
}
.alert.error   { background: #fef2f2; color: #9b1c1c; border-color: #fbcaca; }
.alert.success { background: #e9f7ef; color: #166f3a; border-color: #b6e3c5; }
.alert.info    { background: var(--primary-50); color: var(--primary-dark); border-color: #c5dcf5; }

/* ---------- Thumbnails (photos) ---------- */
.thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: .65rem;
}
@media (min-width: 600px) {
    .thumbs { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
}
.thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .thumb-del {
    position: absolute; top: 4px; right: 4px;
    width: 32px; height: 32px;        /* tactile-friendly */
    border-radius: 50%;
    background: rgba(15,23,42,.7); color: #fff;
    border: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.thumb .thumb-del:hover { background: var(--danger); }

.logo-placeholder {
    width: 140px; height: 140px;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: .85rem; text-align: center; padding: .5rem;
}

/* ---------- Upload photo (caméra vs galerie) ----------
   Pattern garanti iOS Safari : input file VISIBLE (opacity 0) positionné
   en absolute au-dessus du bouton. Le tap utilisateur frappe l'input
   directement - Apple ne peut pas le bloquer puisqu'il n'y a aucun
   .click() programmatique. .sr-only ne marche PAS sur certaines versions
   d'iOS (Safari ignore les éléments clip:rect(0,0,0,0)). */
.upload-pair {
    display: flex; flex-wrap: wrap; gap: .5rem;
}
.upload-pair .btn,
.upload-pair .upload-label { flex: 1; min-width: 180px; }
.upload-label {
    cursor: pointer;
    padding: .85rem 1rem;
    font-size: 1rem;
    position: relative;            /* pour contenir l'input overlay */
    overflow: hidden;              /* clip de l'overlay sur les bords */
}
/* L'input file COUVRE tout le bouton mais reste invisible.
   pointer-events:auto crucial pour iOS qui exige une cible explicite.
   La règle .upload-input override .sr-only en spécificité - la classe
   sr-only reste utilisable ailleurs pour l'accessibilité pure. */
.upload-label .upload-input,
.upload-label .upload-input.sr-only {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important;
    opacity: 0 !important;
    cursor: pointer !important;
    font-size: 0 !important;
    pointer-events: auto !important;
    clip: auto !important;          /* annule clip rect de sr-only */
    overflow: visible !important;
    margin: 0 !important;
}

/* Classe d'accessibilité pure (autres usages - pas l'upload). */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 599px) {
    .upload-pair .btn,
    .upload-pair .upload-label { flex: 1 1 100%; }   /* empilés mobile */
}

/* Feedback positif quand des photos sont sélectionnées (avant submit) */
.upload-feedback-zone.upload-feedback-ok {
    background: #e9f7ef;
    border: 1px solid #b6e3c5;
    color: #166f3a;
    padding: .6rem .75rem;
    border-radius: var(--radius-sm);
    font-size: .88rem;
}

/* ---------- Graphique en barres (stats) ---------- */
.chart-bars {
    display: flex; align-items: flex-end; gap: .5rem;
    height: 180px;
    padding: .5rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.chart-bar {
    flex: 1; min-width: 36px;
    display: flex; flex-direction: column; align-items: center;
    gap: 4px;
    height: 100%;
    justify-content: flex-end;
}
.chart-bar-value {
    font-size: .72rem; font-weight: 600;
    color: var(--text-soft);
}
.chart-bar-fill {
    width: 100%;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 6px 6px 0 0;
    min-height: 2px;
    transition: filter .12s;
}
.chart-bar-fill:hover { filter: brightness(1.1); }
.chart-bar-fill-alt {
    background: linear-gradient(180deg, var(--vert), #15803d);
}
.chart-bar-label {
    font-size: .68rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: .03em;
    text-align: center;
}

/* ---------- Top list (stats) ---------- */
.top-list {
    list-style: none; padding: 0; margin: 0;
    counter-reset: top-rank;
}
.top-list li {
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem 0;
    border-bottom: 1px solid var(--border);
    counter-increment: top-rank;
}
.top-list li:last-child { border-bottom: none; }
.top-list li::before {
    content: counter(top-rank);
    flex-shrink: 0;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-soft);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 700;
}
.top-list li:first-child::before { background: #fef3c7; color: #92400e; }
.top-list li:nth-child(2)::before { background: #e5e7eb; color: #4b5563; }
.top-list li:nth-child(3)::before { background: #fed7aa; color: #9a3412; }
.top-list-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.top-list-count {
    flex-shrink: 0;
    font-size: .78rem; font-weight: 600;
    color: var(--primary);
    background: var(--primary-50);
    padding: 2px 8px;
    border-radius: 999px;
}

/* ---------- Mini-historique (fiche élément) ---------- */
.timeline {
    list-style: none; padding: 0; margin: 0;
    position: relative;
}
.timeline li {
    padding: .55rem 0 .55rem 1.25rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.timeline li:last-child { border-bottom: none; }
.timeline li::before {
    content: ''; position: absolute; left: .35rem; top: 1rem;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--muted);
}
.timeline li.tl-vert::before  { background: var(--vert); }
.timeline li.tl-bleu::before  { background: var(--bleu); }
.timeline li.tl-orange::before{ background: var(--orange); }
.timeline li.tl-rouge::before { background: var(--rouge); }
.timeline-line {
    font-size: .88rem;
    color: var(--text);
}
.timeline-meta {
    font-size: .72rem;
    color: var(--muted);
    margin-top: 2px;
}
.timeline-detail {
    margin-top: .35rem;
    font-size: .78rem;
}
.timeline-detail summary {
    cursor: pointer;
    color: var(--primary);
    padding: .15rem 0;
    list-style: none;
    user-select: none;
}
.timeline-detail summary::-webkit-details-marker { display: none; }
.timeline-detail summary::before { content: '▸ '; transition: transform .15s; display: inline-block; }
.timeline-detail[open] summary::before { content: '▾ '; }
.timeline-detail pre {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .5rem .65rem;
    font-size: .72rem;
    overflow-x: auto;
    margin: .25rem 0 .5rem;
}
.timeline-detail-label {
    font-size: .68rem; font-weight: 600;
    color: var(--muted);
    text-transform: uppercase; letter-spacing: .04em;
    margin-top: .35rem;
}

/* ---------- Card pliable (<details>) ---------- */
.details-card { padding: 0; }
.details-card > summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem 1.1rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: .5rem;
    font-weight: 600;
    user-select: none;
}
.details-card > summary::-webkit-details-marker { display: none; }
.details-card > summary::after {
    content: '▾';
    color: var(--muted);
    transition: transform .15s;
    margin-left: auto;
}
.details-card[open] > summary::after { transform: rotate(180deg); }
.details-card > summary > span:first-child {
    display: inline-flex; align-items: center; gap: .5rem;
    flex: 1; min-width: 0;
}
.details-card > .timeline,
.details-card > ul,
.details-card > div { padding: 0 1.1rem 1rem; }

/* ---------- Page Historique : items pliables ---------- */
.hist-list { padding: .25rem .75rem; }
.hist-item {
    border-bottom: 1px solid var(--border);
}
.hist-item:last-child { border-bottom: none; }
.hist-item > summary {
    list-style: none;
    cursor: pointer;
    padding: .65rem .25rem;
    display: flex; align-items: flex-start; gap: .65rem;
    user-select: none;
}
.hist-item > summary::-webkit-details-marker { display: none; }
.hist-item-main { flex: 1; min-width: 0; }
.hist-item-title {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem;
}
.hist-item-meta {
    font-size: .76rem;
    color: var(--muted);
    margin-top: 2px;
    word-break: break-word;
}
.hist-item-chevron {
    color: var(--muted);
    transition: transform .15s;
    flex-shrink: 0;
}
.hist-item[open] .hist-item-chevron { transform: rotate(180deg); }
.hist-item-body {
    padding: .25rem .25rem .65rem 1.85rem;
    border-top: 1px dashed var(--border);
    margin-top: .35rem;
}
.hist-item-body pre {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .5rem .65rem;
    font-size: .72rem;
    overflow-x: auto;
    margin: .25rem 0 .5rem;
    max-width: 100%;
}

/* ---------- Switch « voir comme » (super_admin) ---------- */
.view-as-switch {
    display: none;
    margin: 0;
}
.view-as-switch select {
    padding: .4rem .6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    font: inherit; color: var(--text);
    cursor: pointer;
    max-width: 200px;
}
.view-as-switch select:focus {
    outline: none; border-color: var(--primary);
    background: #fff;
}
@media (min-width: 1024px) {
    .view-as-switch { display: inline-flex; }
}

.view-as-banner {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-bottom: 2px solid #f59e0b;
    color: #78350f;
    padding: .55rem 1rem;
    display: flex; align-items: center; gap: .5rem;
    font-size: .88rem;
    position: sticky; top: var(--nav-h); z-index: 49;
}
.view-as-banner .btn {
    background: #fff; color: var(--text);
    border: 1px solid #fbbf24;
    box-shadow: none;
}
.view-as-banner .btn:hover { background: #fef3c7; color: var(--text); }

/* Logo structure dans le dashboard */
.struct-banner {
    display: flex; align-items: center; gap: 1rem;
    background: linear-gradient(135deg, var(--surface), var(--surface-2));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}
.struct-banner img {
    max-height: 48px; max-width: 90px;
    object-fit: contain;
}
.struct-banner .struct-banner-name {
    font-weight: 700; font-size: 1.15rem;
    color: var(--text);
}
.struct-banner .struct-banner-sub {
    font-size: .85rem; color: var(--muted);
    margin-top: 2px;
}

/* Variante "Mode super-admin global" (= bypass total du scope orga) :
   identité visuelle KEYME (bleu/violet) pour bien distinguer du contexte
   d'une organisation et signaler "tu vois tout, sois prudent". */
.struct-banner.struct-banner-super {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: transparent;
    color: #fff;
}
.struct-banner.struct-banner-super .struct-banner-name,
.struct-banner.struct-banner-super .struct-banner-sub {
    color: #fff;
}
.struct-banner.struct-banner-super .struct-banner-sub { opacity: .9; }
.struct-banner.struct-banner-super .brand-mark {
    background: rgba(255,255,255,.18);
    color: #fff;
}

/* ---------- Stats cliquables sur le dashboard ---------- */
.stat-link {
    text-decoration: none;
    color: inherit;
    transition: transform .12s, box-shadow .12s, border-color .12s;
}
.stat-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
    text-decoration: none;
}
.stat-link:active { transform: translateY(0); }

/* ---------- Search ---------- */
.search-form .search-bar {
    display: flex; flex-direction: column; gap: .5rem;
}
.search-form .search-bar input {
    flex: 1; padding: .8rem .9rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 1rem; background: #fff;
    min-height: var(--tap);
}
.search-form .search-bar input:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50);
}
.search-form .search-bar .btn { width: 100%; }
.search-form summary {
    margin-top: .75rem; cursor: pointer;
    color: var(--text-soft); font-size: .9rem;
    user-select: none; padding: .3rem 0;
}
@media (min-width: 600px) {
    .search-form .search-bar { flex-direction: row; align-items: stretch; }
    .search-form .search-bar .btn { width: auto; flex-shrink: 0; }
}

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.right { text-align: right; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.flex { display: flex; gap: .5rem; align-items: center; }
.flex.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Auth screen ---------- */
.auth-page {
    min-height: 100vh;
    min-height: 100dvh;             /* vh dynamique iOS */
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    background:
        radial-gradient(700px 500px at 10% 20%, rgba(111,77,255,.18), transparent),
        radial-gradient(700px 500px at 90% 80%, rgba(44,111,199,.15), transparent),
        linear-gradient(135deg, #f6f8fb 0%, #eaf2fc 100%);
}
.auth-box {
    width: 100%; max-width: 400px;
    padding: 1.5rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
@media (min-width: 600px) { .auth-box { padding: 2rem 1.75rem; } }
.auth-box h1 { margin: 0 0 1.25rem; font-size: 1.3rem; text-align: center; }
.auth-box .brand-area { text-align: center; margin-bottom: 1.5rem; }
.auth-box .brand-area img { max-height: 56px; }
.auth-box .brand-area .brand-mark {
    width: 56px; height: 56px; border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 22px;
}

/* ---------- Page Aide : layout 2 colonnes, recherche, sommaire ---------- */
.help-wrapper {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}
@media (max-width: 900px) {
    .help-wrapper { grid-template-columns: 1fr; }
}

/* Header sympa avec gradient + search */
.help-hero {
    background: linear-gradient(135deg, #4285F4 0%, #9B72CB 35%, #D96570 70%, #F4B400 100%);
    color: #fff;
    padding: 2rem 1.5rem 1.75rem;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 24px -8px rgba(66, 133, 244, .35);
}
.help-hero h1 {
    margin: 0 0 .25rem;
    color: #fff;
    font-size: 1.75rem;
    display: flex; align-items: center; gap: .6rem;
}
.help-hero p {
    margin: 0;
    color: rgba(255,255,255,.92);
    font-size: 1rem;
}
.help-search-wrap {
    position: relative;
    margin-top: 1.25rem;
}
.help-search-wrap input {
    width: 100%;
    padding: .85rem 1rem .85rem 2.75rem;
    border: 0;
    border-radius: 10px;
    font-size: 1rem;
    background: rgba(255,255,255,.97);
    color: var(--text);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.help-search-wrap input:focus {
    outline: 2px solid rgba(255,255,255,.6);
    outline-offset: 2px;
}
.help-search-wrap .help-search-icon {
    position: absolute; left: .9rem; top: 50%; transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}
.help-search-wrap .help-search-kbd {
    position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
    background: var(--surface-2);
    color: var(--muted);
    padding: .15rem .4rem;
    border-radius: 4px;
    font-size: .72rem;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    border: 1px solid var(--border);
    pointer-events: none;
}

/* Sommaire latéral sticky */
.help-toc {
    position: sticky;
    top: 80px;
    align-self: start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.help-toc h3 {
    margin: 0 0 .65rem;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}
.help-toc ol {
    margin: 0; padding: 0;
    list-style: none;
    counter-reset: toc;
}
.help-toc li {
    counter-increment: toc;
    margin: .25rem 0;
}
.help-toc li a {
    display: block;
    padding: .35rem .5rem .35rem 1.75rem;
    color: var(--text-soft);
    text-decoration: none;
    border-radius: 6px;
    font-size: .92rem;
    line-height: 1.35;
    position: relative;
    transition: background .12s, color .12s;
}
.help-toc li a::before {
    content: counter(toc);
    position: absolute;
    left: .5rem; top: .35rem;
    width: 1rem; height: 1rem;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
    font-size: .65rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    transition: background .12s, color .12s;
}
.help-toc li a:hover {
    background: var(--primary-50);
    color: var(--primary);
}
.help-toc li a.active {
    background: var(--primary-50);
    color: var(--primary);
    font-weight: 600;
}
.help-toc li a.active::before {
    background: var(--primary);
    color: #fff;
}
.help-toc li a.is-dim { opacity: .35; }

/* Sections masquées par la recherche */
.help-section.is-hidden { display: none; }

/* Surlignage des matches */
mark.help-hl {
    background: linear-gradient(180deg, transparent 55%, #fde68a 55%);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

/* "Aucun résultat" */
.help-empty {
    display: none;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
    font-size: 1.05rem;
}
.help-empty .help-empty-icon {
    display: block;
    font-size: 2.5rem;
    margin-bottom: .5rem;
    opacity: .35;
}

.help-content {
    line-height: 1.65;
    max-width: 880px;
    margin: 0 auto;
}
.help-content h1,
.help-content h2,
.help-content h3,
.help-content h4 {
    color: var(--text);
    margin: 1.8rem 0 .6rem;
    line-height: 1.25;
}
.help-content h1 { font-size: 1.8rem; }
.help-content h2 { font-size: 1.35rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: .35rem;
    margin-top: 2.4rem;
}
.help-content h3 { font-size: 1.1rem; color: var(--text-soft); }
.help-content h1:first-child,
.help-content h2:first-child { margin-top: 0; }
.help-content p { margin: 0 0 1rem; color: var(--text); }
.help-content ul,
.help-content ol { margin: 0 0 1rem 1.25rem; padding: 0; }
.help-content li { margin: .25rem 0; }
.help-content code {
    background: var(--primary-50);
    color: var(--primary-dark);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: .92em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.help-content pre {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    font-size: .88rem;
    line-height: 1.5;
}
.help-content pre code {
    background: transparent;
    color: var(--text);
    padding: 0;
    font-size: 1em;
}
.help-content blockquote {
    margin: 0 0 1rem;
    padding: .75rem 1rem;
    border-left: 4px solid var(--primary);
    background: var(--primary-50);
    color: var(--primary-dark);
    border-radius: 6px;
}
.help-content blockquote p:last-child { margin: 0; }
.help-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.2rem;
    font-size: .92rem;
}
.help-content th,
.help-content td {
    text-align: left;
    padding: .55rem .8rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.help-content th {
    background: var(--surface-2);
    font-weight: 600;
    color: var(--text);
}
.help-content tr:hover td { background: var(--surface-2); }
.help-content hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}
.help-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.help-content a:hover { color: var(--primary-dark); }
.help-content strong { color: var(--text); }

/* =====================================================================
 *  LANDING PAGE (/) - design éditorial moderne
 * ===================================================================== */
.lp-shell {
    --lp-max: 1140px;
    background: var(--surface);
    color: var(--text);
    min-height: 100vh;
}
.lp-shell, .lp-shell * { box-sizing: border-box; }

/* ---------- Nav ---------- */
.lp-nav {
    position: sticky; top: 0; z-index: 30;
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid rgba(226,231,238,.7);
    display: flex; align-items: center;
    padding: .85rem 1.25rem;
    max-width: 100%;
}
.lp-brand {
    display: inline-flex; align-items: center; gap: .55rem;
    color: var(--text); text-decoration: none;
    font-weight: 700; font-size: 1.05rem;
}
.lp-brand img { max-height: 32px; max-width: 110px; }
.lp-brand-mark {
    width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
    box-shadow: 0 4px 12px rgba(44,111,199,.25);
}
.lp-brand-mark-sm { width: 26px; height: 26px; font-size: 12px; border-radius: 7px; }
.lp-brand-name { letter-spacing: -.01em; }

.lp-nav-links {
    margin-left: auto;
    display: flex; align-items: center; gap: 1.6rem;
    font-size: .92rem;
}
.lp-nav-links a {
    color: var(--text-soft); text-decoration: none;
    transition: color .15s;
}
.lp-nav-links a:hover { color: var(--text); }
.lp-nav-links .lp-nav-login {
    color: var(--primary); font-weight: 600;
}
@media (max-width: 720px) {
    .lp-nav-links a:not(.lp-nav-login) { display: none; }
}

/* ---------- Hero ---------- */
.lp-hero {
    position: relative;
    padding: 5rem 1.25rem 4.5rem;
    overflow: hidden;
    text-align: center;
}
.lp-hero-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(60% 50% at 20% 0%, rgba(111,77,255,.10), transparent 60%),
        radial-gradient(50% 50% at 80% 10%, rgba(44,111,199,.12), transparent 65%),
        linear-gradient(180deg, var(--surface) 0%, #f9fbff 100%);
    z-index: 0;
}
.lp-hero-bg::before {
    /* Pattern grille très subtil */
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(44,111,199,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(44,111,199,.06) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 35%, transparent 75%);
            mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 35%, transparent 75%);
    opacity: .7;
}
.lp-hero-content {
    position: relative; z-index: 1;
    max-width: 860px; margin: 0 auto;
    animation: lpFadeUp .7s ease-out;
}
@keyframes lpFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

.lp-pill {
    display: inline-flex; align-items: center; gap: .55rem;
    padding: .35rem .85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .8rem; font-weight: 500;
    color: var(--text-soft);
    box-shadow: 0 2px 8px rgba(15,23,42,.04);
    margin-bottom: 1.6rem;
}
.lp-pill-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(31,157,85,.18);
    animation: lpPulse 2s ease-in-out infinite;
}
@keyframes lpPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(31,157,85,.18); }
    50%      { box-shadow: 0 0 0 6px rgba(31,157,85,.08); }
}

.lp-headline {
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.08;
    letter-spacing: -.02em;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 1.25rem;
}
.lp-gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
}
.lp-subhead {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    line-height: 1.6;
    color: var(--text-soft);
    max-width: 620px;
    margin: 0 auto 2rem;
}

/* CTA buttons */
.lp-hero-cta {
    display: flex; flex-wrap: wrap; gap: .85rem;
    justify-content: center; align-items: center;
    margin: 0 0 1.75rem;
}
.lp-btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .85rem 1.6rem;
    border-radius: 10px;
    font-size: .95rem; font-weight: 600;
    text-decoration: none;
    transition: transform .15s, box-shadow .2s, background .15s;
    white-space: nowrap;
    border: 1px solid transparent;
}
.lp-btn:hover { text-decoration: none; transform: translateY(-1px); }
.lp-btn-primary {
    background: var(--text);
    color: #fff;
    box-shadow: 0 6px 18px rgba(15,23,42,.20), 0 2px 4px rgba(15,23,42,.08);
}
.lp-btn-primary:hover {
    background: #0b1322; color: #fff;
    box-shadow: 0 10px 24px rgba(15,23,42,.26);
}
.lp-btn-secondary {
    background: var(--primary); color: #fff;
    box-shadow: 0 6px 18px rgba(44,111,199,.30);
}
.lp-btn-secondary:hover { background: var(--primary-dark); color: #fff; }
.lp-btn-ghost {
    background: transparent; color: var(--text);
    border-color: var(--border-strong);
}
.lp-btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.lp-trust {
    display: inline-flex; flex-wrap: wrap; justify-content: center;
    gap: .5rem 1rem;
    font-size: .82rem; color: var(--muted);
    margin: 0;
}
.lp-trust .icon { color: var(--success); }
.lp-dot-sep { color: var(--border-strong); }
@media (max-width: 520px) { .lp-dot-sep { display: none; } }

/* ---------- Sections ---------- */
.lp-section {
    padding: 5rem 1.25rem;
    max-width: var(--lp-max);
    margin: 0 auto;
}
.lp-section-alt {
    background: linear-gradient(180deg, #f9fbff 0%, var(--surface) 100%);
    max-width: 100%;
}
.lp-section-alt > * { max-width: var(--lp-max); margin-left: auto; margin-right: auto; }
.lp-section-head {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 3rem;
}
.lp-eyebrow {
    display: inline-block;
    font-size: .78rem; font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: .75rem;
}
.lp-section-head h2 {
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    line-height: 1.15;
    letter-spacing: -.015em;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

/* ---------- Features grid ---------- */
.lp-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 640px)  { .lp-features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .lp-features { grid-template-columns: repeat(3, 1fr); } }
.lp-feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.75rem;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.lp-feature:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: 0 12px 28px rgba(15,23,42,.06);
}
.lp-feature-icon {
    width: 44px; height: 44px; border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 1.1rem;
}
.lp-icon-blue   { background: rgba(44,111,199,.10);  color: var(--primary); }
.lp-icon-violet { background: rgba(111,77,255,.10);  color: var(--accent); }
.lp-icon-amber  { background: rgba(217,119,6,.10);   color: var(--warning); }
.lp-icon-green  { background: rgba(31,157,85,.10);   color: var(--success); }
.lp-feature h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 .4rem;
    letter-spacing: -.005em;
}
.lp-feature p {
    font-size: .92rem;
    line-height: 1.55;
    color: var(--text-soft);
    margin: 0;
}

/* ---------- Steps "how it works" ---------- */
.lp-steps {
    list-style: none;
    margin: 0; padding: 0;
    display: grid; gap: 1.25rem;
    max-width: 820px; margin: 0 auto;
}
.lp-steps li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
}
.lp-step-num {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .95rem;
    box-shadow: 0 6px 16px rgba(44,111,199,.30);
    flex-shrink: 0;
}
.lp-steps h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 .35rem;
}
.lp-steps p {
    font-size: .92rem;
    line-height: 1.55;
    color: var(--text-soft);
    margin: 0;
}

/* ---------- Final CTA ---------- */
.lp-final {
    padding: 4rem 1.25rem;
    max-width: var(--lp-max);
    margin: 0 auto;
}
.lp-final-card {
    background: linear-gradient(135deg, #0b1322 0%, #1a2540 100%);
    color: #fff;
    border-radius: 20px;
    padding: 3.25rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.lp-final-card::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(40% 50% at 80% 50%, rgba(111,77,255,.30), transparent 60%),
        radial-gradient(40% 50% at 20% 50%, rgba(44,111,199,.25), transparent 60%);
    pointer-events: none;
}
.lp-final-card h2,
.lp-final-card p {
    position: relative; z-index: 1;
}
.lp-final-card h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 .75rem;
    letter-spacing: -.015em;
}
.lp-final-card p {
    color: rgba(255,255,255,.78);
    max-width: 520px; margin: 0 auto 1.75rem;
    font-size: 1rem;
}
.lp-final-card .lp-hero-cta { position: relative; z-index: 1; }
.lp-final-card .lp-btn-primary { background: #fff; color: var(--text); box-shadow: 0 6px 18px rgba(0,0,0,.30); }
.lp-final-card .lp-btn-primary:hover { background: #f0f3f8; color: var(--text); }
.lp-final-card .lp-btn-secondary {
    background: rgba(255,255,255,.12); color: #fff;
    border-color: rgba(255,255,255,.18); box-shadow: none;
    backdrop-filter: blur(8px);
}
.lp-final-card .lp-btn-secondary:hover { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- Footer ---------- */
.lp-footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 1.25rem;
    max-width: var(--lp-max); margin: 0 auto;
    display: flex; flex-direction: column; align-items: center;
    gap: 1rem; text-align: center;
}
.lp-footer-brand {
    display: inline-flex; align-items: center; gap: .5rem;
    color: var(--text-soft); font-weight: 600;
    font-size: .95rem;
}
.lp-footer-logo { max-height: 26px; max-width: 90px; }
.lp-footer-links {
    display: flex; gap: 1.5rem;
    font-size: .9rem;
}
.lp-footer-links a {
    color: var(--text-soft); text-decoration: none;
    transition: color .15s;
}
.lp-footer-links a:hover { color: var(--text); }
.lp-footer-copy {
    font-size: .8rem; color: var(--muted);
    line-height: 1.6;
}
.lp-footer-copy a { color: var(--text-soft); text-decoration: underline; text-underline-offset: 2px; }

@media (min-width: 720px) {
    .lp-footer {
        flex-direction: row; justify-content: space-between; text-align: left;
    }
    .lp-footer-copy { text-align: right; max-width: 50%; }
}

/* Layout public dédié (landing) - reset body pour pleine largeur */
.lp-body { margin: 0; background: var(--surface); }

/* ---------- Landing : page Contact ---------- */
.lp-flash-wrap {
    max-width: var(--lp-max);
    margin: 0 auto;
    padding: 0 1.25rem;
}
.lp-flash-success,
.lp-flash-error {
    display: flex; align-items: flex-start; gap: .75rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin: 0 0 1.5rem;
    border: 1px solid;
}
.lp-flash-success {
    background: #e9f7ef; color: #166f3a; border-color: #b6e3c5;
}
.lp-flash-error {
    background: #fef2f2; color: #9b1c1c; border-color: #fbcaca;
}
.lp-flash-icon { flex-shrink: 0; margin-top: 1px; }
.lp-flash-success strong, .lp-flash-error strong {
    display: block; font-size: 1rem; margin-bottom: 2px;
}
.lp-flash-success p, .lp-flash-error p {
    margin: 0; font-size: .92rem; line-height: 1.5;
}

.lp-form-section {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 1.25rem 4rem;
}
.lp-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 12px 32px rgba(15,23,42,.06);
}
@media (min-width: 600px) { .lp-form { padding: 2.5rem; } }

.lp-form-block {
    border: none; padding: 0; margin: 0 0 2rem;
    min-width: 0;
}
.lp-form-block:last-of-type { margin-bottom: 1.25rem; }
.lp-form-block legend {
    padding: 0;
    font-size: .78rem; font-weight: 700;
    color: var(--primary);
    text-transform: uppercase; letter-spacing: .08em;
    margin-bottom: 1rem;
}
.lp-legend-opt {
    color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0;
}

.lp-form-grid {
    display: grid; gap: 1rem;
    grid-template-columns: 1fr;
}
@media (min-width: 600px) {
    .lp-form-grid { grid-template-columns: 1fr 1fr; }
}
.lp-form-row { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.lp-form-row-full { grid-column: 1 / -1; }
.lp-form-row label {
    font-size: .88rem; font-weight: 500;
    color: var(--text);
}
.lp-form-row .req { color: var(--danger); font-weight: 700; }
.lp-form-row input,
.lp-form-row select,
.lp-form-row textarea {
    width: 100%;
    padding: .7rem .85rem;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.lp-form-row input:focus,
.lp-form-row select:focus,
.lp-form-row textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44,111,199,.15);
}
.lp-form-row textarea { resize: vertical; min-height: 120px; }

.lp-form-rgpd {
    font-size: .82rem; color: var(--text-soft);
    background: var(--surface-2);
    border-left: 3px solid var(--primary);
    padding: .75rem 1rem;
    border-radius: 6px;
    margin: 0 0 1.5rem;
    line-height: 1.55;
}

.lp-form-actions {
    display: flex; gap: .75rem; flex-wrap: wrap;
    justify-content: flex-end; align-items: center;
}
.lp-form-actions .lp-btn-ghost {
    order: -1; margin-right: auto;
}
@media (max-width: 480px) {
    .lp-form-actions { justify-content: stretch; }
    .lp-form-actions .lp-btn { flex: 1; justify-content: center; }
}

/* Honeypot : visuellement caché mais accessible (laisse bots le remplir) */
.lp-honeypot {
    position: absolute !important;
    left: -10000px; top: auto;
    width: 1px; height: 1px;
    overflow: hidden;
}

/* ---------- Lien retour accueil sur les pages auth ---------- */
.auth-back-home {
    position: fixed;
    top: 1.25rem; left: 1.25rem;
    z-index: 60;
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem .85rem;
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-soft);
    font-size: .88rem; font-weight: 500;
    text-decoration: none;
    transition: color .15s, border-color .15s, background .15s;
    box-shadow: 0 2px 8px rgba(15,23,42,.06);
}
.auth-back-home:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: #fff;
    text-decoration: none;
}
@media (max-width: 480px) {
    .auth-back-home {
        top: .75rem; left: .75rem;
        padding: .45rem .7rem;
    }
    .auth-back-home span { display: none; } /* juste la flèche sur mobile pour ne pas masquer la box */
}

/* =====================================================================
 *  Style "Gemini" : gradient multi-couleurs animé inspiré de Google Gemini.
 *  Palette : bleu Google → violet → rose → orange Google.
 * ===================================================================== */
:root {
    --gemini-grad: linear-gradient(115deg, #4285F4 0%, #9B72CB 35%, #D96570 65%, #F4B400 100%);
    --gemini-grad-hover: linear-gradient(115deg, #1A73E8 0%, #8456C7 35%, #C94B57 65%, #E89800 100%);
}

/* ---------- Texte gradient Gemini (headline) ---------- */
.lp-headline-gemini {
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    line-height: 1.05;
    letter-spacing: -.025em;
    font-weight: 800;
    margin: 0 0 1.5rem;
}
.lp-gemini-text {
    background: var(--gemini-grad);
    background-size: 200% 200%;
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: lpGeminiShift 8s ease-in-out infinite;
    display: inline-block;
}
@keyframes lpGeminiShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* ---------- Bouton "Gemini" plein (Se connecter) ---------- */
.lp-btn-gemini {
    background: var(--gemini-grad);
    background-size: 200% 200%;
    color: #fff;
    border: none;
    box-shadow:
        0 6px 18px rgba(66,133,244,.25),
        0 6px 18px rgba(217,101,112,.18);
    animation: lpGeminiBtnShift 6s ease-in-out infinite;
    text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.lp-btn-gemini:hover {
    background: var(--gemini-grad-hover);
    background-size: 200% 200%;
    color: #fff;
    transform: translateY(-1px);
    box-shadow:
        0 10px 24px rgba(66,133,244,.32),
        0 10px 24px rgba(217,101,112,.24);
}
@keyframes lpGeminiBtnShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* ---------- Bouton "Gemini" contour gradient (Demander un compte) ---------- */
.lp-btn-gemini-outline {
    /* Double-background : padding-box blanc INTÉRIEUR + border-box gradient EXTÉRIEUR */
    background:
        linear-gradient(#fff, #fff) padding-box,
        var(--gemini-grad) border-box;
    background-size: auto, 200% 200%;
    color: var(--text);
    border: 2px solid transparent;
    font-weight: 600;
    animation: lpGeminiBtnShift 6s ease-in-out infinite;
}
.lp-btn-gemini-outline:hover {
    background:
        linear-gradient(#fafbff, #fafbff) padding-box,
        var(--gemini-grad-hover) border-box;
    background-size: auto, 200% 200%;
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(66,133,244,.15);
}
/* Variante quand le bouton outline est sur fond sombre (CTA final) */
.lp-btn-gemini-outline.lp-btn-on-dark {
    background:
        linear-gradient(#0b1322, #0b1322) padding-box,
        var(--gemini-grad) border-box;
    color: #fff;
}
.lp-btn-gemini-outline.lp-btn-on-dark:hover {
    background:
        linear-gradient(#162038, #162038) padding-box,
        var(--gemini-grad-hover) border-box;
    color: #fff;
}

/* Override pour les boutons Gemini dans la card finale sombre */
.lp-final-card .lp-btn-gemini {
    /* le gradient reste vibrant sur fond sombre, parfait */
}

/* ---------- Pastille d'alerte colorée + tooltip riche au survol ----------
   Remplace l'ancien combo (.dot + texte + ?) par une seule pastille
   avec le mot dedans. Le tooltip enfant s'affiche au :hover et au
   :focus (clavier + mobile via tap qui pose le focus). */
.alerte-pill {
    display: inline-flex; align-items: center;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: .85rem; font-weight: 600;
    line-height: 1.3;
    border: 1px solid;
    cursor: help;
    position: relative;
    vertical-align: -1px;
    user-select: none;
    transition: transform .1s, box-shadow .15s;
}
.alerte-pill:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(15,23,42,.10); }
.alerte-pill:focus { outline: 3px solid rgba(66,133,244,.30); outline-offset: 2px; }

.alerte-pill-vert   { background: #e9f7ef; color: #166f3a; border-color: #b6e3c5; }
.alerte-pill-bleu   { background: #eaf2fc; color: #1f5aa3; border-color: #c5dcf5; }
.alerte-pill-orange { background: #fef3e6; color: #92400e; border-color: #fde2c4; }
.alerte-pill-rouge  { background: #fef2f2; color: #9b1c1c; border-color: #fbcaca; }
.alerte-pill-gris   { background: #f6f8fb; color: #475066; border-color: #e2e7ee; }

/* Tooltip riche : sombre, lisible, multi-lignes, avec petite flèche */
.alerte-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #1a2233;
    color: #fff;
    padding: .7rem .9rem;
    border-radius: 8px;
    font-size: .82rem; font-weight: 400;
    line-height: 1.45;
    text-align: left;
    width: max-content;
    max-width: 280px;
    white-space: normal;
    opacity: 0; visibility: hidden;
    transition: opacity .15s, visibility .15s, transform .15s;
    z-index: 100;
    box-shadow: 0 10px 24px rgba(15,23,42,.25);
    pointer-events: none;
}
.alerte-tooltip::after {
    content: '';
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1a2233;
}
.alerte-pill:hover .alerte-tooltip,
.alerte-pill:focus .alerte-tooltip,
.alerte-pill:focus-within .alerte-tooltip {
    opacity: 1; visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.alerte-tooltip strong {
    display: block;
    color: #fff;
    margin-bottom: 4px;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    opacity: .85;
}
.alerte-tooltip-foot {
    display: block;
    margin-top: .55rem;
    padding-top: .55rem;
    border-top: 1px solid rgba(255,255,255,.15);
    font-size: .75rem;
    opacity: .75;
}
@media (max-width: 480px) {
    .alerte-tooltip { max-width: 220px; }
}

/* ---------- Légende dépliable des couleurs ---------- */
.alert-legend {
    margin: .75rem 0 1rem;
    font-size: .9rem;
}
.alert-legend > summary {
    cursor: pointer;
    color: var(--text-soft);
    padding: .35rem 0;
    user-select: none;
    list-style: none;
    display: inline-flex; align-items: center; gap: .4rem;
}
.alert-legend > summary::-webkit-details-marker { display: none; }
.alert-legend > summary::before {
    content: "▸";
    display: inline-block;
    transition: transform .15s;
    color: var(--muted);
}
.alert-legend[open] > summary::before { transform: rotate(90deg); }
.alert-legend > summary:hover { color: var(--text); }
.alert-legend ul {
    list-style: none;
    padding: .85rem 1rem;
    margin: .5rem 0 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.alert-legend li {
    display: flex; align-items: center; gap: .65rem;
    padding: .35rem 0;
    color: var(--text);
    line-height: 1.45;
    font-size: .88rem;
}
/* dans la légende, les pastilles n'ont pas besoin du tooltip ni du cursor */
.alert-legend li .alerte-pill { cursor: default; flex-shrink: 0; min-width: 60px; justify-content: center; }
.alert-legend li .alerte-pill:hover { transform: none; box-shadow: none; }

/* ---------- Gomette numérotée type de clé ---------- */
.key-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    border: 1.5px solid rgba(0,0,0,.12);
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
    letter-spacing: -.02em;
    flex-shrink: 0;
    vertical-align: middle;
    line-height: 1;
    transition: transform .1s;
}
.key-badge:hover { transform: scale(1.12); }

/* ---------- Alertes compactes dashboard (au-dessus du titre) ---------- */
.dash-alert {
    border-radius: var(--radius-sm);
    margin-bottom: .5rem;
    border: 1px solid transparent;
    overflow: hidden;
}
.dash-alert-red {
    background: #fff5f5;
    border-color: #fca5a5;
    border-left: 4px solid var(--rouge);
}
.dash-alert-orange {
    background: #fffbeb;
    border-color: #fcd34d;
    border-left: 4px solid var(--orange);
}
/* summary = barre de titre cliquable */
.dash-alert > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1rem;
    cursor: pointer;
    user-select: none;
}
.dash-alert > summary::-webkit-details-marker { display: none; }
.dash-alert > summary:hover { filter: brightness(.97); }
.dash-alert-icon { font-size: 1rem; flex-shrink: 0; }
/* fleche collapse auto generée */
.dash-alert-toggle {
    margin-left: auto;
    font-size: .75rem;
    color: var(--muted);
}
.dash-alert-toggle::before { content: '▼ replier'; }
.dash-alert:not([open]) .dash-alert-toggle::before { content: '▶ déplier'; }

/* liste de lignes compactes */
.dash-alert-list {
    list-style: none;
    padding: 0 .75rem .6rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.dash-alert-list li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem .5rem;
    padding: .35rem .5rem;
    background: rgba(255,255,255,.7);
    border-radius: 6px;
    font-size: .9rem;
    line-height: 1.4;
}
.dash-alert-ref {
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}
.dash-alert-ref:hover { text-decoration: underline; }
.dash-alert-sep { color: var(--muted); }
.dash-alert-btn {
    margin-left: auto;
    flex-shrink: 0;
}
@media (max-width: 599px) {
    .dash-alert-btn { margin-left: 0; width: 100%; text-align: center; }
    .dash-alert-list li { flex-direction: column; align-items: flex-start; }
}

/* =====================================================================
 *  Fanfare Event - surcharges specifiques
 * ===================================================================== */

/* Marque pour l'eléphant rose dans le header + auth */
.app-header .brand-mark.elephant,
.auth-box .brand-mark.elephant {
    background: #fce7f3;
    padding: 0;
    overflow: hidden;
}
.app-header .brand-mark.elephant img,
.auth-box .brand-mark.elephant img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}
.auth-box .brand-area .brand-mark.elephant {
    width: 64px; height: 64px;
    border-radius: 18px;
    box-shadow: 0 4px 16px rgba(236, 72, 153, .25);
}

/* Badge couleur instrument-group dans les tableaux */
.group-badge {
    display: inline-flex; align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .75rem; font-weight: 500;
    color: #fff;
    white-space: nowrap;
}

/* Couleurs de fond pour pastilles d'instrument-group dans le PDF / pages */
.group-bar {
    display: inline-block;
    width: 4px; min-height: 1.2em;
    border-radius: 2px;
    margin-right: .5rem;
    vertical-align: middle;
}

/* Liens "lien d'invitation" / public urls */
.event-link-box {
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: .75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .9rem;
    word-break: break-all;
    color: var(--text);
}

/* Bouton copie pour les liens */
.copy-btn.copied {
    background: var(--success) !important;
    color: #fff !important;
    border-color: var(--success) !important;
}

/* Liste de musiciens cochables dans le form evenement */
.musician-pick {
    max-height: 460px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .5rem .75rem;
    background: var(--surface);
}
.musician-pick .invite-row {
    display: flex; align-items: center; gap: .5rem;
    padding: .35rem .25rem;
    cursor: pointer;
    border-radius: 6px;
}
.musician-pick .invite-row:hover {
    background: var(--surface-2);
}
.musician-pick .invite-row + .invite-row {
    border-top: 1px solid var(--border);
}
.musician-pick .invite-row input[type=checkbox] {
    flex-shrink: 0;
}

/* Header de page avec actions */
.page-actions {
    display: flex; gap: .5rem; flex-wrap: wrap;
    align-items: center;
}

/* Bandeau RGPD/notes sous les filtres */
.filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
    margin-bottom: 1rem;
}
@media (min-width: 600px) {
    .filter-bar { grid-template-columns: 2fr 1fr 1fr 1fr; align-items: end; }
}
.filter-bar label {
    display: block;
    font-size: .78rem; font-weight: 600;
    color: var(--muted);
    margin-bottom: .25rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.filter-bar input,
.filter-bar select {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit; background: #fff;
    min-height: var(--tap);
}
.filter-bar input:focus,
.filter-bar select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-50);
}

/* Reponses / statut publique */
.public-card {
    max-width: 540px;
    margin: 0 auto;
}
.public-card .btn-response {
    padding: .9rem 1rem;
    font-size: 1rem;
    text-align: left;
    justify-content: flex-start;
    border-radius: var(--radius);
}
.public-card .btn-response[data-current="true"]::after {
    content: '✓';
    margin-left: auto;
    color: var(--success);
    font-weight: 700;
}

