/* ===========================================================================
   Portraits — feuille de style unique
   ---------------------------------------------------------------------------
   CSS natif, sans étape de compilation : le fichier transféré est le fichier
   servi. Pas de Node, pas de build, rien à reconstruire après une mise à jour.

   Les couleurs sont exprimées en jetons sémantiques (--surface, --content…) :
   changer le thème se fait ici, sans toucher à une seule vue.
   =========================================================================== */

/* --- Jetons ------------------------------------------------------------- */

:root {
    --canvas: #f7f8fb;
    --surface: #ffffff;
    --surface-2: #f1f3f8;
    --surface-3: #e6e9f0;
    --line: #e3e6ec;
    --line-strong: #cdd2dd;

    --content: #1f2430;
    --muted: #626b7d;
    --subtle: #99a1b0;

    --accent: #3f4fc7;
    --accent-hover: #35429f;
    --accent-soft: #eaecfb;
    --accent-content: #ffffff;

    --success: #1c7a4f;
    --success-soft: #e4f4ec;
    --warning: #9a6116;
    --warning-soft: #fdf1de;
    --danger: #b3382c;
    --danger-soft: #fdeae8;

    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 1px 2px rgba(31, 36, 48, .06), 0 1px 3px rgba(31, 36, 48, .05);
    --shadow-lg: 0 10px 30px rgba(31, 36, 48, .12);
}

/* Le mode sombre est piloté par une classe sur <html> : un photographe doit
   pouvoir le forcer en salle, indépendamment du réglage du téléphone. */
html.dark {
    --canvas: #14161c;
    --surface: #1c1f27;
    --surface-2: #242833;
    --surface-3: #2e3340;
    --line: #2f3441;
    --line-strong: #414859;

    --content: #f2f4f8;
    --muted: #a3acbd;
    --subtle: #737d90;

    --accent: #8090f0;
    --accent-hover: #97a4f5;
    --accent-soft: #262c47;
    --accent-content: #10131c;

    --success: #4ec08b;
    --success-soft: #16302a;
    --warning: #e0a951;
    --warning-soft: #322616;
    --danger: #ef7f74;
    --danger-soft: #33191a;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
}

/* --- Base --------------------------------------------------------------- */

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

html {
    -webkit-text-size-adjust: 100%;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--content);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; letter-spacing: -.015em; line-height: 1.25; }
h1 { font-size: 1.5rem; font-weight: 600; }
h2 { font-size: 1rem;   font-weight: 600; }
h3 { font-size: .875rem; font-weight: 600; }
p  { margin: 0; }

/*
 * Chemins de fichiers et commandes.
 *
 * Ils n'ont aucun espace où passer à la ligne : sur un téléphone, le chemin du
 * dossier de dépôt sortait de l'écran et poussait toute la page avec lui. On
 * coupe où il faut, quitte à couper au milieu d'un mot.
 */
code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .8125em;
    overflow-wrap: anywhere;
}

/*
 * Aucune image ne sort de son cadre.
 *
 * Il manquait cette règle de base. Sur la page qu'ouvre le participant, son
 * portrait s'affichait à sa taille réelle — 900 px de large sur un écran de
 * 375 — et poussait toute la page hors de l'écran : on voyait un aplat de
 * couleur, il fallait faire glisser latéralement pour découvrir un visage.
 * C'est la seule page que voient les personnes photographiées.
 */
img, video { max-width: 100%; height: auto; }

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

/* Cible tactile confortable : l'application s'utilise d'une main, l'appareil
   photo dans l'autre. */
button, a, [role="button"] { touch-action: manipulation; }

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

/* Chiffres de largeur fixe : les compteurs ne « sautent » pas quand ils se
   mettent à jour toutes les huit secondes. */
.stat, .tabular { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* --- Utilitaires -------------------------------------------------------- */

.muted   { color: var(--muted); }
.subtle  { color: var(--subtle); font-size: .8125rem; }
.small   { font-size: .875rem; }
.tiny    { font-size: .75rem; }
.strong  { font-weight: 600; }
.center  { text-align: center; }
.right   { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap  { white-space: nowrap; }
.hidden  { display: none !important; }
.grow    { flex: 1 1 auto; min-width: 0; }
/*
 * « Ne te comprime pas » ne veut pas dire « sors de l'écran ».
 *
 * Cette classe empêche une rangée de boutons d'être écrasée par son voisin.
 * Sans la largeur maximale, elle gardait sa largeur naturelle — 620 px pour
 * cinq boutons — et débordait de 265 px sur un téléphone : « Rapport » et
 * « Modifier » étaient purement inaccessibles.
 */
.shrink-0 { flex-shrink: 0; max-width: 100%; }

.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-accent  { color: var(--accent); }

.mt-1 { margin-top: .25rem; }  .mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }  .mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.5rem; }  .mt-6 { margin-top: 2rem; }
.mt-8 { margin-top: 3rem; }
.mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }  .mb-5 { margin-bottom: 1.5rem; }
.mb-6 { margin-bottom: 2rem; }

