@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ─── RESET & BASE ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Color Palette matching boutique */
  --bg-primary:           hsl(240, 24%, 5%);
  --bg-secondary:         hsl(240, 20%, 8%);
  --bg-card:              rgba(10, 10, 18, 0.95);
  --bg-card-hover:        rgba(20, 20, 35, 0.97);
  --bg-surface:           rgba(10, 10, 18, 0.95);
  --bg-surface-elevated:  rgba(20, 20, 35, 0.97);
  --border:               rgba(255, 255, 255, 0.09);
  --border-active:        rgba(168, 85, 247, 0.5);

  --accent-1: hsl(270, 95%, 60%);
  --accent-2: hsl(285, 100%, 65%);
  --accent-3: hsl(315, 100%, 60%);
  --accent-4: hsl(142, 72%, 49%);

  --gradient-main:   linear-gradient(135deg, hsl(270, 95%, 60%) 0%, hsl(285, 100%, 65%) 100%);
  --gradient-card:   linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(124, 58, 237, 0.05));
  --gradient-admin:  linear-gradient(135deg, hsl(315, 100%, 60%) 0%, hsl(270, 95%, 60%) 100%);

  --text-primary:   hsl(0, 0%, 96%);
  --text-secondary: hsl(240, 10%, 75%);
  --text-muted:     hsl(240, 6%, 50%);

  --success: hsl(142, 72%, 49%);
  --warning: hsl(32, 95%, 55%);
  --error:   #ef4444;
  --info:    hsl(285, 100%, 65%);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-glow:  0 0 20px hsla(270, 95%, 60%, 0.4);
  --shadow-card:  0 8px 32px rgba(0,0,0,0.4);
  --shadow-btn:   0 4px 20px hsla(270, 95%, 60%, 0.4);
  
  --font-body: 'Poppins', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ─── SCROLLBAR ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent-1); border-radius: 3px; }

/* ─── CYBER GRID & GLOW BACKGROUND ────────────────────────────────────────────── */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.007) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.007) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -2;
    pointer-events: none;
}

.gradient-bg-glow-1 {
    position: fixed;
    top: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, hsla(270, 95%, 60%, 0.25) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(100px);
}

.gradient-bg-glow-2 {
    position: fixed;
    top: 50%;
    left: -20%;
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, hsla(285, 100%, 65%, 0.2) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(120px);
}

/* ─── GLASS CARD ─────────────────────────────────────────────────────────────── */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.glass:hover { background: var(--bg-card-hover); }

