:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2035;
  --bg-card-hover: #1e2845;
  --border-color: #2a3555;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-glow: rgba(99, 102, 241, 0.4);
  --gradient-1: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
  --gradient-2: linear-gradient(135deg, #06b6d4, #3b82f6, #6366f1);
  --gradient-3: linear-gradient(135deg, #f43f5e, #ec4899, #a855f7);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
}

a { color: var(--accent-primary); text-decoration: none; }

.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: all 0.3s;
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-header i { font-size: 24px; color: var(--accent-primary); }
.sidebar-header span { font-size: 18px; font-weight: 800; }
.sidebar-header span span { background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.sidebar-nav { padding: 12px 0; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.sidebar-link:hover, .sidebar-link.active {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
  border-right: 3px solid var(--accent-primary);
}

.sidebar-link i { width: 20px; text-align: center; font-size: 16px; }

.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 24px;
  min-height: 100vh;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h1 { font-size: 24px; font-weight: 700; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}

.stat-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 20px var(--accent-glow);
  transform: translateY(-2px);
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.stat-card-icon.revenue { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.stat-card-icon.orders { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.stat-card-icon.users { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-card-icon.accounts { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.stat-card-value { font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.stat-card-label { font-size: 13px; color: var(--text-muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: all 0.3s;
  font-family: inherit;
}

.btn-primary { background: var(--gradient-1); color: white; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 15px var(--accent-glow); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-outline { background: transparent; color: var(--accent-primary); border: 1px solid var(--accent-primary); }
.btn-sm { padding: 6px 14px; font-size: 12px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.data-table th {
  background: var(--bg-secondary);
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-card-hover); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-primary { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

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

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  border: 1px solid var(--border-color);
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}

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

.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 { font-size: 18px; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.modal-close:hover { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border-color); display: flex; gap: 12px; justify-content: flex-end; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea { min-height: 80px; resize: vertical; }

.chart-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.chart-container h3 { font-size: 16px; margin-bottom: 16px; }

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

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

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin-left: 0;
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 40px;
  border: 1px solid var(--border-color);
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.login-card h1 { font-size: 22px; margin-bottom: 24px; }
.login-card .form-group { text-align: left; }

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

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px 10px; }
}

.toggle-sidebar {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 101;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  cursor: pointer;
}

/* Admin Game Grid */
.admin-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.admin-game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.admin-game-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-5px);
  box-shadow: 0 10px 20px var(--accent-glow);
}

.admin-game-icon {
  width: 60px;
  height: 60px;
  background: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  border: 2px solid var(--border-color);
}

.admin-game-card:hover .admin-game-icon {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
}

.admin-game-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-game-stats {
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .toggle-sidebar { display: block; }
}