/*
 * Les rangées passent à la ligne d'office.
 *
 * Sans cela, trois boutons côte à côte débordent de l'écran d'un téléphone et
 * le dernier devient inatteignable : sur la page Rapport, « Imprimer » était
 * coupé par le bord droit, sans barre de défilement pour aller le chercher.
 * Un bouton hors de l'écran n'existe pas.
 */
.row    { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.row-top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .75rem; }
.nowrap-row { flex-wrap: nowrap; }

/* Textes libres — adresse, notes internes — où une chaîne sans espace, un lien
   collé ou un nom à rallonge déborderait de sa colonne. */
.wrap { overflow-wrap: anywhere; }
/* Sert aussi bien à des <div> qu'à des <ul> : on retire la puce, qui
   n'apparaissait que lorsque l'élément de liste n'était pas lui-même en
   flex — donc de façon imprévisible d'une liste à l'autre. */
.stack  { display: flex; flex-direction: column; gap: .75rem; list-style: none; padding-left: 0; }

/*
 * Une seule colonne tant que l'écran est étroit.
 *
 * Deux colonnes sur 375 px laissaient 160 px à chacune : « Yanis Berthier »
 * était coupé en « Yanis B... » et l'adresse du lieu tombait à un mot par
 * ligne. Deux colonnes illisibles valent moins qu'une colonne lisible.
 */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Les compteurs, eux, tiennent à deux de front : ce sont des nombres courts. */
.grid-4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (min-width: 900px) {
    .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .grid-2-lg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
}

/* --- Mise en page ------------------------------------------------------- */

.shell { min-height: 100vh; min-height: 100dvh; }

.container {
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem calc(2rem + env(safe-area-inset-bottom));
}
.container-narrow { max-width: 44rem; }
.container-mid    { max-width: 56rem; }

.page-centered {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

/* --- Barre de navigation ------------------------------------------------ */

.nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
}
/* Repli pour les navigateurs sans color-mix (Safari < 16.2) */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .nav { background: var(--surface); }
}

.nav-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 3.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--content);
    font-weight: 600;
    font-size: .9375rem;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand svg { width: 1.375rem; height: 1.375rem; color: var(--accent); }

.nav-links { display: none; gap: .25rem; }
@media (min-width: 820px) { .nav-links { display: flex; } }

.nav-link {
    padding: .375rem .75rem;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
}
.nav-link:hover { background: var(--surface-2); color: var(--content); text-decoration: none; }
.nav-link.active { background: var(--surface-2); color: var(--content); }

.nav-actions { display: flex; align-items: center; gap: .25rem; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--content); }
.icon-btn svg { width: 1.125rem; height: 1.125rem; }

/* Menu déroulant, sans JavaScript : <details> natif */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + .375rem);
    min-width: 14rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 50;
}
.menu-header { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.menu-item {
    display: block;
    width: 100%;
    padding: .625rem 1rem;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: .875rem;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}
.menu-item:hover { background: var(--surface-2); color: var(--content); text-decoration: none; }

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: .6875rem;
    font-weight: 600;
    flex-shrink: 0;
}
.avatar-lg { width: 2.25rem; height: 2.25rem; font-size: .75rem; }

/* Liens repliés sous la barre, uniquement sur petit écran. */
.nav-left { display: flex; align-items: center; gap: 2rem; }
/*
 * Les onglets passent à la ligne au lieu de défiler.
 *
 * Ils défilaient latéralement et « Photographes » était coupé net par le bord
 * de l'écran : rien n'indiquait qu'il fallait faire glisser, et un onglet
 * qu'on ne voit pas est un onglet qui n'existe pas. Un fondu ne réglait rien
 * — il aurait masqué le dernier onglet même une fois arrivé au bout. À quatre
 * entrées, deux lignes coûtent moins qu'un menu caché.
 */
