@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800;900&family=DM+Sans:wght@400;500;600&display=swap');

/* ── Variables ─────────────────────────────── */
:root {
  --primary:       #1E3A5F;
  --primary-dark:  #152D4A;
  --primary-light: #E8EFF7;
  --accent:        #F5A623;
  --accent-light:  #FFF8EB;
  --orange:        #F59E0B;
  --orange-light:  #FEF3C7;
  --danger:        #DC2626;
  --danger-light:  #FEF2F2;
  --bg:            #F4F6FB;
  --surface:       #FFFFFF;
  --border:        #E2E8F0;
  --border-soft:   #F1F5F9;
  --ink:           #0F172A;
  --muted:         #64748B;
  --dim:           #94A3B8;
  --cl-color:      #D97706;
  --cl-light:      #FFFBEB;
  --el-color:      #EA580C;
  --el-light:      #FFF7ED;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 1px 3px rgba(15,23,42,.06), 0 4px 12px rgba(15,23,42,.06);
  --shadow-md:     0 4px 16px rgba(15,23,42,.10);
  --shadow-lg:     0 8px 32px rgba(15,23,42,.12);
  --sidebar-w:     260px;
  --header-h:      0px;
  --font-body:     'DM Sans', system-ui, sans-serif;
  --font-heading:  'Outfit', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg); color: var(--ink); line-height: 1.6; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-dark); }

/* ── Auth layout ──────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 2rem 1rem;
}
.auth-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-logo .logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto 1rem;
  box-shadow: 0 4px 16px rgba(30,58,95,.3);
}
.auth-logo h1 { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 900; color: var(--ink); }
.auth-logo p  { color: var(--muted); font-size: .9rem; margin-top: .25rem; }

/* ── App shell (authenticated) ─────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ───────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  box-shadow: var(--shadow);
}
.sidebar::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  flex-shrink: 0;
}
.sidebar-logo {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(30,58,95,.25);
}
.logo-name-wrap {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.sidebar-logo .logo-name {
  font-family: var(--font-heading);
  font-size: .95rem; font-weight: 900; color: var(--ink); letter-spacing: -.02em;
  line-height: 1.1;
}
.sidebar-logo .logo-name span { color: var(--primary); }
.logo-version-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-heading); font-size: .58rem;
  font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--primary); line-height: 1;
}
.logo-version-tag span {
  background: var(--primary); color: #fff;
  border-radius: 4px; padding: 1px 5px; font-size: .58rem; font-weight: 800;
}

/* Infos tournoi dans sidebar */
.sidebar-tournament {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.sidebar-tournament-name {
  font-family: var(--font-heading);
  font-size: .85rem; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-tournament-status {
  font-size: .7rem; color: var(--muted); margin-top: 2px;
}

/* Nav */
.sidebar-nav { flex: 1; padding: 10px 10px; overflow-y: auto; }
.nav-section-label {
  font-size: .62rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--dim);
  padding: 10px 8px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: .875rem; font-weight: 500;
  transition: all .15s; margin-bottom: 1px;
  text-decoration: none;
}
.nav-item:hover { background: var(--primary-light); color: var(--primary-dark); text-decoration: none; }
.nav-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--primary); color: #fff;
  font-size: .65rem; font-weight: 700; padding: 1px 6px; border-radius: 10px;
}
.nav-item.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-weight: 700; font-size: .8rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong { display: block; font-size: .8rem; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info small { font-size: .68rem; color: var(--muted); }
.btn-logout { color: var(--muted); font-size: 1rem; line-height: 1; transition: color .15s; flex-shrink: 0; background: none; border: none; cursor: pointer; padding: 4px; }
.btn-logout:hover { color: var(--danger); }

/* ── Main content ──────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.main-topbar { display: none; }
.main-topbar::after {
  content: '';
  position: absolute; bottom: -3px; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.topbar-title { font-family: var(--font-heading); font-size: .95rem; font-weight: 700; color: var(--ink); }
.topbar-actions { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); }

.page-body { padding: 2rem; flex: 1; }

/* ── Page header ───────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.page-title { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 800; color: var(--ink); letter-spacing: -.03em; line-height: 1.2; }
.page-subtitle { color: var(--muted); font-size: .9rem; margin-top: 4px; }

/* ── Cards ─────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-body { padding: 20px 24px; }
.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h2 { font-family: var(--font-heading); font-size: .95rem; font-weight: 700; margin: 0; }

/* Tournament cards on home */
.tournament-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: block;
  text-decoration: none;
  transition: all .18s;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.tournament-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.tournament-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--primary);
  text-decoration: none;
}
.tournament-card-name {
  font-family: var(--font-heading);
  font-size: 1rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em;
  margin-bottom: 12px;
}

