/* =====================================================================
 * Feuille de match équipe en ligne — feuille.css
 * Mobile-first. Réutilise les tokens de style.css (--navy, --or, etc.).
 * ===================================================================== */

.feuille-body { padding-bottom: 80px; }

.public-main.feuille-main,
.feuille-body .public-main {
  max-width: 760px;
  padding-top: var(--space-4);
  padding-bottom: 100px;
}

/* --- Bandeaux info / verrouillage --- */
.feuille-banner {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: 0.95rem;
  margin-bottom: var(--space-5);
  border-left: 4px solid var(--navy);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  line-height: 1.45;
}
.feuille-banner--info {
  border-left-color: var(--navy);
  background: #EFF6FF;
  color: var(--navy-dark);
}
.feuille-banner--locked {
  border-left-color: var(--warn);
  background: var(--warn-bg);
  color: #78350F;
  font-weight: 600;
}

/* --- Section --- */
.feuille-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.feuille-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: var(--space-2);
}
.feuille-section__hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}
.feuille-section__actions {
  display: flex; justify-content: flex-start;
  margin-top: var(--space-3);
}

/* --- Grid identification --- */
.feuille-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
@media (min-width: 600px) {
  .feuille-grid { grid-template-columns: 1fr 1fr; }
  .feuille-label:nth-child(1) { grid-column: 1 / -1; }
}
.feuille-label {
  display: flex; flex-direction: column;
  gap: var(--space-1);
}
.feuille-label > span {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.feuille-label input {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 10px 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  min-height: 44px;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.feuille-label input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}
.feuille-label input:disabled {
  background: #F8FAFC;
  color: var(--text-muted);
  cursor: not-allowed;
}

/* --- Lignes membres (joueur/educateur/benevole) --- */
.feuille-section__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.feuille-row {
  display: grid;
  grid-template-columns: minmax(0, 90px) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.feuille-row:last-child { border-bottom: none; }
.feuille-row__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.01em;
}
.feuille-row[data-fonction="educateur"] .feuille-row__label,
.feuille-row[data-fonction="benevole"] .feuille-row__label {
  color: var(--or);
}
.feuille-row__inputs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-2);
}
.feuille-row__inputs input {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  min-height: 40px;
  width: 100%;
  min-width: 0;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.feuille-row__inputs input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
}
.feuille-row__inputs input:disabled {
  background: #F8FAFC;
  color: var(--text-muted);
  cursor: not-allowed;
}
.feuille-row__inputs input::placeholder { color: #A0AEC0; }

.feuille-row__remove {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.feuille-row__remove:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}
.feuille-row__remove:disabled,
.feuille-row__remove--disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Mobile : empile label / inputs / bouton */
@media (max-width: 600px) {
  .feuille-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 6px var(--space-2);
  }
  .feuille-row__label {
    grid-column: 1 / 2;
    grid-row: 1;
  }
  .feuille-row__inputs {
    grid-column: 1 / 3;
    grid-row: 2;
    grid-template-columns: 1fr 1fr;
  }
  .feuille-row__inputs .f-lic {
    grid-column: 1 / 3;
  }
  .feuille-row__remove {
    grid-column: 2 / 3;
    grid-row: 1;
    align-self: center;
  }
}

@media (max-width: 380px) {
  .feuille-section { padding: var(--space-4); }
  .feuille-row__inputs { grid-template-columns: 1fr; }
  .feuille-row__inputs .f-lic { grid-column: 1; }
}

/* Bouton « + Ajouter » plus discret */
.feuille-add {
  font-size: 0.88rem;
  color: var(--navy);
  border: 1.5px dashed var(--border-strong);
  background: transparent;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
  min-height: 40px;
}
.feuille-add:hover {
  background: #F1F5F9;
  border-color: var(--navy);
}
.feuille-add:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* --- Statusbar fixe en bas --- */
.feuille-statusbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 10px var(--space-4);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.88rem;
  z-index: 50;
  box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.06);
}
.feuille-statusbar__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-light);
  flex-shrink: 0;
}
.feuille-statusbar__dot--ok { background: var(--success); }
.feuille-statusbar__dot--pending { background: var(--warn); animation: pulse-dot 1.2s ease-in-out infinite; }
.feuille-statusbar__dot--saving { background: var(--navy); animation: pulse-dot 1s ease-in-out infinite; }
.feuille-statusbar__dot--error { background: var(--danger); animation: pulse-dot 0.8s ease-in-out infinite; }
.feuille-statusbar__dot--locked { background: var(--warn); }
.feuille-statusbar__msg { font-weight: 600; color: var(--text); flex-shrink: 0; }
.feuille-statusbar__count { color: var(--text-muted); font-size: 0.82rem; margin-left: auto; text-align: right; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.85); }
}

/* Mobile : statusbar compactée */
@media (max-width: 480px) {
  .feuille-statusbar { gap: 8px; padding: 8px 12px; }
  .feuille-statusbar__msg { font-size: 0.82rem; }
  .feuille-statusbar__count { font-size: 0.74rem; }
}

/* --- Erreur (lien invalide) --- */
.feuille-error {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  text-align: center;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--danger);
}
.feuille-error h2 {
  color: var(--danger);
  margin-bottom: var(--space-3);
}
.feuille-error p { margin-bottom: var(--space-2); }

/* --- Footnote (bas de page) --- */
.feuille-footnote {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-top: var(--space-3);
  box-shadow: var(--shadow-sm);
  font-size: 0.88rem;
  line-height: 1.55;
}
.feuille-footnote p { margin-bottom: var(--space-2); }
.feuille-footnote p:last-child { margin-bottom: 0; }

/* =====================================================================
 * Onglet admin Compositions
 * (Réutilisé dans admin.html — la classe .compositions-* est consommée
 *  par renderCompositions() dans admin.js).
 * ===================================================================== */

.compositions-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.compositions-summary__kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: center;
}
.compositions-summary__kpi strong {
  display: block;
  font-size: 1.6rem;
  color: var(--navy-dark);
  font-family: var(--font-head);
  line-height: 1.1;
}
.compositions-summary__kpi span {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.compositions-table { width: 100%; }
.compositions-table td { vertical-align: middle; }

.compositions-bar {
  width: 100%;
  max-width: 180px;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
}
.compositions-bar__fill {
  height: 100%;
  background: var(--text-light);
  transition: width 0.4s ease;
}
.compositions-bar--ok .compositions-bar__fill { background: var(--success); }
.compositions-bar--partial .compositions-bar__fill { background: var(--warn); }
.compositions-bar--empty .compositions-bar__fill { background: var(--text-light); }