.nav-links-mobile {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    padding: 0 1.25rem .5rem;
}
@media (min-width: 820px) { .nav-links-mobile { display: none; } }

.menu > summary.icon-btn { width: auto; padding: 0 .5rem; gap: .5rem; }
.nav-username { max-width: 8rem; }

/* --- Carte -------------------------------------------------------------- */

/*
 * Marges resserrées tant que l'écran est étroit.
 *
 * 1.5 rem de chaque côté, c'est 48 px pris sur les 375 px d'un téléphone :
 * 13 % de la largeur consacrés à du vide, pendant que les noms se coupaient
 * faute de place. La respiration revient dès qu'il y a de quoi la payer.
 */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1rem;
}
.card-tight { padding: .875rem; }

@media (min-width: 640px) {
    .card { padding: 1.5rem; }
    .card-tight { padding: 1.125rem; }
}
.card-flush { padding: 0; }
.card-accent { border-color: var(--accent); }

/*
 * Le titre se replie sur deux lignes, l'action reste à sa droite.
 *
 * Laisser cette rangée passer à la ligne renvoyait le bouton sous le titre
 * dès qu'il manquait quelques pixels — une ligne entière perdue pour rien,
 * alors que le titre, lui, se replie sans gêner personne.
 */
.card-header {
    padding: .875rem 1rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
@media (min-width: 640px) { .card-header { padding: 1rem 1.5rem; } }

/* --- Boutons ------------------------------------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    height: 2.5rem;
    padding: 0 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font: inherit;
    font-size: .875rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .12s, border-color .12s, color .12s;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn svg { width: 1.125rem; height: 1.125rem; }

.btn-primary   { background: var(--accent); color: var(--accent-content); box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--content); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost     { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--content); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-success   { background: var(--success); color: #fff; }

.btn-sm { height: 2rem; padding: 0 .75rem; font-size: .8125rem; }
.btn-lg { height: 3rem; padding: 0 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }

/*
 * Le bouton principal de l'écran shooting.
 *
 * Il occupait toute la largeur et 4 rem de haut : trois personnes et demie
 * tenaient à l'écran d'un téléphone, sur une liste de plusieurs centaines. On
 * passait la séance à faire défiler. Il est désormais sur la ligne du nom.
 *
 * 2.75 rem de haut, soit 44 px : le minimum pour être atteint au pouce sans
 * viser, appareil photo dans l'autre main. On réduit la place perdue, jamais
 * la cible.
 */
/*
 * Le bouton le plus utilisé de l'application, réduit à sa coche.
 *
 * Le mot « SHOOTÉE » prenait la largeur du nom, qui se faisait tronquer, pour
 * un geste que personne ne lit plus après la troisième personne. Mais la cible
 * ne rétrécit pas : on la vise d'une main, debout, à contre-jour. Elle reste
 * plus haute et plus large que les 44 px recommandés, et la coche grossit pour
 * occuper la place que le texte a laissée.
 */
.btn-shoot {
    height: 2.75rem;
    width: 3.5rem;
    padding: 0;
    border-radius: var(--radius);
}
.btn-shoot svg { width: 1.375rem; height: 1.375rem; }

/*
 * Le texte reste petit, la zone touchable ne l'est pas.
 *
 * Ces liens faisaient 20 px de haut : au doigt, on visait « Supprimer » et on
 * touchait à côté — ou pire, on l'atteignait sans le vouloir. Le remplissage
 * vertical élargit la cible sans grossir le texte, qui doit rester discret.
 */
.btn-link {
    background: none;
    border: 0;
    padding: .5rem 0;
    font: inherit;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    text-decoration: underline;
}
.btn-link:hover { color: var(--content); }
.btn-link.danger { color: var(--danger); }

/* --- Formulaires -------------------------------------------------------- */

.field { display: block; margin-bottom: 1.25rem; }
.field:last-child { margin-bottom: 0; }

.label {
    display: block;
    margin-bottom: .375rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--content);
}

.input, .select, .textarea {
    display: block;
    width: 100%;
    padding: .625rem .875rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--content);
    font: inherit;
    /* 16px minimum : en dessous, Safari iOS zoome à la mise au point. */
    font-size: max(16px, 1rem);
    transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.textarea { min-height: 4.5rem; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2399a1b0' stroke-width='1.8'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .625rem center;
    background-size: 1.125rem;
}

