/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f0f2f5;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --text-primary: #1e293b;
  --text-secondary: #334155;
  --text-muted: #475569;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --green: #16a34a;
  --green-bg: rgba(22, 163, 74, 0.08);
  --red: #dc2626;
  --red-bg: rgba(220, 38, 38, 0.08);
  --yellow: #ca8a04;
  --yellow-bg: rgba(202, 138, 4, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-card: #1e2130;
  --bg-hover: #252836;
  --border: #2d3148;
  --border-hover: #3d4260;
  --text-primary: #e8eaf0;
  --text-secondary: #c0c4d0;
  --text-muted: #a8adb8;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.12);
  --yellow: #eab308;
  --yellow-bg: rgba(234, 179, 8, 0.12);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  flex-shrink: 0;
}

.sidebar-brand-logo {
  height: 60px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  line-height: 1.2;
  flex: 1;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.sidebar-section:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 8px 12px 4px;
  opacity: 0.6;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}

.sidebar-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-link:hover {
  color: var(--accent);
  background: rgba(59, 130, 246, 0.06);
}

.sidebar-link:hover svg {
  opacity: 1;
}

.sidebar-link.active {
  color: #fff;
  background: var(--accent);
}

.sidebar-link.active svg {
  opacity: 1;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-user-section {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.sidebar-user-role {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  background: rgba(124, 58, 237, 0.08);
  padding: 2px 8px;
  border-radius: 10px;
}

.sidebar-company-header {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-company-logo {
  height: 36px;
  width: 32px;
  object-fit: contain;
}

.sidebar-company-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.sidebar-user-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-lang-switch {
  margin-bottom: 8px;
}

.sidebar-theme-toggle,
.sidebar-profile-link,
.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}

.sidebar-theme-toggle:hover,
.sidebar-profile-link:hover,
.sidebar-logout-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-logout-btn {
  color: var(--red);
}

.sidebar-logout-btn:hover {
  background: var(--red-bg);
  color: var(--red);
}

.lang-switch {
  display: flex;
  gap: 2px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.lang-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all var(--transition);
  text-align: center;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

.lang-flag {
  flex-shrink: 0;
  border-radius: 2px;
  vertical-align: middle;
}

.sidebar-home {
  margin-bottom: 4px;
}

/* Sidebar dropdown toggle */
.sidebar-dropdown-toggle {
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.dropdown-chevron {
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  opacity: 0.4;
}

.sidebar-dropdown-toggle.open .dropdown-chevron {
  transform: rotate(180deg);
}

/* Sidebar games dropdown */
.sidebar-games {
  display: none;
  flex-direction: column;
  gap: 1px;
  margin-left: 12px;
  padding-left: 0;
  margin-bottom: 4px;
}

.sidebar-games.open {
  display: flex;
}

.sidebar-game {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition);
}

.sidebar-game:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.sidebar-game img {
  width: 20px;
  height: 26px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.sidebar-game-count {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 1px 6px;
  border-radius: 8px;
}

.sidebar-link.active .sidebar-game-count {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

/* Sidebar tracking brand logo */
.sidebar-tracking-logo {
  height: 30px;
  width: 30px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 2px;
}

/* Main content offset */
.main-content {
  margin-left: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content .container {
  flex: 1;
}

/* Mobile sidebar toggle (legacy, replaced by topbar hamburger) */
.sidebar-toggle {
  display: none !important;
}

/* ===== CONTAINER ===== */
.container {
  padding: 28px 32px;
}

/* ===== HERO (HOME) ===== */
.hero {
  text-align: center;
  padding: 40px 0 32px;
}

.hero-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.hero-logo {
  height: 70px;
  width: auto;
  object-fit: contain;
}

.hero-logo:first-child {
  height: 115px;
}

.hero-logos-separator {
  width: 1px;
  height: 48px;
  background: var(--border);
}

.hero h1 {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

/* ===== STATS BAR ===== */
.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 24px;
  margin-bottom: 12px;
  padding: 14px 18px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-card));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.info-banner svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--accent);
  opacity: 0.8;
}

.info-banner p {
  margin: 0;
}

.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-top: 24px;
  margin-bottom: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.stat-card {
  flex: 1;
  padding: 24px 20px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.stat-card:last-child {
  border-right: none;
}

.stat-icon {
  display: none;
}

.stat-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ===== GAME CARDS ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.game-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  aspect-ratio: 3/4;
  display: flex;
  align-items: flex-end;
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.game-card-image {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.game-card-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  z-index: 1;
}

.game-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.game-card:hover .game-card-image img {
  transform: scale(1.06);
}

.game-card-overlay {
  position: relative;
  z-index: 2;
  padding: 20px;
  width: 100%;
}

.game-card-overlay h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.game-card-count {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

/* ===== GAME HERO (Players page) ===== */
.game-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 28px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--bg-card) 0%, #eef2ff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.game-hero img {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.game-hero-info h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.game-hero-info p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ===== FILTERS ===== */
.filters {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  position: relative;
  z-index: 10;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 150px;
}

.filter-group label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.filter-group select,
.filter-group input {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  transition: all var(--transition);
  width: 100%;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-group-sm {
  flex: 0;
  min-width: 140px;
}

/* Custom select with images */
.custom-select {
  position: relative;
}

.custom-select-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.custom-select-btn:hover {
  border-color: var(--border-hover);
}

.custom-select.open .custom-select-btn {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-select-btn svg {
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.5;
  transition: transform 0.2s;
}

.custom-select.open .custom-select-btn svg {
  transform: rotate(180deg);
}

.custom-select-text {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 240px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}

.custom-select.open .custom-select-dropdown {
  display: block;
}

.custom-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.custom-select-option:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.custom-select-option.active {
  background: rgba(59, 130, 246, 0.08);
  color: var(--accent);
  font-weight: 600;
}

.custom-select-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.custom-select-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 1px 6px;
  border-radius: 8px;
}

.type-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.type-dot-joined { background: var(--green); }
.type-dot-left { background: var(--red); }
.type-dot-swap { background: var(--accent); }

.type-option-joined.active { color: var(--green); }
.type-option-left.active { color: var(--red); }
.type-option-swap.active { color: var(--accent); }

.btn {
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}


/* ===== SORT BAR ===== */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.sort-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-right: 4px;
}

.sort-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.sort-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.sort-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.sort-btn.active.asc::after {
  content: ' \25B2';
  font-size: 9px;
}

.sort-btn.active.desc::after {
  content: ' \25BC';
  font-size: 9px;
}

/* Grid columns selector */
.grid-cols-selector {
  display: flex;
  gap: 4px;
  margin-left: auto;
  margin-right: 8px;
}

.grid-cols-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.grid-cols-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.grid-cols-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== PLAYER CARDS GRID ===== */
.players-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.player-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.player-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pc-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pc-team-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
  background: var(--bg-hover);
  padding: 2px;
}

.pc-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
}

a.pc-name {
  color: var(--accent);
}

a.pc-name:hover {
  text-decoration: underline;
}

.pc-team {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

.pc-gear {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.pc-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.pc-item-full {
  grid-column: 1 / -1;
}

.pc-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pc-label svg {
  opacity: 0.5;
  flex-shrink: 0;
}

.pc-value {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-empty {
  color: var(--text-muted);
  opacity: 0.4;
}

.pc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.pc-stat {
  text-align: center;
  padding: 10px 8px;
  border-right: 1px solid var(--border);
}

.pc-stat:last-child {
  border-right: none;
}

.pc-stat-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.pc-stat-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Brand highlight in table */
.brand-highlight {
  color: var(--green);
  font-weight: 600;
  background: var(--green-bg);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(22, 163, 74, 0.15);
}


/* ===== BRAND PLAYERS PAGE ===== */
.bp-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.bp-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
  flex: 1;
}

.bp-stat-card:first-child,
.bp-stat-card:nth-child(2) {
  flex: 1.5;
}

.bp-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.bp-stat-card:first-child .bp-stat-value {
  color: var(--accent);
}

.bp-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bp-stat-game {
  position: relative;
}

/* ===== FILTERS TOGGLE (mobile) ===== */
.filters-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  justify-content: center;
}

.filters-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.filters-toggle-chevron {
  transition: transform 0.2s ease;
}

.filters-open .filters-toggle-chevron {
  transform: rotate(180deg);
}

.filters-collapsible {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.filters-collapsible .btn-reset {
  align-self: flex-end;
  margin-bottom: 1px;
}

.filter-group-search-mobile {
  display: none;
}

.filter-group-search-desktop {
  display: flex;
}

.bp-brand-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* ===== TABLE FOOTER ===== */
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
}

.table-info {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.page-btn:hover:not(:disabled):not(.active) {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-dots {
  color: var(--text-muted);
  padding: 0 4px;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.08);
  color: var(--accent);
  white-space: nowrap;
}

.badge-team {
  background: var(--green-bg);
  color: var(--green);
}

.badge-free {
  background: var(--red-bg);
  color: var(--red);
}

/* ===== CHANGES PAGE ===== */
.page-header {
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.page-header .subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Timeline layout */
.changes-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.changes-day {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.changes-day summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.changes-day summary::-webkit-details-marker {
  display: none;
}

.day-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.day-header:hover {
  background: var(--bg-hover);
}

.day-header::before {
  content: '\25B6';
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.changes-day[open] > .day-header::before {
  transform: rotate(90deg);
}

.day-label {
  font-size: 16px;
  font-weight: 700;
  text-transform: capitalize;
  color: var(--text-primary);
}

.day-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 3px 10px;
  border-radius: 12px;
}

.day-count-details {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  margin-left: auto;
}
.day-count-joined, .day-count-swap, .day-count-left {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
}
.day-count-joined { color: var(--green); background: var(--green-bg); }
.day-count-swap { color: var(--accent); background: rgba(124, 58, 237, 0.08); }
.day-count-left { color: var(--red); background: var(--red-bg); }
.day-count-sep { display: none; }

.day-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px 16px;
  background: var(--bg-primary);
}

.change-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.change-section-header:first-child {
  padding-top: 0;
}
.change-section-header span {
  white-space: nowrap;
}
.change-section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.change-section-joined span { color: var(--green); }
.change-section-swap span { color: var(--accent); }
.change-section-left span { color: var(--red); }

/* Change cards */
.change-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.change-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.change-card.brand-left {
  border-left: 3px solid var(--red);
}

.change-card.brand-joined {
  border-left: 3px solid var(--green);
}

.change-card-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex-shrink: 0;
}

.change-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.change-player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.change-player-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.change-team-logo {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

.product-img-placeholder {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--bg-hover);
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.change-player-link {
  text-decoration: none;
  color: inherit;
}
.change-player-link:hover .change-player {
  color: var(--accent);
}

.change-player {
  font-weight: 700;
  font-size: 14px;
  display: block;
  white-space: nowrap;
  transition: color var(--transition);
}

.change-team {
  color: var(--text-muted);
  font-size: 12px;
  display: block;
  white-space: nowrap;
}

.change-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.change-card-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.change-detail {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.change-field-label {
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.8px;
  min-width: 70px;
  text-align: right;
  flex-shrink: 0;
}

.change-values {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  min-width: 0;
}

.change-old {
  color: var(--red);
  text-decoration: line-through;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.change-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

.change-arrow::after {
  content: '\2192';
}

.change-new {
  color: var(--green);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.change-product {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  transition: opacity var(--transition);
}

a.change-product:hover {
  opacity: 0.8;
}

.product-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--bg-hover);
  flex-shrink: 0;
}


/* Tags */
.brand-tag {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag-left {
  background: var(--red-bg);
  color: var(--red);
}

.tag-joined {
  background: var(--green-bg);
  color: var(--green);
}

.tag-swap {
  background: rgba(59, 130, 246, 0.08);
  color: var(--accent);
}

.change-card.brand-swap {
  border-left: 3px solid var(--accent);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  font-size: 14px;
}

/* ===== LOADING ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

/* ===== FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--text-primary);
}

/* ===== LEGAL ===== */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 0;
}

.legal-content h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 32px;
}

.legal-content section {
  margin-bottom: 28px;
}

.legal-content h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.legal-content p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

/* ===== AUTH PAGES ===== */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
}

.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-md);
}

.auth-logo {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 16px;
}

.auth-contact {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 20px;
}

.auth-contact a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-contact a:hover {
  text-decoration: underline;
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #3b82f6 0%, #7c3aed 50%, #db2777 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-row {
  display: flex;
  gap: 12px;
}

.auth-row .auth-field {
  flex: 1;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-field input,
.auth-field select {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition);
}

.auth-field input:focus,
.auth-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.auth-error {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
  text-align: center;
}

.auth-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.auth-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ===== ADMIN TABLE ===== */
.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  padding: 12px 14px;
  background: var(--bg-hover);
  border-bottom: 2px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.admin-table tr:hover td {
  background: var(--bg-hover);
}

.actions-cell {
  display: flex;
  gap: 6px;
}

.btn-action {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  background: transparent;
}

.btn-edit {
  color: var(--accent);
  border-color: var(--accent);
}

.btn-edit:hover {
  background: rgba(59, 130, 246, 0.08);
}

.btn-delete {
  color: var(--red);
  border-color: var(--red);
}

.btn-delete:hover {
  background: var(--red-bg);
}

/* Company logo in table */
.company-cell-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.company-logo-sm {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Company select with preview */
.company-select-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.company-select-wrap select {
  flex: 1;
}

.company-preview {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Role badges */
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-admin {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
}

.role-client {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.role-demo {
  background: rgba(202, 138, 4, 0.1);
  color: var(--yellow);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-card h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 20px;
}

.modal-card select {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.btn-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-cancel:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ===== PROFILE PAGE ===== */
.profile-page {
  max-width: 900px;
  margin: 0 auto;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.profile-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: -1px;
}

.profile-header-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-header-info h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.profile-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-username {
  font-size: 13px;
  color: var(--text-muted);
}

.profile-company-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.profile-company-display em {
  color: var(--text-muted);
  font-weight: 400;
}

.profile-company-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 3px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.profile-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.profile-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.profile-section-title svg {
  color: var(--accent);
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-form-row {
  display: flex;
  gap: 12px;
}

.profile-form-row .profile-form-field {
  flex: 1;
}

.profile-form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.profile-form-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-form-field input,
.profile-form-field select {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition);
}

.profile-form-field input:focus,
.profile-form-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.profile-form-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  margin-top: 4px;
}

.profile-info-block {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.profile-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-info-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.profile-info-value {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.profile-success {
  color: var(--green);
  font-size: 13px;
  min-height: 18px;
  text-align: center;
}

.field-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 768px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .profile-header {
    flex-direction: column;
    text-align: center;
    padding: 24px;
  }
  .profile-header-meta {
    justify-content: center;
  }
  .profile-company-display {
    justify-content: center;
  }
}

.auth-field input:disabled,
.auth-field select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Sidebar user link */
.sidebar-user-link {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.sidebar-user-link:hover {
  background: var(--bg-hover);
}

.sidebar-user-name .role-badge {
  font-size: 9px;
  padding: 1px 6px;
  vertical-align: middle;
  margin-left: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .container {
    padding: 20px;
  }

  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }

  .players-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 150;
  }

  .sidebar-open .sidebar-overlay {
    display: block;
  }

  .topbar-hamburger {
    display: flex !important;
  }

  .topbar {
    padding: 0 16px;
  }

  .topbar-right {
    display: none !important;
  }

  .topbar-brand-desktop {
    display: none !important;
  }

  .topbar-brand-mobile {
    display: flex !important;
  }

  .sidebar-brand {
    display: none !important;
  }

  .sidebar-company-header {
    display: flex !important;
  }

  .sidebar-user-section {
    display: flex !important;
  }

  .main-content {
    margin-left: 0;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero-sub {
    font-size: 14px;
  }

  .container {
    padding: 16px;
  }

  .filters {
    gap: 8px;
    flex-direction: column;
  }

  .filters-toggle {
    display: flex;
  }

  .filters-collapsible {
    display: none;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .filters-open .filters-collapsible {
    display: flex;
  }

  .filter-group-search-mobile {
    display: flex;
    width: 100%;
  }

  .filter-group-search-desktop {
    display: none !important;
  }

  .filter-group {
    width: 100%;
    min-width: unset;
  }

  .filter-group select,
  .filter-group input {
    min-width: unset;
    font-size: 12px;
    width: 100%;
  }

  .filter-group-sm {
    min-width: unset;
  }

  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .game-hero {
    padding: 16px;
    gap: 16px;
  }

  .game-hero img {
    width: 56px;
    height: 75px;
  }

  .game-hero-info h1 {
    font-size: 20px;
  }

  .stats-bar {
    flex-direction: column;
  }

  .stat-card {
    padding: 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .stat-card:last-child {
    border-bottom: none;
  }

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

  .players-grid {
    grid-template-columns: 1fr !important;
  }

  .sort-bar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .grid-cols-selector {
    display: none;
  }

  .export-btns {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }

  .table-footer {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }

  .change-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .change-card-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .change-player-info {
    min-width: unset;
  }

  .change-card-right {
    width: 100%;
    justify-content: flex-start;
  }

  .change-detail {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }

  .change-field-label {
    text-align: left;
    min-width: unset;
  }

  .change-values {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
  }

  .change-product {
    width: 100%;
  }

  .change-old,
  .change-new {
    max-width: none;
    white-space: normal;
    word-break: break-word;
  }

  .change-arrow {
    align-self: center;
  }

  .pd-header {
    flex-direction: column;
    padding: 24px;
    gap: 16px;
  }

  .pd-avatar, .pd-avatar-placeholder {
    width: 80px !important;
    height: 80px !important;
  }

  .pd-name {
    font-size: 22px;
  }

  .pd-gear-grid {
    grid-template-columns: 1fr !important;
  }

  .pd-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .day-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .day-count-details {
    width: 100%;
    margin-left: 0;
  }

  .bp-stats {
    gap: 6px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .bp-stat-card {
    min-width: unset;
    padding: 12px 10px;
    flex: unset;
  }

  .bp-stat-card:first-child,
  .bp-stat-card:nth-child(2) {
    flex: unset;
  }

  .bp-stat-value {
    font-size: 20px;
  }

  .bp-stat-label {
    font-size: 10px;
    text-align: center;
  }

  .bp-stat-label img {
    width: 18px !important;
    height: 18px !important;
  }

  /* pc-stats inside cards: 2x2 grid on mobile */
  .pc-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .pc-stat {
    border-bottom: 1px solid var(--border);
  }

  .pc-stat:nth-child(2) {
    border-right: none;
  }

  .pc-stat:nth-child(3),
  .pc-stat:nth-child(4) {
    border-bottom: none;
  }

  .btn-reset {
    width: 100%;
    justify-content: center;
  }

  .page-header h2 {
    font-size: 20px;
  }
}

/* ===== PLAYER AVATAR (list cards) ===== */
.pc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-hover);
}

.pc-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-hover);
  flex-shrink: 0;
}

.pc-team img {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 2px;
}

/* ===== BACK LINK ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 24px;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--accent);
}

/* ===== PLAYER DETAIL PAGE ===== */
.player-detail {
  max-width: none;
}

.pd-header {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 28px;
  padding: 32px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.pd-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
}

.pd-identity {
  display: flex;
  align-items: center;
  gap: 24px;
}

.pd-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-hover);
  border: 4px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.pd-avatar-placeholder {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-hover), var(--border));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 4px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.pd-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pd-name {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.pd-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pd-team {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
}

.pd-team-logo {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: contain;
}

.pd-country {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.pd-country-flag {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

.pd-game-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-hover);
  padding: 4px 12px 4px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.pd-game-img {
  width: 22px;
  height: 30px;
  object-fit: contain;
  border-radius: 3px;
}

.pd-separator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.4;
}

.pd-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.pd-socials {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pd-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.pd-social-link:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.pd-social-twitch:hover { color: #9146ff; }
.pd-social-instagram:hover { color: #e4405f; }
.pd-social-youtube:hover { color: #ff0000; }
.pd-social-tiktok:hover { color: #000; }
.pd-social-steam:hover { color: #1b2838; }

.pd-source-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.pd-source-link:hover {
  border-color: var(--accent);
}

.pd-real-name {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
}

.pd-birthday {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.pd-birthday svg {
  opacity: 0.5;
}

.pd-bio {
  margin-bottom: 28px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
}

.pd-bio p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Sections */
.pd-section {
  margin-bottom: 32px;
}

.pd-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pd-section-title svg {
  color: var(--accent);
}

/* Gear grid */
.pd-gear-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.pd-gear-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.pd-gear-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.pd-gear-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  flex-shrink: 0;
}

.pd-gear-product-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.pd-gear-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.pd-gear-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.pd-gear-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Stats grid */
.pd-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.pd-stat-card {
  padding: 22px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  transition: all var(--transition);
}

.pd-stat-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.pd-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}

.pd-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

/* Footer meta */
.pd-footer-meta {
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

@media (max-width: 1200px) {
  .pd-gear-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .pd-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Reset filters button */
.btn-reset {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-reset:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-hover);
}

@media (max-width: 480px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filters {
    flex-direction: column;
  }

  .filter-group {
    width: 100%;
  }

  .filter-group select,
  .filter-group input {
    width: 100%;
    min-width: unset;
  }

  .players-grid {
    grid-template-columns: 1fr !important;
  }

  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

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

/* ===== TOPBAR ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  border: none;
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  min-width: 40px;
  min-height: 40px;
  flex-shrink: 0;
}

.topbar-hamburger svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-primary);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.topbar-brand-mobile {
  display: none;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
}

.topbar-brand-mobile-logo {
  height: 28px;
  width: auto;
}

.topbar-company-logo {
  height: 50px;
  width: 50px;
  object-fit: contain;
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition);
}

.topbar-user:hover {
  background: var(--bg-hover);
}

.topbar-user-info {
  display: flex;
  flex-direction: column;
}

.topbar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.topbar-user-company {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
}

.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

.topbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.topbar-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.topbar .lang-switch {
  margin: 0;
}

/* ===== PLAYER CHANGE HISTORY ===== */
.pd-changes-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.pd-change-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.pd-change-item:last-child {
  border-bottom: none;
}

.pd-change-item:hover {
  background: var(--bg-hover);
}

.pd-change-date {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 140px;
  flex-shrink: 0;
}

.pd-change-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.pd-change-field {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--bg-hover);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.pd-change-old {
  color: var(--red);
  text-decoration: line-through;
  opacity: 0.7;
}

.pd-change-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

.pd-change-new {
  color: var(--green);
  font-weight: 600;
}

/* ===== ADMIN LOGS ===== */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.admin-tab {
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}

.admin-tab:hover {
  color: var(--text-primary);
}

.admin-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Sidebar */
.sidebar-nav .sidebar-section {
  animation: fadeIn 0.4s ease both;
}

.sidebar-nav .sidebar-section:nth-child(1) { animation-delay: 0.1s; }
.sidebar-nav .sidebar-section:nth-child(2) { animation-delay: 0.2s; }
.sidebar-nav .sidebar-section:nth-child(3) { animation-delay: 0.3s; }

.sidebar-link {
  animation: slideInLeft 0.3s ease both;
}

/* Main content */
.main-content {
  animation: fadeIn 0.3s ease both;
}

/* No sidebar mode (public index) */
.no-sidebar .main-content {
  margin-left: 0;
}

.btn-login-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 1.5rem;
  padding: 12px 32px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-login-hero:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

/* Hero section (index) */
.hero {
  animation: fadeInUp 0.5s ease both;
}

.hero h1 {
  animation: fadeInUp 0.5s ease 0.1s both;
}

.hero-sub {
  animation: fadeInUp 0.5s ease 0.2s both;
}

.hero-logos {
  animation: scaleIn 0.5s ease both;
}

/* Stats bar */
.stats-bar {
  animation: fadeInUp 0.5s ease 0.2s both;
}

.stat-card {
  animation: fadeInUp 0.4s ease both;
}

.stat-card:nth-child(1) { animation-delay: 0.15s; }
.stat-card:nth-child(2) { animation-delay: 0.25s; }
.stat-card:nth-child(3) { animation-delay: 0.35s; }
.stat-card:nth-child(4) { animation-delay: 0.45s; }

/* Section titles */
.section-title {
  animation: fadeInUp 0.4s ease 0.3s both;
}

/* Games grid */
.games-grid {
  animation: fadeIn 0.4s ease 0.35s both;
}

.game-card {
  animation: scaleIn 0.4s ease both;
}

.game-card:nth-child(1) { animation-delay: 0.1s; }
.game-card:nth-child(2) { animation-delay: 0.15s; }
.game-card:nth-child(3) { animation-delay: 0.2s; }
.game-card:nth-child(4) { animation-delay: 0.25s; }
.game-card:nth-child(5) { animation-delay: 0.3s; }
.game-card:nth-child(6) { animation-delay: 0.35s; }
.game-card:nth-child(n+7) { animation-delay: 0.4s; }

/* Page headers (players, changes, etc.) */
.page-header {
  animation: fadeInUp 0.5s ease both;
}

/* Game hero banner */
.game-hero {
  animation: fadeInUp 0.5s ease 0.1s both;
}

/* Filters */
.filters {
  animation: fadeInUp 0.4s ease 0.15s both;
}

/* Player cards grid */
.players-grid {
  animation: fadeIn 0.4s ease 0.2s both;
}

.player-card {
  animation: fadeInUp 0.35s ease both;
}

.player-card:nth-child(1) { animation-delay: 0.05s; }
.player-card:nth-child(2) { animation-delay: 0.1s; }
.player-card:nth-child(3) { animation-delay: 0.15s; }
.player-card:nth-child(4) { animation-delay: 0.2s; }
.player-card:nth-child(5) { animation-delay: 0.25s; }
.player-card:nth-child(6) { animation-delay: 0.3s; }
.player-card:nth-child(n+7) { animation-delay: 0.35s; }

/* Change cards */
.change-card {
  animation: fadeInUp 0.35s ease both;
}

.change-card:nth-child(1) { animation-delay: 0.05s; }
.change-card:nth-child(2) { animation-delay: 0.1s; }
.change-card:nth-child(3) { animation-delay: 0.15s; }
.change-card:nth-child(4) { animation-delay: 0.2s; }
.change-card:nth-child(5) { animation-delay: 0.25s; }
.change-card:nth-child(n+6) { animation-delay: 0.3s; }

/* Table */
.table-container {
  animation: fadeInUp 0.5s ease 0.2s both;
}

/* Pagination */
.table-footer {
  animation: fadeIn 0.4s ease 0.3s both;
}

/* Player detail page */
.back-link {
  animation: slideInLeft 0.3s ease both;
}

.pd-header {
  animation: fadeInUp 0.5s ease 0.1s both;
}

.pd-section {
  animation: fadeInUp 0.4s ease both;
}

.pd-section:nth-child(1) { animation-delay: 0.15s; }
.pd-section:nth-child(2) { animation-delay: 0.25s; }
.pd-section:nth-child(3) { animation-delay: 0.35s; }
.pd-section:nth-child(4) { animation-delay: 0.45s; }

.pd-gear-card {
  animation: scaleIn 0.35s ease both;
}

.pd-gear-card:nth-child(1) { animation-delay: 0.1s; }
.pd-gear-card:nth-child(2) { animation-delay: 0.15s; }
.pd-gear-card:nth-child(3) { animation-delay: 0.2s; }
.pd-gear-card:nth-child(4) { animation-delay: 0.25s; }
.pd-gear-card:nth-child(5) { animation-delay: 0.3s; }
.pd-gear-card:nth-child(6) { animation-delay: 0.35s; }
.pd-gear-card:nth-child(n+7) { animation-delay: 0.4s; }

.pd-stat-card {
  animation: scaleIn 0.35s ease both;
}

.pd-stat-card:nth-child(1) { animation-delay: 0.1s; }
.pd-stat-card:nth-child(2) { animation-delay: 0.15s; }
.pd-stat-card:nth-child(3) { animation-delay: 0.2s; }
.pd-stat-card:nth-child(4) { animation-delay: 0.25s; }
.pd-stat-card:nth-child(5) { animation-delay: 0.3s; }
.pd-stat-card:nth-child(6) { animation-delay: 0.35s; }

.pd-change-item {
  animation: fadeIn 0.3s ease both;
}

.pd-change-item:nth-child(1) { animation-delay: 0.05s; }
.pd-change-item:nth-child(2) { animation-delay: 0.1s; }
.pd-change-item:nth-child(3) { animation-delay: 0.15s; }
.pd-change-item:nth-child(4) { animation-delay: 0.2s; }
.pd-change-item:nth-child(n+5) { animation-delay: 0.25s; }

/* Profile page */
.profile-page {
  animation: fadeIn 0.4s ease both;
}

.profile-header {
  animation: fadeInUp 0.5s ease 0.1s both;
}

.profile-card {
  animation: fadeInUp 0.4s ease both;
}

.profile-card:nth-child(1) { animation-delay: 0.15s; }
.profile-card:nth-child(2) { animation-delay: 0.25s; }
.profile-card:nth-child(3) { animation-delay: 0.35s; }

/* Login page */
.auth-card {
  animation: scaleIn 0.5s ease both;
}

.auth-field {
  animation: fadeInUp 0.4s ease both;
}

.auth-field:nth-child(1) { animation-delay: 0.1s; }
.auth-field:nth-child(2) { animation-delay: 0.2s; }

.auth-btn {
  animation: fadeInUp 0.4s ease 0.3s both;
}

/* Admin page */
.admin-tabs {
  animation: fadeInUp 0.4s ease 0.1s both;
}

.admin-panel.active {
  animation: fadeIn 0.4s ease both;
}

/* Footer */
.site-footer {
  animation: fadeIn 0.5s ease 0.4s both;
}

/* Topbar */
.topbar {
  animation: fadeIn 0.3s ease both;
}

/* Day count swap animation (changes page) */
.day-count-swap {
  animation: scaleIn 0.3s ease both;
}

/* Custom select dropdowns */
.custom-select-wrapper {
  animation: fadeIn 0.3s ease both;
}

/* Hover lift effect for interactive cards */
.game-card,
.player-card,
.pd-gear-card,
.pd-stat-card,
.stat-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.game-card:hover,
.player-card:hover,
.pd-gear-card:hover,
.pd-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* ===== EXPORT BUTTONS ===== */
.export-btns {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.btn-export {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-export:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(124, 58, 237, 0.04);
}

/* ===== DASHBOARD ===== */
.dash-controls {
  margin-bottom: 24px;
  animation: fadeInUp 0.4s ease both;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.dash-equipment-section {
  margin-bottom: 32px;
  animation: fadeInUp 0.4s ease both;
}

.dash-equipment-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.dash-equipment-title svg {
  color: var(--accent);
}

.dash-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .dash-row {
    grid-template-columns: 1fr;
  }
}

.loading-sm {
  color: var(--text-muted);
  font-size: 13px;
  padding: 12px 0;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.dash-card-wide {
  grid-column: span 2;
}

.dash-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.dash-card-title svg {
  color: var(--accent);
}

.dash-chart {
  min-height: 200px;
}

.dash-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

/* Brand bars */
.brand-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-bar-logo {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-bar-logo-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
}

.brand-bar-label {
  width: 80px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-bar-track {
  flex: 1;
  height: 22px;
  background: var(--bg-hover);
  border-radius: 4px;
  overflow: hidden;
}

.brand-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  min-width: 2px;
}

.brand-bar-value {
  width: 45px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
  flex-shrink: 0;
}

.brand-bar-count {
  width: 35px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  flex-shrink: 0;
}

/* Top gear list */
.top-gear-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.top-gear-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.top-gear-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(124, 58, 237, 0.06);
  border-radius: var(--radius-sm);
  z-index: 0;
  transition: width 0.5s ease;
}

.top-gear-rank {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  width: 24px;
  z-index: 1;
}

.top-gear-name {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-gear-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  z-index: 1;
}

/* Trend chart */
.trend-chart {
  overflow-x: auto;
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  height: 180px;
  gap: 2px;
  min-width: 100%;
}

.trend-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  cursor: pointer;
}

.trend-bar {
  width: 80%;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  transition: height 0.4s ease;
  min-height: 4px;
  opacity: 0.8;
}

.trend-bar-col:hover .trend-bar {
  opacity: 1;
}

.trend-bar-label {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 4px;
  transform: rotate(-45deg);
  transform-origin: top center;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .dash-card-wide {
    grid-column: span 1;
  }
}

/* ===== TEAM PAGE ===== */
.team-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  animation: fadeInUp 0.4s ease both;
}

.team-header-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  padding: 8px;
  border: 1px solid var(--border);
}

.team-header-info h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
}

.team-header-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.team-game-section {
  margin-bottom: 32px;
  animation: fadeInUp 0.4s ease 0.1s both;
}

.team-game-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-game-logo {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 6px;
}

.team-game-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(124, 58, 237, 0.08);
  padding: 2px 10px;
  border-radius: 10px;
}

.team-roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.team-player-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.team-player-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.team-player-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.team-player-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.team-player-avatar-ph {
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.team-player-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.team-player-country {
  font-size: 12px;
  color: var(--text-muted);
}

.team-player-gear {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.team-gear-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.team-gear-label {
  color: var(--text-muted);
  font-weight: 500;
}

.team-gear-value {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-player-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.team-setting {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(124, 58, 237, 0.06);
  padding: 3px 8px;
  border-radius: 4px;
}

/* ===== GLOBAL SEARCH ===== */
.topbar-search {
  flex: 1;
  max-width: 480px;
  margin: 0 16px;
}

.search-global {
  position: relative;
}

.search-global-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-global-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: all var(--transition);
}

.search-global-input::placeholder {
  color: var(--text-muted);
}

.search-global-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-family: inherit;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  pointer-events: none;
}

.search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 420px;
  overflow-y: auto;
  z-index: 500;
}

.search-results.open {
  display: block;
}

.search-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 10px 14px 4px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background var(--transition);
  cursor: pointer;
}

.search-result-item:hover {
  background: var(--bg-hover);
}

.search-result-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.search-result-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.search-result-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-result-name {
  font-size: 13px;
  font-weight: 600;
}

.search-result-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.search-result-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 2px 8px;
  border-radius: 10px;
}

.search-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 768px) {
  .topbar-search {
    display: none;
  }
}

/* ===== DARK MODE TOGGLE ===== */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon,
.sidebar-theme-toggle .icon-sun,
.sidebar-theme-toggle .icon-moon { display: none; }

[data-theme="dark"] .theme-toggle .icon-sun,
[data-theme="dark"] .sidebar-theme-toggle .icon-sun { display: block; }
:root:not([data-theme="dark"]) .theme-toggle .icon-moon,
.theme-toggle .icon-moon,
:root:not([data-theme="dark"]) .sidebar-theme-toggle .icon-moon,
.sidebar-theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon,
[data-theme="dark"] .sidebar-theme-toggle .icon-moon { display: none; }

/* Dark mode specific overrides */
[data-theme="dark"] .sidebar-link:hover {
  background: rgba(139, 92, 246, 0.1);
}

[data-theme="dark"] .game-card-image img {
  opacity: 0.85;
}

[data-theme="dark"] .auth-card {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .modal-card {
  background: var(--bg-card);
}

[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--bg-primary);
  border-color: var(--border);
  color: var(--text-primary);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus {
  border-color: var(--accent);
}

[data-theme="dark"] .admin-table th {
  background: var(--bg-primary);
}

[data-theme="dark"] .admin-table td {
  border-color: var(--border);
}

[data-theme="dark"] .change-card {
  border-color: var(--border);
}

[data-theme="dark"] .custom-select-dropdown {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .custom-select-option:hover {
  background: var(--bg-hover);
}

[data-theme="dark"] .pd-avatar-placeholder {
  background: var(--bg-hover);
}

[data-theme="dark"] .hero {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
}

/* Teams grid */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  animation: fadeInUp 0.4s ease;
}

.teams-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
  font-size: 15px;
}

.team-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.team-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.12);
}

.team-card-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--bg);
  flex-shrink: 0;
}

