/* ══════════════════════════════════════
   ADMIN LAYOUT
══════════════════════════════════════ */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 60px);
}

/* ── Sidebar ── */
.admin-sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.sidebar-group {
  margin-bottom: 4px;
}
.sidebar-group__label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 16px 4px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--t) var(--ease), background var(--t) var(--ease);
  border-left: 2px solid transparent;
  margin: 1px 0;
}
.sidebar-link:hover { color: var(--text); background: var(--bg-2); }
.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
}
.sidebar-link__icon { font-size: 1rem; opacity: 0.8; }

/* ── Main content ── */
.admin-main {
  padding: 28px 32px;
  overflow-y: auto;
}

.admin-section { display: none; }
.admin-section.active { display: block; }

.admin-section__title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}
.admin-section__sub {
  font-size: 0.85rem;
  color: var(--text-2);
  margin-bottom: 24px;
}

/* ── Toolbar ── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar__start { flex: 1; display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar__end   { display: flex; gap: 8px; }

/* ── Admin stat cards ── */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 900px) { .admin-stats { grid-template-columns: repeat(2, 1fr); } }

.admin-stat {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
}
.admin-stat__val {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
  line-height: 1;
}
.admin-stat__label {
  font-size: 0.75rem;
  color: var(--text-3);
  font-weight: 500;
  margin-top: 5px;
}

/* ── Player row in add-list ── */
.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition: border-color var(--t) var(--ease);
  gap: 10px;
}
.player-row:hover { border-color: var(--border-2); }
.player-row__name { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.player-row__tag  { font-size: 0.75rem; color: var(--accent); font-weight: 500; }

/* ── Match editor row ── */
.match-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.match-row:last-child { border-bottom: none; }
.match-row__name  { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.match-row__name--win { color: var(--green); }
.match-row__vs    { font-size: 0.75rem; color: var(--text-3); font-weight: 600; }
.match-round-head {
  padding: 8px 16px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}

/* ── Participant chip ── */
.participant-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  transition: border-color var(--t) var(--ease);
}
.participant-chip:hover { border-color: var(--border-2); }
.participant-chip__num {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-3);
  min-width: 16px;
  text-align: center;
}
.participant-chip__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 0.75rem;
  padding: 0 0 0 4px;
  line-height: 1;
  transition: color var(--t) var(--ease);
}
.participant-chip__remove:hover { color: var(--red); }

/* ── Participant list (flex-wrap container) ── */
.participant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ══════════════════════════════════════
   RESPONSIVE ADMIN
══════════════════════════════════════ */
@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    overflow-x: auto;
    padding: 8px;
    gap: 2px;
  }
  .sidebar-group__label { display: none; }
  .sidebar-group { display: contents; }
  .sidebar-link {
    border-left: none;
    border-radius: var(--r);
    white-space: nowrap;
    flex-shrink: 0;
    border-bottom: 2px solid transparent;
  }
  .sidebar-link.active {
    background: var(--accent-dim);
    border-bottom-color: var(--accent);
    border-left-color: transparent;
  }
  .admin-main { padding: 20px 16px; }
}
