/* =============================================================================
 * FESTORGA PHOTOGRAPHE - Design system v2
 * Inspire tronc, mais plus moderne, fun et chaleureux.
 * Palette : indigo/violet pour orga, rose pour photographe, slate pour admin.
 * Icones : Lucide (charge en CDN dans le layout).
 * ============================================================================= */

:root {
    /* THEME BARAD-DUR (v1.32) : obsidienne, braises et or en fusion.
       Couleur primaire = braise (orange fondu) */
    --primary:        #ea580c;
    --primary-hover:  #c2410c;
    --primary-dark:   #7c2d12;
    --primary-soft:   #ffedd5;
    --primary-pale:   #fff7ed;

    /* Photographe (cramoisi de Mordor) - variables "pink" conservees (noms techniques stables) */
    --pink:        #be123c;
    --pink-hover:  #9f1239;
    --pink-dark:   #881337;
    --pink-soft:   #ffe4e6;

    /* Orga (braise) - meme que primary */
    --orga:        var(--primary);
    --orga-soft:   var(--primary-soft);

    /* Admin (pierre sombre) */
    --admin:       #44403c;
    --admin-dark:  #0c0a09;
    --admin-soft:  #f5f5f4;

    /* Couleurs semantiques */
    --success:      #10b981;
    --success-soft: #d1fae5;
    --success-dark: #065f46;
    --warn:         #f59e0b;
    --warn-soft:    #fef3c7;
    --warn-dark:    #92400e;
    --danger:       #ef4444;
    --danger-soft:  #fee2e2;
    --danger-dark:  #991b1b;
    --info:         #0ea5e9;
    --info-soft:    #e0f2fe;
    --info-dark:    #075985;

    /* Neutre : pierre chaude (stone) */
    --bg:        #fafaf9;
    --bg-alt:    #f5f5f4;
    --card:      #ffffff;
    --border:    #e7e5e4;
    --border-strong: #d6d3d1;
    --text:      #1c1917;
    --text-soft: #57534e;
    --text-mute: #a8a29e;

    /* Espaces */
    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
    --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

    /* Radius */
    --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 20px; --r-full: 999px;

    /* Ombres */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow:    0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 20px 35px -8px rgba(15, 23, 42, 0.12), 0 8px 12px -6px rgba(15, 23, 42, 0.06);
    --shadow-glow: 0 0 0 4px rgba(234, 88, 12, 0.16);

    /* Typo : Cinzel pour les grands titres (grave dans la pierre) */
    --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Inter", "Roboto", sans-serif;
    --font-display: "Cinzel", "Plus Jakarta Sans", serif;
    --font-mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
}

h1, .sidebar-brand, .photog-hero-acro, .dossier-banner-acro, .auth-logo h1 {
    font-family: var(--font-display);
    letter-spacing: 0.015em;
}

* { box-sizing: border-box; }
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

html, body {
    margin: 0; padding: 0;
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Lucide icons - reglages globaux */
[data-lucide] {
    display: inline-block;
    vertical-align: middle;
    stroke-width: 2;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.icon-sm  { width: 14px; height: 14px; }
.icon-md  { width: 18px; height: 18px; }
.icon-lg  { width: 22px; height: 22px; }
.icon-xl  { width: 28px; height: 28px; }
.icon-2xl { width: 36px; height: 36px; }

a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-hover); }

h1, h2, h3, h4, h5 { color: var(--text); margin: 0 0 var(--s-3) 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 1.875rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.4rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 600; }
p  { margin: 0 0 var(--s-3) 0; }

.lead { color: var(--text-soft); font-size: 1.05rem; margin-bottom: var(--s-6); line-height: 1.6; }
.muted, .text-muted { color: var(--text-soft); }
.text-mute { color: var(--text-mute); }
.text-small { font-size: 0.85rem; }
.text-center { text-align: center; }

code {
    background: var(--bg-alt); padding: 2px 7px; border-radius: var(--r-sm);
    font-family: var(--font-mono); font-size: 0.88em; color: var(--primary-dark);
}

/* =============================================================================
 * LAYOUT APP : sidebar + main
 * ============================================================================= */
.app-layout, .layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.sidebar {
    /* Tour de Barad-dur : obsidienne, lueur de braise au sommet */
    background:
        radial-gradient(ellipse 120% 40% at 50% -5%, rgba(234, 88, 12, 0.28), transparent 65%),
        linear-gradient(180deg, #1c1917 0%, #0c0a09 100%);
    color: #e7e5e4;
    padding: var(--s-5) var(--s-3);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden; /* jamais de barre horizontale dans le menu */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
}
.sidebar-nav a, .sidebar-group-toggle { min-width: 0; }
.sidebar-nav a { overflow-wrap: anywhere; }

/* Menu lateral REELLEMENT fige (desktop) : fixe au bord, pleine hauteur,
   le contenu est decale d'autant. En mobile le tiroir garde son comportement. */
@media (min-width: 901px) {
    .app-layout, .layout { display: block; }
    .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 250px; z-index: 90; }
    body.has-dev-banner .sidebar { top: 38px; }
    /* width auto (v1.96.0) : avec width 100 % + la marge du menu, toute page
       debordait d'environ 100 px sous 1530 px de large (portables 1366/1440) */
    .app-layout > .main, .layout > .main { margin-left: 250px; width: auto; }
}
.sidebar.role-admin {
    background:
        radial-gradient(ellipse 120% 40% at 50% -5%, rgba(220, 38, 38, 0.3), transparent 65%),
        linear-gradient(180deg, #1c1917 0%, #0c0a09 100%);
}
.sidebar.role-orga {
    background:
        radial-gradient(ellipse 120% 40% at 50% -5%, rgba(234, 88, 12, 0.3), transparent 65%),
        linear-gradient(180deg, #1c1917 0%, #0c0a09 100%);
}
.sidebar.role-photographe {
    background:
        radial-gradient(ellipse 120% 40% at 50% -5%, rgba(190, 18, 60, 0.32), transparent 65%),
        linear-gradient(180deg, #1c1917 0%, #0c0a09 100%);
}

.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: var(--s-2) var(--s-3);
    color: #fff; font-weight: 800; font-size: 1.15rem;
    letter-spacing: -0.01em;
    text-decoration: none;
    margin-bottom: var(--s-1);
}
.sidebar-brand:hover { color: #fff; }
.sidebar-brand-icon {
    width: 36px; height: 36px;
    border-radius: var(--r);
    background: rgba(255,255,255,0.12);
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; flex-shrink: 0;
}

.sidebar-role {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px;
    border-radius: var(--r-full);
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9);
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    margin: 0 var(--s-3) var(--s-5);
    width: fit-content;
}

.sidebar-section {
    color: rgba(255,255,255,0.45);
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
    margin: var(--s-5) var(--s-3) var(--s-2); font-weight: 600;
}

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px var(--s-3);
    color: rgba(255,255,255,0.78);
    border-radius: var(--r);
    text-decoration: none;
    font-size: 0.92rem; font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav a.active { background: rgba(255,255,255,0.18); color: #fff; font-weight: 600; box-shadow: var(--shadow-xs); }
.sidebar-nav a [data-lucide] { color: currentColor; opacity: 0.85; }

/* Groupes depliables de la sidebar (v1.23.0) */
.sidebar-group { display: flex; flex-direction: column; }
.sidebar-group-toggle {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 9px var(--s-3);
    border: 0; background: transparent; cursor: pointer;
    color: rgba(255,255,255,0.78); border-radius: var(--r);
    font-size: 0.92rem; font-weight: 500; font-family: inherit; text-align: left;
    transition: background 0.15s, color 0.15s;
}
.sidebar-group-toggle:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-group.active > .sidebar-group-toggle { color: #fff; font-weight: 600; }
.sidebar-group-toggle > span:first-of-type { flex: 1; }
.sidebar-group-toggle [data-lucide] { color: currentColor; opacity: 0.85; }
.sidebar-group-toggle .bell-badge { position: static; }
.sidebar-chevron { transition: transform 0.2s; opacity: 0.6; }
.sidebar-group.open .sidebar-chevron { transform: rotate(180deg); }
.sidebar-group-items {
    display: none; flex-direction: column; gap: 1px;
    margin: 2px 0 4px 20px; padding-left: 10px;
    border-left: 1px solid rgba(255,255,255,0.14);
}
.sidebar-group.open .sidebar-group-items { display: flex; }
.sidebar-group-items a { padding: 7px 10px; font-size: 0.87rem; position: relative; }
.sidebar-group-items a .bell-badge { position: static; margin-left: auto; }

/* Sous-menu deroulant DANS un groupe (v1.55.2) : ex. Dossiers par forfait */
.sidebar-sub { width: 100%; }
.sidebar-sub summary { list-style: none; display: flex; align-items: center; gap: 9px;
    padding: 7px 10px; font-size: 0.87rem; border-radius: 8px; cursor: pointer;
    color: inherit; }
.sidebar-sub summary::-webkit-details-marker { display: none; }
.sidebar-sub summary:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-sub summary.active { color: #fff; font-weight: 600; }
.sidebar-sub summary .sidebar-chevron { margin-left: auto; }
.sidebar-sub[open] summary .sidebar-chevron { transform: rotate(180deg); }
.sidebar-sub .sidebar-sub-lien { display: block; padding: 6px 10px 6px 34px; font-size: 0.83rem;
    border-radius: 8px; opacity: 0.9; }
.sidebar-sub .sidebar-sub-lien:hover { background: rgba(255,255,255,0.08); opacity: 1; }

.sidebar-user {
    padding: var(--s-3);
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: var(--s-4);
}
.sidebar-user-row { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s-3); }
.sidebar-user-avatar {
    width: 38px; height: 38px;
    border-radius: var(--r-full);
    background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.1));
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.95rem;
    flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-name { color: #fff; font-weight: 600; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { color: rgba(255,255,255,0.55); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar .btn-logout {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 8px;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85); border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--r); font-size: 0.85rem; font-weight: 500;
    text-decoration: none; cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.sidebar .btn-logout:hover { background: rgba(255,255,255,0.15); color: #fff; }

.sidebar-version {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 8px; padding: 4px;
    color: rgba(255,255,255,0.45); font-size: 0.75rem;
    text-decoration: none; border-radius: var(--r-sm);
    transition: color 0.15s, background 0.15s;
}
.sidebar-version:hover, .sidebar-version.active { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.08); }
.sidebar-version [data-lucide] { width: 13px; height: 13px; }

.main {
    padding: var(--s-8);
    max-width: 1280px;
    width: 100%;
}
/* Pages en pleine largeur (v1.96.1, navigateur de videos) : plus de plafond
   a 1280 px, marges reduites pour donner la place a la grille */
.main.main-wide { max-width: none; padding: var(--s-5); }

/* Page header reutilisable */
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: var(--s-4); flex-wrap: wrap;
    margin-bottom: var(--s-6);
}
.page-header-left { display: flex; align-items: center; gap: var(--s-4); flex: 1; min-width: 0; }
.page-header-icon {
    width: 52px; height: 52px;
    border-radius: var(--r-lg);
    background: var(--primary-soft); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.page-header-icon.success { background: var(--success-soft); color: var(--success); }
.page-header-icon.warn    { background: var(--warn-soft);    color: var(--warn-dark); }
.page-header-icon.danger  { background: var(--danger-soft);  color: var(--danger); }
.page-header-icon.info    { background: var(--info-soft);    color: var(--info-dark); }
.page-header-icon.pink    { background: var(--pink-soft);    color: var(--pink); }
.page-header-icon.admin   { background: var(--admin-soft);   color: var(--admin); }
.page-header h1 { margin: 0; }
.page-header .lead { margin-top: 4px; margin-bottom: 0; }
.page-header-actions { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }

.back-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-soft); font-size: 0.88rem; margin-bottom: var(--s-3);
}
.back-link:hover { color: var(--primary); }

/* =============================================================================
 * TOPBAR (page publique / vitrine)
 * ============================================================================= */
.topbar {
    background: rgba(255,255,255,0.85);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.topbar-inner {
    max-width: 1200px; margin: 0 auto;
    padding: var(--s-3) var(--s-6);
    display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
    flex-wrap: wrap;
}
.topbar .brand {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.25rem; font-weight: 800; color: var(--text);
    letter-spacing: -0.02em; text-decoration: none;
}
.topbar .brand:hover { color: var(--text); }
.topbar .brand-icon {
    width: 34px; height: 34px;
    border-radius: var(--r);
    background: linear-gradient(135deg, var(--primary) 0%, var(--pink) 100%);
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
}
.topbar .brand span { color: var(--primary); }
.topbar nav { display: flex; gap: var(--s-2); flex-wrap: wrap; }

.container { max-width: 1100px; margin: 0 auto; padding: var(--s-8) var(--s-6) var(--s-12); }

/* =============================================================================
 * CARDS
 * ============================================================================= */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-5) var(--s-6);
    margin-bottom: var(--s-4);
    box-shadow: var(--shadow-xs);
}
.card.compact { padding: var(--s-4); }
.card.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.card.ok    { border-left: 4px solid var(--success); background: linear-gradient(90deg, var(--success-soft) 0%, var(--card) 30%); }
.card.ko    { border-left: 4px solid var(--danger);  background: linear-gradient(90deg, var(--danger-soft)  0%, var(--card) 30%); }
.card.warn  { border-left: 4px solid var(--warn);    background: linear-gradient(90deg, var(--warn-soft)    0%, var(--card) 30%); }
.card h2:first-child, .card h3:first-child { margin-top: 0; }

.link-card {
    display: block; text-decoration: none; color: inherit;
    transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}
.link-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    text-decoration: none;
    color: inherit;
}
.link-card h3 { color: var(--primary); }