.team-card-logo-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--border);
}

.team-card-info {
  flex: 1;
  min-width: 0;
}

.team-card-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-card-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.team-card-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.team-card:hover .team-card-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

@media (max-width: 768px) {
  .teams-grid {
    grid-template-columns: 1fr;
  }
}

/* Sync panel */
.sync-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  max-width: 600px;
}

.sync-info h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}

.sync-info p {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px !important;
  font-size: 14px;
}

.sync-btn.syncing {
  opacity: 0.7;
  pointer-events: none;
}

.sync-btn.syncing svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sync-status {
  margin-top: 20px;
}

.sync-running {
  padding: 12px 16px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

.sync-success {
  padding: 12px 16px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  color: #10b981;
  font-size: 13px;
  font-weight: 500;
}

.sync-error {
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #ef4444;
  font-size: 13px;
  font-weight: 500;
}

.sync-log {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Top gear clickable links */
.top-gear-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

.top-gear-link::after {
  content: 'View';
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.top-gear-link:hover {
  background: rgba(124, 58, 237, 0.08);
}

.top-gear-link:hover .top-gear-name {
  color: var(--accent);
  text-decoration: underline;
}

.top-gear-link:hover::after {
  opacity: 1;
}

/* Product page */
.product-header {
  margin-bottom: 28px;
}

.product-header-type {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 4px;
}

.product-header h1 {
  font-size: 28px;
  font-weight: 900;
  margin: 0 0 8px;
}

.product-header-count {
  color: var(--text-muted);
  font-size: 14px;
}

.product-game-section {
  margin-bottom: 28px;
}

.product-players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.product-player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.product-player-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.1);
}

.product-player-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.product-player-avatar-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
}