.input.error, .select.error, .textarea.error { border-color: var(--danger); }
.field-error { margin-top: .375rem; font-size: .8125rem; color: var(--danger); }
.field-hint  { margin-top: .375rem; font-size: .8125rem; color: var(--subtle); }

/*
 * Une liste de cases à cocher, une par ligne sur téléphone.
 *
 * Elles étaient posées dans une rangée souple prévue pour des étiquettes
 * courtes : « Yanis Berthier » se coupait en deux lignes, et la case se
 * retrouvait à côté du seul prénom. On ne devine plus ce qu'on coche.
 */
.check-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: .625rem .75rem; }
@media (min-width: 560px) { .check-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .check-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.check { display: flex; align-items: flex-start; gap: .625rem; cursor: pointer; }
.check input { width: 1.125rem; height: 1.125rem; margin: .1875rem 0 0; accent-color: var(--accent); flex-shrink: 0; }
.check span { font-size: .875rem; }

/* --- Recherche ---------------------------------------------------------- */

.search { position: relative; }
.search svg {
    position: absolute;
    left: .875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: var(--subtle);
    pointer-events: none;
}
.search input {
    width: 100%;
    padding: .875rem 2.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--content);
    font: inherit;
    font-size: max(16px, 1rem);
}
.search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.search-busy {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .75rem;
    color: var(--subtle);
}

/* --- Listes ------------------------------------------------------------- */

.list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.list > li + li { border-top: 1px solid var(--line); }

.list-row {
    display: flex;
    align-items: center;
    gap: .875rem;
    width: 100%;
    padding: .875rem 1.125rem;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}
.list-row:hover { background: var(--surface-2); text-decoration: none; }
.list-row.selected { background: var(--surface-2); }

/* --- Badges ------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .125rem .5rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 500;
    white-space: nowrap;
}
.badge-neutral { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.badge-accent  { background: var(--accent-soft); color: var(--accent); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft); color: var(--danger); }

/* --- Messages ----------------------------------------------------------- */

.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .875rem 1.125rem;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: 1rem;
}
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-danger  { background: var(--danger-soft);  color: var(--danger); }
.alert-info    { background: var(--surface-2);    color: var(--content); }

/* --- Statistiques ------------------------------------------------------- */

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
}
/* Certaines vignettes du tableau de bord mènent vers la liste correspondante. */
a.stat-card {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease;
}
a.stat-card:hover { border-color: var(--line-strong); background: var(--surface-2); }

/* La mention des absents, sous les tuiles : elle mène à leur liste sans
   prétendre au même poids que les quatre chiffres de la séance. */
.stat-aside { margin-top: .5rem; font-size: .75rem; }
.stat-aside a { color: var(--subtle); text-decoration: underline; text-underline-offset: .2em; }
.stat-aside a:hover { color: var(--warning, var(--accent)); }

/* Le nom d'un photographe mène à sa série. Souligné au survol seulement : la
   liste doit rester une liste de chiffres, pas une page de liens. */
.production-row a { color: inherit; text-decoration: none; }
.production-row a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }

.stat-label { font-size: .75rem; font-weight: 500; color: var(--muted); }
.stat-value { margin-top: .25rem; font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-hint  { margin-top: .125rem; font-size: .75rem; color: var(--subtle); }

/* Un compteur qui change pendant qu'on le regarde : brève mise en évidence,
   sinon la valeur bouge sans qu'on sache laquelle. */
@keyframes stat-updated {
    0%   { color: var(--accent); transform: translateY(-2px); }
    100% { color: inherit; transform: none; }
}
.just-updated { animation: stat-updated .9s ease-out; }
@media (prefers-reduced-motion: reduce) {
    .just-updated { animation: none; }
}

.progress {
    height: .625rem;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
}
.progress > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
    transition: width .5s ease;
}