.card-section-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-soft); font-weight: 700;
    margin-bottom: var(--s-2);
}

/* =============================================================================
 * BOUTONS
 * ============================================================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px;
    background: var(--primary);
    color: #fff !important;
    border: 0;
    border-radius: var(--r);
    font-size: 0.92rem; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: transform 0.1s, background 0.15s, box-shadow 0.2s;
    line-height: 1.2;
}
.btn:hover { background: var(--primary-hover); color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }

.btn-secondary { background: var(--text-soft); }
.btn-secondary:hover { background: #334155; }

.btn-outline { background: transparent; color: var(--text) !important; border: 1px solid var(--border-strong); box-shadow: none; }
.btn-outline:hover { background: var(--bg-alt); color: var(--text); border-color: var(--text-soft); }

.btn-ghost {
    background: transparent; color: var(--primary) !important;
    border: 1px solid transparent; box-shadow: none;
}
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary-hover); transform: none; box-shadow: none; }

.btn-success { background: var(--success); }
.btn-success:hover { background: #059669; }
.btn-danger  { background: var(--danger); }
.btn-danger:hover  { background: #dc2626; }
.btn-pink    { background: var(--pink); }
.btn-pink:hover    { background: var(--pink-hover); }

.btn-large { padding: 14px 28px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }
.btn-mini, .btn-sm {
    padding: 5px 12px; font-size: 0.82rem;
    background: transparent; color: var(--text) !important;
    border: 1px solid var(--border-strong); box-shadow: none;
    border-radius: var(--r-sm);
}
.btn-mini:hover, .btn-sm:hover { background: var(--bg-alt); transform: none; box-shadow: none; }

.btn-icon {
    padding: 6px;
    width: 32px; height: 32px;
    background: transparent; color: var(--text-soft) !important;
    border: 1px solid var(--border); border-radius: var(--r-sm);
    box-shadow: none;
}
.btn-icon:hover { background: var(--bg-alt); color: var(--primary) !important; transform: none; box-shadow: none; }
.btn-icon.danger:hover { color: var(--danger) !important; background: var(--danger-soft); }

/* =============================================================================
 * FORMULAIRES
 * ============================================================================= */
.field { display: block; margin: 0 0 var(--s-4); }
.field > span, .field-label {
    display: block; font-weight: 600; font-size: 0.85rem;
    margin-bottom: var(--s-2); color: var(--text);
}
.field > .help, .field-help { font-size: 0.82rem; color: var(--text-soft); margin-top: var(--s-1); }

.field input, .field select, .field textarea,
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="url"], input[type="tel"],
select, textarea {
    display: block; width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r);
    font-size: 0.95rem; font-family: inherit;
    background: var(--card); color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus,
input:focus, select:focus, textarea:focus {
    outline: 0;
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}
input[readonly], textarea[readonly], input:disabled, select:disabled, textarea:disabled {
    background: var(--bg-alt); cursor: not-allowed; color: var(--text-soft);
}
textarea { min-height: 80px; resize: vertical; line-height: 1.5; }

input[type="file"] { padding: 7px; background: var(--bg-alt); border-style: dashed; cursor: pointer; }

.row { display: flex; gap: var(--s-4); flex-wrap: wrap; align-items: flex-end; margin-bottom: var(--s-3); }
.row > * { flex: 1; min-width: 200px; margin-bottom: 0; }

/* =============================================================================
 * FLASH / ALERTES
 * ============================================================================= */
.flash, .alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r);
    margin: 0 0 var(--s-4);
    border-left: 4px solid;
    font-size: 0.93rem;
    background: var(--card);
}
.flash [data-lucide], .alert [data-lucide] { flex-shrink: 0; margin-top: 2px; }
.flash.ok,    .alert-success { background: var(--success-soft); border-color: var(--success); color: var(--success-dark); }
.flash.ko,    .alert-error, .alert-danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-dark); }
.flash.warn,  .alert-warn    { background: var(--warn-soft);    border-color: var(--warn);    color: var(--warn-dark); }
.flash.info,  .alert-info    { background: var(--info-soft);    border-color: var(--info);    color: var(--info-dark); }

/* =============================================================================
 * PILLS / BADGES
 * ============================================================================= */
.pill, .badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: 0.74rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
    background: var(--bg-alt); color: var(--text-soft);
}
.pill [data-lucide], .badge [data-lucide] { width: 12px; height: 12px; }
.pill.ok,    .badge-success { background: var(--success-soft); color: var(--success-dark); }
.pill.ko,    .badge-danger  { background: var(--danger-soft);  color: var(--danger-dark); }
.pill.warn,  .badge-warn    { background: var(--warn-soft);    color: var(--warn-dark); }
.pill.info,  .badge-info    { background: var(--info-soft);    color: var(--info-dark); }
.pill.muted, .badge-gray    { background: var(--bg-alt);       color: var(--text-soft); }
.pill.pink                  { background: var(--pink-soft);    color: var(--pink-dark); }

.role-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: var(--r-full);
    background: var(--primary-soft); color: var(--primary-dark);
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; margin-left: 6px;
}

/* =============================================================================
 * STATS GRID
 * ============================================================================= */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-4); }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: var(--s-6); }

.stat {
    display: flex; align-items: center; gap: var(--s-3);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-4) var(--s-5);
    box-shadow: var(--shadow-xs);
    text-decoration: none; color: inherit;
    transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}
.stat.link-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--r);
    background: var(--primary-soft); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon.success { background: var(--success-soft); color: var(--success-dark); }
.stat-icon.warn    { background: var(--warn-soft);    color: var(--warn-dark); }
.stat-icon.danger  { background: var(--danger-soft);  color: var(--danger-dark); }
.stat-icon.info    { background: var(--info-soft);    color: var(--info-dark); }
.stat-icon.pink    { background: var(--pink-soft);    color: var(--pink-dark); }
.stat-body { min-width: 0; }
.stat-num   { font-size: 1.7rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.stat-label { font-size: 0.8rem; color: var(--text-soft); margin-top: 2px; }

/* =============================================================================
 * FILTRES / TABS
 * ============================================================================= */
.filters { display: flex; gap: var(--s-2); margin: 0 0 var(--s-5); flex-wrap: wrap; }
.filters a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 13px;
    border-radius: var(--r-full);
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 0.85rem; font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}
.filters a:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.filters a.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; box-shadow: var(--shadow-xs); }

/* =============================================================================
 * DEFINITION LIST
 * ============================================================================= */
dl.kv {
    display: grid; grid-template-columns: 200px 1fr;
    gap: var(--s-2) var(--s-5); margin: 0;
}
dl.kv dt {
    color: var(--text-soft); font-size: 0.85rem;
    display: flex; align-items: center; gap: 6px;
}
dl.kv dd { margin: 0; color: var(--text); }
dl.kv dd em { color: var(--text-mute); font-style: italic; }

/* =============================================================================
 * TABLES
 * ============================================================================= */
.table-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}
table {
    width: 100%; border-collapse: collapse;
    font-size: 0.92rem;
}
.table-wrap table { background: transparent; border: 0; box-shadow: none; }
th {
    text-align: left; padding: var(--s-3) var(--s-4);
    background: var(--bg-alt);
    font-size: 0.74rem; font-weight: 700; color: var(--text-soft);
    text-transform: uppercase; letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.1s; }
tbody tr:hover td { background: var(--bg-alt); }
td .actions { display: flex; gap: 6px; }

/* =============================================================================
 * EMPTY STATE
 * ============================================================================= */
.empty {
    background: var(--card);
    border: 2px dashed var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-12) var(--s-6);
    text-align: center;
}
.empty-icon {
    width: 72px; height: 72px;
    border-radius: var(--r-full);
    background: var(--primary-soft); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
    margin: 0 auto var(--s-4);
}
.empty-icon [data-lucide] { width: 32px; height: 32px; }
.empty h3 { margin-bottom: var(--s-2); }
.empty p { color: var(--text-soft); max-width: 420px; margin: 0 auto var(--s-4); }

/* =============================================================================
 * AUTH (login/register)
 * ============================================================================= */
.auth-layout {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: var(--s-6);
    /* Portes du Mordor : obsidienne animee de braises */
    background: linear-gradient(135deg, #0c0a09 0%, #450a0a 45%, #7c2d12 100%);
    background-size: 200% 200%;
    animation: auth-gradient 18s ease infinite;
}
@keyframes auth-gradient {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
.auth-card {
    background: var(--card);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    padding: var(--s-8);
    width: 100%; max-width: 460px;
}
.auth-card.wide { max-width: 720px; }
.auth-logo {
    text-align: center; margin-bottom: var(--s-6);
    display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
}
.auth-logo .brand-icon {
    width: 56px; height: 56px;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--pink) 100%);
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
    box-shadow: var(--shadow-md);
}
.auth-logo h1 { margin: 0; font-size: 1.4rem; }
.auth-logo p { margin: 0; color: var(--text-soft); font-size: 0.9rem; }
.auth-footer { text-align: center; margin-top: var(--s-5); font-size: 0.88rem; color: var(--text-soft); }