/* Stat pills */
.stat-pill {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  text-align: center;
  display: flex; flex-direction: column;
}
.stat-pill-value { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 800; line-height: 1; }
.stat-pill-label { font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 2px; font-weight: 600; }

/* ── Stat cards ─────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-card-value { font-family: var(--font-heading); font-size: 2rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 4px; }
.stat-card-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }

/* ── Grid ───────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 768px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } .grid-2 { grid-template-columns: 1fr; } }

/* ── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 600; line-height: 1;
  cursor: pointer; border: none; transition: all .15s;
  text-decoration: none; white-space: nowrap; font-family: var(--font-body);
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(30,58,95,.25); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(30,58,95,.35); transform: translateY(-1px); color: #fff; text-decoration: none; }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.25); }
.btn-accent:hover { background: #1D4ED8; color: #fff; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; color: #fff; text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: .95rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* ── Forms ──────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.form-group label { font-size: .82rem; font-weight: 700; color: var(--ink); }
.form-hint { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=time],
select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem; font-family: var(--font-body);
  background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,58,95,.12);
}
input.error { border-color: var(--danger); }

/* ── Alerts ─────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: .875rem; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 8px;
}
.alert-success { background: var(--primary-light); color: #14532D; border: 1px solid #86EFAC; }
.alert-error, .alert-danger { background: var(--danger-light); color: #991B1B; border: 1px solid #FCA5A5; }
.alert-info { background: var(--accent-light); color: #1E40AF; border: 1px solid #93C5FD; }
.alert-warning { background: var(--orange-light); color: #92400E; border: 1px solid #FCD34D; }

/* ── Badges ─────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: .7rem; font-weight: 700; letter-spacing: .04em;
}
.badge-green  { background: var(--primary-light); color: #14532D; }
.badge-blue   { background: var(--accent-light);   color: #1E40AF; }
.badge-orange { background: var(--orange-light);    color: #92400E; }
.badge-yellow { background: #FEF9C3;               color: #713F12; }
.badge-red    { background: var(--danger-light);    color: #991B1B; }
.badge-gray   { background: #F1F5F9;               color: var(--muted); }
.badge-cl     { background: var(--cl-light);        color: var(--cl-color); border: 1px solid var(--cl-color)30; }
.badge-el     { background: var(--el-light);        color: var(--el-color); border: 1px solid var(--el-color)30; }

/* ── Tables ─────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
  background: var(--bg); padding: 10px 14px;
  text-align: left; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); }

/* ── Match cards ────────────────────────────── */
.match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  transition: box-shadow .15s;
}
.match-card:hover { box-shadow: var(--shadow-md); }
.match-card.played { border-left: 3px solid var(--primary); }
.match-team {
  flex: 1; min-width: 0;
  font-weight: 600; font-size: .9rem;
  display: flex; align-items: center; gap: 8px;
}
.match-team.away { justify-content: flex-end; text-align: right; }
.team-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.match-score {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.score-box {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 6px; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 800; font-size: .95rem;
}
.score-box.winner { background: var(--primary); border-color: var(--primary); color: #fff; }
.score-sep { color: var(--dim); font-weight: 700; font-size: .8rem; }
.match-meta { font-size: .72rem; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pitch-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent-light); color: var(--accent);
  border-radius: 10px; padding: 2px 8px; font-size: .68rem; font-weight: 600;
}
.time-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--orange-light); color: var(--cl-color);
  border-radius: 10px; padding: 2px 8px; font-size: .68rem; font-weight: 600;
}

/* ── Score input inline ─────────────────────── */
.score-input {
  width: 46px; height: 38px; text-align: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 1rem;
  padding: 0; border: 1.5px solid var(--border); border-radius: 6px;
}
.score-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.12); }

/* ── Standings table ────────────────────────── */
.standings-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.pos-cl td:first-child { border-left: 3px solid var(--cl-color); }
.pos-el td:first-child { border-left: 3px solid var(--el-color); }
.pos-out td:first-child { border-left: 3px solid var(--dim); }

