:root {
  --bg: #09111f;
  --bg-soft: #111c2f;
  --panel: rgba(15, 23, 42, 0.72);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #e5eefc;
  --muted: #93a4c3;
  --primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(59,130,246,.22), transparent 30%),
    radial-gradient(circle at top right, rgba(139,92,246,.18), transparent 28%),
    linear-gradient(180deg, #08101d 0%, #0f172a 100%);
  color: var(--text);
  min-height: 100vh;
}
.hidden { display: none !important; }
.glass-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.aurora {
  position: absolute;
  border-radius: 999px;
  filter: blur(30px);
  opacity: .5;
}
.aurora-1 { width: 320px; height: 320px; background: rgba(59,130,246,.35); top: 10%; left: 18%; }
.aurora-2 { width: 260px; height: 260px; background: rgba(139,92,246,.32); bottom: 8%; right: 16%; }
.login-card {
  width: min(92vw, 460px);
  padding: 38px;
  border-radius: 28px;
  position: relative;
  z-index: 2;
}
.brand-mark {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  background: var(--primary);
  border-radius: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 18px;
}
.brand-mark.small {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  margin-bottom: 0;
}
.login-card h1, .topbar h1, .sidebar-brand h2, .panel-head h3 { margin: 0; }
.login-card p, .topbar p, .sidebar-brand p { color: var(--muted); }
.form-stack {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}
.form-stack.compact { margin-top: 0; }
label { display: grid; gap: 8px; }
label span { color: #bfd0ee; font-size: 14px; }
input, select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.05);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
}
input[type="file"] {
  padding: 10px 16px;
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  background: rgba(59,130,246,.2);
  border: 1px solid rgba(59,130,246,.3);
  border-radius: 12px;
  padding: 8px 14px;
  color: #bfdbfe;
  cursor: pointer;
  margin-right: 12px;
  transition: all 0.2s ease;
}
input[type="file"]::file-selector-button:hover {
  background: rgba(59,130,246,.3);
  border-color: rgba(59,130,246,.4);
}
input::placeholder { color: #7890b2; }
.primary-btn, .ghost-btn, .status-btn, .danger-btn {
  border: none;
  cursor: pointer;
  border-radius: 16px;
  padding: 14px 18px;
  color: white;
  transition: transform .2s ease, opacity .2s ease;
}
.primary-btn { background: var(--primary); }
.primary-btn.slim, .ghost-btn { padding: 10px 14px; border-radius: 12px; }
.ghost-btn { background: rgba(255,255,255,.07); }
.status-btn { background: rgba(16,185,129,.16); color: #98f0ca; }
.danger-btn { background: rgba(239,68,68,.16); color: #fecaca; }
button:hover { transform: translateY(-1px); opacity: .95; }
.message { min-height: 22px; margin-top: 12px; color: #fca5a5; }
.dashboard {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  padding: 20px;
  min-height: 100vh;
}
.sidebar {
  border-radius: 28px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.sidebar-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}
.nav-list {
  display: grid;
  gap: 10px;
}
.nav-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  padding: 14px 16px;
  border-radius: 16px;
  cursor: pointer;
}
.nav-item.active {
  background: rgba(59,130,246,.18);
  border-color: rgba(59,130,246,.28);
}
.content { display: grid; gap: 20px; }
.topbar {
  border-radius: 28px;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel { display: none; }
.active-panel { display: block; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  border-radius: 24px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.08);
  transition: all 0.3s ease;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}
.stat-card .label { color: var(--muted); font-size: 13px; }
.stat-card .value { font-size: 34px; font-weight: 700; margin-top: 8px; }

.stat-users { background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(59,130,246,0.05)); border-color: rgba(59,130,246,0.3); }
.stat-users .value { color: #60a5fa; }

.stat-active { background: linear-gradient(135deg, rgba(16,185,129,0.2), rgba(16,185,129,0.05)); border-color: rgba(16,185,129,0.3); }
.stat-active .value { color: #34d399; }

.stat-teams { background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(139,92,246,0.05)); border-color: rgba(139,92,246,0.3); }
.stat-teams .value { color: #a78bfa; }

.stat-recruiting { background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(59,130,246,0.05)); border-color: rgba(59,130,246,0.3); }
.stat-recruiting .value { color: #60a5fa; }

.stat-ongoing { background: linear-gradient(135deg, rgba(16,185,129,0.2), rgba(16,185,129,0.05)); border-color: rgba(16,185,129,0.3); }
.stat-ongoing .value { color: #34d399; }

.stat-games { background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(245,158,11,0.05)); border-color: rgba(245,158,11,0.3); }
.stat-games .value { color: #fbbf24; }

.stat-drivers { background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(239,68,68,0.05)); border-color: rgba(239,68,68,0.3); }
.stat-drivers .value { color: #f87171; }

.stat-participants { background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(168,85,247,0.05)); border-color: rgba(168,85,247,0.3); }
.stat-participants .value { color: #c084fc; }

.stat-joins { background: linear-gradient(135deg, rgba(14,165,233,0.2), rgba(14,165,233,0.05)); border-color: rgba(14,165,233,0.3); }
.stat-joins .value { color: #38bdf8; }

.stat-today-teams { background: linear-gradient(135deg, rgba(236,72,153,0.2), rgba(236,72,153,0.05)); border-color: rgba(236,72,153,0.3); }
.stat-today-teams .value { color: #f472b6; }

.stat-today-joins { background: linear-gradient(135deg, rgba(20,184,166,0.2), rgba(20,184,166,0.05)); border-color: rgba(20,184,166,0.3); }
.stat-today-joins .value { color: #2dd4bf; }
.two-column {
  display: grid;
  grid-template-columns: 1.3fr .9fr;
  gap: 20px;
}
.games-layout { grid-template-columns: .95fr 1.2fr; }
.panel-card {
  border-radius: 28px;
  padding: 24px;
}
.highlight-card {
  background: linear-gradient(135deg, rgba(59,130,246,.16), rgba(139,92,246,.15));
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.panel-head.wrap { flex-wrap: wrap; }
.badge {
  font-size: 12px;
  color: #bfdbfe;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(59,130,246,.15);
}
.toolbar { display: flex; gap: 10px; align-items: center; }
.toolbar-input { min-width: 280px; }
.timeline-list, .feature-list { display: grid; gap: 12px; }
.timeline-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.05);
}
.feature-list { padding-left: 18px; color: #dbe7fb; }
.table-wrap {
  overflow: auto;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.06);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
th { color: #9eb3d6; font-size: 13px; font-weight: 600; background: rgba(255,255,255,.03); }
td { color: #e9f1ff; }
.status-pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}
.status-recruiting { background: rgba(59,130,246,.16); color: #bfdbfe; }
.status-ongoing { background: rgba(16,185,129,.16); color: #a7f3d0; }
.status-finished { background: rgba(148,163,184,.16); color: #cbd5e1; }
.status-cancelled, .status-disabled { background: rgba(239,68,68,.16); color: #fecaca; }
.status-active { background: rgba(16,185,129,.16); color: #a7f3d0; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }

.icon-preview {
  margin-top: 12px;
  min-height: 120px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.preview-placeholder {
  color: #7890b2;
  font-size: 14px;
}
.icon-preview img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}
.default-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.default-icon {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.default-icon:hover {
  background: rgba(59,130,246,.12);
  border-color: rgba(59,130,246,.28);
}
.default-icon.selected {
  background: rgba(59,130,246,.2);
  border-color: rgba(59,130,246,.4);
  box-shadow: 0 0 0 2px rgba(59,130,246,.3);
}
.default-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.default-icon span {
  font-size: 11px;
  color: #9eb3d6;
}
@media (max-width: 1100px) {
  .dashboard { grid-template-columns: 1fr; }
  .stats-grid, .two-column, .games-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .toolbar { width: 100%; flex-direction: column; }
  .toolbar-input { min-width: 0; }
}