/* Choix de role (cartes) */
.role-choice { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.role-choice-card {
    display: block; text-align: center;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-6) var(--s-4);
    text-decoration: none; color: inherit;
    transition: all 0.18s;
}
.role-choice-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    color: inherit;
}
.role-choice-card.pink:hover { border-color: var(--pink); }
.role-choice-icon {
    width: 64px; height: 64px;
    border-radius: var(--r-lg);
    display: inline-flex; align-items: center; justify-content: center;
    margin: 0 auto var(--s-3);
    background: var(--primary-soft); color: var(--primary);
}
.role-choice-icon.pink { background: var(--pink-soft); color: var(--pink); }
.role-choice-card h3 { margin-bottom: 6px; }
.role-choice-card p { color: var(--text-soft); font-size: 0.88rem; margin: 0; }

/* =============================================================================
 * MOBILE : drawer + adaptations
 * ============================================================================= */
.mobile-bar { display: none; }
.sidebar-overlay { display: none; }

@media (max-width: 900px) {
    .app-layout, .layout { display: block; grid-template-columns: none; }

    .sidebar {
        position: fixed; top: 0; left: 0;
        height: 100vh; width: 270px; max-width: 85vw;
        z-index: 1000; transform: translateX(-100%);
        transition: transform 0.28s ease;
        box-shadow: 6px 0 24px rgba(0,0,0,0.25);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open { overflow: hidden; }
    .sidebar-overlay {
        display: block; position: fixed; inset: 0;
        background: rgba(15,23,42,0.5); z-index: 999;
        opacity: 0; pointer-events: none; transition: opacity 0.25s;
    }
    body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }

    .mobile-bar {
        display: flex; align-items: center; gap: var(--s-3);
        background: var(--card); border-bottom: 1px solid var(--border);
        padding: 10px 14px;
        position: sticky; top: 0; z-index: 50;
        box-shadow: var(--shadow-xs);
    }
    .mobile-bar-burger {
        width: 40px; height: 40px;
        border: none; background: transparent; cursor: pointer;
        display: flex; flex-direction: column;
        justify-content: center; align-items: center; gap: 4px;
        border-radius: var(--r-sm);
    }
    .mobile-bar-burger:hover { background: var(--bg-alt); }
    .mobile-bar-burger span {
        width: 22px; height: 2px;
        background: var(--text); border-radius: 2px;
        transition: transform 0.2s, opacity 0.2s;
    }
    body.sidebar-open .mobile-bar-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    body.sidebar-open .mobile-bar-burger span:nth-child(2) { opacity: 0; }
    body.sidebar-open .mobile-bar-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
    .mobile-bar-title {
        font-weight: 700; color: var(--text); font-size: 0.95rem; flex: 1;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .mobile-bar-role {
        font-size: 0.7rem; padding: 4px 10px; border-radius: var(--r-full);
        background: var(--primary-soft); color: var(--primary-dark);
        white-space: nowrap; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    }

    .main { padding: var(--s-4); max-width: 100%; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .page-header-actions { width: 100%; }
    .page-header-actions .btn { flex: 1; }

    .row { flex-direction: column; gap: var(--s-3); }
    .row > * { min-width: 0; }
    dl.kv { grid-template-columns: 1fr; gap: 4px var(--s-3); }
    dl.kv dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; margin-top: var(--s-2); }

    .grid.stats { grid-template-columns: repeat(2, 1fr); }
    .stat { padding: var(--s-3); }
    .stat-num { font-size: 1.3rem; }

    h1 { font-size: 1.4rem; }
    h2 { font-size: 1.15rem; }
    h3 { font-size: 1rem; }

    /* iOS : 16px min */
    .field input, .field select, .field textarea, input, select, textarea { font-size: 16px; }

    table { min-width: 600px; }
    .table-wrap { overflow-x: auto; }

    .role-choice { grid-template-columns: 1fr; }
    .auth-card { padding: var(--s-5) var(--s-4); }
}

@media (max-width: 480px) {
    .main { padding: var(--s-3); }
    .card { padding: var(--s-4); }
    .grid.stats { grid-template-columns: 1fr; }
}

/* =============================================================================
 * PHASE A - securite, conformite, compte (v0.4.0)
 * ============================================================================= */

/* Bandeau dev (REGLES.md 2.4) */
.dev-banner {
    position: sticky; top: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center; gap: var(--s-2);
    padding: 6px var(--s-4);
    font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em;
    box-shadow: var(--shadow-xs);
}
.dev-banner [data-lucide] { width: 16px; height: 16px; }

/* Footer interne */
.app-footer {
    margin-top: var(--s-8);
    padding-top: var(--s-4);
    border-top: 1px solid var(--border);
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4);
    justify-content: space-between;
    font-size: 0.8rem; color: var(--text-mute);
}
.app-footer nav { display: flex; flex-wrap: wrap; gap: var(--s-4); }
.app-footer a { color: var(--text-soft); text-decoration: none; }
.app-footer a:hover { color: var(--primary); }

.public-footer {
    margin-top: var(--s-5);
    display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; justify-content: center;
    font-size: 0.8rem;
}
.public-footer a { color: var(--text-soft); text-decoration: none; }
.public-footer a:hover { color: var(--primary); }
.public-footer-version { color: var(--text-mute); }

/* Liens auth secondaires */
.auth-links { text-align: right; margin: calc(-1 * var(--s-2)) 0 var(--s-4); }
.auth-links a { font-size: 0.85rem; color: var(--primary); text-decoration: none; }

/* Case a cocher consentement */
.field-check {
    display: flex; align-items: flex-start; gap: var(--s-2);
    margin: 0 0 var(--s-4); font-size: 0.88rem; color: var(--text-soft);
}
.field-check input { margin-top: 3px; flex-shrink: 0; }
.field-check a { color: var(--primary); }

/* Lien Mon compte dans la sidebar */
.btn-account {
    display: flex; align-items: center; gap: var(--s-2);
    margin-bottom: var(--s-2); padding: 8px 10px;
    border-radius: var(--r); color: var(--text-soft); text-decoration: none;
    font-size: 0.9rem;
}
.btn-account:hover, .btn-account.active { background: rgba(255,255,255,0.08); color: #fff; }

/* Bandeau cookies (REGLES.md 5.3) */
.cookie-banner {
    position: fixed; left: var(--s-4); right: var(--s-4); bottom: var(--s-4);
    z-index: 300; max-width: 720px; margin: 0 auto;
    background: var(--card); border: 1px solid var(--border-strong);
    border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
    padding: var(--s-4);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3);
}
.cookie-text { display: flex; align-items: flex-start; gap: var(--s-2); font-size: 0.88rem; color: var(--text-soft); }
.cookie-text a { color: var(--primary); }
.cookie-actions { display: flex; gap: var(--s-2); }

/* Pages legales */
.legal-page {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--r-lg); box-shadow: var(--shadow);
    padding: var(--s-8); text-align: left; line-height: 1.7;
}
.legal-page h1 { margin-top: var(--s-2); }
.legal-page h2 { margin-top: var(--s-6); font-size: 1.05rem; }
.legal-back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-soft); text-decoration: none; font-size: 0.85rem; }
.legal-note { margin-top: var(--s-6); font-size: 0.8rem; color: var(--text-mute); font-style: italic; }

/* Compte / 2FA */
.page-sub { margin: 4px 0 0; color: var(--text-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-3) 0; }
.danger-zone { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px dashed var(--border-strong); }
.danger-zone .help { display: block; margin-top: var(--s-2); }
.twofa-grid { display: grid; grid-template-columns: minmax(0, 240px) 1fr; gap: var(--s-8); align-items: start; }
.twofa-qr { text-align: center; }
.twofa-qr canvas { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 8px; }
.totp-secret {
    display: inline-block; margin-top: var(--s-2);
    font-family: var(--font-mono); font-size: 0.95rem; letter-spacing: 0.05em;
    background: var(--bg-alt); padding: 6px 10px; border-radius: var(--r-sm);
    user-select: all;
}
@media (max-width: 640px) {
    .twofa-grid { grid-template-columns: 1fr; }
    .cookie-banner { flex-direction: column; align-items: stretch; }
    .cookie-actions { justify-content: flex-end; }
}

/* Vignette photo (pipeline image) */
.photo-thumb {
    width: 44px; height: 44px; object-fit: cover;
    border-radius: var(--r-sm); border: 1px solid var(--border);
    background: var(--bg-alt); display: block;
}

/* Upload : dropzone, liste, progression (REGLES 8.1/8.3) */
.dropzone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--r-lg);
    padding: var(--s-6);
    text-align: center;
    color: var(--text-soft);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: var(--s-3);
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--pink);
    background: var(--pink-soft);
}
.dropzone [data-lucide] { width: 36px; height: 36px; color: var(--pink); }
.dropzone p { margin: var(--s-2) 0 4px; }
.dropzone input[type="file"] { margin-top: var(--s-3); font-size: 0.85rem; }
.upload-count { font-weight: 600; margin-bottom: var(--s-2); }
.upload-items { list-style: none; padding: 0; margin: 0 0 var(--s-3); max-height: 220px; overflow-y: auto; }
.upload-items li {
    display: flex; align-items: center; gap: var(--s-2);
    padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--r-sm);
    margin-bottom: 4px; background: var(--card);
}
.upload-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem; }
.upload-size { font-size: 0.8rem; color: var(--text-mute); }
.upload-remove {
    border: 0; background: var(--bg-alt); color: var(--text-soft);
    width: 22px; height: 22px; border-radius: 50%; cursor: pointer; line-height: 1;
}
.upload-remove:hover { background: var(--danger-soft); color: var(--danger); }
.upload-progress {
    height: 8px; background: var(--bg-alt); border-radius: var(--r-full);
    overflow: hidden; margin-bottom: var(--s-3);
}
.upload-progress-bar {
    height: 100%; width: 0; background: var(--pink);
    transition: width 0.2s; border-radius: var(--r-full);
}

/* =============================================================================
 * SUPER ADMIN (v0.6.0)
 * ============================================================================= */
.filter-bar {
    display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center;
    margin-bottom: var(--s-4);
}
.filter-bar input {
    padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r);
    font: inherit; background: var(--card);
}
.mig-list { list-style: none; padding: 0; margin: var(--s-2) 0 0; }
.mig-list li {
    display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap;
    padding: 6px 0; border-bottom: 1px solid var(--border);
}
.mig-list li:last-child { border-bottom: 0; }
.secret-field { display: flex; gap: var(--s-2); align-items: center; }
.secret-field input { flex: 1; }
.btn-account.active { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar.role-admin { background: linear-gradient(180deg, var(--admin) 0%, var(--admin-dark) 100%); }
.form-actions { margin-top: var(--s-4); }

/* =============================================================================
 * PHASE E - notifications, IA, mode sombre (v0.7.0)
 * ============================================================================= */

/* Cloche + badge */
.topbar-bell { position: relative; color: inherit; display: inline-flex; padding: 6px; }
.sidebar-tools { display: flex; gap: var(--s-2); margin-bottom: var(--s-2); }
.sidebar-tool {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: var(--r);
    background: rgba(255,255,255,0.08); color: #fff; border: 0; cursor: pointer;
    text-decoration: none;
}
.sidebar-tool:hover, .sidebar-tool.active { background: rgba(255,255,255,0.16); }
.bell-badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--danger); color: #fff; font-size: 0.62rem; font-weight: 700;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-full);
    display: inline-flex; align-items: center; justify-content: center;
}