/* ── Bracket ────────────────────────────────── */
.bracket-wrap { overflow-x: auto; padding-bottom: 1rem; }
.bracket { display: flex; gap: 2rem; align-items: flex-start; }
.bracket-round { display: flex; flex-direction: column; gap: 1rem; min-width: 240px; }
.bracket-round-label {
  font-family: var(--font-heading); font-size: .73rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  margin-bottom: .5rem; text-align: center;
  white-space: nowrap;
}
.bracket-match {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow);
}
.bracket-team {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; font-size: .85rem; font-weight: 500; gap: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.bracket-team:last-child { border-bottom: none; }
.bracket-team.winner { background: var(--primary-light); font-weight: 700; color: var(--primary-dark); }
.bracket-team-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bracket-score { font-family: var(--font-heading); font-weight: 800; color: var(--ink); min-width: 20px; text-align: right; }
.bracket-meta { padding: 5px 12px; background: var(--bg); font-size: .65rem; color: var(--muted); display: flex; gap: 8px; }

/* ── Planning grid ──────────────────────────── */
.planning-grid { display: grid; gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; }
.planning-header { background: var(--bg); padding: 10px 14px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: center; }
.planning-cell { background: var(--surface); padding: 8px; min-height: 60px; }
.planning-match-slot {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 6px 8px; font-size: .75rem;
  margin-bottom: 4px; cursor: default;
}
.planning-match-slot .teams { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planning-match-slot .time  { font-size: .65rem; color: var(--muted); }
.planning-time-col { background: var(--bg); padding: 8px 10px; font-size: .78rem; font-weight: 600; color: var(--muted); display: flex; align-items: center; white-space: nowrap; }

/* ── Stepper ────────────────────────────────── */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 28px; overflow-x: auto; }
.step {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; font-size: .8rem; font-weight: 600;
  color: var(--dim); white-space: nowrap;
}
.step-num {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 2px solid var(--border);
  font-weight: 800; font-size: .75rem; flex-shrink: 0;
}
.step.done .step-num  { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.done            { color: var(--primary); }
.step.active .step-num{ background: var(--accent); border-color: var(--accent); color: #fff; }
.step.active          { color: var(--accent); }
.step-arrow { color: var(--border); font-size: .8rem; flex-shrink: 0; }

/* ── Pitch cards ────────────────────────────── */
.pitch-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  transition: all .15s;
}
.pitch-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.pitch-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(30,58,95,.25);
}

/* ── Empty state ────────────────────────────── */
.empty-state { padding: 56px 24px; text-align: center; }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 800; margin-bottom: 6px; }
.empty-state p   { color: var(--muted); font-size: .875rem; margin-bottom: 16px; }

