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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #e5e7eb;
  min-height: 100vh;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid #1f2937;
}

.nav {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 600;
  font-size: 1.1rem;
}

.brand span {
  color: #38bdf8;
}

.nav-links {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

.nav-links a {
  text-decoration: none;
  color: #9ca3af;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.nav-links a:hover {
  color: #e5e7eb;
  border-color: #4b5563;
}

.nav-links a.active {
  color: #0f172a;
  background: #38bdf8;
  border-color: #38bdf8;
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 1rem 3rem;
}

.page {
  background: #020617;
  border-radius: 1rem;
  padding: 2rem 1.75rem;
  border: 1px solid #1f2937;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

h1 {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}

.tagline {
  font-size: 0.9rem;
  color: #9ca3af;
  margin-bottom: 1.4rem;
}

p {
  font-size: 0.95rem;
  color: #d1d5db;
  line-height: 1.6;
}

.chip {
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #9ca3af;
}

footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.form {
  margin-top: 1rem;
  display: grid;
  gap: 0.9rem;
  max-width: 420px;
}

.form label span {
  display: block;
  font-size: 0.85rem;
  color: #a3a3a3;
  margin-bottom: 0.25rem;
}

.form input[type="text"],
.form input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 0.6rem;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
}

/* Selects style (form + tableaux admin) */
.form select,
.user-table select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.9rem;
  outline: none;
  appearance: none;
  /* enlève le style natif */
  -moz-appearance: none;
  -webkit-appearance: none;
}

/* Petit chevron custom via background (optionnel) */
.form select {
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7L10 12L15 7' stroke='%23e5e7eb' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px;
  padding-right: 2rem;
  /* pour ne pas que le texte passe sous l’icône */
}

.form select:focus,
.user-table select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.5);
}

.form button {
  border: none;
  border-radius: 0.6rem;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
  background: #38bdf8;
  color: #0f172a;
}

.linklike {
  background: transparent;
  border: 1px solid #4b5563;
  color: #e5e7eb;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
}

.error {
  margin-top: 0.6rem;
  margin-bottom: 0.6rem;
  color: #fca5a5;
  font-size: 0.9rem;
}

.hint {
  margin-top: 0.8rem;
  color: #a3a3a3;
  font-size: 0.85rem;
}

/* Tableau de gestion des utilisateurs + général */
.user-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.2rem;
  font-size: 0.9rem;
}

.user-table thead {
  background: #020617;
}

.user-table th,
.user-table td {
  padding: 0.55rem 0.75rem;
  /* hauteur de base, utilisée partout */
  text-align: left;
  border-bottom: 1px solid #1f2937;
}

.user-table th {
  font-weight: 600;
  color: #9ca3af;
}

.user-table tbody tr:hover {
  background: #020617;
}

/* Ligne d'actions dans le tableau */
.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

/* Inputs dans le tableau */
.user-table input[type="text"],
.user-table input[type="password"] {
  padding: 0.35rem 0.5rem;
  border-radius: 0.45rem;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.85rem;
}

/* Boutons réutilisables */
.btn {
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s ease;
}

.btn-primary {
  background: #38bdf8;
  color: #0f172a;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(56, 189, 248, 0.4);
  background: #0ea5e9;
}

.btn-outline {
  background: transparent;
  color: #e5e7eb;
  border: 1px solid #4b5563;
}

.btn-outline:hover {
  background: #111827;
}

.btn-danger {
  background: #b91c1c;
  color: #fee2e2;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Pour le gros bouton "Créer" */
.form button[type="submit"] {
  width: 100%;
  border-radius: 999px;
}

.user-actions-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  /* espace entre les boutons */
}

.user-actions-row form {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  /* espace interne entre inputs */
}

.user-actions-row .btn {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.prono-correct {
  color: #22c55e;
  /* vert */
  font-weight: 600;
}

.prono-partial {
  color: #f59e0b;
  /* orange */
  font-weight: 600;
}

.prono-wrong {
  color: #ef4444;
  /* rouge */
  font-weight: 600;
}

.evo-up {
  color: #22c55e;
  font-weight: 600;
}

.evo-down {
  color: #ef4444;
  font-weight: 600;
}

.evo-same {
  color: #9ca3af;
  font-weight: 500;
}

.team-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 6px;
  margin-left: 6px;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.3));
}

/* Badge Week dans le tableau admin */
.chip-week {
  border-color: #38bdf8;
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.07);
  font-size: 0.78rem;
}

/* Bloc d’actions pour chaque prono */
.prono-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Formulaire d’édition compact en grille */
.prono-edit-form {
  display: grid;
  grid-template-columns:
    minmax(160px, 1.5fr)
    /* date */
    minmax(110px, 1fr)
    /* team1 */
    minmax(110px, 1fr)
    /* team2 */
    90px
    /* bo */
    70px
    /* week */
    minmax(110px, 1.2fr)
    /* result */
    auto;
  /* bouton */
  gap: 0.4rem;
  align-items: center;
}