/* Liste de notifications */
.notif-list { list-style: none; padding: 0; margin: 0; }
.notif-item { display: flex; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { background: var(--primary-pale); margin: 0 calc(-1 * var(--s-3)); padding-left: var(--s-3); padding-right: var(--s-3); border-radius: var(--r-sm); }
.notif-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--info); }
.notif-dot.type-success { background: var(--success); }
.notif-dot.type-warn { background: var(--warn); }
.notif-dot.type-error { background: var(--danger); }
.notif-title { font-weight: 600; }

/* Barre de boutons IA sous un textarea */
.ai-bar { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: calc(-1 * var(--s-2)) 0 var(--s-4); }

/* --- Mode sombre (REGLES.md 6.4) --- */
[data-theme="dark"] {
    --bg: #0c0a09;
    --bg-alt: #1c1917;
    --card: #1c1917;
    --border: #292524;
    --border-strong: #44403c;
    --text: #e7e5e4;
    --text-soft: #d6d3d1;
    --text-mute: #a8a29e;
    --primary-soft: #431407;
    --primary-pale: #2c1206;
    --pink-soft: #4c0519;
    --admin-soft: #1c1917;
    --success-soft: #064e3b;
    --warn-soft: #451a03;
    --danger-soft: #450a0a;
    --info-soft: #082f49;
    /* Textes des flashs/pastilles LISIBLES en sombre (v1.60) : les couleurs
       "dark" du theme clair disparaissaient sur les fonds -soft assombris */
    --success-dark: #6ee7b7;
    --warn-dark: #fcd34d;
    --danger-dark: #fca5a5;
    --info-dark: #7dd3fc;
}
[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] .legal-page,
[data-theme="dark"] .auth-card { background: var(--card); }
[data-theme="dark"] .photo-thumb { background: var(--bg-alt); }

/* Tchat en bulle flottante (v1.36) */
.chat-fab {
    position: fixed; right: 18px; bottom: 18px; z-index: 150;
    width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
    background: linear-gradient(135deg, var(--pink), var(--primary));
    color: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 26px -8px rgba(190, 18, 60, .7);
    transition: transform .15s;
}
.chat-fab:hover { transform: scale(1.07); }
.chat-fab .bell-badge { position: absolute; top: -3px; right: -3px; }
/* La bulle d'aide laisse la place au tchat quand il est present */
body:has(.chat-widget) .help-fab { bottom: 84px; }

.chat-panel {
    position: fixed; right: 18px; bottom: 84px; z-index: 150;
    width: min(370px, calc(100vw - 32px));
    height: min(500px, calc(100vh - 120px));
    display: flex; flex-direction: column;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 16px; overflow: hidden;
    box-shadow: 0 24px 60px -12px rgba(12, 10, 9, .5);
}
.chat-panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 14px; color: #fff;
    background: linear-gradient(115deg, #7f1d1d, #292524);
}
.chat-panel-head strong { display: inline-flex; align-items: center; gap: 6px; }
.chat-panel-close { border: 0; background: transparent; color: #fff; font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 0 4px; }
.chat-panel-thread { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; }
.chat-panel-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--bg); }
.chat-panel-form textarea { flex: 1; resize: none; min-height: 44px; }
.chat-panel-form .btn { align-self: flex-end; padding: 10px 14px; }

/* Tchat par dossier (REGLES.md 9) */
.chat-thread { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px 2px; }
.chat-msg { display: flex; }
/* Ligne systeme du journal des modifications (v1.48) */
.chat-log { text-align: center; font-size: .74rem; color: var(--text-soft); padding: 2px 8px; }
.chat-msg.mine { justify-content: flex-end; }
.chat-bubble { max-width: 78%; background: var(--surface-2, rgba(100,116,139,.12)); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; }
.chat-msg.mine .chat-bubble { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.chat-meta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.chat-body { white-space: pre-wrap; word-break: break-word; }
.chat-read { margin-top: 2px; display: flex; align-items: center; gap: 4px; }

/* Palette Ctrl+K (REGLES.md 6.6) */
.palette-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: none; z-index: 200; padding: 12vh 16px 0; }
.palette-overlay.visible { display: block; }
.palette { max-width: 560px; margin: 0 auto; background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,.35); }
[data-theme="dark"] .palette { background: #1c1917; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--border); padding: 14px 16px; font-size: 1rem; background: transparent; color: inherit; outline: none; }
.palette-results { max-height: 46vh; overflow-y: auto; padding: 6px; }
.palette-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); padding: 8px 10px 2px; }
.palette-results a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: inherit; }
.palette-results a:hover { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.palette-empty { padding: 16px; color: var(--text-soft); text-align: center; }

/* Modales aide + visite guidee (REGLES.md 6.3) */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 190; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { max-width: 520px; width: 100%; background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: 0 24px 64px rgba(0,0,0,.35); }
[data-theme="dark"] .modal { background: #1c1917; }

/* Popup photos d'un autre event, par-dessus le dossier (v1.42) */
.photos-modal { max-width: 920px; max-height: 86vh; display: flex; flex-direction: column; }
.photos-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.photos-modal-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 2px; }
.photos-modal-grid a { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.photos-modal-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .15s ease; }
.photos-modal-grid a:hover img { transform: scale(1.04); }
.photos-modal-foot { margin-top: 12px; display: flex; justify-content: flex-end; }
button.autre-event-chip { cursor: pointer; font: inherit; }
.autre-event-chip .chip-count { font-size: .78rem; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 14%, transparent); }