/* Graphique en barres, rendu côté serveur, sans bibliothèque */
.chart { display: flex; align-items: flex-end; gap: 2px; }
.chart-col { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.chart-count { font-size: .625rem; font-weight: 500; color: var(--muted); text-align: center; margin-bottom: .25rem; font-variant-numeric: tabular-nums; }
.chart-bar { border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.chart-bar.peak { background: var(--accent); }
.chart-labels { display: flex; gap: 2px; margin-top: .375rem; }
.chart-labels > span { flex: 1 1 0; text-align: center; font-size: .625rem; color: var(--subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Onglets et filtres -------------------------------------------------- */

/*
 * Les onglets passent à la ligne au lieu de sortir de l'écran.
 *
 * La rangée défilait horizontalement : le cinquième onglet existait, hors du
 * champ de vision, et un onglet qu'on ne voit pas est un onglet qui n'existe
 * pas — rien n'indique qu'il faut faire glisser. Une seconde ligne coûte
 * quarante pixels, une fois, et seulement quand la place manque vraiment.
 *
 * Le défilement reste comme filet pour les rangées trop longues même sur deux
 * lignes.
 */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    flex-shrink: 0;
    padding: .375rem .75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    font: inherit;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}
.chip:hover { color: var(--content); text-decoration: none; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-content); }
.chip .count { font-size: .75rem; opacity: .75; font-variant-numeric: tabular-nums; }

/* --- Écran de prise de vue ----------------------------------------------- */
/*
 * Conçu pour être utilisé debout, d'une main, avec une file d'attente devant
 * soi. Tout y est plus grand qu'ailleurs, et rien de destructeur n'est à
 * portée de pouce.
 */

.capture-body { background: var(--canvas); }

.capture-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .625rem .875rem;
    /* Encoche et barre d'accueil des téléphones récents. */
    padding-top: calc(.625rem + env(safe-area-inset-top));
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.capture-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    margin-left: -.375rem;
    border-radius: var(--radius);
    color: var(--muted);
}
.capture-back:hover { background: var(--surface-2); color: var(--content); }
.capture-back svg { width: 1.375rem; height: 1.375rem; }
.capture-title { min-width: 0; flex: 1 1 auto; }
.capture-percent { font-size: .9375rem; font-weight: 600; color: var(--accent); flex-shrink: 0; }

.capture-progress { position: sticky; top: 0; height: 3px; background: var(--surface-2); }
.capture-progress > span { display: block; height: 100%; background: var(--accent); transition: width .4s ease; }

.capture-main {
    max-width: 40rem;
    margin: 0 auto;
    padding: 0 .875rem calc(3rem + env(safe-area-inset-bottom));
}

.capture-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .625rem; }

/*
 * Une personne par ligne, nom à gauche, action à droite.
 *
 * L'ancienne disposition empilait le nom, le bouton pleine largeur et le lien
 * de note : 190 px par personne. Sur 220 participants, la séance se passait à
 * faire défiler pour retrouver quelqu'un qu'on a devant soi.
 */
.capture-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .625rem;
    padding: .5rem .625rem .5rem .75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
}
.capture-row.is-shot { background: var(--surface-2); border-color: transparent; }
/* Écartée de la file, pas effacée : le fond s'estompe, le nom reste lisible. */
/* « Déclarer absent », sous le nom.
   Discret par la taille et la couleur, mais écrit en toutes lettres : c'est
   ce qui manquait quand l'action était cachée derrière un pictogramme. La
   zone tactile déborde le texte par du remplissage, sans ajouter de hauteur
   à la ligne — le texte est petit, la cible ne l'est pas. */
