/* ── Page header ──────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
}
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* ── Admin toolbar ────────────────────────────────── */
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  white-space: nowrap;
}
.action-btn:hover:not(:disabled) {
  background: #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.action-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.action-btn--green {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}
.action-btn--green:hover:not(:disabled) { background: #bbf7d0; }
.action-btn--blue {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}
.action-btn--blue:hover:not(:disabled) { background: #bfdbfe; }
.action-btn--red {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}
.action-btn--red:hover:not(:disabled) { background: #fecaca; }
.action-btn--pending {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde047;
  opacity: .75;
  cursor: not-allowed;
}
.action-btn.action-btn--pending:hover {
  background: #fef9c3;
  box-shadow: none;
}
.btn-launch-hint {
  font-size: 12px;
  color: #854d0e;
  font-style: italic;
}

.phase-short { display: none; }

@media (max-width: 640px) {
  .admin-toolbar {
    gap: 6px;
  }
  .action-btn {
    flex: 1;
    justify-content: center;
    min-width: 0;
    padding: 8px 10px;
    font-size: 12px;
  }
  .phase-detail { display: none; }
  .phase-short  { display: inline; }
}

/* ── Tabs ─────────────────────────────────────────── */
.tabs {
	display: flex;
	gap: 4px;
	border-bottom: 2px solid #e2e8f0;
	margin-bottom: 24px;
}
.tab {
	padding: 10px 20px;
	cursor: pointer;
	font-weight: 600;
	font-size: 13px;
	color: #64748b;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	transition: color .15s, border-color .15s;
	border-radius: 6px 6px 0 0;
}
.tab:hover { color: #1e293b; }
.tab.active {
	border-bottom-color: #2563eb;
	color: #2563eb;
}
.tab-content {
	display: none;
	animation: fadeIn 0.2s ease;
}
.tab-content.active { display: block; }
@keyframes fadeIn {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── Group blocks ─────────────────────────────────── */
.groups-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(480px, 100%), 1fr));
	gap: 20px;
}
.league-group {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.league-group-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
}
.league-group-header h3 {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	color: #1e293b;
	text-transform: uppercase;
	letter-spacing: .05em;
}

/* ── Ranking table ────────────────────────────────── */
.ranking-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}
.ranking-table thead th {
	padding: 8px 12px;
	text-align: center;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: #94a3b8;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
}
.ranking-table thead th:first-child { text-align: left; padding-left: 16px; }
.ranking-table tbody tr {
	border-bottom: 1px solid #f1f5f9;
	transition: background .15s;
}
.ranking-table tbody tr:last-child { border-bottom: none; }
.ranking-table tbody tr:hover { background: #f8fafc; }
.ranking-table td {
	padding: 10px 12px;
	text-align: center;
	color: #475569;
}
.ranking-table td:first-child { text-align: left; padding-left: 16px; }

/* Rank badge */
.rank-cell {
	font-weight: 700;
	color: #94a3b8;
	font-size: 12px;
	width: 28px;
}
.rank-1 { color: #f59e0b; }
.rank-2 { color: #94a3b8; }
.rank-3 { color: #b45309; }

/* Team cell */
.team-cell-name {
	display: flex;
	align-items: center;
	gap: 10px;
}
.team-cell-name img {
	width: 28px; height: 28px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	background: #e2e8f0;
}
.team-cell-name .team-init-sm {
	width: 28px; height: 28px;
	border-radius: 50%;
	background: #94a3b8;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	display: flex; align-items: center; justify-content: center;
	flex-shrink: 0;
}
.team-cell-name span { font-weight: 600; color: #1e293b; }

/* Stat cells */
.stat-w { color: #16a34a; font-weight: 700; }
.stat-d { color: #64748b; }
.stat-l { color: #dc2626; font-weight: 700; }
.stat-gd { color: #475569; }
.stat-pts {
	font-weight: 800;
	font-size: 14px;
	color: #1e293b;
}

/* Add team button */
.btn-add-team {
	margin: 10px 16px 12px;
	padding: 6px 14px;
	font-size: 12px;
	background: #eff6ff;
	color: #2563eb;
	border: 1px solid #bfdbfe;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 600;
	transition: background .15s;
}
.btn-add-team:hover { background: #dbeafe; }

@media (max-width: 640px) {
  .groups-grid { gap: 12px; }

  .ranking-table { font-size: 11px; }

  .ranking-table thead th {
    padding: 6px 4px;
    font-size: 10px;
    letter-spacing: 0;
  }
  .ranking-table thead th:first-child { padding-left: 10px; }

  .ranking-table td {
    padding: 8px 4px;
  }
  .ranking-table td:first-child { padding-left: 10px; }

  .rank-cell { width: 18px; font-size: 11px; }

  .team-cell-name { gap: 6px; }
  .team-cell-name img,
  .team-cell-name .team-init-sm {
    width: 22px; height: 22px;
    font-size: 8px;
  }
  .team-cell-name span {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stat-pts { font-size: 12px; }
}



/* Overlay sombre derrière la modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: none; /* cachée par défaut */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* La modal en elle-même */
.modal {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease;
    position: relative;
}

/* Animation légère à l’apparition */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Titre de la modal */
.modal h2 {
    margin-top: 0;
    font-size: 1.4rem;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Bouton de fermeture (X) */
.modal-close {
    position: absolute;
    top: 12px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close:hover {
    color: #000;
}

/* Champs du formulaire */
.modal form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.modal label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #444;
}

.modal input, 
.modal select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.modal input:focus, 
.modal select:focus {
    border-color: #4a90e2;
    outline: none;
}

/* Boutons */
.modal .btn {
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.3s;
}

.modal .btn-primary {
	margin-top: 20px;
    background: #4a90e2;
    color: #fff;
}
.modal .btn-primary:hover {
    background: #357ABD;
}

.modal .btn-secondary {
	margin-top: 20px;
    background: #f0f0f0;
    color: #333;
}
.modal .btn-secondary:hover {
    background: #ddd;
}

/* Responsive */
@media (max-width: 480px) {
    .modal {
        width: 95%;
        padding: 15px;
    }
    .modal h2 {
        font-size: 1.2rem;
    }
}