/* Le bouton "Enregistrer" reste compact */
.prono-edit-form .btn {
  white-space: nowrap;
}

/* Formulaire de suppression en dessous, plus discret */
.prono-delete-form {
  align-self: flex-start;
}

/* Mini bouton delete */
.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
}

/* Main plus large pour les pages admin */
main.admin-main {
  max-width: 1500px;
}

/* Zebra effect pour le tableau du classement / général */
.user-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
  /* très léger */
}

.user-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.045);
  /* un peu plus clair */
}

.user-table tbody tr {
  transition: background 0.15s ease;
}

.user-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.08);
  /* survol */
}

/* Bulle de couleur devant les pseudos */
.user-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

.user-name-colored {
  font-weight: 500;
}

/* Ligne qui a déjà un prono (mode lock) */
.prono-row-has-value .prono-input[readonly] {
  background-color: #020617;
  border-color: #38bdf8;
  color: #e5e7eb;
  cursor: default;
}

/* Ligne en édition */
.prono-row-editing {
  background-color: rgba(56, 189, 248, 0.10);
  /* bleu très léger */
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6) inset;
}

.edit-badge {
  margin-left: 10px;
  padding: 3px 8px;
  background-color: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
  border-radius: 12px;
  font-size: 0.75rem;
}

.week-pagination {
  margin: 1rem 0 2rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.week-link {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 0.85rem;
  text-decoration: none;
  color: #e5e7eb;
}

.week-link:hover {
  border-color: #38bdf8;
}

.week-link.active-week {
  background-color: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
}

/* ============================
   TABLEAU GENERAL PRONOS
   ============================ */

.user-table.general-table {
  width: 100%;
  table-layout: fixed;
  /* colonnes de largeur identique */
}

/* Centre tous les scores par défaut */
.user-table.general-table th,
.user-table.general-table td {
  text-align: center;
}

/* Date & Match : alignés à gauche, textes autorisés à passer à la ligne */
.user-table.general-table th:nth-child(1),
.user-table.general-table td:nth-child(1),
.user-table.general-table th:nth-child(2),
.user-table.general-table td:nth-child(2) {
  text-align: left;
  white-space: normal;
}

/* Colonnes de pronos + Résultat : une seule ligne (évite les empilements de "2 - 0") */
.user-table.general-table th:nth-child(n+3),
.user-table.general-table td:nth-child(n+3) {
  white-space: nowrap;
}

/* Case SANS prono */
.user-table.general-table td.no-pick {
  background-color: #4b1212;
  /* rouge pour "tu n'as rien mis" */
  color: #fee2e2;
}

/* Couleurs de fond des cases selon le statut du prono (quand il y a un pick) */
.user-table.general-table td.cell-correct {
  background-color: #065f46;
  /* vert */
}

.user-table.general-table td.cell-partial {
  background-color: #4b3b16;
  /* jaune/brun */
}

.user-table.general-table td.cell-wrong {
  background-color: #4b1212;
  /* rouge foncé pour mauvais prono */
}

/* Cases "À venir" pour les matchs non joués (Week future) */
.user-table.general-table td.upcoming-cell {
  color: #9ca3af;
  font-style: italic;
  text-align: center;
  background: transparent;
}

.brand-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  margin-right: 8px;
  vertical-align: middle;
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.4));
}

.week-separator td {
  background: #0f172a;
  color: #38bdf8;
  font-weight: bold;
  text-align: center;
  padding: 0.6rem;
}

.day-separator td {
  background: #020617;
  color: #94a3b8;
  font-weight: 600;
  text-align: center;
  font-size: 0.9rem;
}

.week-details, .day-details {
  margin: 0.75rem 0;
}

.week-summary {
  cursor: pointer;
  font-weight: 800;
  padding: 0.6rem 0.8rem;
  background: #0f172a;
  color: #38bdf8;
  border-radius: 10px;
}

.day-summary {
  cursor: pointer;
  font-weight: 700;
  padding: 0.5rem 0.8rem;
  background: #020617;
  color: #94a3b8;
  border-radius: 10px;
  margin-top: 0.6rem;
}

.week-content, .day-content {
  margin-top: 0.6rem;
}

.form-input {
  width: 100%;
  background-color: #020617;
  color: #e5e7eb;
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 0.7rem 0.9rem;
}

.user-table tbody tr {
  height: 84px;              /* hauteur fixe */
  vertical-align: middle;
}

.user-table td {
  padding: 1rem 0.75rem;
  vertical-align: middle;
}

.prono-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  min-width: 220px;
}

.week-toggle td {
  background: #0f172a;
  color: #38bdf8;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
  padding: 0.75rem 0.9rem;
}

.day-toggle td {
  background: #020617;
  color: #94a3b8;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  padding: 0.6rem 0.9rem;
}