.capture-meta-row { display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.capture-meta-row > .capture-meta { min-width: 0; flex: 1; }
.capture-absent { flex: 0 0 auto; }
.capture-absent > button {
    padding: .5rem .5rem;
    margin: -.5rem -.5rem;
    border: 0;
    background: none;
    font: inherit;
    font-size: .75rem;
    color: var(--subtle);
    text-decoration: underline;
    text-underline-offset: .2em;
    cursor: pointer;
}
.capture-absent > button:hover { color: var(--warning, var(--accent)); }
/* « Ajouter une personne » : un bouton, au-dessus de la liste, toujours là.
   Secondaire par la couleur pour ne pas concurrencer les SHOOTÉE verts, mais
   de la taille d'un vrai bouton — c'est une fonction de la séance, pas un
   rattrapage d'erreur qu'on cacherait jusqu'à l'échec. */
/* La zone de suppression se distingue du reste du formulaire : on ne doit pas
   pouvoir la confondre avec les champs qu'on vient de remplir. */
/* Séparateur entre deux réglages d'une même page qui s'adressent à deux
   publics différents : le portail aux participants, la galerie au client. */
.separator { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* La galerie du client : une grille de portraits, pour parcourir une promotion
   du regard plutôt qu'en huit cents défilements. */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    gap: 1rem;
}
.gallery-item { margin: 0; }
.gallery-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--surface-2);
    display: block;
}
.gallery-item figcaption { margin-top: .375rem; display: flex; flex-direction: column; gap: .125rem; }
.gallery-name {
    font-size: .8125rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gallery-download { font-size: .75rem; color: var(--subtle); }
.gallery-download:hover { color: var(--accent); }

.danger-zone { border-color: var(--danger, #b42318); }
.danger-zone h2 { font-size: 1rem; }

.capture-ajout { margin: 0 0 .75rem; }
.capture-ajout svg { width: 1rem; height: 1rem; }
.capture-row.is-absent { background: var(--surface-2); border-style: dashed; }
.capture-row.is-absent .capture-name { opacity: .7; }

/* Confirmation visuelle après une action, sans bloquer l'écran. */
@keyframes capture-flash { from { background: var(--success-soft); } to { background: var(--surface-2); } }
.capture-row.just-changed { animation: capture-flash 1.1s ease-out; }

.capture-identity { min-width: 0; }

/* Le nom passe à la ligne plutôt que d'être coupé : sur cet écran, se tromper
   de personne coûte bien plus cher que deux lignes de haut. */
/* Le nom porte le poids, le prénom l'accompagne : on balaye une colonne de
   noms de famille, c'est l'ordre dans lequel la liste est classée. */
.capture-name { font-size: 1rem; font-weight: 600; line-height: 1.2; }
.capture-firstname { font-weight: 400; color: var(--muted); }
/*
 * La ligne d'appoint tient sur une ligne, quitte à être coupée.
 *
 * « Agence de Marseille · Technicien » passait sur deux lignes et rendait
 * 15 cm de haut à chaque personne — on revenait aux six personnes par écran.
 * Le début suffit à situer quelqu'un ; la liste complète est dans l'export.
 */
.capture-meta {
    margin-top: .125rem;
    font-size: .75rem;
    line-height: 1.3;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.capture-actions { display: flex; align-items: center; gap: .375rem; }
.capture-done { display: flex; align-items: center; gap: .375rem; }

/* Bouton d'appoint d'une ligne déjà faite : discret, sans jamais devenir
   trop petit pour être touché. */
.capture-row .btn-row {
    height: 2.5rem;
    padding: 0 .625rem;
    font-size: .75rem;
}

/*
 * La note de retouche : un pictogramme sur la ligne, le formulaire en
 * surimpression une fois ouvert.
 *
 * Le lien « Ajouter une note de retouche » occupait une ligne entière sur
 * chacune des 220 personnes, pour un geste qui sert quelques fois par séance.
 */
.capture-note { display: flex; }
.capture-note > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius);
    color: var(--subtle);
    cursor: pointer;
    list-style: none;
}
.capture-note > summary::-webkit-details-marker { display: none; }
.capture-note > summary:hover { background: var(--surface-2); color: var(--content); }
.capture-note > summary svg { width: 1.125rem; height: 1.125rem; }
.capture-note[open] > summary { background: var(--surface-2); color: var(--content); }

/* Le volet recouvre le début de la ligne suivante au lieu de repousser toute
   la liste : ce qu'on regardait reste où on l'a laissé.

   Le positionnement porte sur le panneau, pas sur les formulaires qu'il
   contient. Il visait `> form` tant qu'il n'y en avait qu'un ; le jour où la
   déclaration d'absence en a ajouté un second, les deux se sont retrouvés
   calés aux mêmes coordonnées, superposés — le bouton était dans la page et
   invisible à l'écran. Un sélecteur qui dépend du nombre d'enfants est un
   piège qui se referme à la première extension. */
.capture-note > .capture-note-panel {
    position: absolute;
    z-index: 3;
    top: calc(100% - .25rem);
    right: .375rem;
    left: .375rem;
    padding: .75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg, 0 10px 30px rgb(0 0 0 / .18));
}

/* Une note déjà écrite se voit sans ouvrir quoi que ce soit. */
.capture-note.has-notes > summary { color: var(--warning, var(--accent)); }

/* Le tri de l'écran de prise de vue : discret, sous les onglets. */
.capture-tri {
    display: flex;
    align-items: flex-end;
    gap: .5rem;
    margin: .875rem 0 .25rem;
}
.capture-tri .field-inline { flex: 1 1 auto; }

.capture-hint { padding: 2rem .5rem; text-align: center; font-size: .875rem; color: var(--muted); }

/* --- Avancement d'une séance en cours ------------------------------------ */
/*
 * Le chiffre qu'on regarde quinze fois dans la journée.
 *
 * Un anneau plutôt qu'une barre : la part restante se voit d'un coup d'œil à
 * plusieurs mètres, et le pourcentage tient au centre sans rien encombrer.
 * Tout est en SVG dans la page — aucune bibliothèque, aucune image à charger.
 */
.progress-cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}
@media (min-width: 720px) { .progress-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.progress-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
}
.progress-card:hover { text-decoration: none; border-color: var(--accent-hover, var(--accent)); }
.progress-card-body { min-width: 0; flex: 1 1 auto; }
.block { display: block; }