/* ── Divider ────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Utils ──────────────────────────────────── */
.text-muted  { color: var(--muted); }
.text-xs     { font-size: .75rem; }
.text-sm     { font-size: .875rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.w-full { width: 100%; }

/* Team color swatch */
.color-swatch { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ── Progress bar ───────────────────────────── */
.progress-bar {
  height: 6px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 6px; background: var(--primary); border-radius: 3px;
  transition: width .4s ease;
}

/* ── Team avatar ────────────────────────────── */
.team-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: .7rem; flex-shrink: 0;
}
.team-avatar-sm { width: 24px; height: 24px; border-radius: 6px; font-size: .6rem; }

/* ── Standings position dots ─────────────────── */
.standing-pos {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 800; flex-shrink: 0;
}
.pos-cl { background: var(--cl-color); color: #fff; }
.pos-el { background: var(--el-color); color: #fff; }
.pos-out { background: var(--border); color: var(--muted); }

/* ── CL / EL buttons ─────────────────────────── */
.btn-cl {
  background: var(--cl-light); color: var(--cl-color);
  border: 1px solid color-mix(in srgb, var(--cl-color) 30%, transparent);
}
.btn-cl:hover { background: color-mix(in srgb, var(--cl-color) 15%, white); color: var(--cl-color); text-decoration: none; }
.btn-el {
  background: var(--el-light); color: var(--el-color);
  border: 1px solid color-mix(in srgb, var(--el-color) 30%, transparent);
}
.btn-el:hover { background: color-mix(in srgb, var(--el-color) 15%, white); color: var(--el-color); text-decoration: none; }

/* ── Qualified cards ─────────────────────────── */
.qualified-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.qualified-card.cl { border-top: 3px solid var(--cl-color); }
.qualified-card.el { border-top: 3px solid var(--el-color); }
.qualified-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 16px; border-bottom: 1px solid var(--border-soft);
}
.qualified-row:last-child { border-bottom: none; }

/* ── Seed badge ──────────────────────────────── */
.seed-badge {
  background: var(--orange-light); color: var(--cl-color);
  font-size: .72rem; font-weight: 800;
  padding: 3px 8px; border-radius: 10px;
}

/* ── Match form inputs ───────────────────────── */
.score-box-input {
  width: 46px; height: 38px; text-align: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 1rem;
  padding: 0; border: 1.5px solid var(--border); border-radius: 6px;
  background: var(--surface);
}
.score-box-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(30,58,95,.12); }

/* ── Match winner/loser highlight ───────────── */
.match-winner { font-weight: 800 !important; color: var(--ink) !important; }
.match-loser  { color: var(--dim) !important; }

/* ── Bracket wrapper ─────────────────────────── */
.bracket-wrapper { overflow-x: auto; padding-bottom: 16px; }
.bracket-round-title {
  font-family: var(--font-heading); font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: .5rem; text-align: center;
}
.match-status-played { border-left: 3px solid var(--primary); }

/* ── Tags ────────────────────────────────────── */
.tag {
  display: inline-flex; padding: 3px 8px; border-radius: 6px;
  font-size: .72rem; font-weight: 600;
}

/* ── Steps (old style compat) ────────────────── */
.steps {
  display: flex; flex-wrap: wrap; gap: 0;
  margin-bottom: 24px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.steps .step {
  padding: 10px 16px; font-size: .8rem; font-weight: 600;
  color: var(--dim); border-right: 1px solid var(--border);
  flex: 1; text-align: center; min-width: 80px;
}
.steps .step:last-child { border-right: none; }
.steps .step.done   { background: var(--primary-light); color: var(--primary-dark); }
.steps .step.active { background: var(--accent-light);  color: var(--accent); }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 220px; }
}
@media (max-width: 640px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════
   ── Custom Modal System ─────────────────────
   ══════════════════════════════════════════════ */

.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.modal-overlay.open {
  opacity: 1; pointer-events: all;
}
.modal-box {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15,23,42,.18), 0 4px 16px rgba(15,23,42,.10);
  padding: 0;
  width: 100%; max-width: 420px;
  transform: scale(.94) translateY(8px);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .18s ease;
  opacity: 0;
  overflow: hidden;
}
.modal-overlay.open .modal-box {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Icon header */
.modal-icon-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 28px 28px 0;
}
.modal-icon {
  width: 56px; height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.modal-icon.danger  { background: var(--danger-light); }
.modal-icon.warning { background: var(--orange-light); }
.modal-icon.info    { background: var(--primary-light); }
.modal-icon.success { background: var(--primary-light); }

/* Content */
.modal-content {
  padding: 18px 28px 0;
  text-align: center;
}
.modal-title {
  font-family: var(--font-heading);
  font-size: 1.1rem; font-weight: 800;
  color: var(--ink); margin-bottom: 8px;
}
.modal-message {
  font-size: .88rem; color: var(--muted);
  line-height: 1.55;
}
.modal-detail {
  margin-top: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
}

/* Actions */
.modal-actions {
  display: flex; gap: 10px;
  padding: 22px 28px 24px;
  justify-content: flex-end;
}
.modal-actions .btn { min-width: 90px; justify-content: center; }
.modal-btn-cancel {
  background: var(--bg); color: var(--muted);
  border: 1.5px solid var(--border);
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.modal-btn-cancel:hover { background: var(--border); color: var(--ink); }
.modal-btn-confirm {
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .88rem; font-weight: 700;
  cursor: pointer; border: none; transition: all .15s;
  display: flex; align-items: center; gap: 6px;
}
.modal-btn-confirm.danger  { background: var(--danger);  color: #fff; }
.modal-btn-confirm.danger:hover  { background: #b91c1c; }
.modal-btn-confirm.warning { background: var(--orange); color: #fff; }
.modal-btn-confirm.warning:hover { background: #d97706; }
.modal-btn-confirm.primary { background: var(--primary); color: #fff; }
.modal-btn-confirm.primary:hover { background: var(--primary-dark); }
.modal-btn-confirm.info    { background: var(--accent);  color: #fff; }

/* ══════════════════════════════════════════════════════════════
   ── DARK MODE ───────────────────────────────────────────────
   ══════════════════════════════════════════════════════════════ */

html[data-dark] body, body.dark {
  --bg:          #0F172A;
  --surface:     #1E293B;
  --border:      #334155;
  --border-soft: #1E293B;
  --ink:         #F1F5F9;
  --muted:       #94A3B8;
  --dim:         #475569;
  --primary-light: rgba(30,58,95,.15);
  --accent-light:  rgba(37,99,235,.15);
  --orange-light:  rgba(245,158,11,.15);
  --danger-light:  rgba(220,38,38,.15);
  --cl-light:    rgba(217,119,6,.12);
  --el-light:    rgba(234,88,12,.12);
  --shadow:      0 1px 3px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.3);
  --shadow-md:   0 4px 16px rgba(0,0,0,.4);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.5);
}

html[data-dark] .card, body.dark .card,
body.dark .sidebar,
body.dark .auth-box,
body.dark .modal-box { background: var(--surface); }

body.dark input,
body.dark select,
body.dark textarea {
  background: #0F172A;
  color: var(--ink);
  border-color: var(--border);
}
body.dark input:focus,
body.dark select:focus { border-color: var(--primary); }

body.dark .nav-item:hover,
body.dark .nav-item.active { background: rgba(255,255,255,.06); }

body.dark .btn-ghost { color: var(--muted); border-color: var(--border); }
body.dark .btn-ghost:hover { background: rgba(255,255,255,.08); }

body.dark .score-box { background: #0F172A; color: var(--ink); }
body.dark .match-card { background: var(--surface); border-color: var(--border); }
body.dark .bracket-match { background: var(--surface); }
body.dark .bracket-team { background: var(--surface); }
body.dark .bracket-team.winner { background: rgba(30,58,95,.15); }

body.dark .pub-tab { color: var(--muted); border-color: var(--border); }
body.dark .pub-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Dark mode toggle button */
.dark-toggle {
  width: 36px; height: 20px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: background .2s;
  border: none;
  flex-shrink: 0;
}
.dark-toggle.on { background: var(--primary); }
.dark-toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.dark-toggle.on::after { transform: translateX(16px); }

/* ══════════════════════════════════════════════════════════════
   ── SIDEBAR LOGO v0.5 ────────────────────────────────────────
   Remplace .sidebar-logo + .logo-name-wrap
   ══════════════════════════════════════════════════════════════ */

.sidebar-logo {
  padding: 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  overflow: hidden;
}

/* Bande dégradée en haut avec le nom */
.sidebar-logo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}
.sidebar-logo-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
  overflow: hidden;
  backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255,255,255,.3);
}
.sidebar-logo-icon img { width: 28px; height: 28px; object-fit: contain; border-radius: 4px; }
.sidebar-logo-name-wrap { flex: 1; min-width: 0; }
.sidebar-logo-appname {
  font-family: var(--font-heading);
  font-size: 1rem; font-weight: 900;
  color: #fff;
  letter-spacing: -.02em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Badge BETA 0.5 */
.sidebar-logo-version {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 3px;
}
.sidebar-logo-version .v-label {
  font-family: var(--font-heading);
  font-size: .58rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.75);
}
.sidebar-logo-version .v-number {
  background: rgba(255,255,255,.25);
  color: #fff;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--font-heading);
  font-size: .6rem; font-weight: 800;
  letter-spacing: .04em;
  border: 1px solid rgba(255,255,255,.3);
}

/* ── Annonces ────────────────────────────────────────────────── */
.announcement {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  font-size: .85rem;
  margin-bottom: 8px;
}
.announcement.info    { background: var(--accent-light); border-color: var(--accent); }
.announcement.warning { background: var(--orange-light); border-color: var(--orange); }
.announcement.success { background: var(--primary-light); border-color: var(--primary); }
.announcement .ann-msg { flex: 1; font-weight: 600; color: var(--ink); }
.announcement .ann-meta { font-size: .7rem; color: var(--muted); margin-top: 2px; }

/* ── Live indicator ─────────────────────────────────────────── */
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger);
  display: inline-block;
  animation: live-pulse 1.4s infinite;
}
@keyframes live-pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.4; transform:scale(.7); }
}

/* Alias for no-flash dark mode */
html[data-dark] body { --bg:#0F172A;--surface:#1E293B;--border:#334155;--border-soft:#1E293B;--ink:#F1F5F9;--muted:#94A3B8;--dim:#475569; }
