@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --bg:       #07070f;
  --bg2:      #0d0d1a;
  --bg3:      #12121f;
  --bg4:      #1a1a2e;
  --purple:   #A855F7;
  --cyan:     #00F0FF;
  --yellow:   #FFD700;
  --green:    #00FF94;
  --red:      #FF4466;
  --border:   rgba(168,85,247,0.15);
  --border2:  rgba(0,240,255,0.15);
  --text:     #FFFFFF;
  --text2:    #A0A0C0;
  --text3:    #505070;
  --sidebar-w: 230px;
  --radius:   12px;
  --radius-sm: 8px;
}

html, body { height: 100%; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 100% 60% at 10% 0%,   rgba(168,85,247,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 80%  50% at 90% 100%,  rgba(0,240,255,0.06) 0%, transparent 55%);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(168,85,247,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168,85,247,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ─────────────────────────────────────────────── */
.admin-wrap {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: rgba(13,13,26,0.95);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  backdrop-filter: blur(16px);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 24px 20px 20px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.sidebar-logo .logo-icon {
  width: 24px; height: 24px;
  color: var(--cyan);
}

.sidebar-logo span {
  color: var(--purple);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.snav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.snav svg { width: 16px; height: 16px; flex-shrink: 0; }

.snav:hover {
  background: rgba(168,85,247,0.1);
  color: var(--text);
}

.snav.active {
  background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(0,240,255,0.1));
  color: var(--cyan);
  border: 1px solid rgba(0,240,255,0.2);
  box-shadow: 0 0 12px rgba(0,240,255,0.08);
}

.snav.active svg { color: var(--cyan); }

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text3);
  text-decoration: none;
  font-size: 13px;
  border: 1px solid rgba(255,68,102,0.15);
  transition: all 0.2s;
}

.sidebar-logout svg { width: 15px; height: 15px; }

.sidebar-logout:hover {
  background: rgba(255,68,102,0.1);
  color: var(--red);
  border-color: rgba(255,68,102,0.3);
}

/* ── Main ───────────────────────────────────────────────── */
.admin-main {
  flex: 1;
  padding: 32px 36px;
  min-width: 0;
  max-width: 1100px;
}

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

.page-header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text);
}

.page-header h1 svg { width: 22px; height: 22px; color: var(--cyan); }

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  border: 1px solid;
}

.alert-success { background: rgba(0,255,148,0.08); border-color: rgba(0,255,148,0.3); color: var(--green); }
.alert-danger, .alert-error { background: rgba(255,68,102,0.08); border-color: rgba(255,68,102,0.3); color: var(--red); }
.alert-info { background: rgba(0,240,255,0.08); border-color: rgba(0,240,255,0.3); color: var(--cyan); }
.alert-warning { background: rgba(255,215,0,0.08); border-color: rgba(255,215,0,0.3); color: var(--yellow); }

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--purple), #7C3AED);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 0 16px rgba(168,85,247,0.3);
}

.btn-primary:hover {
  box-shadow: 0 0 24px rgba(168,85,247,0.5);
  transform: translateY(-1px);
}

.btn-primary svg { width: 15px; height: 15px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: rgba(255,255,255,0.05);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-color: rgba(168,85,247,0.3);
}

.btn-secondary svg { width: 14px; height: 14px; }

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

.btn-lg { padding: 12px 28px; font-size: 14px; }

.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid;
  transition: all 0.18s;
}

.btn-sm svg { width: 12px; height: 12px; }

.btn-edit {
  color: var(--cyan);
  border-color: rgba(0,240,255,0.25);
  background: rgba(0,240,255,0.06);
}

.btn-edit:hover {
  background: rgba(0,240,255,0.15);
  border-color: rgba(0,240,255,0.5);
}

.btn-danger {
  color: var(--red);
  border-color: rgba(255,68,102,0.25);
  background: rgba(255,68,102,0.06);
}

.btn-danger:hover {
  background: rgba(255,68,102,0.15);
  border-color: rgba(255,68,102,0.5);
}

/* ── Forms ──────────────────────────────────────────────── */
.admin-form { display: flex; flex-direction: column; gap: 0; }

.form-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--purple);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}

.section-title svg { width: 16px; height: 16px; }

.section-desc {
  color: var(--text2);
  font-size: 13px;
  margin-bottom: 16px;
  margin-top: -8px;
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

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

.form-group.flex-2 { flex: 2; }

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

.label-hint {
  font-weight: 400;
  text-transform: none;
  color: var(--text3);
}

.form-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: 10px 12px;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: 'Inter', sans-serif;
}

.form-input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.12);
}

.form-input::placeholder { color: var(--text3); }

select.form-input option {
  background: var(--bg3);
  color: var(--text);
}

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

.input-hint {
  font-size: 11px;
  color: var(--text3);
}

.form-check-wrap { flex-direction: row; align-items: center; }

.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

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

.check-text { font-size: 13px; color: var(--text2); }

.form-actions {
  display: flex;
  gap: 12px;
  padding-top: 4px;
}

.form-group-btn { flex: 0; min-width: auto; justify-content: flex-end; }

/* ── Table ──────────────────────────────────────────────── */
.table-wrap {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.data-table thead {
  background: rgba(168,85,247,0.06);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text2);
}

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

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.row-inactive td { opacity: 0.45; }

/* ── Table cells ────────────────────────────────────────── */
.rank-cell {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--purple);
}

.rtp-cell {
  font-weight: 700;
  color: var(--cyan);
}

.text-muted { color: var(--text2); }

.expert-row-name, .game-row-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.tbl-avatar, .tbl-game-img {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.tbl-game-img { border-radius: 6px; }

.tbl-avatar-ph, .tbl-game-ph {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #000;
}

.tbl-game-ph { border-radius: 6px; }

.slug-link {
  color: var(--cyan);
  text-decoration: none;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.slug-link svg { width: 12px; height: 12px; opacity: 0.7; }
.slug-link:hover { text-decoration: underline; }

.casino-count { color: var(--text2); font-size: 12px; }

.action-btns { display: flex; gap: 6px; align-items: center; }

/* ── Badges ─────────────────────────────────────────────── */
.badge-active {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  background: rgba(0,255,148,0.1);
  border: 1px solid rgba(0,255,148,0.25);
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.badge-inactive {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 3px 8px;
  border-radius: 20px;
}

.promo-badge-sm {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  color: #000;
  letter-spacing: 0.5px;
}

/* ── Empty state ────────────────────────────────────────── */
.empty-admin {
  text-align: center;
  padding: 60px 24px;
  color: var(--text2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ── Game links grid ────────────────────────────────────── */
.game-links-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-link-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.game-link-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.game-link-thumb {
  width: 36px; height: 36px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(168,85,247,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--purple);
  border: 1px solid var(--border);
}

.game-link-thumb img { width: 100%; height: 100%; object-fit: cover; }

.game-link-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.game-link-input { flex: 1; margin-bottom: 0; }

/* ── Login ──────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  backdrop-filter: blur(16px);
  box-shadow: 0 0 60px rgba(168,85,247,0.1);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 6px;
}

.login-logo svg { color: var(--cyan); width: 28px; height: 28px; }

.login-logo span { color: var(--purple); }

.login-sub {
  text-align: center;
  font-size: 13px;
  color: var(--text2);
  font-weight: 400;
  margin-bottom: 28px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Misc ───────────────────────────────────────────────── */
.mb-4 { margin-bottom: 20px; }