.ring { position: relative; flex-shrink: 0; width: 7.5rem; height: 7.5rem; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring-track { stroke: var(--surface-2); }
.ring-value {
    stroke: var(--accent);
    stroke-linecap: round;
    transition: stroke-dashoffset .6s ease, stroke .3s;
}
.progress-card.is-complete .ring-value { stroke: var(--success); }

.ring-percent {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.625rem;
    font-weight: 600;
    letter-spacing: -.02em;
}

.progress-figures { font-size: 1.75rem; font-weight: 600; line-height: 1.1; }

@media (prefers-reduced-motion: reduce) {
    .ring-value { transition: none; }
}

/* --- Suivi côté client --------------------------------------------------- */
/*
 * Une liste de noms à lire debout, dans un couloir, en cherchant qui aller
 * chercher. Rien d'autre : ni photo, ni bouton, ni action.
 */
.suivi-list { list-style: none; margin: 0; padding: 0; }
.suivi-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    padding: .625rem 1rem;
    border-top: 1px solid var(--line);
}
.suivi-row:first-child { border-top: 0; }
.suivi-name { display: block; font-size: 1rem; font-weight: 600; line-height: 1.25; }

/* Le service et le poste : ce qui dit où aller chercher la personne. */
.suivi-org { display: block; margin-top: .0625rem; font-size: .75rem; color: var(--muted); }

.suivi-filtres { display: flex; flex-wrap: wrap; gap: .75rem; }
.field-inline { display: flex; flex-direction: column; gap: .25rem; flex: 1 1 9rem; min-width: 0; }
.field-inline .label { font-size: .75rem; }
.field-inline .input { height: 2.5rem; padding: 0 .625rem; font-size: .875rem; }

.suivi .stat-value { font-size: 2.5rem; font-weight: 600; line-height: 1; }

/* Proposition d'actualisation quand un autre photographe a modifié la liste.
   Jamais appliquée d'office : la liste bougerait sous le pouce. */
.capture-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    margin-top: .625rem;
    padding: .625rem 1rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--accent);
    font: inherit;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
}
.capture-refresh svg { width: 1rem; height: 1rem; }
.capture-refresh[hidden] { display: none; }

.capture-toast {
    position: fixed;
    left: 50%;
    bottom: calc(1.25rem + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 30;
    max-width: calc(100vw - 2rem);
    padding: .625rem 1rem;
    border-radius: 999px;
    background: var(--content);
    color: var(--canvas);
    font-size: .875rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.capture-toast.is-error { background: var(--danger); color: #fff; }

/* --- État vide ---------------------------------------------------------- */

.empty {
    padding: 3.5rem 1.5rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    text-align: center;
}
.empty h2 { font-size: .9375rem; }
.empty p { margin: .375rem auto 0; max-width: 26rem; font-size: .875rem; color: var(--muted); }

/* --- Photos ------------------------------------------------------------- */

.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (min-width: 640px) { .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.photo-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.photo-frame { position: relative; aspect-ratio: 4 / 5; background: var(--surface-2); }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-flags { position: absolute; top: .5rem; left: .5rem; display: flex; flex-direction: column; gap: .25rem; align-items: flex-start; }
.photo-body { padding: .75rem; }
.photo-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .5rem; font-size: .75rem; font-weight: 500; }

.thumb-strip { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; }
.thumb-strip img { width: 4rem; height: 5rem; object-fit: cover; border-radius: var(--radius); flex-shrink: 0; background: var(--surface-2); }

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    border: 2px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: border-color .12s, background-color .12s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--surface-2); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* --- Tableaux ----------------------------------------------------------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); }
table.data { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.data th {
    padding: .625rem .75rem;
    background: var(--surface-2);
    color: var(--muted);
    font-size: .75rem;
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
}
table.data td { padding: .625rem .75rem; border-top: 1px solid var(--line); }

/* --- Étapes ------------------------------------------------------------- */

.steps { display: flex; align-items: center; gap: .5rem; list-style: none; margin: 0 0 2rem; padding: 0; }
.steps li { display: flex; align-items: center; gap: .625rem; flex: 1 1 0; min-width: 0; }
.step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.75rem; height: 1.75rem; flex-shrink: 0;
    border-radius: 999px;
    background: var(--surface-2); color: var(--subtle);
    font-size: .75rem; font-weight: 600;
}
.step-num.done, .step-num.current { background: var(--accent); color: var(--accent-content); }
.step-label { display: none; font-size: .875rem; color: var(--muted); }
.step-label.current { color: var(--content); font-weight: 500; }
.step-line { display: none; flex: 1 1 auto; height: 1px; background: var(--line); }
@media (min-width: 720px) { .step-label, .step-line { display: block; } }

