:root {
  --bg-primary: #0a0f1c;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --border: rgba(0, 212, 255, 0.15);
  --neon-green: #00ffcc;
  --neon-cyan: #00d4ff;
  --text-primary: #f0f4f8;
  --text-secondary: #8899aa;
  --text-muted: #556677;
  --danger: #ff4757;
  --success: #00ff88;
  --warning: #ffa502;
  --glass: rgba(17, 24, 39, 0.6);
  --shadow: 0 8px 32px rgba(0, 255, 204, 0.08);
  --radius: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0, 255, 204, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 212, 255, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* Header */
.header {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(10, 15, 28, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner { display: flex; align-items: center; justify-content: space-between; }

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.logo-text { font-size: 18px; font-weight: 700; }
.logo-text span { color: var(--neon-green); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
  color: #0a0f1c;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0, 255, 204, 0.3); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: transparent;
  color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
}
.btn-secondary:hover { background: rgba(0, 212, 255, 0.1); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-icon { padding: 8px; min-width: 36px; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.card-glass {
  background: var(--glass);
  backdrop-filter: blur(16px);
}

/* Forms */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.form-control:disabled { opacity: 0.6; cursor: not-allowed; }

textarea.form-control { min-height: 200px; resize: vertical; font-family: 'Consolas', monospace; font-size: 13px; }

select.form-control { cursor: pointer; }

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-error { background: rgba(255, 71, 87, 0.15); border: 1px solid rgba(255, 71, 87, 0.3); color: #ff6b7a; }
.alert-success { background: rgba(0, 255, 136, 0.15); border: 1px solid rgba(0, 255, 136, 0.3); color: var(--success); }
.alert-info { background: rgba(0, 212, 255, 0.1); border: 1px solid rgba(0, 212, 255, 0.2); color: var(--neon-cyan); }

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-active { background: rgba(0, 255, 136, 0.15); color: var(--success); }
.badge-inactive { background: rgba(255, 71, 87, 0.15); color: var(--danger); }
.badge-used { background: rgba(255, 165, 2, 0.15); color: var(--warning); }
.badge-easy { background: rgba(0, 255, 136, 0.1); color: var(--success); }
.badge-medium { background: rgba(255, 165, 2, 0.1); color: var(--warning); }
.badge-hard { background: rgba(255, 71, 87, 0.1); color: var(--danger); }

/* Tables */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

tr:hover td { background: rgba(0, 212, 255, 0.03); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 560px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-overlay.active .modal { transform: translateY(0); }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-header h3 { font-size: 20px; color: var(--neon-green); }

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Hero */
.hero {
  text-align: center;
  padding: 80px 20px 60px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle { font-size: 18px; color: var(--text-secondary); max-width: 600px; margin: 0 auto 40px; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin: 48px 0;
}

.feature-card h3 { color: var(--neon-cyan); margin-bottom: 8px; font-size: 16px; }
.feature-card p { color: var(--text-secondary); font-size: 14px; }

/* Footer */
.footer {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

/* Loading */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--neon-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

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

.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
  .hero { padding: 40px 16px; }
  .card { padding: 20px; }
  th, td { padding: 10px 12px; font-size: 13px; }
}