.tour-steps { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.tour-step { display: flex; gap: 12px; align-items: flex-start; }
.tour-icon { flex: 0 0 auto; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: color-mix(in srgb, var(--primary) 14%, transparent); }
.help-fab { position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface, #fff); color: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 120; }
[data-theme="dark"] .help-fab { background: #1c1917; }
.help-fab:hover { transform: scale(1.05); }

/* Mediatheque (grille de photos) */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.media-item { margin: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface, #fff); }
[data-theme="dark"] .media-item { background: #1c1917; }
.media-item img { width: 100%; height: 140px; object-fit: cover; display: block; }
.media-item figcaption { padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; position: relative; }
.media-credit { font-weight: 600; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-delete { position: absolute; right: 6px; top: 6px; border: 0; background: transparent; cursor: pointer; color: var(--text-soft); }
.media-delete:hover { color: #dc2626; }

/* Erreurs d'upload lisibles */
.upload-errors .flash { font-size: .88rem; }

/* Notes perso en etoiles (privees) */
.stars { display: inline-flex; gap: 1px; }
.stars .star { border: 0; background: transparent; cursor: pointer; font-size: 1.05rem; line-height: 1; padding: 1px; color: var(--border); transition: color .12s, transform .12s; }
.stars .star.on { color: #f59e0b; }
.stars .star:hover { transform: scale(1.2); color: #f59e0b; }

/* Visionneuse plein ecran (galerie) */
.lightbox { position: fixed; inset: 0; background: rgba(2,6,23,.94); z-index: 300; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 6px; }
.lightbox-close { position: absolute; top: 12px; right: 18px; font-size: 2rem; border: 0; background: transparent; color: #fff; cursor: pointer; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 1.6rem; width: 48px; height: 64px; border-radius: 8px; cursor: pointer; }
.lightbox-nav:hover { background: rgba(255,255,255,.25); }
.lightbox-nav.prev { left: 14px; }
.lightbox-nav.next { right: 14px; }
.lightbox-caption { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #cbd5e1; font-size: .9rem; }

/* L'attribut HTML hidden doit TOUJOURS gagner, meme sur les blocs en display:flex
   (modales, visionneuse, bandeau cookies, barre de progression). */
[hidden] { display: none !important; }

/* Uploader "flux" facon Google Photos */
.flux-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: var(--s-4); }
.flux-card { position: relative; margin: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: #1c191722; }
.flux-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flux-card.is-queued img, .flux-card.is-uploading img { opacity: .55; }
.flux-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.25); }
.flux-bar span { display: block; height: 100%; width: 0; background: #22c55e; transition: width .15s; }
.flux-card.is-done .flux-bar { display: none; }
.flux-state { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; font-size: .7rem; color: #fff; padding: 6px; }
.flux-card.is-done .flux-state::after { content: "\2713"; position: absolute; top: 6px; right: 8px; width: 20px; height: 20px; border-radius: 50%; background: #16a34a; color: #fff; font-size: .8rem; line-height: 20px; }
.flux-card.is-error { outline: 2px solid #dc2626; cursor: pointer; }
.flux-card.is-error .flux-state { background: rgba(127,29,29,.75); }
.flux-card.is-uploading .flux-state::before { content: ""; width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: fluxspin .8s linear infinite; }
@keyframes fluxspin { to { transform: rotate(360deg); } }
.flux-pill { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 150; background: #1c1917; color: #e2e8f0; border: 1px solid #334155; border-radius: 999px; padding: 10px 18px; font-size: .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.35); display: flex; align-items: center; gap: 8px; }
.flux-pill a { color: #93c5fd; }
.flux-spin { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: fluxspin .8s linear infinite; }
.flux-overlay { position: fixed; inset: 0; z-index: 260; background: rgba(30,58,138,.35); border: 4px dashed #60a5fa; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.flux-overlay-inner { background: #1c1917; color: #fff; padding: 24px 34px; border-radius: 14px; text-align: center; font-size: 1.05rem; }

/* Boutons telechargement photos */
.media-download { position: absolute; right: 30px; top: 6px; color: var(--text-soft); }
.media-download:hover { color: var(--primary); }
.media-download.media-social { right: 54px; }
.lightbox-download { position: absolute; top: 14px; left: 18px; }

/* Viewer type Adobe Bridge (v1.27.0) */
.lightbox-toolbar { position: absolute; top: 14px; left: 18px; display: flex; gap: 8px; }
.lightbox-stars { position: absolute; bottom: 46px; left: 0; right: 0; display: flex; justify-content: center; }
.lightbox-stars .stars .star { font-size: 1.6rem; color: rgba(255,255,255,.35); }
.lightbox-stars .stars .star.on { color: #f59e0b; }
.lightbox-help { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.55); font-size: .78rem; white-space: nowrap; }
@media (max-width: 640px) { .lightbox-help { display: none; } }

/* Panneau tags de la visionneuse (v1.29.0) */
.lightbox-tags {
    position: absolute; top: 60px; right: 16px; bottom: 96px;
    width: 240px; overflow-y: auto;
    background: rgba(15, 23, 42, .82);
    border: 1px solid rgba(255,255,255,.14); border-radius: 14px;
    padding: 12px; color: #e2e8f0;
    display: flex; flex-direction: column; gap: 10px;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    scrollbar-width: thin;
}
.lightbox-tags-head { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; }
.tag-section-title {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
    color: rgba(255,255,255,.55); font-weight: 700; margin-bottom: 5px;
}
.tag-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.tag-tile {
    display: flex; align-items: center; gap: 6px; min-height: 36px;
    border: 1px solid rgba(255,255,255,.22); border-radius: 10px;
    background: rgba(255,255,255,.07); color: #e2e8f0;
    padding: 7px 9px; font-size: .78rem; font-weight: 600; text-align: left;
    cursor: pointer; font-family: inherit; line-height: 1.2;
    transition: background .15s, border-color .15s, transform .1s;
    overflow-wrap: anywhere;
}
.tag-tile:hover { background: rgba(255,255,255,.18); transform: translateY(-1px); }
.tag-tile.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.tag-tile.on::before { content: "\2713"; font-weight: 800; flex-shrink: 0; }
.tag-group summary { cursor: pointer; font-size: .85rem; font-weight: 600; padding: 4px 0; }
.tag-group[open] summary { color: #fdba74; }
@media (max-width: 700px) { .lightbox-tags { width: 78vw; top: auto; bottom: 96px; max-height: 40vh; } }

/* Doublons ignores dans l uploader flux */
.flux-card.is-duplicate { outline: 2px solid #f59e0b; }
.flux-card.is-duplicate img { opacity: .45; }
.flux-card.is-duplicate .flux-state { background: rgba(120,53,15,.75); }
.flux-card.is-duplicate .flux-bar { display: none; }

/* Pagination maison + garde-fou contre les SVG geants du template par defaut */
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: var(--s-4); }
.pagination-links { display: flex; gap: 6px; flex-wrap: wrap; }
nav[role="navigation"] svg { width: 18px; height: 18px; }

/* Mediatheque en dossiers */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.folder-card { display: block; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; background: var(--surface, #fff); transition: transform .12s, box-shadow .12s; }
[data-theme="dark"] .folder-card { background: #1c1917; }
.folder-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.folder-cover { height: 130px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--primary) 8%, transparent); color: var(--text-soft); overflow: hidden; }
.folder-cover img { width: 100%; height: 100%; object-fit: cover; }
.folder-info { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }

/* Scroll infini */
.infinite-sentinel { display: flex; justify-content: center; padding: 18px; }
.infinite-sentinel .infinite-spin { visibility: hidden; }
.infinite-sentinel.is-loading .infinite-spin { visibility: visible; }
.infinite-sentinel .infinite-end { display: none; }
.infinite-sentinel.is-done .infinite-end { display: inline; }
.infinite-sentinel.is-done .infinite-spin { display: none; }

/* =============================================================================
 * ESPACE PHOTOGRAPHE V3 - moderne, chaleureux, anime (v1.21.0)
 * ============================================================================= */
@keyframes pv-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pv-pulse {
    0%, 100% { box-shadow: 0 0 0 5px rgba(234, 88, 12, .2); }
    50%      { box-shadow: 0 0 0 10px rgba(234, 88, 12, .07); }
}
@media (prefers-reduced-motion: reduce) {
    .photog-hero, .dossier-card, .step.current .step-dot { animation: none !important; }
}

/* Hero degrade avec halos decoratifs */
.photog-hero {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px; flex-wrap: wrap;
    padding: 28px 30px; border-radius: 22px; margin-bottom: var(--s-6);
    /* Fournaise du Mordor : cramoisi -> obsidienne */
    background: linear-gradient(115deg, #7f1d1d 0%, #292524 60%, #0c0a09 115%);
    color: #fff;
    border: 1px solid rgba(234, 88, 12, 0.25);
    box-shadow: 0 18px 40px -18px rgba(127, 29, 29, .6);
    animation: pv-rise .45s ease both;
}
.photog-hero::before {
    content: ""; position: absolute; top: -80px; right: -50px;
    width: 300px; height: 300px; border-radius: 50%;
    background: radial-gradient(circle, rgba(251, 146, 60, .38), rgba(234, 88, 12, .14) 45%, transparent 70%);
}
.photog-hero::after {
    content: ""; position: absolute; bottom: -110px; left: 32%;
    width: 260px; height: 260px; border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 119, 6, .18), transparent 70%);
}
.photog-hero > * { position: relative; z-index: 1; }
.photog-hero h1 { color: #fff; margin: 0; font-size: 1.7rem; letter-spacing: -0.02em; }
.photog-hero-sub { margin: 3px 0 0; color: rgba(255,255,255,.88); }
.photog-hero-sub a { color: #fde68a; }
.photog-hero-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.photog-hero-avatar { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255,255,255,.5); box-shadow: 0 6px 16px rgba(0,0,0,.25); flex-shrink: 0; }
.photog-hero-initials { display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.2); font-size: 1.5rem; font-weight: 800; }
.photog-hero-acro {
    width: 62px; height: 62px; border-radius: 18px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3);
    font-weight: 800; font-size: 1.05rem; letter-spacing: .04em;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

/* Chips de stats dans le hero (verre depoli) */
.photog-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.photog-stat {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 13px; border-radius: var(--r-full);
    background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.22);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    font-size: .84rem; font-weight: 600; color: #fff; text-decoration: none;
}
.photog-stat b { font-weight: 800; }
a.photog-stat:hover { background: rgba(255,255,255,.3); color: #fff; }

/* Bouton blanc sur fond degrade */
.btn-white { background: #fff; color: #be185d !important; box-shadow: 0 8px 20px -8px rgba(0,0,0,.4); }
.btn-white:hover { background: #fdf2f8; color: #9d174d !important; }

/* Cartes dossier / event avec bandeau colore */
.dossier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.dossier-card {
    border: 1px solid var(--border); border-radius: 18px; background: var(--card);
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: transform .16s ease, box-shadow .22s ease, border-color .22s ease;
    animation: pv-rise .4s ease both;
}
.dossier-card:nth-child(2) { animation-delay: .06s; }
.dossier-card:nth-child(3) { animation-delay: .12s; }
.dossier-card:nth-child(4) { animation-delay: .18s; }
.dossier-card:nth-child(5) { animation-delay: .24s; }
.dossier-card:nth-child(n+6) { animation-delay: .3s; }
[data-theme="dark"] .dossier-card { background: #1c1917; }
.dossier-card:hover { transform: translateY(-4px); box-shadow: 0 18px 34px -16px rgba(28, 25, 23, .3); border-color: #fdba74; }

.dossier-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 13px 18px; color: #fff;
    background: linear-gradient(120deg, #9f1239, #7c2d12);
}
.dossier-banner.v2 { background: linear-gradient(120deg, #7c2d12, #b45309); }
.dossier-banner.v3 { background: linear-gradient(120deg, #292524, #9f1239); }
.dossier-banner-acro { font-weight: 800; font-size: 1.05rem; letter-spacing: .05em; }
.dossier-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.dossier-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.dossier-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }

.date-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: var(--r-full);
    background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25);
    font-size: .76rem; font-weight: 600; white-space: nowrap;
}

/* Stepper de progression du dossier */
.steps { display: flex; align-items: flex-start; margin: 6px 0 2px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 56px; }
.step-dot {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-alt); color: var(--text-mute); border: 2px solid var(--border);
    transition: background .2s, color .2s;
}
.step-label { font-size: .68rem; color: var(--text-mute); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.step.done .step-dot { background: linear-gradient(135deg, #10b981, #059669); border-color: transparent; color: #fff; box-shadow: 0 4px 10px -4px rgba(16,185,129,.6); }
.step.done .step-label { color: #059669; }
.step.current .step-dot { background: linear-gradient(135deg, #ea580c, #be123c); border-color: transparent; color: #fff; animation: pv-pulse 2.4s ease infinite; }
.step.current .step-label { color: var(--pink); }
.step.refused .step-dot { background: linear-gradient(135deg, #ef4444, #dc2626); border-color: transparent; color: #fff; animation: none; box-shadow: 0 0 0 5px rgba(239,68,68,.15); }
.step.refused .step-label { color: #dc2626; }
.step-line { flex: 1; height: 3px; border-radius: 3px; background: var(--border); margin: 16px 4px 0; }
.step-line.done { background: linear-gradient(90deg, #10b981, #34d399); }

/* Message contextuel selon le statut du dossier */
.status-callout {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 13px 16px; border-radius: 14px;
    margin-top: var(--s-3); font-size: .92rem;
}
.status-callout [data-lucide] { flex-shrink: 0; margin-top: 2px; }
.status-callout.draft    { background: var(--pink-soft);    color: var(--pink-dark); }
.status-callout.pending  { background: var(--warn-soft);    color: var(--warn-dark); }
.status-callout.refused  { background: var(--danger-soft);  color: var(--danger-dark); }
.status-callout.approved { background: var(--success-soft); color: var(--success-dark); }
[data-theme="dark"] .status-callout.draft    { background: #4c0519; color: #fda4af; }
[data-theme="dark"] .status-callout.pending  { color: #fcd34d; }
[data-theme="dark"] .status-callout.refused  { color: #fca5a5; }
[data-theme="dark"] .status-callout.approved { color: #6ee7b7; }

/* Formulaire du dossier decoupe en sections */
.card.photog-form { padding: 0; overflow: hidden; }
.form-section { padding: 22px 26px; }
.form-section + .form-section { border-top: 1px dashed var(--border); }
.form-section-head { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.form-section-head h3 { margin: 0; font-size: 1.02rem; }
.form-section-head p { margin: 1px 0 0; font-size: .82rem; color: var(--text-soft); }
.icon-chip {
    width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--pink-soft); color: var(--pink);
}
.icon-chip.violet { background: #fef3c7; color: #b45309; }
.icon-chip.blue   { background: var(--info-soft); color: var(--info-dark); }
.icon-chip.green  { background: var(--success-soft); color: var(--success-dark); }
.icon-chip.amber  { background: var(--warn-soft); color: var(--warn-dark); }
[data-theme="dark"] .icon-chip { background: #4c0519; color: #fda4af; }
[data-theme="dark"] .icon-chip.violet { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .icon-chip.blue   { color: #7dd3fc; }
[data-theme="dark"] .icon-chip.green  { color: #6ee7b7; }
[data-theme="dark"] .icon-chip.amber  { color: #fcd34d; }

/* Champs plus doux : fond gris clair qui devient blanc au focus */
.photog-form input, .photog-form select, .photog-form textarea { background: var(--bg); }
.photog-form input:focus, .photog-form select:focus, .photog-form textarea:focus {
    background: var(--card); border-color: var(--pink);
    box-shadow: 0 0 0 4px rgba(190, 18, 60, .14);
}
.photog-form .form-section .field:last-child { margin-bottom: 0; }
.photog-form .form-section .row:last-child { margin-bottom: 0; }

.form-footer {
    padding: 16px 26px;
    border-top: 1px solid var(--border); background: var(--bg);
    display: flex; gap: 14px; align-items: center; justify-content: flex-end; flex-wrap: wrap;
}
[data-theme="dark"] .form-footer { background: #171310; }

.remember-box {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 11px 14px; border-radius: 12px;
    background: var(--primary-pale); border: 1px solid #fed7aa;
    font-size: .84rem; color: var(--text-soft); cursor: pointer;
    flex: 1; min-width: 260px;
}
.remember-box input { margin-top: 2px; accent-color: var(--pink); flex-shrink: 0; }
[data-theme="dark"] .remember-box { background: #292018; border-color: #7c2d12; }

/* Carte de soumission mise en scene */
.submit-card {
    border: 1px solid #fecdd3; border-radius: 18px;
    padding: 24px 26px; margin-bottom: var(--s-4);
    background: linear-gradient(120deg, #fff1f2 0%, #fff7ed 100%);
}
[data-theme="dark"] .submit-card { background: linear-gradient(120deg, #2b0a12, #291507); border-color: #881337; }
.submit-card h3 { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.submit-card .remember-box { background: rgba(255,255,255,.65); border-color: #fecdd3; margin: var(--s-3) 0; }
[data-theme="dark"] .submit-card .remember-box { background: rgba(12,10,9,.5); border-color: #881337; }

/* Documents en cartes cliquables */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: var(--s-2); }
.doc-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px; border: 1px solid var(--border); border-radius: 14px;
    background: var(--card); text-decoration: none; color: inherit;
    transition: transform .14s ease, box-shadow .2s ease, border-color .2s ease;
}
.doc-card:hover { transform: translateY(-2px); border-color: var(--pink); box-shadow: var(--shadow); color: inherit; }
.doc-card > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.doc-name { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: .78rem; color: var(--text-mute); }

/* Facts des cartes event */
.event-open-facts { display: flex; gap: 14px; flex-wrap: wrap; }
.event-open-facts span { display: inline-flex; align-items: center; gap: 5px; }

@media (max-width: 640px) {
    .photog-hero { padding: 20px; border-radius: 18px; }
    .photog-hero h1 { font-size: 1.3rem; }
    .photog-hero-avatar, .photog-hero-acro { width: 50px; height: 50px; }
    .photog-hero > .btn { width: 100%; }
    .form-section { padding: 16px; }
    .form-footer { padding: 14px 16px; }
    .submit-card { padding: 18px 16px; }
}

/* =============================================================================
 * COTE TEAM / ORGA V3 - meme langage visuel, teinte indigo (v1.22.0)
 * ============================================================================= */
.photog-hero.orga {
    background: linear-gradient(115deg, #7c2d12 0%, #292524 58%, #0c0a09 125%);
    box-shadow: 0 18px 40px -18px rgba(124, 45, 18, .6);
}
.photog-hero.orga .btn-white { color: #7c2d12 !important; }
.photog-hero.orga .btn-white:hover { background: #fff7ed; color: #431407 !important; }

/* L'oeil de Sauron veille sur les evenements (pose sur les heros d'events) */
.sauron-eye {
    position: absolute; right: 26px; top: 50%;
    width: 130px; height: 82px;
    transform: translateY(-50%);
    border-radius: 50%;
    background: radial-gradient(ellipse at center, #fef3c7 0%, #fbbf24 16%, #ea580c 42%, #7f1d1d 68%, transparent 74%);
    opacity: .85; pointer-events: none;
    animation: sauron-flicker 4.5s ease-in-out infinite;
    z-index: 0;
}
.sauron-eye::after {
    content: ""; position: absolute; left: 50%; top: 50%;
    width: 14px; height: 66px;
    transform: translate(-50%, -50%);
    background: #0c0a09; border-radius: 50%;
    box-shadow: 0 0 16px 4px rgba(12, 10, 9, .85);
}
@keyframes sauron-flicker {
    0%, 100% { opacity: .75; filter: blur(.6px); }
    50%      { opacity: 1; filter: blur(0); }
}
@media (prefers-reduced-motion: reduce) { .sauron-eye { animation: none; } }
@media (max-width: 700px) { .sauron-eye { display: none; } }

/* Bouton verre depoli sur fond degrade */
.btn-glass {
    background: rgba(255,255,255,.14); color: #fff !important;
    border: 1px solid rgba(255,255,255,.35); box-shadow: none;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.btn-glass:hover { background: rgba(255,255,255,.28); color: #fff !important; }
.photog-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Avatar rond dans les tableaux et listes */
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar-sm {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .84rem; color: #fff;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    object-fit: cover;
}
.cell-user > div { min-width: 0; }
.cell-user .cell-name { font-weight: 600; }
.cell-user .cell-sub { font-size: .78rem; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Infos presentees en tuiles (vue dossier candidat) */
.fact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; margin-top: var(--s-2); }
.fact {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 13px; border-radius: 12px;
    background: var(--bg); border: 1px solid var(--border);
}
[data-theme="dark"] .fact { background: #171310; }
.fact .icon-chip { width: 34px; height: 34px; border-radius: 10px; }
.fact > div { min-width: 0; }
.fact-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-mute); font-weight: 700; }
.fact-value { font-size: .9rem; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }

/* Liens externes (portfolio, reseaux) en chips cliquables */
.link-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: var(--s-2); }
.link-chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px; border-radius: var(--r-full);
    border: 1px solid var(--border); background: var(--card);
    font-size: .85rem; font-weight: 600; color: var(--text); text-decoration: none;
    transition: all .15s;
}
.link-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }

/* Cadrage des vignettes (v1.44.2) : TOUTES les images recadrees (object-fit:
   cover) sont ancrees en HAUT, partout et tout le temps - on garde les
   visages, on coupe les pieds. Sans effet sur les images non recadrees. */
img { object-position: center top; }

/* Titres de section des listes (events en cours / passes, v1.44) */
.section-title { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; color: var(--text); }
.section-title .icon-sm { color: var(--primary); }

/* Texte long (motivation, materiel) en encart doux */
.quote-box {
    padding: 14px 16px; border-radius: 12px;
    background: var(--bg); border: 1px solid var(--border);
    border-left: 4px solid #fdba74;
    color: var(--text-soft); white-space: pre-line;
}
[data-theme="dark"] .quote-box { background: #171310; }

/* Ordres du jour du dashboard admin (v1.37) */
.task-row {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; margin-bottom: 8px;
    border: 1px solid var(--border); border-radius: 12px;
    background: var(--bg); text-decoration: none; color: inherit;
    transition: transform .12s ease, border-color .2s ease, box-shadow .2s ease;
}
.task-row:hover { transform: translateX(3px); border-color: var(--primary); box-shadow: var(--shadow); color: inherit; }
.task-row:last-child { margin-bottom: 0; }
.task-row-label { flex: 1; min-width: 0; font-size: .92rem; }
.task-row-label b { font-size: 1.05rem; }
[data-theme="dark"] .task-row { background: #171310; }

/* Carte de decision (valider / refuser) */
.decision-card {
    border: 1px solid #fed7aa; border-radius: 18px;
    padding: 24px 26px; margin-bottom: var(--s-4);
    background: linear-gradient(120deg, #fff7ed 0%, #fff1f2 100%);
}
[data-theme="dark"] .decision-card { background: linear-gradient(120deg, #291507, #2b0a12); border-color: #7c2d12; }
.decision-card h3 { display: flex; align-items: center; gap: 9px; }

/* Parcours dossier didactique (v1.57, inspiration La Comte) */
.sommaire-dossier { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.sommaire-dossier a { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--text); text-decoration: none; padding: 7px 13px 7px 8px; border: 1px solid var(--border); border-radius: 99px; }
.sommaire-dossier a:hover { border-color: var(--pink); color: var(--pink); }
.jalon { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--pink); color: #fff; font-size: .78rem; font-weight: 700; flex: none; }
.form-section-head .jalon { width: 26px; height: 26px; }
.check-dossier { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 6px; }
.check-dossier li { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--text-soft); }
.check-dossier li.ok { color: var(--text); }
.check-dossier li.ok i { color: #16a34a; }
.check-dossier li a { color: inherit; text-decoration: underline; }

/* Compteur de messages non lus dans le menu (v1.58) : pastille rouge simple */
.chat-count {
    margin-left: auto; flex: none;
    background: var(--danger); color: #fff;
    font-size: .7rem; font-weight: 700;
    min-width: 19px; height: 19px; padding: 0 6px;
    border-radius: 99px;
    display: inline-flex; align-items: center; justify-content: center;
}

/* Choix du forfait en blocs (v1.59) : cartes radio riches, coche visible */
.forfait-blocs { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.forfait-bloc {
    position: relative; display: block; cursor: pointer;
    border: 2px solid var(--border); border-radius: 16px;
    background: var(--card); padding: 18px 18px 16px;
    transition: border-color .15s, box-shadow .15s;
}
.forfait-bloc:hover { border-color: var(--pink); }
.forfait-bloc input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.forfait-bloc:has(input:checked) { border-color: var(--pink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink) 25%, transparent); }
.forfait-bloc-coche {
    position: absolute; top: 12px; right: 12px; width: 26px; height: 26px;
    border-radius: 50%; background: var(--pink); color: #fff;
    display: none; align-items: center; justify-content: center;
}
.forfait-bloc:has(input:checked) .forfait-bloc-coche { display: inline-flex; }
.forfait-bloc-tete { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-right: 30px; }
.forfait-bloc-tete h3 { margin: 0; font-size: 1.05rem; }
.forfait-bloc-desc { margin: 8px 0 0; font-size: .86rem; color: var(--text-soft); white-space: pre-line; }
.forfait-bloc-droits {
    display: flex; gap: 8px; align-items: flex-start;
    margin: 12px 0 0; padding: 10px 12px; border-radius: 10px;
    font-size: .84rem; background: var(--pink-soft);
}
.forfait-bloc-droits.libre { background: rgba(22,163,74,.12); }
.forfait-bloc-details { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.forfait-bloc-details li { display: flex; gap: 8px; align-items: flex-start; font-size: .84rem; }
.forfait-bloc-details li i { flex: none; margin-top: 2px; opacity: .7; }
.forfait-bloc-avantages { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

/* Photo de profil moderne (v1.59) : rond cliquable, apercu, envoi auto */
.avatar-uploader { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.avatar-drop {
    position: relative; width: 96px; height: 96px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    border: 2px dashed var(--border); overflow: hidden; background: var(--card);
    transition: border-color .15s, box-shadow .15s;
}
.avatar-drop:hover { border-color: var(--pink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink) 20%, transparent); }
.avatar-drop img { width: 100%; height: 100%; object-fit: cover; }
.avatar-drop-initiale { font-size: 1.7rem; font-weight: 700; color: var(--text-soft); }
.avatar-drop-badge {
    position: absolute; bottom: 2px; right: 2px; width: 28px; height: 28px;
    border-radius: 50%; background: var(--pink); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    border: 2px solid var(--card); pointer-events: none;
}

/* Domaines de predilection en tuiles a cocher (v1.59) */
.domaines-tuiles { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.domaine-tuile { position: relative; cursor: pointer; }
.domaine-tuile input { position: absolute; opacity: 0; pointer-events: none; }
.domaine-tuile span {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px; border-radius: 99px; font-size: .85rem; font-weight: 500;
    border: 1px solid var(--border); background: var(--card);
    transition: border-color .15s, background .15s, color .15s;
}
.domaine-tuile:hover span { border-color: var(--pink); }
.domaine-tuile:has(input:checked) span { background: var(--pink); border-color: var(--pink); color: #fff; font-weight: 600; }

/* Zone d'ajout des photos d'exemple (v1.59) : clic, envoi automatique */
.exemples-drop {
    display: flex; gap: 12px; align-items: center;
    padding: 18px; border: 2px dashed var(--border); border-radius: 14px;
    cursor: pointer; transition: border-color .15s, background .15s;
}
.exemples-drop:hover { border-color: var(--pink); }
.exemples-drop > i { width: 28px; height: 28px; color: var(--pink); flex: none; }

/* Bandeau profil incomplet (v1.60) : impossible a rater, sans etre rouge vif */
.profil-incomplet {
    display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
    padding: 16px 20px; margin-bottom: var(--s-4);
    border-radius: 16px; border: 1px solid var(--warn);
    background: linear-gradient(120deg, var(--warn-soft), var(--card) 85%);
}
.profil-incomplet > i { width: 30px; height: 30px; color: var(--warn-dark); flex: none; }

/* Page publique d'inscription par event (v1.62, inspiree de La Comte) */
.insc-hero {
    background: linear-gradient(135deg, #1c1917, #431407 70%, #4c0519);
    color: #fff; border-radius: 20px; padding: 28px 30px; margin-bottom: var(--s-4);
}
.insc-hero h1 { margin: 10px 0 6px; color: #fff; }
.insc-hero h1 small { font-size: .6em; opacity: .8; font-weight: 600; }
.insc-hero-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: .9rem; opacity: .92; }
.insc-hero-desc { margin: 12px 0 0; opacity: .88; white-space: pre-line; }
.insc-titre { display: flex; align-items: center; gap: 8px; margin: var(--s-5) 0 var(--s-3); font-size: 1.05rem; }
.insc-forfaits { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.insc-forfait {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    padding: 18px; border-radius: 16px; border: 1px solid var(--border);
    background: var(--card); cursor: pointer; text-align: left; font: inherit; color: inherit;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.insc-forfait:hover { border-color: var(--pink); transform: translateY(-2px); box-shadow: var(--shadow-xs); }
.insc-forfait-nom { font-weight: 700; font-size: 1.02rem; }
.insc-forfait-prix { font-size: 1.6rem; font-weight: 800; color: var(--pink); line-height: 1.1; }
.insc-forfait-prix small { font-size: .55em; }
.insc-forfait-prix em { display: block; font-style: normal; font-size: .5em; font-weight: 600; color: var(--text-soft); letter-spacing: .04em; text-transform: uppercase; }
.insc-forfait-voir { margin-top: auto; font-size: .82rem; font-weight: 600; color: var(--pink); }
dialog.insc-detail {
    border: 0; border-radius: 18px; padding: 26px 28px; max-width: 480px; width: calc(100vw - 40px);
    background: var(--card); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0,0,0,.45);
}
dialog.insc-detail::backdrop { background: rgba(12, 10, 9, .55); backdrop-filter: blur(2px); }
dialog.insc-detail h3 { margin: 0 30px 10px 0; }
.insc-detail-fermer {
    position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
    border: 0; cursor: pointer; background: var(--bg-alt); color: var(--text); font-size: 1.1rem;
}
.insc-detail-prix {
    background: linear-gradient(120deg, var(--warn-soft), var(--card));
    border-radius: 12px; padding: 14px; text-align: center;
    font-size: 1.9rem; font-weight: 800; color: var(--warn-dark); margin-bottom: 12px;
}
.insc-detail-prix small { font-size: .5em; }
.insc-detail-prix span { display: block; font-size: .45em; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }

/* Parcours de bienvenue plein ecran (v1.63) : grande carte, fond Mordor */
.bienvenue-body {
    min-height: 100vh; margin: 0;
    background:
        radial-gradient(1100px 560px at 15% -10%, rgba(67, 20, 7, .9), transparent),
        radial-gradient(900px 500px at 110% 110%, rgba(76, 5, 25, .85), transparent),
        #0c0a09;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 44px 18px;
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}
.bienvenue-cadre { width: 100%; max-width: 780px; }
.bienvenue-marque {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    color: #fff; font-family: Cinzel, serif; font-weight: 700; font-size: 1.2rem;
    margin-bottom: 20px; letter-spacing: .04em;
}
.bienvenue-cadre > .card, .bienvenue-cadre form.card {
    padding: 38px 44px; border-radius: 24px;
    box-shadow: 0 40px 110px -35px rgba(0, 0, 0, .75);
}
.bienvenue-cadre h1 { font-size: 1.6rem; }
.bienvenue-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }
.bienvenue-pied { text-align: center; color: rgba(255,255,255,.55); font-size: .78rem; margin-top: 18px; }
@media (max-width: 700px) {
    .bienvenue-body { padding: 18px 10px 32px; }
    .bienvenue-cadre > .card, .bienvenue-cadre form.card { padding: 24px 18px; border-radius: 18px; }
    .bienvenue-cadre h1 { font-size: 1.3rem; }
    .bienvenue-actions { flex-direction: column-reverse; }
    .bienvenue-actions .btn { width: 100%; justify-content: center; }
}

/* Entete du parcours (v1.63) : lisible sur le fond Mordor quel que soit le theme */
.bienvenue-entete { margin-bottom: 18px; }
.bienvenue-etape { color: rgba(255, 255, 255, .85); font-size: .84rem; font-weight: 600; letter-spacing: .03em; }
.bienvenue-passer { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.bienvenue-passer:hover { background: rgba(255,255,255,.2); }
.bienvenue-progression { height: 9px; border-radius: 99px; background: rgba(255,255,255,.16); overflow: hidden; }
.bienvenue-progression > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--pink), #f97316); transition: width .3s; }

/* Case "je n'en ai pas" sous son champ (v1.63.1) */
.optout-case {
    display: flex; align-items: center; gap: 7px; cursor: pointer;
    font-size: .8rem; color: var(--text-soft);
    margin: -8px 0 14px;
}

/* Champs fichier modernises (v1.63.3) : zone cliquable + glisser-deposer */
.fichier-zone {
    display: flex; gap: 10px; align-items: center;
    padding: 13px 16px; border: 2px dashed var(--border); border-radius: 12px;
    cursor: pointer; max-width: 520px; position: relative;
    transition: border-color .15s, background .15s;
}
.fichier-zone:hover, .fichier-zone.survol { border-color: var(--pink); }
.fichier-zone.rempli { border-style: solid; border-color: var(--success); }
.fichier-zone > i { color: var(--pink); flex: none; }
.fichier-zone-texte { min-width: 0; font-size: .88rem; }
.fichier-zone-texte em { display: block; font-style: normal; font-size: .78rem; color: var(--text-soft); overflow-wrap: anywhere; }
.fichier-cache { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.exemples-drop.survol { border-color: var(--pink); }

/* Trombinoscope des photographes (v1.64, facon yggdra-guest) */
.trombi { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tuile-photographe {
    position: relative; display: flex; flex-direction: column;
    background: var(--card); border: 1px solid var(--border); border-radius: 16px;
    overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tuile-photographe:hover { transform: translateY(-2px); box-shadow: var(--shadow-xs); border-color: var(--pink); }
.tuile-lien { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.tuile-couv {
    position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, hsl(var(--teinte, 340) 55% 42%), hsl(calc(var(--teinte, 340) + 45) 60% 28%));
}
.tuile-couv img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tuile-initiales { color: #fff; font-weight: 800; font-size: 1.9rem; letter-spacing: .02em; opacity: .92; text-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.tuile-coin { position: absolute; bottom: 7px; left: 7px; }
.tuile-corps { padding: 10px 12px 4px; display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.tuile-titre { font-weight: 700; font-size: .94rem; line-height: 1.22; overflow-wrap: anywhere; }
.tuile-sous { color: var(--text-soft); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tuile-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.tuile-badges .pill { font-size: .66rem; padding: 2px 7px; }
.tuile-pied {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 12px 10px; margin-top: auto; font-size: .74rem; color: var(--text-soft);
}
.tuile-pied span { display: inline-flex; align-items: center; gap: 5px; }

/* Pop-up des photos d'exemple sur la fiche photographe (v1.66.1) */
dialog.fiche-lightbox {
    border: 0; padding: 0; background: transparent; max-width: min(92vw, 1100px);
    overflow: visible;
}
dialog.fiche-lightbox::backdrop { background: rgba(12, 10, 9, .82); backdrop-filter: blur(3px); }
dialog.fiche-lightbox img {
    display: block; max-width: min(92vw, 1100px); max-height: 86vh;
    border-radius: 14px; box-shadow: 0 30px 90px -20px rgba(0, 0, 0, .8);
}
.fiche-lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(255, 255, 255, .92); color: #1c1917; font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
}
.fiche-lightbox-nav.prev { left: -18px; }
.fiche-lightbox-nav.next { right: -18px; }
.fiche-lightbox-nav:hover { background: #fff; }
dialog.fiche-lightbox .insc-detail-fermer { top: -14px; right: -14px; }

/* --- Selection + telechargement groupe de la mediatheque (v1.70) --- */
.media-item { position: relative; }
.media-check,
.media-check-lock {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
}
.media-check {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--pink, #e5484d);
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 1px 3px rgba(0, 0, 0, .4);
    background: #fff;
}
.media-check-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
}
/* Anneau rose sur les vignettes cochees (navigateurs recents : :has) */
.media-item:has(.media-check:checked) {
    outline: 3px solid var(--pink, #e5484d);
    outline-offset: -3px;
}
.media-selbar {
    position: sticky;
    top: 8px;
    z-index: 6;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: var(--s-4, 16px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
}
[data-theme="dark"] .media-selbar { background: #1c1917; }
.media-selall {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: .85rem;
    margin: 0;
}
.media-selall input { width: 18px; height: 18px; accent-color: var(--pink, #e5484d); cursor: pointer; }

/* --- Etiquettes couleur globales + moyenne des notes (v1.71) --- */
.color-rouge  { background: #e5484d; }
.color-orange { background: #f5a623; }
.color-vert   { background: #30a46c; }
.color-bleu   { background: #3b82f6; }

/* Pastille couleur sur la vignette (cachee si aucune couleur) */
.media-color-dot { display: none; width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.media-color-dot.on { display: inline-block; }

/* Barre couleur a gauche de la vignette quand une etiquette est posee */
.media-item[data-color="rouge"]  { box-shadow: inset 5px 0 0 #e5484d; }
.media-item[data-color="orange"] { box-shadow: inset 5px 0 0 #f5a623; }
.media-item[data-color="vert"]   { box-shadow: inset 5px 0 0 #30a46c; }
.media-item[data-color="bleu"]   { box-shadow: inset 5px 0 0 #3b82f6; }

/* Moyenne des notes (super admin) */
.media-avg { font-size: .78rem; color: #f5a623; font-weight: 600; white-space: nowrap; }

/* Pastilles couleur dans la visionneuse */
.lightbox-colors { display: inline-flex; gap: 6px; align-items: center; margin-left: 6px; }
.vw-color {
    width: 20px; height: 20px; border-radius: 50%; cursor: pointer; padding: 0;
    border: 2px solid rgba(255,255,255,.35);
    box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.vw-color.on { border-color: #fff; box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(0,0,0,.5); }

/* --- Module Repas (v1.76) --- */
.meal-options { display: grid; gap: 8px; }
.meal-option {
    display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
    border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px;
    transition: border-color .12s, background .12s;
}
.meal-option:hover { border-color: var(--pink, #e5484d); }
.meal-option input { margin-top: 3px; accent-color: var(--pink, #e5484d); width: 18px; height: 18px; flex: 0 0 auto; }
.meal-option:has(input:checked) { border-color: var(--pink, #e5484d); background: rgba(229, 72, 77, .06); }
.meal-option:has(input:disabled) { opacity: .7; cursor: default; }
.meal-option.is-boisson:has(input:checked) { border-color: #3b82f6; background: rgba(59, 130, 246, .06); }
.meal-option-body { display: flex; flex-direction: column; gap: 2px; }
.meal-option-name { font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.meal-option-desc { font-size: .82rem; color: var(--text-soft); }
.meal-ingredients { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.meal-ingredient { font-size: .72rem; line-height: 1.4; padding: 2px 8px; border-radius: 999px; background: var(--surface-2, rgba(0,0,0,.05)); color: var(--text-soft); border: 1px solid var(--border, rgba(0,0,0,.08)); }
.meal-option.is-complet { opacity: .55; }
.meal-option.is-complet .meal-option-name { text-decoration: line-through; }
.meal-option-neutre .meal-option-name { font-weight: 500; color: var(--text-soft); }

/* Videos confidentielles (v1.91.0) */
.video-item { color: inherit; text-decoration: none; display: block; }
.video-item:hover { border-color: var(--primary); }
.video-thumb { position: relative; height: 140px; background: #1c1917; display: flex; align-items: center; justify-content: center; color: #a8a29e; }
.video-thumb img { width: 100%; height: 140px; object-fit: cover; display: block; }
.video-thumb [data-lucide] { width: 36px; height: 36px; }
.video-duration { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.75); color: #fff; font-size: .75rem; font-weight: 600; padding: 1px 6px; border-radius: 4px; }
.video-tags-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-player { width: 100%; max-height: 70vh; background: #000; border-radius: 8px; display: block; }
.video-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: var(--s-3); color: var(--text-soft); font-size: .9rem; align-items: center; }
.video-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.video-tag-picker { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; }
.video-tag-group { display: flex; flex-direction: column; gap: 2px; }
.video-tag { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; cursor: pointer; }
.video-tag-group .video-tag + .video-tag { padding-left: 18px; }
.video-preview { display: flex; align-items: center; gap: 12px; margin: 0 0 var(--s-4); }
.video-preview img { width: 160px; height: 90px; object-fit: cover; border-radius: 6px; background: #000; }
.video-progress { margin: var(--s-3) 0; }
.video-progress-bar { height: 10px; border-radius: 6px; background: var(--border); overflow: hidden; }
.video-progress-bar span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }

/* Videos : depot en masse et file d'envoi (v1.92.0) */
.video-drop { margin-bottom: var(--s-4); }
.video-drop-large { padding: 72px var(--s-6); }
.video-drop .help { display: block; }
.video-drop-pick { text-decoration: underline; cursor: pointer; }
.video-queue-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: var(--s-3); }
.video-queue-lot { margin-bottom: var(--s-3); }
.video-queue-lot summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.video-queue-list { list-style: none; margin: 0 0 var(--s-3); padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.vq-item { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.vq-thumb { flex: 0 0 96px; height: 54px; border-radius: 6px; background: #1c1917; color: #a8a29e; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.vq-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vq-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.vq-title { width: 100%; font-weight: 600; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: inherit; }
.vq-title:disabled { border-color: transparent; padding-left: 0; }
.vq-bar { height: 6px; }
.vq-extra:empty { display: none; }
.vq-actions { display: flex; gap: 6px; flex-shrink: 0; }
.vq-ok { border-color: var(--success); }
.vq-ok .vq-bar span { background: var(--success); }
.vq-erreur, .vq-refuse { border-color: var(--danger); }
.vq-erreur .vq-state, .vq-refuse .vq-state { color: var(--danger-dark); }
.vq-doublon { border-color: var(--warn); }
.vq-doublon .vq-bar span { background: var(--warn); }
.vq-annule { opacity: .6; }
.video-queue-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) {
    .vq-item { flex-wrap: wrap; }
    .vq-actions { width: 100%; justify-content: flex-end; }
}

/* Videos : apercu au survol et popup de lecture (v1.93.0) */
.video-thumb .video-hover-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .15s; }
.video-item.vv-previewing .video-hover-preview { opacity: 1; }
.video-item.vv-previewing .video-duration { z-index: 1; }
.video-lightbox { flex-direction: column; }
.video-lightbox-player { max-width: 92vw; max-height: 80vh; background: #000; border-radius: 6px; outline: none; }
.video-lightbox-top { position: absolute; top: 12px; left: 18px; right: 70px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: #fff; }
.video-lightbox-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.video-lightbox-pos { color: rgba(255,255,255,.6); font-size: .85rem; }
.video-lightbox-top .btn { background: rgba(255,255,255,.12); color: #fff !important; border-color: rgba(255,255,255,.35); }
body.vv-open { overflow: hidden; }
@media (max-width: 640px) {
    .video-lightbox-title { max-width: 60vw; }
    .video-lightbox .lightbox-nav { width: 36px; height: 52px; }
}

/* Videos : rattrapage des vignettes (v1.94.0) */
.video-repair-status { margin: 0 0 var(--s-3); }
.video-unreadable { color: var(--warn-dark); font-weight: 600; }

/* Lecteur invisible de calcul des vignettes (v1.94.1) : dans la fenetre
   (un lecteur hors ecran peut etre mis en pause par le navigateur) */
.video-probe { position: fixed; right: 0; bottom: 0; width: 16px; height: 9px; opacity: .01; pointer-events: none; z-index: -1; }

/* Texte reserve aux lecteurs d'ecran */
.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; }

/* Navigateur de videos facon Adobe Bridge (v1.96.0) */
.vb { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); }
.vb-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; background: var(--card); border-bottom: 1px solid var(--border); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.vb-path { margin: 0; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.vb-path-root { color: inherit; text-decoration: none; letter-spacing: .03em; }
.vb-path-sep { color: var(--text-mute); }
.vb-spacer { flex: 1 1 10px; }
.vb-size { display: flex; align-items: center; gap: 8px; color: var(--text-mute); font-size: .82rem; }
.vb-size input { width: 110px; accent-color: var(--primary); }
.vb-toolbar select, .vb-search input, .vb-inspector select { min-height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: .85rem; }
.vb-search input { width: 200px; max-width: 100%; box-sizing: border-box; }
.vb-inspector select { width: 100%; }
.vb-views { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.vb-views button { width: 38px; height: 36px; border: 0; background: transparent; color: var(--text-mute); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.vb-views button + button { border-left: 1px solid var(--border-strong); }
.vb-views button[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); }
.vb-views svg { width: 16px; height: 16px; }

.vb-body { display: flex; flex-wrap: wrap; align-items: flex-start; }
.vb-panel { background: var(--card); padding: 12px 14px; box-sizing: border-box; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.vb-filters { flex: 1 0 210px; max-width: 250px; border-right: 1px solid var(--border); }
.vb-center { flex: 999 1 420px; min-width: 0; padding: 14px; box-sizing: border-box; }
.vb-inspector { flex: 1 0 280px; max-width: 320px; border-left: 1px solid var(--border); }
.vb-panel-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 8px; }
.vb-clear { font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 600; }

.vb-facet summary { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-mute); cursor: pointer; padding: 8px 0 4px; }
.vb-facet-items { display: flex; flex-direction: column; gap: 1px; }
.vb-facet-scroll { max-height: 260px; overflow-y: auto; }
.vb-facet-item { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 6px; border-radius: 6px; cursor: pointer; font-size: .86rem; color: var(--text-soft); }
.vb-facet-item:hover { background: var(--bg-alt); }
.vb-facet-item.on { background: var(--primary-soft); color: var(--text); font-weight: 600; }
.vb-facet-item input { accent-color: var(--primary); margin: 0; }
.vb-facet-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb-facet-stars { color: #f59e0b; letter-spacing: 1px; }
.vb-facet-count { margin-left: auto; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.vb-swatch { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }

.vb-drop-slim { padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; }
.vb-drop-slim svg { width: 20px; height: 20px; }
.vb-drop-slim p { margin: 0; }
.vb-drop-slim .help { display: none; }

.vb-grid { grid-template-columns: repeat(auto-fill, minmax(calc(70px + var(--vb-size, 3) * 40px), 1fr)); gap: 14px 10px; }
.vb-item { padding: 6px; border: 2px solid transparent; border-radius: 8px; background: transparent; cursor: default; user-select: none; }
.vb-item:hover { background: var(--bg-alt); border-color: transparent; }
.vb-item.vb-selected { border-color: var(--primary); background: var(--primary-soft); }
.vb-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[data-theme="dark"] .vb-item { background: transparent; }
[data-theme="dark"] .vb-item.vb-selected { background: var(--primary-soft); }
.vb-item .video-thumb { height: auto; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; }
.vb-item .video-thumb img { height: 100%; }
.vb-color { display: block; height: 3px; border-radius: 2px; margin-top: 5px; }
.vb-item figcaption { padding: 4px 0 0; }
.vb-name { font-size: 12px; }
.vb-line { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.vb-stars { font-size: 12px; letter-spacing: 1px; }
.vb-stars .on { color: #f59e0b; }
.vb-stars .off { color: var(--border-strong); }
.vb-pill { font-size: .6rem; padding: 1px 6px; }
.vb-list-meta { display: none; }
.vb-list .vb-grid { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.vb-list .vb-item { display: flex; align-items: center; gap: 14px; }
.vb-list .vb-item .video-thumb { flex: 0 0 120px; }
.vb-list .vb-color { flex: 0 0 4px; width: 4px; height: 44px; margin: 0; }
.vb-list .vb-item figcaption { flex: 1 1 auto; min-width: 0; }
.vb-list .vb-list-meta { display: block; }
.vb-sentinel { height: 1px; }
.vb-center .pagination-bar { margin-top: var(--s-4); }

.vb-insp-empty { text-align: center; color: var(--text-mute); padding: 30px 6px; }
.vb-insp-empty svg { width: 28px; height: 28px; }
.vb-preview { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 6px; background: #1c1917; padding: 0; cursor: pointer; overflow: hidden; }
.vb-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vb-preview-play { position: absolute; inset: 0; margin: auto; width: 48px; height: 48px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; }
.vb-insp-title { font-weight: 700; margin: 10px 0; word-break: break-all; }
.vb-meta { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 4px 10px; font-size: .82rem; margin: 0 0 12px; }
.vb-meta dt { color: var(--text-mute); }
.vb-meta dd { margin: 0; }
.vb-break { word-break: break-all; }
.vb-insp-block { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.vb-insp-label { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-mute); }
.vb-insp-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.vb-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.vb-seg button { min-height: 34px; border: 1px solid var(--border-strong); border-radius: 6px; background: transparent; color: var(--text-soft); font: inherit; font-size: .82rem; cursor: pointer; }
.vb-seg button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--text); font-weight: 700; }
.vb-rate { display: flex; flex-wrap: wrap; align-items: center; }
.vb-rate button { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--border-strong); cursor: pointer; padding: 0 2px; min-width: 30px; min-height: 36px; }
.vb-rate button.on, .vb-rate button:hover { color: #f59e0b; }
.vb-rate .vb-rate-clear, .vb-colors .vb-rate-clear { font-size: .78rem; color: var(--text-mute); text-decoration: underline; min-width: 0; border: 0; background: transparent; cursor: pointer; }
.vb-colors { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.vb-colorbtn { width: 26px; height: 26px; border: 2px solid transparent; border-radius: 6px; cursor: pointer; padding: 0; display: inline-block; box-sizing: border-box; }
.vb-colorbtn[aria-pressed="true"], .vb-colorbtn.on { border-color: var(--text); }
span.vb-colorbtn { opacity: .3; cursor: default; }
span.vb-colorbtn.on { opacity: 1; }
.vb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vb-chip { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--bg-alt); font-size: .82rem; }
.vb-chip-x { width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--text-mute); cursor: pointer; font-size: 15px; line-height: 1; }
.vb-chip-x:hover { color: var(--danger); }
.vb-tag-add { display: flex; gap: 6px; }
.vb-tag-add input { flex: 1 1 auto; min-width: 0; min-height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; font-size: .85rem; }
.vb-insp-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.vb-statusbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 8px 14px; background: var(--card); border-top: 1px solid var(--border); border-radius: 0 0 var(--r-lg) var(--r-lg); color: var(--text-mute); font-size: .78rem; position: sticky; bottom: 0; z-index: 4; }

@media (max-width: 1100px) {
    .vb-panel { position: static; max-height: none; }
    .vb-filters, .vb-inspector { flex: 1 1 100%; max-width: none; border: 0; border-bottom: 1px solid var(--border); }
    .vb-inspector { order: 3; border-top: 1px solid var(--border); }
    .vb-center { order: 2; }
    .vb-keys { display: none; }
}
@media (max-width: 640px) {
    .vb-search input { width: 100%; }
    .vb-search { flex: 1 1 100%; }
    .vb-size { display: none; }
}
