/* CSS Variables for dynamic branding */
:root {
  --color-primary: var(--color-primary);
  --color-secondary: #667eea;
  --color-secondary-dark: #764ba2;
  --color-accent: #ffc107;
  --color-bg-primary: #f8f9fa;
  --color-bg-secondary: #f5f5f5;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Lecteur (read-only) role: hide write actions globally */
body.role-lecteur .not-lecteur { display: none !important; }

/* Hide elements tagged .non-admin-only when the current user IS an admin.
   Conversely, non-admin users (viewer, lecteur, club, ligue_admin, directeur_jeu)
   see these elements — typically top-level nav shortcuts (e.g. Statistiques)
   that admins reach via the Settings page instead, to keep the admin navbar
   uncrowded. The body.role-* class is set by auth-utils.js on DOMContentLoaded. */
body.role-admin .non-admin-only { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 40px;
  max-width: 1200px;
  width: 100%;
  margin: 20px auto;
}

.login-container {
  max-width: 400px;
}

.header {
  text-align: center;
  margin-bottom: 40px;
}

.header h1 {
  color: #333;
  font-size: 28px;
  margin-bottom: 10px;
}

.header p {
  color: #666;
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: #333;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  font-size: 14px;
  transition: border-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04) inset;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-secondary) 15%, transparent);
}

.btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1), 0 4px 12px color-mix(in srgb, var(--color-secondary) 20%, transparent);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12), 0 8px 20px color-mix(in srgb, var(--color-secondary) 30%, transparent);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.btn-secondary {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  margin-top: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1), 0 4px 12px rgba(108,117,125,0.2);
}

.btn-success {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1), 0 4px 12px rgba(40,167,69,0.25);
}
.btn-success:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.12), 0 8px 20px rgba(40,167,69,0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1), 0 4px 12px rgba(220,53,69,0.25);
}
.btn-danger:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.12), 0 8px 20px rgba(220,53,69,0.3);
}

.btn-small {
  width: auto;
  padding: 8px 16px;
  font-size: 14px;
  display: inline-block;
}

/* ===== Standard app-wide : zone de filtres isolée + boutons compacts =====
   (uniformisation UX, demande Jeff 20/06/2026). Réutiliser ces classes
   plutôt que des styles inline. Pour modifier l'apparence : un seul endroit. */

/* Carte « widget » avec barre d'accent navy à gauche (reprend l'esprit .kw) */
.card-accent {
  position: relative;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  border: 1.5px solid #c4cfe2;
  border-radius: 18px;
}
/* Barre d'accent insérée verticalement (top/bottom 14px) → pas besoin de
   overflow:hidden, donc AUCUN risque de couper un tableau/contenu large.
   Permet d'appliquer .card-accent à n'importe quelle carte de contenu. */
.card-accent::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 5px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--color-primary, #1F4788), #6f63d6);
}

/* Sous-panneau isolé regroupant les sélecteurs/filtres */
.filter-panel {
  background: #dbe3f1;
  border: 1px solid #bdcae0;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
}
.filter-panel-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  color: #2d3c59;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
/* Si une .filter-bar locale (avec son propre fond/padding) se retrouve imbriquée
   dans .filter-panel, on neutralise son fond pour éviter le « panneau dans le
   panneau » — le .filter-panel fournit déjà fond + padding. */
.filter-panel .filter-bar {
  background: transparent;
  padding: 0;
  border: none;
  margin: 0;
}

/* Pied du panneau : actions alignées à droite, séparées par un filet */
.filter-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #c6d0e2;
}

/* Bouton Excel compact uniforme (vert), à placer en haut-droite des cartes.
   S'utilise avec .btn : class="btn btn-excel". .btn-excel-import = variante. */
.btn-excel {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  white-space: nowrap;
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1), 0 4px 12px rgba(40,167,69,0.25);
}
.btn-excel:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.12), 0 8px 20px rgba(40,167,69,0.3);
}

.error {
  background: #f8d7da;
  color: #721c24;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 20px;
  border: 1px solid #f5c6cb;
  box-shadow: 0 2px 8px rgba(220,53,69,0.1);
}