/* --- Erreurs ------------------------------------------------------------ */

.error-card { max-width: 28rem; text-align: center; }
.error-code { font-size: .875rem; font-weight: 600; color: var(--subtle); letter-spacing: .1em; }
.error-card h1 { margin: .5rem 0 .75rem; }

/* --- Portail participant ------------------------------------------------ */

.portal { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.portal main { flex: 1 1 auto; display: flex; justify-content: center; padding: 3.5rem 1.25rem 2rem; }
.portal-inner { width: 100%; max-width: 32rem; }
.portal-title { font-size: 1.875rem; font-weight: 600; letter-spacing: -.02em; }
@media (min-width: 640px) { .portal-title { font-size: 2.25rem; } }
/* « 2 / 3 » posé sur la photo : lisible sur un fond clair comme sur un fond
   sombre, d'où le fond noir translucide plutôt qu'une couleur du thème. */
.portal-compteur {
    position: absolute;
    top: .625rem;
    right: .625rem;
    padding: .25rem .5rem;
    border-radius: 999px;
    background: rgb(0 0 0 / .62);
    color: #fff;
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}

/* Le nombre de photos à côté du nom, dans la liste des résultats. */
.portal-compte {
    display: inline-block;
    margin-left: .375rem;
    padding: .125rem .4375rem;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--subtle);
    font-size: .75rem;
    white-space: nowrap;
}

.portal-photo {
    position: relative;
    width: 100%;
    max-width: 24rem;
    margin: 0 auto;
    display: block;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface-2);
}
.portal-footer { padding: 0 1.25rem calc(1.5rem + env(safe-area-inset-bottom)); text-align: center; }

/* Choix entre plusieurs personnes : la vignette permet de se reconnaître,
   là où quatre boutons portant le même nom feraient choisir au hasard. */
.portal-choice {
    display: flex;
    align-items: center;
    gap: .875rem;
    width: 100%;
    padding: .625rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--content);
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: border-color .12s, background-color .12s;
}
.portal-choice:hover { border-color: var(--accent); background: var(--surface-2); }
.portal-choice img,
.portal-choice-empty {
    width: 3.5rem;
    height: 4.375rem;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--surface-2);
}

/* --- Barre collante de l'écran shooting ---------------------------------
   Se cale sous le bandeau de l'écran de prise de vue, encoche comprise. */

.sticky-search {
    position: sticky;
    top: calc(3.5rem + env(safe-area-inset-top));
    z-index: 10;
    margin: 0 -.875rem;
    padding: .875rem;
    background: color-mix(in srgb, var(--canvas) 94%, transparent);
    backdrop-filter: blur(8px);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .sticky-search { background: var(--canvas); }
}

/* --- Rapport client ------------------------------------------------------ */

.report-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: 56rem;
    margin: 0 auto;
    padding: 1rem 1.25rem 0;
}

/* --- Impression --------------------------------------------------------- */

@media print {
    .nav, .no-print, .btn { display: none !important; }
    body { background: #fff; color: #000; }
    .card, .stat-card, .list { border-color: #ddd; box-shadow: none; break-inside: avoid; }
    .container { max-width: none; padding: 0; }
    a { color: #000; text-decoration: none; }

    /* Les cartes du rapport s'enchaînent : on évite qu'un tableau soit coupé
       au milieu d'une ligne, et que les titres restent seuls en bas de page. */
    .report h2 { break-after: avoid; }
    .report table.data tr { break-inside: avoid; }
    .report .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .chart-bar { background: #999 !important; }
    .chart-bar.peak { background: #333 !important; }
}

/* --- Mouvement réduit --------------------------------------------------- */

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