.product-player-info {
  min-width: 0;
}

.product-player-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-player-team {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.product-player-team-logo {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

@media (max-width: 768px) {
  .product-players-grid {
    grid-template-columns: 1fr;
  }
}

/* Reduce animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== WEBHOOKS PAGE ===== */
.wh-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.wh-count {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 14px;
}

.wh-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.wh-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.wh-type-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.wh-type-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wh-type-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.wh-form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

.wh-form-row {
  margin-bottom: 16px;
}

.wh-form-row label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.wh-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--transition);
}

.wh-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wh-form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover { background: var(--bg-primary); }

.wh-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.wh-empty p {
  margin-top: 12px;
  font-size: 14px;
}

.wh-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wh-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition);
}

.wh-item:hover {
  border-color: var(--border-hover);
}

.wh-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wh-item-info {
  flex: 1;
  min-width: 0;
}

.wh-item-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.wh-item-url {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wh-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.wh-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  cursor: pointer;
}

.wh-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.wh-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-hover);
  border-radius: 20px;
  transition: all 0.2s;
}

.wh-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.wh-toggle input:checked + .wh-toggle-slider {
  background: var(--accent);
}

.wh-toggle input:checked + .wh-toggle-slider::before {
  transform: translateX(16px);
}

.wh-btn-test,
.wh-btn-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.wh-btn-test:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.wh-btn-delete:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.wh-add-section {
  margin-bottom: 32px;
}

.wh-list-section {
  margin-bottom: 24px;
}

/* ===== EXPORT MODAL ===== */
.export-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.export-modal-overlay.open { display: flex; }

.export-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 480px;
  max-width: 92vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: fadeInUp 0.2s ease;
}

.export-modal h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--text-primary);
}

.export-modal-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.export-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 16px;
  margin-bottom: 20px;
}

.export-col-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  font-size: 13px;
  color: var(--text-secondary);
  user-select: none;
}
.export-col-item:hover { background: var(--bg-hover); }

.export-col-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.export-col-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.export-col-actions button {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  font-family: inherit;
}
.export-col-actions button:hover { text-decoration: underline; }

.export-modal-btns {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.export-modal-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.export-modal-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.export-modal-btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.export-modal-btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}
.export-modal-btn-cancel {
  background: transparent;
}