.success {
  background: #d4edda;
  color: #155724;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 20px;
  border: 1px solid #c3e6cb;
  box-shadow: 0 2px 8px rgba(40,167,69,0.1);
}

/* Modern Navigation Bar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
  padding: 14px 20px;
  border-bottom: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(248,249,250,0.9) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow:
    0 4px 10px rgba(0,0,0,0.07),
    0 12px 32px rgba(31,71,136,0.12),
    0 1px 0 rgba(255,255,255,0.8) inset;
  /* Lift the entire navbar's stacking context above page content so that
     dropdowns (which create their own stacking context due to backdrop-filter)
     paint above stat cards / action buttons that come later in the DOM. */
  position: relative;
  z-index: 1000;
}

.navbar h2 {
  color: #1a1a2e;
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0;
  flex-shrink: 0;
}

.navbar-subtitle {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: #888;
  letter-spacing: 0.2px;
  margin-top: 1px;
  line-height: 1.3;
}

.navbar-page-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary, #1F4788);
  margin-top: 3px;
  letter-spacing: 0.1px;
}

.navbar .nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
  background: rgba(0,0,0,0.04);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.13);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08) inset, 0 1px 2px rgba(0,0,0,0.04);
}

.navbar .nav-links > a,
.navbar .nav-links > .nav-dropdown > .nav-dropdown-btn {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 15px;
  border-radius: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.navbar .nav-links > a:hover,
.navbar .nav-links > .nav-dropdown:hover > .nav-dropdown-btn {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--color-secondary) 35%, transparent);
}

.navbar .nav-links > a.active,
.navbar .nav-links > .nav-dropdown > .nav-dropdown-btn.active {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
  color: white;
  box-shadow:
    0 4px 14px color-mix(in srgb, var(--color-secondary) 40%, transparent),
    0 1px 2px rgba(0,0,0,0.1);
}

/* Dropdown Menu */
.nav-dropdown {
  position: relative;
  z-index: 9000;
}

.nav-dropdown-btn {
  font-family: inherit;
}

.nav-dropdown-btn::after {
  content: '▼';
  font-size: 8px;
  margin-left: 4px;
  transition: transform 0.2s;
}

.nav-dropdown:hover .nav-dropdown-btn::after {
  transform: rotate(180deg);
}

.nav-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  min-width: 220px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
  border-radius: 14px;
  padding: 8px 0;
  z-index: 9001;
  margin-top: 0;
  padding-top: 12px;
  border: 1px solid rgba(255,255,255,0.7);
}

/* Invisible bridge to prevent hover gap */
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 10px;
  background: transparent;
}

.nav-dropdown:hover .nav-dropdown-content,
.nav-dropdown:focus-within .nav-dropdown-content {
  display: block !important;
  animation: dropdownFade 0.2s ease;
}

/* Ensure dropdown works even when button has active class */
.nav-dropdown > .nav-dropdown-btn.active {
  pointer-events: auto;
}

/* Force dropdown to show on hover even when button is active */
.nav-dropdown:hover > .nav-dropdown-content {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-dropdown-content a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: #333;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-dropdown-content a:hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--color-secondary) 8%, transparent) 0%, color-mix(in srgb, var(--color-secondary-dark) 8%, transparent) 100%);
  color: var(--color-secondary);
}

.nav-dropdown-content a .nav-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
}

.nav-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 8px 0;
}

/* Logout button special styling */
.nav-links .nav-logout {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
  color: white !important;
  margin-left: 6px;
  border-radius: 10px;
  padding: 9px 15px;
}

.nav-links .nav-logout:hover {
  background: linear-gradient(135deg, #c0392b 0%, #a93226 100%) !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(231,76,60,0.35) !important;
}

/* Tooltip styles for nav links */
.nav-tooltip {
  position: relative;
}

.nav-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  padding: 8px 12px;
  background: #333;
  color: white;
  font-size: 12px;
  font-weight: normal;
  border-radius: 6px;
  white-space: nowrap;
  max-width: 250px;
  white-space: normal;
  text-align: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-tooltip::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 2px;
  border: 6px solid transparent;
  border-bottom-color: #333;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
}