/* ─── BUTTONS ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn:hover::before { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient-main);
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover { box-shadow: 0 6px 30px rgba(139,92,246,0.6); transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 20px rgba(239,68,68,0.35);
}
.btn-danger:hover { box-shadow: 0 6px 25px rgba(239,68,68,0.55); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent-1); color: var(--text-primary); }

.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-full { width: 100%; }

/* ─── FORM ELEMENTS ─────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.25s ease;
  outline: none;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus {
  border-color: var(--accent-1);
  background: rgba(139,92,246,0.08);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}
.form-input.error { border-color: var(--error); box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }

.input-wrapper { position: relative; }
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}
.input-wrapper .form-input { padding-left: 42px; }
.input-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
}
.input-toggle:hover { color: var(--accent-1); }

/* ─── ALERTS / TOAST ────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slide-in 0.3s ease;
}
.alert-error   { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.alert-info    { background: rgba(6,182,212,0.12);  border: 1px solid rgba(6,182,212,0.3);  color: #67e8f9; }

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── BADGE ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-admin  { background: rgba(236,72,153,0.2); color: #f9a8d4; border: 1px solid rgba(236,72,153,0.35); }
.badge-user   { background: rgba(99,102,241,0.2); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.35); }
.badge-vip    { background: rgba(245,158,11,0.2); color: #fbbf24; border: 1px solid rgba(245,158,11,0.45); }
.badge-guest  { background: rgba(156,163,175,0.2); color: #d1d5db; border: 1px solid rgba(156,163,175,0.35); }
.badge-success{ background: rgba(16,185,129,0.2); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.35); }

/* ─── LOADING SPINNER ────────────────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── NAVBAR ─────────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(10,10,15,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.navbar-brand .logo-icon-img {
  height: 32px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(168, 85, 247, 0.4));
  transform: scale(3.0);
  transform-origin: left center;
  margin-right: 65px;
}
.navbar-actions { display: flex; align-items: center; gap: 12px; }
.navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px 4px 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}
.navbar-user:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.15);
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
}

/* ─── STAT CARDS ─────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.stat-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-main);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow); border-color: var(--border-active); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}
.stat-icon.purple { background: rgba(139,92,246,0.2); }
.stat-icon.cyan   { background: rgba(6,182,212,0.2); }
.stat-icon.pink   { background: rgba(236,72,153,0.2); }
.stat-icon.green  { background: rgba(16,185,129,0.2); }
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ─── TABLE ─────────────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow: hidden;               /* Clips EVERYTHING (incl. scrollbar) to border-radius */
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
/* Inner scroll container injected by JS — keeps scrollbar inside the rounded box */
.table-scroll {
  overflow-x: auto;
}
.table-scroll::-webkit-scrollbar { height: 5px; }
.table-scroll::-webkit-scrollbar-track { background: transparent; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--accent-1); border-radius: 3px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
thead th {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody td {
  padding: 14px 20px;
  color: var(--text-secondary);
  vertical-align: middle;
}
tbody td:first-child { color: var(--text-primary); font-weight: 500; }

/* ─── SECTION HEADER ────────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.section-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ─── PAGE LAYOUT ────────────────────────────────────────────────────────────── */
.page-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}
.page-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--accent-1);
  text-shadow: 0 0 20px rgba(168,85,247,0.4);
}
.gradient-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── PROFILE CARD ───────────────────────────────────────────────────────────── */
.profile-card {
  padding: 32px;
  background: var(--gradient-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.profile-card::after {
  content: '';
  position: absolute;
  top: -50%; right: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 70% 30%, rgba(139,92,246,0.08), transparent 60%);
  pointer-events: none;
}
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 0 30px rgba(139,92,246,0.4);
}
.profile-info { flex: 1; }
.profile-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.profile-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ─── INFO GRID ─────────────────────────────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.info-item {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.25s ease;
}
.info-item:hover { border-color: var(--border-active); }
.info-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.info-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}
.info-value.masked {
  font-family: monospace;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

/* ─── MODAL ─────────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-backdrop.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 420px;
  width: 90%;
  transform: scale(0.9);
  transition: transform 0.3s;
}
.modal-backdrop.active .modal { transform: scale(1); }
.modal-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* ─── RESPONSIVE ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 12px 16px; }
  .page-content { padding: 20px 16px; }
  .profile-card { flex-direction: column; text-align: center; }
  .profile-meta { justify-content: center; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

.lua-logo-img {
  height: 24px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(168, 85, 247, 0.4));
  transform: scale(2.4);
  transform-origin: left center;
  margin-right: 38px;
}

/* ─── NEW DASHBOARD LAYOUT ─────────────────────────────────────────────────── */
.dashboard-layout {
  display: flex;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
  gap: 32px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.dashboard-sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  scrollbar-width: none;
}
.dashboard-sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar-profile {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
}

.sidebar-profile .avatar {
  width: 56px;
  height: 56px;
  font-size: 1.5rem;
}

.sidebar-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-since {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.sidebar-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
}
.sidebar-status.active {
  border-color: rgba(16, 185, 129, 0.3);
}
.sidebar-status.active .status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success);
}
.sidebar-status.inactive {
  border-color: rgba(239, 68, 68, 0.3);
}
.sidebar-status.inactive .status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--error); box-shadow: 0 0 8px var(--error);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
}
.sidebar-link:hover {
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  text-decoration: none;
}
.sidebar-link.active {
  background: rgba(168, 85, 247, 0.1);
  color: var(--accent-1);
  border: 1px solid var(--border-active);
  box-shadow: inset 0 0 20px rgba(168, 85, 247, 0.05);
  text-decoration: none;
}

.dashboard-main {
  flex: 1;
  min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  overflow-y: auto;
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
}
.dashboard-main::-webkit-scrollbar {
  width: 6px;
}
.dashboard-main::-webkit-scrollbar-track {
  background: transparent;
}
.dashboard-main::-webkit-scrollbar-thumb {
  background: var(--border-active);
  border-radius: 3px;
}

.main-header {
  margin-bottom: 32px;
}
.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 4px;
}

@media (max-width: 900px) {
  body {
    height: auto;
    overflow: visible;
    display: block;
    overflow-x: hidden;
  }
  .dashboard-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .dashboard-sidebar {
    width: 100%;
    overflow-y: visible;
  }
  .dashboard-main {
    overflow-y: visible;
  }
}
/* Global Reset: Remove all underlines from links and text decorations */
a, a:hover, a:focus, a:active {
  text-decoration: none !important;
}
