/* TRAIL MASTER HUB – Thème Trail Tafaray */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* Couleurs logo Trail Tafaray */
  --primary: #c45c26;          /* Orange / terracotta */
  --primary-dark: #9a4518;
  --primary-light: #fef3e8;
  --navy: #1a365d;             /* Bleu navy */
  --navy-dark: #0f2744;
  --navy-light: #2c5282;
  --accent: #e07a3d;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --surface: #ffffff;
  --bg: #f8f6f3;               /* Fond chaud léger */
  --bg-elevated: #fffaf6;
  --border: #e8e0d8;
  --text: #1a202c;
  --text-muted: #64748b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(26,54,93,0.06), 0 1px 2px rgba(26,54,93,0.04);
  --shadow-md: 0 8px 24px rgba(26,54,93,0.1);
}

* { box-sizing: border-box; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  margin: 0;
  min-height: 100vh;
}

.app-header {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, #1e3a5f 100%);
  box-shadow: 0 4px 24px rgba(15,39,68,0.35);
  position: sticky;
  top: 0;
  z-index: 40;
}

.nav-btn {
  transition: all 0.18s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}
.nav-btn:hover {
  background: rgba(224,122,61,0.2) !important;
  color: white !important;
}
.nav-btn.active, .nav-btn[data-section].active {
  background: var(--primary) !important;
  color: white !important;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.input, select.input, textarea.input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-size: 0.9375rem;
  font-family: inherit;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.15s ease;
}
.input:hover { border-color: #cbd5e1; background: white; }
.input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.input::placeholder { color: #94a3b8; }

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.1rem;
  padding-right: 2.5rem;
}

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

.btn-primary, .btn-secondary, .btn-danger, .btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.25;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 2px 8px rgba(196,92,38,0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), #7c3412);
  transform: translateY(-1px);
}
.btn-secondary {
  background: white;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-elevated); border-color: #cbd5e1; }
.btn-danger {
  background: #fef2f2;
  color: var(--danger);
  border: 1.5px solid #fecaca;
}
.btn-danger:hover { background: #fee2e2; }
.btn-success {
  background: #ecfdf5;
  color: #059669;
  border: 1.5px solid #a7f3d0;
}

table { border-collapse: separate; border-spacing: 0; width: 100%; }
thead th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
}
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }

.badge, .status-paid, .status-unpaid, .status-partial {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
}
.status-paid { background: #ecfdf5; color: #059669; }
.status-unpaid { background: #fef2f2; color: #dc2626; }
.status-partial { background: #fffbeb; color: #d97706; }
.badge { background: var(--primary-light); color: var(--primary-dark); }

.summary-box {
  background: linear-gradient(135deg, #fef3e8 0%, #fde8d0 100%);
  border: 1px solid #f5c89a;
  border-radius: var(--radius);
  padding: 1.25rem;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-family: 'JetBrains Mono', monospace;
}
.stat-card .stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}

[id^="modal-"] { backdrop-filter: blur(4px); }
[id^="modal-"] > div {
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.section.hidden { display: none !important; }
.section:not(.hidden) { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.font-mono, .tabular-nums {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

#live-races .card { border-left: 4px solid var(--primary); }

@media (max-width: 640px) {
  .section-title { font-size: 1.15rem; }
  .stat-card .stat-value { font-size: 1.4rem; }
}


/* Progress bars dashboard */
.progress-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}
.tshirt-stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  text-align: center;
}
.tshirt-stat .size {
  font-size: 1.25rem;
  font-weight: 700;
  color: #4f46e5;
  font-family: 'JetBrains Mono', monospace;
}
.tshirt-stat .qty {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.tshirt-stat .lbl {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}


/* Badges paiement admin (liste inscrits uniquement) */
.badge-pay {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-paye { background: #d1fae5; color: #047857; border: 1px solid #6ee7b7; }
.badge-attente { background: #fef3c7; color: #b45309; border: 1px solid #fcd34d; }
.badge-impaye { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.badge-gratuit { background: #ede9fe; color: #6d28d9; border: 1px solid #c4b5fd; }
.badge-remise { background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; }
.badge-remise-paye { background: #ccfbf1; color: #0f766e; border: 1px solid #5eead4; }
.badge-remise-attente { background: #ffedd5; color: #c2410c; border: 1px solid #fdba74; }
.admin-pay-cell { min-width: 7rem; }


/* Femmes – texte rose, sans fond (classements + listes live) */
#rankings-body tr.row-femme,
#affiche-body tr.row-femme,
#modal-live-list tr.row-femme {
  background-color: transparent !important;
  color: #db2777 !important;
}
#rankings-body tr.row-femme td,
#affiche-body tr.row-femme td,
#modal-live-list tr.row-femme td {
  color: #db2777 !important;
}
#rankings-body tr.row-femme:hover,
#modal-live-list tr.row-femme:hover {
  background-color: transparent !important;
}

/* Alertes clignotantes (cut-off / anomalies) */
@keyframes alertBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.alert-blink {
  animation: alertBlink 1.2s ease-in-out infinite;
}
.alert-blink-row {
  animation: alertBlink 1.4s ease-in-out infinite;
  background-color: #fef2f2 !important;
}
.alert-blink-box {
  animation: alertBlink 1.2s ease-in-out infinite;
  box-shadow: 0 0 0 2px #f87171;
}
.alert-blink-border {
  animation: alertBlink 1.5s ease-in-out infinite;
}

/* ========== PRO FEATURES – Dark / Jour J / Feedback ========== */
body.theme-dark {
  --surface: #1e293b;
  --bg: #0f172a;
  --bg-elevated: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  background: var(--bg);
  color: var(--text);
}
body.theme-dark .card {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}
body.theme-dark .section-title { color: #f8fafc; }
body.theme-dark .input, body.theme-dark select.input, body.theme-dark textarea.input {
  background: #0f172a;
  border-color: #475569;
  color: #f1f5f9;
}
body.theme-dark table th { background: #0f172a; color: #cbd5e1; }
body.theme-dark table td { border-color: #334155; }
body.theme-dark .btn-secondary {
  background: #334155;
  color: #e2e8f0;
  border-color: #475569;
}
body.theme-dark #rankings-body tr.row-femme,
body.theme-dark #affiche-body tr.row-femme {
  background-color: transparent !important;
  color: #f9a8d4 !important;
}

/* Mode Jour J – gros boutons, contraste max, police large */
body.mode-jourj {
  font-size: 1.05rem;
}
body.mode-jourj .nav-btn {
  padding: 0.65rem 1rem !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
}
body.mode-jourj .btn-primary,
body.mode-jourj .btn-secondary {
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  min-height: 48px;
}
body.mode-jourj #manual-scan {
  font-size: 1.35rem !important;
  padding: 1rem !important;
  font-weight: 700;
  letter-spacing: 0.04em;
}
body.mode-jourj #scan-type,
body.mode-jourj #scan-agent {
  font-size: 1.1rem !important;
  min-height: 48px;
}
body.mode-jourj .section-title {
  font-size: 1.6rem;
}

/* Flash feedback scan */
#scan-flash {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.12s ease;
}
#scan-flash.ok {
  background: rgba(16, 185, 129, 0.35);
  opacity: 1;
}
#scan-flash.err {
  background: rgba(239, 68, 68, 0.4);
  opacity: 1;
}
#scan-flash-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 101;
  padding: 1.25rem 2rem;
  border-radius: 16px;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  max-width: 90vw;
}
#scan-flash-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
#scan-flash-banner.ok { background: #059669; }
#scan-flash-banner.err { background: #dc2626; }

/* Stats course dashboard */
.race-progress-card {
  border-left: 4px solid #6366f1;
}
.race-progress-card .pct {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

/* Agent chip */
.agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #c7d2fe;
}
.agent-chip:hover, .agent-chip.active {
  background: #4f46e5;
  color: white;
  border-color: #4f46e5;
}
body.theme-dark .agent-chip {
  background: #312e81;
  color: #c7d2fe;
  border-color: #4338ca;
}
body.theme-dark .agent-chip.active {
  background: #6366f1;
  color: white;
}

/* Accordion paramètres */
.param-accordion { margin-bottom: 0.75rem; }
.param-accordion-header {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; text-align: left; cursor: pointer;
  padding: 0.75rem 1rem; border: none; background: transparent;
  font-weight: 600; font-size: 0.95rem; color: inherit;
}
.param-accordion-header:hover { background: rgba(0,0,0,0.03); }
.param-accordion-header .acc-chevron {
  transition: transform 0.2s ease; color: #64748b; font-size: 0.85rem;
}
.param-accordion.open .acc-chevron { transform: rotate(180deg); }
.param-accordion-body { display: none; padding: 0 1rem 1rem; }
.param-accordion.open .param-accordion-body { display: block; }
.param-accordion .acc-actions { display: flex; gap: 0.5rem; align-items: center; }

/* Éditeur dossard */
.bib-ed-tool {
  width: 32px; height: 32px; border-radius: 6px;
  background: #334155; color: #e2e8f0; border: 1px solid #475569;
  display: inline-flex; align-items: center; justify-content: center;
}
.bib-ed-tool:hover { background: #475569; }
.bib-ed-tool.active { background: #7c3aed; border-color: #8b5cf6; color: #fff; }
.bib-ed-el {
  position: absolute; cursor: move; user-select: none;
  border: 1px solid transparent; box-sizing: border-box;
  display: flex; align-items: center; justify-content: flex-start;
  white-space: nowrap; overflow: hidden;
}
.bib-ed-el.selected {
  border: 1px dashed #a78bfa;
  box-shadow: 0 0 0 1px rgba(167,139,250,0.4);
  z-index: 20;
}
.bib-ed-el .bib-ed-handle {
  position: absolute; width: 10px; height: 10px; background: #a78bfa;
  border: 1px solid #fff; border-radius: 2px; display: none;
}
.bib-ed-el.selected .bib-ed-handle { display: block; }
.bib-ed-handle.se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.bib-ed-handle.e { right: -5px; top: 50%; margin-top: -5px; cursor: ew-resize; }
.bib-ed-handle.s { bottom: -5px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.bib-ed-layer-item {
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
  background: #1e293b; color: #cbd5e1;
}
.bib-ed-layer-item:hover { background: #334155; }
.bib-ed-layer-item.active { background: #5b21b6; color: #fff; }
.bib-ed-layer-item .vis { opacity: 0.5; margin-right: 4px; }

.bib-ed-ctx-menu {
  position: fixed; z-index: 100; min-width: 210px; max-height: 70vh; overflow-y: auto;
  background: #1e293b; border: 1px solid #475569; border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45); padding: 6px 0; color: #e2e8f0;
  font-size: 12px;
}
.bib-ed-ctx-title { padding: 6px 12px; font-weight: 700; color: #c4b5fd; border-bottom: 1px solid #334155; margin-bottom: 4px; }
.bib-ed-ctx-section { padding: 6px 12px 2px; font-size: 10px; text-transform: uppercase; color: #94a3b8; letter-spacing: 0.04em; }
.bib-ed-ctx-item {
  display: block; width: 100%; text-align: left; padding: 7px 12px;
  background: transparent; border: none; color: #e2e8f0; cursor: pointer;
}
.bib-ed-ctx-item:hover { background: #4c1d95; }
.bib-ed-ctx-item.inline { display: inline-block; width: auto; padding: 4px 10px; background: #4c1d95; border-radius: 4px; margin-left: 6px; }
.bib-ed-ctx-row { display: flex; align-items: center; padding: 4px 12px; gap: 6px; }
.bib-ed-ctx-num { width: 64px; background: #334155; border: 1px solid #475569; border-radius: 4px; color: #fff; padding: 4px; }

/* ===== Phase 1/2 – PIN lock, docs, bénévoles, live ===== */
#pin-lock-overlay, #fb-auth-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(15, 23, 42, 0.96);
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
#pin-lock-overlay.show, #fb-auth-overlay.show { display: flex; }
.fb-auth-card .input { text-align: left; font-size: 1rem; letter-spacing: normal; width: 100%; }
.pin-lock-card {
  background: #fff; border-radius: 1.25rem; padding: 2rem 1.75rem;
  max-width: 400px; width: 90%; text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.4);
}
.pin-lock-card .input { text-align: center; font-size: 1.25rem; letter-spacing: 0.15em; }
body.access-locked > header,
body.access-locked > nav,
body.access-locked > main {
  visibility: hidden !important;
  pointer-events: none !important;
}
.label-mg { color: #64748b; font-weight: 500; font-size: 0.92em; }

/* Mode inscription publique (URL ?public=1) : formulaire seul */
body.mode-public .header-admin-controls,
body.mode-public #role-badge,
body.mode-public #role-menu,
body.mode-public #btn-logout,
body.mode-public #btn-jourj-toggle,
body.mode-public #btn-theme-toggle,
body.mode-public #btn-lock-app,
body.mode-public #online-status,
body.mode-public #sync-status,
body.mode-public #operator-banner,
body.mode-public #btn-export-excel,
body.mode-public #btn-portail,
body.mode-public #btn-payer {
  display: none !important;
}
body.mode-public nav {
  display: none !important;
}
body.mode-public #insc-mode-options,
body.mode-public #insc-mode-bar,
body.mode-public #insc-mode-banner,
body.mode-public .field-payment-related,
body.mode-public .field-admin-only {
  display: none !important;
}
/* Agent d'inscription */
body.mode-agent #insc-mode-bar .insc-mode-btn:not([data-mode="STANDARD"]),
body.mode-agent #insc-mode-options,
body.mode-agent .field-admin-only,
body.mode-agent .field-payment-related {
  display: none !important;
}
body:not(.mode-public):not(.mode-agent) .field-public-payment {
  display: none !important;
}
body.mode-public .field-public-payment,
body.mode-agent .field-public-payment {
  display: block !important;
}
body.mode-public #org-payment-info,
body.mode-agent #org-payment-info {
  display: block !important;
}

.doc-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.25rem; height: 1.25rem; border-radius: 9999px;
  font-size: 0.65rem; font-weight: 700; margin: 0 1px;
}
.doc-missing { background: #fee2e2; color: #b91c1c; }
.doc-pending { background: #fef3c7; color: #b45309; }
.doc-valid { background: #d1fae5; color: #047857; }
.doc-rejected { background: #fecaca; color: #991b1b; }

.live-scan-row {
  display: grid; grid-template-columns: 52px 1fr auto auto;
  gap: 0.5rem; align-items: center;
  padding: 0.35rem 0; border-bottom: 1px solid #f1f5f9;
  font-size: 0.8rem;
}
.stat-mini {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.5rem 1rem; background: #f8fafc; border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
}
.stat-mini .stat-n { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.stat-mini .stat-l { font-size: 0.7rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.03em; }

.btn-xs {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.2rem 0.4rem; border-radius: 0.35rem; font-size: 0.7rem;
  background: #f1f5f9; border: 1px solid #e2e8f0; cursor: pointer;
  margin: 0 1px;
}
.btn-xs:hover { background: #e2e8f0; }
.btn-xs.btn-success { background: #d1fae5; color: #047857; border-color: #a7f3d0; }
.btn-xs.btn-warning { background: #fef3c7; color: #b45309; border-color: #fde68a; }

.nav-btn.role-hidden { display: none !important; }

body.mode-jourj #section-benevoles .btn-primary,
body.mode-jourj #section-scanner .btn-primary {
  min-height: 3rem; font-size: 1rem;
}

/* ===== Documents validation UI ===== */
.docs-mini { display: inline-flex; gap: 2px; align-items: center; }
.docs-cell { white-space: nowrap; }

.docs-panel {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem;
}
.docs-panel-header {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.875rem; color: #334155;
  margin-bottom: 0.75rem;
}
.docs-panel-header i { color: #6366f1; }
.docs-panel-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 0.6rem;
}
@media (min-width: 640px) {
  .docs-panel-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.doc-card {
  background: #fff;
  border-radius: 0.75rem;
  border: 1.5px solid #e2e8f0;
  padding: 0.65rem 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.doc-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.doc-card-missing { border-color: #fecaca; background: #fff5f5; }
.doc-card-pending { border-color: #fde68a; background: #fffbeb; }
.doc-card-valid { border-color: #a7f3d0; background: #ecfdf5; }
.doc-card-rejected { border-color: #fca5a5; background: #fef2f2; }

.doc-card-top {
  display: flex; align-items: center; gap: 0.4rem;
  margin-bottom: 0.5rem; flex-wrap: wrap;
}
.doc-card-top i { font-size: 0.9rem; color: #64748b; }
.doc-card-label { font-size: 0.72rem; font-weight: 600; color: #475569; flex: 1; }
.doc-card-status {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em; padding: 0.15rem 0.45rem; border-radius: 9999px;
  background: #f1f5f9; color: #64748b;
}
.doc-card-valid .doc-card-status { background: #d1fae5; color: #047857; }
.doc-card-pending .doc-card-status { background: #fef3c7; color: #b45309; }
.doc-card-missing .doc-card-status { background: #fee2e2; color: #b91c1c; }
.doc-card-rejected .doc-card-status { background: #fecaca; color: #991b1b; }

.doc-card-actions { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.doc-act {
  font-size: 0.65rem; padding: 0.25rem 0.45rem; border-radius: 0.4rem;
  border: 1px solid transparent; cursor: pointer; font-weight: 600;
  transition: all 0.12s;
}
.doc-act-pending { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.doc-act-pending:hover { background: #fde68a; }
.doc-act-valid { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.doc-act-valid:hover { background: #a7f3d0; }
.doc-act-reject { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.doc-act-reject:hover { background: #fecaca; }
.doc-act-missing { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.doc-act-missing:hover { background: #e2e8f0; }

/* ===== Planning bénévoles ===== */
.plan-day {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.plan-day-header {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-bottom: 1px solid #e2e8f0;
  font-weight: 700; font-size: 0.9rem; color: #334155;
  text-transform: capitalize;
}
.plan-day-header i { color: #6366f1; }
.plan-day-count {
  margin-left: auto; font-size: 0.7rem; font-weight: 600;
  background: #e0e7ff; color: #4338ca;
  padding: 0.15rem 0.55rem; border-radius: 9999px;
}
.plan-slots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  padding: 0.85rem;
}
@media (min-width: 768px) {
  .plan-slots { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .plan-slots { grid-template-columns: 1fr 1fr 1fr; }
}

.plan-slot-card {
  position: relative;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.85rem;
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.plan-slot-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.06); }
.plan-slot-full { border-color: #a7f3d0; background: #f0fdf4; }
.plan-slot-bar { height: 4px; width: 100%; }
.plan-slot-body { padding: 0.75rem 0.85rem; }
.plan-slot-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 0.5rem;
}
.plan-slot-post { font-weight: 700; font-size: 0.9rem; color: #1e293b; }
.plan-slot-time {
  font-size: 0.75rem; color: #64748b; margin-top: 0.15rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.plan-slot-time i { margin-right: 0.25rem; opacity: 0.6; }
.plan-slot-role {
  font-family: inherit; background: #f1f5f9; padding: 0.1rem 0.4rem;
  border-radius: 0.3rem; font-size: 0.7rem; font-weight: 600;
}
.plan-slot-actions { display: flex; gap: 0.2rem; }

.plan-slot-progress {
  height: 4px; background: #f1f5f9; border-radius: 9999px;
  overflow: hidden; margin-bottom: 0.4rem;
}
.plan-slot-progress-bar { height: 100%; border-radius: 9999px; transition: width 0.3s; }

.plan-slot-cap {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.72rem; color: #64748b; margin-bottom: 0.5rem;
}
.plan-cap-full {
  color: #047857; font-weight: 700; font-size: 0.7rem;
}
.plan-assign-btn {
  background: #eef2ff; color: #4338ca; border: none;
  border-radius: 0.4rem; padding: 0.25rem 0.55rem;
  font-size: 0.7rem; font-weight: 600; cursor: pointer;
}
.plan-assign-btn:hover { background: #e0e7ff; }

.plan-slot-people { display: flex; flex-direction: column; gap: 0.3rem; }
.plan-person {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.4rem; border-radius: 0.5rem;
  background: #f8fafc; border: 1px solid #f1f5f9;
  font-size: 0.78rem;
}
.plan-person-present { background: #ecfdf5; border-color: #a7f3d0; }
.plan-person-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 700; flex-shrink: 0;
}
.plan-person-name { flex: 1; font-weight: 500; color: #334155; }
.plan-person-badge {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  background: #d1fae5; color: #047857; padding: 0.1rem 0.35rem;
  border-radius: 9999px;
}
.plan-person-remove {
  background: transparent; border: none; color: #94a3b8;
  cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0.2rem;
}
.plan-person-remove:hover { color: #ef4444; }

/* Compact participant list – show ~10 rows without scroll */
#section-liste table td,
#section-liste table th,
#participants-body td {
  padding: 0.3rem 0.45rem !important;
  font-size: 0.72rem;
  line-height: 1.15;
}
#section-liste .card {
  max-height: none !important;
}
#section-liste table {
  font-size: 0.72rem;
}

/* Uniform font in participants list */
#section-liste table,
#section-liste table td,
#section-liste table th,
#participants-body,
#participants-body td {
  font-family: inherit;
  font-size: 0.75rem !important;
  line-height: 1.2;
}

/* Fond rose clair pour toutes les femmes dans toutes les listes */
#participants-body tr.row-femme,
#rankings-body tr.row-femme,
#affiche-body tr.row-femme,
#modal-live-list tr.row-femme,
#scan-result tr.row-femme,
table tr.row-femme {
  background-color: transparent !important;
  color: #db2777;
}
#participants-body tr.row-femme td,
#rankings-body tr.row-femme td,
#affiche-body tr.row-femme td,
#modal-live-list tr.row-femme td,
table tr.row-femme td {
  color: #db2777 !important;
}
#participants-body tr.row-femme:hover,
#rankings-body tr.row-femme:hover {
  background-color: transparent !important;
}

/* Femmes : fond rose clair partout (même couleur que la version de référence #fce7f3).
   Lignes en <div> (scans récents, live), cartes scanner, et impression navigateur. */
.row-femme { background-color: transparent !important; color: #db2777 !important; }
.row-femme td { color: #db2777 !important; }
.live-scan-row.row-femme, div.row-femme { border-radius: 6px; }
body.theme-dark .row-femme,
body.theme-dark table tr.row-femme { background-color: transparent !important; color: #f9a8d4 !important; }
body.theme-dark .row-femme td { color: #f9a8d4 !important; }
@media print {
  .row-femme, table tr.row-femme { background-color: transparent !important; color: #db2777 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .row-femme td { color: #db2777 !important; }
}

/* ===== fusion2 : formulaire public bilingue FR / MG ===== */
body.mode-public #header-menu-wrap,
body.mode-public #header-menu { display: none !important; }
body.mode-public #section-inscription .label-mg,
body.mode-public .mg-below {
  display: block; font-size: 0.78em; font-style: italic; font-weight: 400; color: #64748b; line-height: 1.25; margin-top: 1px;
}
body.mode-public #section-inscription .section-title .label-mg { font-size: 0.6em; }
body.mode-public #section-inscription .btn-primary .mg-below { color: rgba(255,255,255,.85); font-size: .75em; }
body.mode-public #section-inscription .label { margin-bottom: 4px; }
.pub-intro { display: none; }
body.mode-public .pub-intro { display: block; }
/* Pop-up « INSCRIPTION REÇUE » */
#pub-success-modal { position: fixed; inset: 0; z-index: 120; background: rgba(15,23,42,.65); display: flex; align-items: center; justify-content: center; padding: 12px; }
#pub-success-modal .pub-success-card { background: #fff; border-radius: 20px; max-width: 560px; width: 100%; max-height: 94vh; overflow-y: auto; box-shadow: 0 25px 60px rgba(0,0,0,.35); }
#pub-success-modal .pub-success-head { background: linear-gradient(135deg,#059669,#0d9488); color: #fff; text-align: center; padding: 22px 16px 18px; border-radius: 20px 20px 0 0; }
#pub-success-modal .pub-success-head h2 { font-size: 1.75rem; font-weight: 800; letter-spacing: .02em; margin: 6px 0 0; }
#pub-success-modal .pub-success-head p { font-style: italic; opacity: .92; font-weight: 600; margin: 2px 0 0; }
#pub-success-modal .pub-ref { font-family: ui-monospace, monospace; font-size: 1.6rem; font-weight: 800; letter-spacing: .12em; color: #0f172a; background: #f1f5f9; border: 2px dashed #94a3b8; border-radius: 12px; padding: 8px 12px; text-align: center; }
#pub-success-modal .btn-primary .mg-below { color: rgba(255,255,255,.9) !important; display: block; }
body.mode-public #section-inscription button[type="submit"] { flex-direction: column; align-items: center; line-height: 1.2; }

/* ===== fusion3 : paiement public – seuls les opérateurs renseignés ===== */
#org-payment-info.tmh-pay-none .tmh-pay-part { display: none !important; }
body.mode-public #org-payment-info.tmh-pay-empty,
body.mode-agent #org-payment-info.tmh-pay-empty { display: none !important; }
body.mode-public.tmh-no-mobile-money .field-public-payment,
body.mode-agent.tmh-no-mobile-money .field-public-payment { display: none !important; }

/* ===== fusion3 : gros bouton d'envoi (formulaire public) ===== */
body.mode-public #pub-submit-row { display: flex; justify-content: center; margin-top: 2rem; padding: 0.5rem 0 1rem; }
body.mode-public #pub-submit-row .pub-submit-btn {
  width: 100%; max-width: 560px; min-height: 76px; padding: 1rem 1.5rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 1.35rem; font-weight: 800; letter-spacing: .01em; line-height: 1.2;
  border-radius: 1rem; box-shadow: 0 10px 24px rgba(79, 70, 229, .35);
}
body.mode-public #pub-submit-row .pub-submit-btn .mg-below { font-size: .8rem !important; font-weight: 600; font-style: italic; color: rgba(255,255,255,.9) !important; }
body.mode-public #pub-submit-row .pub-submit-btn i { font-size: 1.1rem; }
@media (max-width: 640px) {
  body.mode-public #pub-submit-row { position: static; margin-left: -0.25rem; margin-right: -0.25rem; }
  body.mode-public #pub-submit-row .pub-submit-btn { max-width: none; font-size: 1.2rem; min-height: 72px; }
}
/* lien certificat (formulaire public) */
.pub-cert-link { display: none; }
body.mode-public .pub-cert-link { display: flex; }

/* fusion4 : contenu du lien public */
body.mode-public.portal-pending #section-inscription > *:not(#pub-closed-box) { visibility: hidden; }
body.mode-public.portal-form .pub-cert-link { display: none !important; }
body.mode-public.portal-closed #section-inscription > *:not(#pub-closed-box) { display: none !important; }
.pub-closed-box { display: none; }
body.mode-public.portal-closed .pub-closed-box { display: block; max-width: 560px; margin: 3rem auto; padding: 2.5rem 1.5rem; text-align: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 1.25rem; box-shadow: 0 10px 30px rgba(15,23,42,.08); }
.pub-closed-box .pub-closed-icon { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 9999px; background: #fee2e2; color: #b91c1c; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.pub-closed-box h2 { font-size: 1.6rem; font-weight: 800; color: #0f172a; }
.pub-closed-box .pub-closed-sub { margin-top: 1rem; color: #475569; }
.pub-closed-box .mg-below { display: block; font-style: italic; color: #64748b; font-size: .9em; }
body.mode-public.portal-certs #section-inscription, body.mode-public.portal-certs .pub-closed-box { display: none !important; }
#pub-cert-frame { display: none; }
body.mode-public.portal-certs #pub-cert-frame { display: block; position: fixed; left: 0; right: 0; bottom: 0; top: var(--pub-header-h, 64px); width: 100%; height: calc(100% - var(--pub-header-h, 64px)); border: 0; z-index: 30; background: #0f172a; }
/* fusion4 : page certificats plein écran (le logo est dans la page) */
body.mode-public.portal-certs header { display: none !important; }
body.mode-public.portal-certs #pub-cert-frame { top: 0 !important; height: 100% !important; }
body.mode-public.portal-certs { overflow: hidden; }

/* ===== fusion5 : en-tête Association Trail Tafaray (page Inscription) ===== */
@font-face { font-family: 'Cinzel Decorative'; src: url('../fonts/CinzelDecorative-Black.ttf') format('truetype'); font-weight: 900; font-display: swap; }
#section-inscription > h2.section-title { display: none; }
.insc-hero { position: relative; overflow: hidden; border-radius: 1.5rem; margin-bottom: 1.25rem; color: #fff;
  background: radial-gradient(900px 300px at 50% -20%, rgba(245,158,11,.35), transparent 60%),
              radial-gradient(600px 300px at 100% 120%, rgba(13,148,136,.3), transparent 60%),
              linear-gradient(165deg, #0b1324 0%, #13284a 55%, #0b1f3a 100%);
  box-shadow: 0 18px 45px rgba(15,23,42,.28); border-bottom: 4px solid #f59e0b; }
.insc-hero-mountains { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 48%; pointer-events: none; }
.insc-hero-inner { position: relative; display: flex; align-items: center; gap: 1.75rem; padding: 1.75rem 2rem 2.4rem; }
.insc-hero-logo { flex: none; width: 128px; height: 128px; border-radius: 9999px; background: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 6px rgba(245,158,11,.35), 0 0 0 12px rgba(245,158,11,.12), 0 16px 35px rgba(0,0,0,.45); }
.insc-hero-logo img { width: 96px; height: 96px; object-fit: contain; }
.insc-hero-text { min-width: 0; }
.insc-hero-kicker { font-family: 'Cinzel Decorative', 'Playfair Display', Georgia, serif; font-weight: 900; letter-spacing: .1em;
  font-size: clamp(1.15rem, 2.6vw, 2rem); line-height: 1.15; color: #fbbf24; text-shadow: 0 2px 14px rgba(245,158,11,.35); }
.insc-hero-title { font-family: 'Playfair Display', Georgia, serif; font-weight: 800; font-size: clamp(1.5rem, 3vw, 2.3rem); line-height: 1.15; margin: .3rem 0 .1rem; color: #fff; }
.insc-hero-title-public { display: none; }
body.mode-public .insc-hero-title-staff { display: none; }
body.mode-public .insc-hero-title-public { display: inline; }
.insc-hero-mg { font-style: italic; opacity: .85; font-size: .95rem; display: none; }
body.mode-public .insc-hero-mg { display: block; }
.insc-hero-ornament { display: flex; align-items: center; gap: .6rem; margin: .7rem 0 .6rem; color: #f59e0b; }
.insc-hero-ornament span { height: 2px; width: 60px; background: linear-gradient(90deg, transparent, #f59e0b); }
.insc-hero-ornament span:last-child { background: linear-gradient(270deg, transparent, #f59e0b); }
.insc-hero-event { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem 1rem; border-radius: 9999px; font-weight: 600; font-size: .95rem;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(6px); }
.insc-hero-event i { color: #fbbf24; }
.insc-hero-event.hidden { display: none; }
@media (max-width: 640px) {
  .insc-hero { border-radius: 1.1rem; }
  .insc-hero-inner { flex-direction: column; text-align: center; gap: 1rem; padding: 1.5rem 1rem 2.2rem; }
  .insc-hero-logo { width: 104px; height: 104px; } .insc-hero-logo img { width: 78px; height: 78px; }
  .insc-hero-ornament { justify-content: center; }
  .insc-hero-event { font-size: .85rem; }
  .insc-hero-kicker { font-size: 1.02rem; letter-spacing: .05em; }
  .insc-hero-mountains { height: 30%; }
}

/* ===== fusion5 : menu « Import / Export / Listes » ===== */
.ioe-menu { position: fixed; z-index: 80; background: #fff; color: #0f172a; border: 1px solid #e2e8f0; border-radius: 1rem;
  box-shadow: 0 20px 45px rgba(15,23,42,.28); padding: .4rem; overflow-y: auto; border-top: 4px solid #f59e0b; }
.ioe-menu.hidden { display: none; }
.ioe-group + .ioe-group { border-top: 1px solid #f1f5f9; margin-top: .25rem; padding-top: .25rem; }
.ioe-group-title { font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #b45309; padding: .45rem .6rem .25rem; display: flex; gap: .4rem; align-items: center; }
.ioe-menu .ioe-item { display: flex !important; width: 100%; align-items: center; gap: .6rem; text-align: left; padding: .55rem .65rem; border-radius: .6rem;
  font-size: .85rem; font-weight: 500; color: #1e293b; background: transparent; }
.ioe-menu .ioe-item[style*="display: none"] { display: none !important; }
.ioe-menu .ioe-item i { width: 1.1rem; text-align: center; color: #64748b; }
.ioe-menu .ioe-item:hover { background: #fef3c7; }
.ioe-menu .ioe-item:hover i { color: #b45309; }
.ioe-menu .ioe-item.active { background: #eef2ff; color: #3730a3; }
@media (max-width: 640px) { .ioe-menu .ioe-item { padding: .7rem .65rem; font-size: .92rem; } }
.ioe-menu .ioe-item.bg-indigo-600 { background: #eef2ff !important; color: #3730a3 !important; font-weight: 700; } .ioe-menu .ioe-item.bg-indigo-600 i { color: #4f46e5; }
/* fusion5 : menu Import/Export/Listes – libellés courts + précision, focus clavier, cibles tactiles */
.ioe-menu .ioe-item { display: flex; align-items: center; gap: .6rem; min-height: 40px; }
.ioe-menu .ioe-item .ioe-lbl { flex: 1 1 auto; text-align: left; }
.ioe-menu .ioe-item .ioe-hint { flex: 0 0 auto; font-size: .7rem; color: #94a3b8; text-align: right; max-width: 45%; }
.ioe-menu .ioe-item i { width: 1.1rem; text-align: center; color: #64748b; }
.ioe-menu .ioe-item:focus-visible { outline: 2px solid #4f46e5; outline-offset: -2px; background: #eef2ff; }
.ioe-menu .ioe-group + .ioe-group { border-top: 1px solid #e2e8f0; margin-top: .25rem; padding-top: .25rem; }
@media (max-width: 640px) { .ioe-menu .ioe-item { min-height: 46px; } }
/* fusion5 : bouton public « Télécharger le formulaire d'inscription (PDF) » – visible seulement en mode formulaire public */
.pub-blank-dl { display: none; }
body.mode-public.portal-form .pub-blank-dl { display: flex; justify-content: center; margin: -0.25rem 0 1.25rem; }
.pub-blank-dl button { display: flex; align-items: center; gap: .85rem; width: 100%; max-width: 560px; padding: .9rem 1.2rem; border-radius: 1rem;
  background: #fff; color: #1e293b; border: 2px solid #f59e0b; box-shadow: 0 8px 22px rgba(245,158,11,.18); text-align: left; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.pub-blank-dl button:hover, .pub-blank-dl button:focus-visible { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(245,158,11,.28); outline: none; }
.pub-blank-dl button:disabled { opacity: .6; cursor: wait; }
.pub-blank-dl button > i.fa-file-pdf { font-size: 1.8rem; color: #dc2626; }
.pub-blank-dl button > i.fa-download { margin-left: auto; color: #b45309; }
.pub-blank-dl button span { display: flex; flex-direction: column; line-height: 1.25; }
.pub-blank-dl button strong { font-size: 1rem; }
.pub-blank-dl button small { font-size: .82rem; color: #64748b; font-style: italic; margin-top: .15rem; }
/* fusion5 : écran Arrivées */
.fin-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 900px) { .fin-grid { grid-template-columns: 1fr; } }
.fin-side { display: flex; flex-direction: column; gap: 1rem; }
.fin-label { display: block; font-weight: 700; font-size: 1.05rem; color: #1e293b; margin-bottom: .5rem; }
.fin-label small { display: block; font-weight: 400; font-size: .8rem; color: #64748b; }
.fin-input-row { display: flex; gap: .5rem; }
.fin-bib-input { flex: 1; min-width: 0; font-size: 2.6rem; font-weight: 800; text-align: center; letter-spacing: .1em; padding: .5rem; border: 3px solid #4f46e5; border-radius: 1rem; font-family: ui-monospace, monospace; }
.fin-bib-input:focus { outline: none; box-shadow: 0 0 0 4px rgba(79,70,229,.25); }
.fin-go { font-size: 1.1rem; padding: 0 1.2rem; border-radius: 1rem; }
.fin-cam { display: flex; gap: .5rem; margin: .6rem 0; flex-wrap: wrap; }
#fin-reader { max-width: 360px; margin: .5rem auto; }
.fin-result { border-radius: 1rem; padding: 1rem; margin-top: .5rem; border: 2px solid; }
.fin-ok { background: #ecfdf5; border-color: #10b981; } .fin-warn { background: #fffbeb; border-color: #f59e0b; }
.fin-err { background: #fef2f2; border-color: #ef4444; } .fin-info { background: #eef2ff; border-color: #818cf8; }
.fin-title { font-weight: 800; font-size: 1.05rem; margin-bottom: .4rem; }
.fin-ok .fin-title { color: #047857; } .fin-warn .fin-title { color: #b45309; } .fin-err .fin-title { color: #b91c1c; } .fin-info .fin-title { color: #3730a3; }
.fin-main { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.fin-bib { font-size: 2.4rem; font-weight: 900; background: #0f172a; color: #fff; border-radius: .8rem; padding: .2rem .9rem; font-family: ui-monospace, monospace; }
.fin-who { flex: 1; min-width: 180px; } .fin-name { font-size: 1.35rem; font-weight: 800; color: #0f172a; }
.fin-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .85rem; color: #475569; margin-top: .2rem; }
.fin-time { text-align: right; font-size: 2rem; font-weight: 900; font-family: ui-monospace, monospace; color: #0f172a; }
.fin-time small, .fin-ranks small { display: block; font-size: .7rem; font-weight: 600; text-transform: uppercase; color: #64748b; font-family: inherit; }
.fin-ranks { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .8rem; }
.fin-ranks > div { background: #fff; border-radius: .7rem; padding: .5rem; text-align: center; }
.fin-ranks b { font-size: 1.6rem; color: #4f46e5; } .fin-ranks span { font-size: .8rem; color: #94a3b8; margin-left: .2rem; }
.fin-extra { font-size: .82rem; color: #475569; margin-top: .5rem; }
.fin-lookup { margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed #cbd5e1; } .fin-lookup label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: .3rem; }
.fin-h3 { font-weight: 700; color: #1e293b; margin-bottom: .6rem; }
.fin-start-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid #f1f5f9; flex-wrap: wrap; }
.fin-start-name small { display: block; font-size: .75rem; color: #64748b; } .fin-start-act { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; } .fin-start-act input { width: 7.5rem; }
.fin-top-race h4 { font-weight: 700; font-size: .85rem; margin-top: .4rem; color: #4f46e5; } .fin-top-race ol { font-size: .82rem; }
.fin-top-race li { display: flex; justify-content: space-between; padding: .1rem 0; } .fin-top-race em { color: #94a3b8; font-style: normal; } .fin-top-race p { font-size: .8rem; color: #94a3b8; }
.fin-table th { text-align: left; font-size: .72rem; text-transform: uppercase; color: #64748b; padding: .3rem; } .fin-table td { padding: .35rem .3rem; border-top: 1px solid #f1f5f9; }
@media (max-width: 640px) { .fin-bib-input { font-size: 2rem; } .fin-time { text-align: left; font-size: 1.6rem; } .fin-go span { display: none; } }
/* fusion5 : onglets du Scanner */
.scan-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; background: #e2e8f0; padding: .3rem; border-radius: 1rem; margin-bottom: 1rem; }
.scan-tab { padding: .6rem .8rem; border-radius: .8rem; font-weight: 700; font-size: .9rem; color: #475569; text-align: center; line-height: 1.2; }
.scan-tab small { display: block; font-weight: 400; font-size: .72rem; color: #94a3b8; }
.scan-tab.active { background: #fff; color: #4338ca; box-shadow: 0 2px 8px rgba(15,23,42,.12); }
#scanner-finish-panel { display: none; }
#section-scanner.fin-mode #scanner-finish-panel { display: block; }
#section-scanner.fin-mode > :not(.scan-tabs):not(#scanner-finish-panel):not(.section-title) { display: none !important; }
.vol-raceday-head { display: flex; gap: .7rem; align-items: center; margin-bottom: .7rem; } .vol-raceday-head > i { font-size: 1.4rem; color: #f59e0b; }
.vol-raceday-head small { display: block; color: #64748b; font-size: .78rem; }
.vol-raceday-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .6rem; }
.vol-raceday-grid button { display: flex; gap: .6rem; align-items: center; text-align: left; padding: .7rem .8rem; border: 1px solid #e2e8f0; border-radius: .8rem; background: #f8fafc; min-height: 56px; }
.vol-raceday-grid button:hover, .vol-raceday-grid button:focus-visible { border-color: #818cf8; background: #eef2ff; outline: none; }
.vol-raceday-grid i { font-size: 1.3rem; color: #4f46e5; width: 1.6rem; text-align: center; } .vol-raceday-grid small { display: block; font-size: .74rem; color: #64748b; }
.fin-side > .card { min-width: 0; overflow: hidden; } .fin-start-act input { width: 6.8rem; } .fin-top-race li { gap: .5rem; padding-right: .2rem; }
@media (max-width: 900px) { .fin-grid { grid-template-columns: minmax(0, 1fr); } }
.fin-entry { min-width: 0; } .fin-bib-input { width: 100%; }
.audit-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; } .audit-filters .input { max-width: 11rem; padding: .3rem .5rem; }
.audit-scroll { max-height: 22rem; overflow-y: auto; }
.rolecfg th { text-align: left; font-size: .72rem; text-transform: uppercase; color: #64748b; padding: .35rem; } .rolecfg th:not(:first-child), .rolecfg td:not(:first-child) { text-align: center; width: 6rem; }
.rolecfg td { padding: .4rem .35rem; border-top: 1px solid #f1f5f9; } .rolecfg input { width: 1.15rem; height: 1.15rem; accent-color: #4f46e5; } .rolecfg input:disabled { opacity: .3; }
.rolecfg-sep td { font-weight: 700; font-size: .72rem; text-transform: uppercase; color: #4f46e5; background: #f8fafc; }
/* fusion5 : Live – jour de course admin */
.live-raceday { background: linear-gradient(135deg, #eef2ff, #fff7ed); border: 1px solid #c7d2fe; border-radius: 1.2rem; padding: 1rem; margin-bottom: 1.25rem; }
.live-raceday-head { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.live-raceday-head h3 { font-weight: 800; color: #312e81; font-size: 1.05rem; } .live-raceday-head h3 i { color: #f59e0b; margin-right: .3rem; }
.live-raceday-pub { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .8rem; }
#live-raceday-slot #scanner-finish-panel { display: block; }
/* fusion5 : résultats publics */
.pub-results-btn { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; display: flex; gap: .5rem; align-items: center; background: #0f172a; color: #fbbf24; border: 2px solid #f59e0b; border-radius: 999px; padding: .6rem 1rem; box-shadow: 0 10px 25px rgba(0,0,0,.25); font-weight: 800; }
.pub-results-btn span { display: flex; flex-direction: column; line-height: 1.1; text-align: left; } .pub-results-btn small { font-weight: 400; font-style: italic; font-size: .7rem; color: #e2e8f0; }
.pub-results-modal { position: fixed; inset: 0; z-index: 80; background: rgba(15,23,42,.6); display: none; align-items: flex-start; justify-content: center; padding: 1rem; overflow-y: auto; }
.pub-results-modal.show { display: flex; }
.pub-results-card { background: #fff; border-radius: 1.2rem; width: 100%; max-width: 820px; overflow: hidden; box-shadow: 0 25px 60px rgba(0,0,0,.35); }
.pr-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; background: #0f172a; color: #fff; border-bottom: 4px solid #f59e0b; }
.pr-head h3 { font-family: 'CinzelDeco', Georgia, serif; font-size: 1.3rem; color: #fbbf24; } .pr-head p { font-style: italic; font-size: .8rem; color: #cbd5e1; }
.pr-close { font-size: 2rem; line-height: 1; color: #fff; padding: 0 .4rem; }
.pr-tabs { display: flex; gap: .3rem; flex-wrap: wrap; padding: .7rem 1rem 0; } .pr-tab { padding: .4rem .8rem; border-radius: .6rem; background: #f1f5f9; font-weight: 600; font-size: .85rem; } .pr-tab.active { background: #4f46e5; color: #fff; }
.pr-search { padding: .7rem 1rem; } .pr-search input { width: 100%; border: 1px solid #cbd5e1; border-radius: .6rem; padding: .5rem .7rem; }
.pr-table-wrap { max-height: 65vh; overflow: auto; padding: 0 1rem 1rem; } .pr-table { width: 100%; font-size: .85rem; } .pr-table th { text-align: left; font-size: .7rem; text-transform: uppercase; color: #64748b; padding: .35rem; position: sticky; top: 0; background: #fff; }
.pr-table td { padding: .4rem .35rem; border-top: 1px solid #f1f5f9; } .pr-table tr.f td { background: #fdf2f8; } .pr-table .mono { font-family: ui-monospace, monospace; font-weight: 700; } .pr-table small { color: #94a3b8; }
.bk-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; } .bk-table th, .cap-table th { text-align: left; font-size: .7rem; text-transform: uppercase; color: #64748b; padding: .3rem; }
.bk-table td, .cap-table td { padding: .4rem .3rem; border-top: 1px solid #f1f5f9; } .cap-table .input { width: 7rem; padding: .3rem .5rem; }
.cap-full { background: #fee2e2; color: #b91c1c; font-size: .68rem; font-weight: 700; padding: .1rem .4rem; border-radius: .4rem; }
.race-full-note { margin-top: .4rem; font-size: .82rem; background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; padding: .5rem .7rem; border-radius: .6rem; }
.fin-by { font-size: .7rem; color: #6366f1; margin-top: .1rem; } .fin-by i { margin-right: .15rem; }
@media (max-width: 900px) { .fin-grid { grid-template-columns: minmax(0, 1fr); } }
.fin-entry { min-width: 0; } .fin-bib-input { width: 100%; }
/* fusion5 : dashboard synthèse */
.dash-plus-table th { text-align: left; font-size: .7rem; text-transform: uppercase; color: #64748b; padding: .3rem; white-space: nowrap; }
.dash-plus-table td { padding: .4rem .3rem; border-top: 1px solid #f1f5f9; white-space: nowrap; }
.dash-sexbar { display: flex; width: 90px; height: 8px; border-radius: 4px; overflow: hidden; background: #e2e8f0; }
.dash-sexbar span { background: #6366f1; } .dash-sexbar i { background: #ec4899; }
.dash-plus-recent li { display: flex; gap: .6rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid #f1f5f9; }
.dash-plus-recent li div { flex: 1; min-width: 0; } .dash-plus-recent small { display: block; color: #64748b; font-size: .74rem; }
.dash-plus-recent time { font-size: .72rem; color: #94a3b8; } .dash-dot { width: .6rem; height: .6rem; border-radius: 50%; background: #6366f1; flex: none; } .dash-dot.f { background: #ec4899; }
/* fusion5 : coureur sans dossard */
.fin-unknown-btn { display: flex; gap: .7rem; align-items: center; width: 100%; margin: .2rem 0 .4rem; padding: .7rem .9rem; border-radius: 1rem; border: 2px dashed #f59e0b; background: #fffbeb; color: #92400e; text-align: left; min-height: 56px; }
.fin-unknown-btn:hover, .fin-unknown-btn:focus-visible { background: #fef3c7; outline: none; } .fin-unknown-btn i { font-size: 1.6rem; } .fin-unknown-btn b { font-size: 1.05rem; } .fin-unknown-btn small { display: block; font-size: .75rem; color: #b45309; }
.fin-note-row { display: flex; gap: .4rem; margin-top: .4rem; } .fin-note-row .input { flex: 1; min-width: 0; }
.fin-warn-badge { display: inline-flex; align-items: center; gap: .25rem; background: #f59e0b; color: #fff; font-size: .72rem; font-weight: 800; padding: .1rem .5rem; border-radius: 999px; margin-left: .4rem; vertical-align: middle; }
.fin-warn-badge.hidden { display: none; } .fin-unknown-card { border: 2px solid #fcd34d; }
.fin-assign-res { display: flex; flex-direction: column; gap: .2rem; margin-top: .3rem; } .fin-assign-res button { text-align: left; padding: .4rem .6rem; border-radius: .5rem; background: #f1f5f9; } .fin-assign-res button:hover { background: #e0e7ff; } .fin-assign-res small { color: #64748b; }
.rc-off { display: none !important; }
.rc-all { font-size: .68rem; font-weight: 600; color: #4f46e5; text-decoration: underline; text-transform: none; } .rc-na { color: #cbd5e1; }
.rc-srv { font-size: .62rem; background: #e0e7ff; color: #3730a3; padding: 0 .3rem; border-radius: .3rem; font-weight: 700; }
/* fusion5 : Bénévoles → Postes & contacts */
.si-post { border: 1px solid #e2e8f0; border-radius: .75rem; padding: .6rem; margin-bottom: .6rem; display: grid; gap: .4rem; }
.si-post-name { font-weight: 700; color: #7c2d12; }
.si-row { display: flex; gap: .4rem; margin-bottom: .4rem; align-items: center; } .si-row .input { flex: 1; min-width: 0; }
.si-del { color: #e11d48; font-weight: 700; padding: 0 .4rem; }
@media (max-width: 640px) { .si-row { flex-wrap: wrap; } .si-row .input { flex-basis: 100%; } }

/* fusion9.2 : option Navette visible aussi dans les formulaires public et agent (facultative) */
body.mode-public .field-navette-option:not(.hidden),
body.mode-agent .field-navette-option:not(.hidden) {
  display: block !important;
}


/* ===== Fond BLANC ECLATANT listes / tableaux (plus de gris/noir) ===== */
#participants-body tr,
#affiche-body tr,
#rankings-body tr,
#modal-live-list tr,
#scan-result tr,
table.aff-table tbody tr,
.dash-plus-table tbody tr,
main table tbody tr {
  background-color: #ffffff !important;
}
#participants-body tr:hover,
#affiche-body tr:hover,
#rankings-body tr:hover,
main table tbody tr:hover {
  background-color: #ffffff !important;
}
#participants-body tr.row-homme,
#affiche-body tr.row-homme,
table tr.row-homme {
  background-color: #ffffff !important;
  color: #0f172a;
}
#participants-body td,
#affiche-body td,
#rankings-body td {
  background-color: transparent !important;
}
/* Femmes : texte rose, fond toujours blanc */
#participants-body tr.row-femme,
#affiche-body tr.row-femme,
#rankings-body tr.row-femme,
table tr.row-femme {
  background-color: #ffffff !important;
  color: #db2777 !important;
}

/* Dossards toujours en noir (meme pour les femmes) */
.bib-num,
#participants-body tr.row-femme td.bib-num,
#participants-body tr.row-femme .bib-num,
.aff-bib,
#affiche-body tr.row-femme .aff-bib,
tr.row-femme td:has(.aff-bib),
tr.row-femme .aff-bib {
  color: #0f172a !important;
}

/* fusion12-5 : bouton « Télécharger le formulaire » discret, en haut à droite, hauteur ≤ un champ du formulaire */
body.mode-public.portal-form .pub-blank-dl { justify-content: flex-end; margin: 0 0 .6rem; }
body.mode-public.portal-form .pub-blank-dl button { width: auto; max-width: 100%; gap: .5rem; padding: .35rem .75rem; border-radius: .6rem; border-width: 1px; box-shadow: none; min-height: 0; max-height: 46px; }
body.mode-public.portal-form .pub-blank-dl button:hover, body.mode-public.portal-form .pub-blank-dl button:focus-visible { transform: none; box-shadow: 0 2px 8px rgba(245,158,11,.25); }
body.mode-public.portal-form .pub-blank-dl button > i.fa-file-pdf { font-size: 1.05rem; }
body.mode-public.portal-form .pub-blank-dl button > i.fa-download { font-size: .8rem; margin-left: .25rem; }
body.mode-public.portal-form .pub-blank-dl button span { line-height: 1.15; text-align: left; }
body.mode-public.portal-form .pub-blank-dl button strong { font-size: .78rem; font-weight: 600; }
body.mode-public.portal-form .pub-blank-dl button small { font-size: .66rem; margin-top: 0; }
/* fusion12-5 : champ « Code participant » (agent : remplissage auto ; public : facultatif, enregistré seulement) */
.annu-code-box { margin: 0 0 1rem; max-width: 26rem; }
.annu-code-box .annu-row { display: flex; gap: .5rem; align-items: center; }
.annu-code-box .annu-l-public { display: none; }
body.mode-public .annu-code-box .annu-l-public { display: inline; }
body.mode-public .annu-code-box .annu-l-agent, body.mode-public .annu-code-box .annu-agent-only { display: none; }
#personCodeInput { text-transform: uppercase; font-family: ui-monospace, monospace; }
/* fusion12-5 : mode rapide « Vous possédez un code ? » (public uniquement) */
.annu-mode-wrap { display: none; }
body.mode-public .annu-mode-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; margin: 0 0 .75rem; padding: .55rem .8rem; border: 1px solid #c7d2fe; background: #eef2ff; border-radius: .6rem; }
.annu-mode-lbl { display: flex; align-items: center; gap: .4rem; cursor: pointer; font-size: .9rem; }
.annu-mode-help { font-size: .72rem; color: #64748b; }
.annu-hide { display: none !important; }
.annu-badge { display: inline-block; margin-left: .35rem; padding: .05rem .45rem; font-size: .68rem; font-weight: 700; color: #3730a3; background: #e0e7ff; border-radius: 999px; }
.annu-code-box .annu-l-code { display: none; }
body.mode-public.annu-code-mode .annu-code-box .annu-l-public { display: none; }
body.mode-public.annu-code-mode .annu-code-box .annu-l-code { display: inline; }
/* fusion12-6 : anciens réglages de design dossard masqués (HTML/JS conservés, réversible) – seule la carte « Concevoir les dossards » reste visible */
.tmh-legacy-bib-hidden { display: none !important; }

/* fusion12-7 : liste des inscrits – colonnes Organisme / Observation (tronquées + infobulle), badge Groupe, ligne sous le nom sur mobile */
#participants-body .ins-trunc { display: block; max-width: 9.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#participants-body td.ins-obs .ins-trunc { max-width: 11rem; color: #475569; }
#participants-body .ins-sub { display: none; }
.ins-grp { display: inline-flex; align-items: center; gap: .25rem; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
  font-size: 10px; font-weight: 600; line-height: 1.2; padding: .1rem .4rem; border-radius: 999px; background: #e0e7ff; color: #3730a3 !important; }
.ins-grp i { font-size: 9px; }
#bulk-actions-bar .bulk-grp { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
#bulk-actions-bar #bulk-groupe { width: 13rem; max-width: 100%; }
body.perm-no-edit #bulk-grp-box { display: none !important; }
@media (max-width: 640px) {
  #section-liste table th.ins-org, #section-liste table th.ins-obs, #participants-body td.ins-org, #participants-body td.ins-obs { display: none; }
  #participants-body .ins-sub { display: block; margin-top: .15rem; font-weight: 400; font-size: 10px; line-height: 1.25; color: #64748b !important; max-width: 13rem; }
  #participants-body .ins-sub span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #participants-body .ins-sub .ins-sub-org { color: #334155 !important; }
  #participants-body .ins-sub .ins-sub-obs { font-style: italic; }
  #bulk-actions-bar .bulk-grp { width: 100%; }
  #bulk-actions-bar #bulk-groupe { flex: 1 1 100%; width: auto; }
}