.nav-tooltip:hover::after,
.nav-tooltip:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Generic tooltip class for any element (tabs, buttons, etc.) */
.tooltip {
  position: relative;
  cursor: pointer;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  padding: 8px 12px;
  background: #333;
  color: white;
  font-size: 12px;
  font-weight: normal;
  border-radius: 6px;
  max-width: 280px;
  white-space: normal;
  text-align: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tooltip::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 2px;
  border: 6px solid transparent;
  border-bottom-color: #333;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
}

.tooltip:hover::after,
.tooltip:hover::before {
  opacity: 1;
  visibility: visible;
}

.card {
  background: var(--color-bg-primary);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(31,71,136,0.06);
  transition: box-shadow 0.25s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 12px 32px rgba(31,71,136,0.08);
}

.card h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 18px;
}

.table-container {
  overflow-x: auto;
  margin-top: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

thead {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
  color: white;
}

th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
}

td {
  padding: 12px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 13px;
}

tbody tr:hover {
  background: var(--color-bg-primary);
}

tbody tr:nth-child(even) {
  background: #fafafa;
}

.rank-1,
.rank-2,
.rank-3 {
  font-weight: bold;
}

/* Qualified for final - green highlight */
.qualified-for-final {
  background: #e8f5e9 !important;
  border-left: 4px solid #4caf50;
}

.qualified-for-final td:first-child {
  font-weight: bold;
  color: #2e7d32;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1), 0 8px 24px color-mix(in srgb, var(--color-secondary) 25%, transparent);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.12), 0 12px 32px color-mix(in srgb, var(--color-secondary) 30%, transparent);
}

.stat-card h4 {
  font-size: 14px;
  margin-bottom: 10px;
  opacity: 0.9;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: bold;
}

.filter-section {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-section .form-group {
  flex: 1;
  min-width: 200px;
  margin-bottom: 0;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--color-secondary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.file-upload {
  border: 2px dashed var(--color-secondary);
  padding: 30px;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
  margin-bottom: 20px;
}

.file-upload:hover {
  background: var(--color-bg-primary);
}

.file-upload input[type="file"] {
  display: none;
}

.file-name {
  color: #28a745;
  font-weight: 600;
  margin-top: 10px;
}

.action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.action-buttons button {
  flex: 1;
}

.player-link {
  color: var(--color-secondary);
  text-decoration: none;
  font-weight: 600;
}

.player-link:hover {
  text-decoration: underline;
}

/* ============================================================
   MICRO-INTERACTIONS & POLISH
   ============================================================ */

/* Dashboard stat cards: staggered entrance animation */
@keyframes kpiSlideUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.compact-stat {
  opacity: 0;
  animation: kpiSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.compact-stats > :nth-child(1) { animation-delay: 0ms; }
.compact-stats > :nth-child(2) { animation-delay: 80ms; }
.compact-stats > :nth-child(3) { animation-delay: 160ms; }

/* Stat cards on other pages also animate */
.stat-card {
  opacity: 0;
  animation: kpiSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.stats-grid > :nth-child(1) { animation-delay: 0ms; }
.stats-grid > :nth-child(2) { animation-delay: 80ms; }
.stats-grid > :nth-child(3) { animation-delay: 160ms; }
.stats-grid > :nth-child(4) { animation-delay: 240ms; }
.stats-grid > :nth-child(5) { animation-delay: 320ms; }

/* Login page: subtle glow pulse on form container */
.login-container {
  animation: loginGlow 3s ease-in-out infinite;
}

@keyframes loginGlow {
  0%, 100% { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(102, 126, 234, 0.3); }
  50% { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 12px rgba(102, 126, 234, 0); }
}

/* Navbar: active link bottom indicator bar */
.navbar .nav-links > a.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 20%;
  right: 20%;
  height: 3px;
  background: white;
  border-radius: 2px;
  opacity: 0.85;
}

/* Table rows: left accent bar on hover (applied to first cell to avoid pseudo-cell shift) */
tbody tr {
  transition: background 0.2s ease;
}

tbody td:first-child {
  position: relative;
}

tbody td:first-child::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-secondary, #667eea);
  opacity: 0;
  transform: scaleY(0);
  transform-origin: center;
  transition: opacity 0.2s, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 2px 2px 0;
}

tbody tr:hover td:first-child::before {
  opacity: 1;
  transform: scaleY(1);
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  .compact-stat,
  .stat-card {
    opacity: 1;
    animation: none;
  }
  .login-container {
    animation: none;
  }
  tbody td:first-child::before {
    transition: none;
  }
}

@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 16px;
    margin: 10px auto;
    border-radius: 10px;
  }

  .navbar {
    flex-direction: column;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
  }

  .navbar .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 3px;
    border-radius: 10px;
  }

  .navbar .nav-links > a,
  .navbar .nav-links > .nav-dropdown > .nav-dropdown-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .nav-dropdown-content {
    position: static;
    box-shadow: none;
    border: 1px solid #e0e0e0;
    margin-top: 5px;
    border-radius: 8px;
  }

  .filter-section {
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card .stat-value {
    font-size: 24px;
  }

  table {
    font-size: 12px;
  }

  th, td {
    padding: 6px 4px;
    white-space: nowrap;
  }

  .card {
    padding: 16px;
  }

  h2 {
    font-size: 18px;
  }

  h3 {
    font-size: 16px;
  }

  .btn {
    font-size: 13px;
    padding: 8px 14px;
  }

  select, input[type="text"], input[type="email"], input[type="password"], input[type="date"], textarea {
    font-size: 16px; /* prevents iOS zoom on focus */
  }
}

/* ===========================================================================
   P4.10 (V 2.0.1188) — Présentation commune des écrans fichiers.
   Barre de stats COMPACTE sur Joueurs / Tournois / Inscriptions uniquement
   (body.file-page). Neutralise les grosses cartes KPI colorées sans toucher au
   calcul des chiffres, ni à la page Statistiques, ni au dashboard.
   =========================================================================== */
body.file-page .stats-grid {
  display: flex !important; flex-wrap: wrap !important; gap: 8px !important;
  margin-bottom: 14px !important; grid-template-columns: none !important;
}
/* P4.11 (V 3.0.14) — Pastilles de stats raffinées : surface plate, petit point
   indigo (au lieu de la barre), valeur en héros, libellé en petites capitales
   discrètes, survol subtil. Cohérent avec les boutons/filtres .btn-fp-*. */
body.file-page .stat-card {
  flex: 0 1 auto !important; min-width: 0 !important; min-height: 0 !important;
  background: #e9edf5 !important;
  border: 1px solid #d3dcec !important;
  color: #1f2733 !important; padding: 9px 16px !important;
  border-radius: 12px !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.5) !important; transform: none !important;
  display: inline-flex !important; align-items: center !important; gap: 9px !important;
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease, border-color .15s ease !important;
}
body.file-page .stat-card::before {
  content: '' !important; width: 7px !important; height: 7px !important; border-radius: 50% !important;
  background: #1F4788 !important; flex: none !important; order: 0 !important; opacity: .9 !important;
}
body.file-page .stat-card:hover { transform: translateY(-1px) !important; background: #eff2f8 !important; border-color: #bcc9e2 !important; box-shadow: 0 6px 16px rgba(31,71,136,.12) !important; }
body.file-page .stat-card *, body.file-page .stat-card h2, body.file-page .stat-card h3, body.file-page .stat-card h4 {
  text-shadow: none !important;
}
body.file-page .stat-card h2, body.file-page .stat-card h3, body.file-page .stat-card h4,
body.file-page .stat-card p, body.file-page .stat-card .stat-label, body.file-page .stat-card small {
  font-size: 10.5px !important; font-weight: 700 !important; margin: 0 !important; color: #54607a !important;
  text-transform: uppercase !important; letter-spacing: .045em !important; opacity: 1 !important; order: 2;
}
body.file-page .stat-card .stat-value, body.file-page .stat-card .stat-number, body.file-page .stat-card .value {
  font-size: 17px !important; font-weight: 800 !important; margin: 0 !important; order: 1; color: #1F4788 !important;
}

/* Boutons utilitaires harmonisés (palette des modales) — réutilisables sur les 4 fichiers. */
.btn-fp-primary { background: #1F4788 !important; color: #fff !important; border: 1px solid #1F4788 !important; border-radius: 11px !important; }
.btn-fp-primary:hover { filter: brightness(1.07); }
.btn-fp-secondary { background: #fff !important; color: #1F4788 !important; border: 1px solid #cdd9ec !important; border-radius: 11px !important; }
.btn-fp-secondary:hover { background: #f4f6fb !important; }
.btn-fp-danger { background: #fff5f5 !important; color: #c0392b !important; border: 1px solid #f3c2c2 !important; border-radius: 11px !important; }
.btn-fp-danger:hover { background: #fdecea !important; }

/* Sélecteurs / filtres uniformisés sur les pages fichiers. */
body.file-page select, body.file-page input[type="date"], body.file-page input[type="text"], body.file-page input[type="search"], body.file-page input[type="number"] {
  border-radius: 10px !important; border: 1px solid #d7dee9 !important; padding: 9px 12px !important; font-size: 14px !important;
  transition: border-color .12s ease, box-shadow .12s ease;
}
body.file-page select:focus, body.file-page input:focus {
  outline: none !important; border-color: #3a6fc4 !important; box-shadow: 0 0 0 3px rgba(58,111,196,.15) !important;
}

/* ===========================================================================
   P4.10 (V 2.0.1194) — Styles partagés de la FICHE (modale enregistrement) et
   des modales d'édition, réutilisés par les pages fichiers (id #ficheModal,
   classe .fp-edit-modal). Cohérent avec la fiche Tournois.
   =========================================================================== */
@keyframes ficheIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.fiche-card { animation: ficheIn .24s cubic-bezier(.2,.8,.2,1) both; }
#ficheModal .fiche-field { background: #f7f9fc; border: 1px solid #eef1f6; border-radius: 12px; padding: 10px 13px; }
#ficheModal .fiche-field .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: #8a93a3; font-weight: 700; margin-bottom: 3px; }
#ficheModal .fiche-field .val { font-size: 14px; font-weight: 600; color: #1f2733; word-break: break-word; }
#ficheModal .fiche-act { border: 1px solid transparent; border-radius: 11px; padding: 10px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
#ficheModal .fiche-act.primary { background: #1F4788; color: #fff; }
#ficheModal .fiche-act.secondary { background: #fff; color: #334155; border-color: #d7dee9; }
#ficheModal .fiche-act.secondary:hover { background: #f4f6fb; }
#ficheModal .fiche-act.danger { background: #fff5f5; color: #c0392b; border-color: #f3c2c2; }
#ficheModal .fiche-act.danger:hover { background: #fdecea; }
#ficheModal .fiche-act:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(2,6,23,.14); }
#ficheModal .fiche-act:active { transform: translateY(0); }
#ficheModal .fiche-close:hover { background: rgba(255,255,255,.32) !important; }
.fp-edit-modal input[type="text"], .fp-edit-modal input[type="date"], .fp-edit-modal input[type="number"],
.fp-edit-modal input[type="email"], .fp-edit-modal input[type="tel"], .fp-edit-modal select, .fp-edit-modal textarea {
  border-radius: 10px !important; border: 1px solid #d7dee9 !important; padding: 10px 12px !important; font-size: 14px !important;
  transition: border-color .12s ease, box-shadow .12s ease; }
.fp-edit-modal input:focus, .fp-edit-modal select:focus, .fp-edit-modal textarea:focus {
  outline: none !important; border-color: #3a6fc4 !important; box-shadow: 0 0 0 3px rgba(58,111,196,.15) !important; }
.fp-edit-modal label { font-weight: 600 !important; color: #1f2733; }
