/* ==========================================================================
   LOOP PLAYER PRO — Modern Dark Glassmorphic SaaS Design System
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-base: #060913;
  --bg-surface: rgba(17, 23, 40, 0.75);
  --bg-card: rgba(20, 28, 48, 0.55);
  --bg-card-hover: rgba(30, 42, 70, 0.75);
  --bg-elevated: rgba(24, 33, 56, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-glow: rgba(56, 189, 248, 0.35);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.35);
  --accent-gold: #fbbf24;
  --accent-blue: #38bdf8;
  --accent-green: #34d399;
  --accent-red: #fb7185;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.5);
  --sidebar-width: 260px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(56, 189, 248, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(244, 63, 94, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}
a:hover {
  color: #7dd3fc;
}

/* SIDEBAR SYSTEM */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: fixed;
  height: 100vh;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  z-index: 999;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  margin-bottom: 6px;
}
.brand-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: white;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.4);
}
.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}
.brand-sub {
  font-size: 0.65rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
}
.close-sidebar-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}
.nav-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  font-weight: 700;
  padding: 12px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.16), rgba(56, 189, 248, 0.03));
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.nav-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
  flex-shrink: 0;
}

.user-profile {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  padding: 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 0.85rem;
}

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 26px 32px;
  max-width: 1600px;
  transition: margin 0.3s ease;
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
}

/* TOPBAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.mobile-toggle-btn {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1.2rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.page-header h1 {
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}
.page-header p {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 3px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.search-box {
  position: relative;
  width: 280px;
}
.search-box input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px 14px 10px 38px;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s;
}
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* BUTTONS */
.btn {
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: white;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.45);
  color: white;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: #e2e8f0;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fb7185;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
}
.btn-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.btn-success:hover {
  background: rgba(16, 185, 129, 0.3);
  color: #fff;
}
.btn-blue {
  background: #0284c7;
  color: white;
}
.btn-blue:hover {
  background: #0369a1;
  color: white;
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}
.stat-card.c-blue { border-left: 3px solid #38bdf8; }
.stat-card.c-green { border-left: 3px solid #34d399; }
.stat-card.c-yellow { border-left: 3px solid #fbbf24; }
.stat-card.c-pink { border-left: 3px solid #f472b6; }
.stat-card.c-purple { border-left: 3px solid #a78bfa; }
.stat-card.c-cyan { border-left: 3px solid #22d3ee; }

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}
.stat-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
}
.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}
.stat-hint {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* CARDS */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 22px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* TABLES */
.table-responsive {
  overflow-x: auto;
  border-radius: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  background: rgba(14, 20, 36, 0.85);
  padding: 13px 16px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}
td {
  padding: 13px 16px;
  font-size: 0.86rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
tr:hover td {
  background: rgba(56, 189, 248, 0.02);
}

/* PILLS & BADGES */
.mac-pill {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  color: #fff;
}
.key-pill {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--accent-gold);
}

.badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.badge-active, .badge-1year {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-lifetime {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-trial {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.badge-expired {
  background: rgba(239, 68, 68, 0.12);
  color: #fb7185;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge-banned {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.role-pill {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.role-superadmin { background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: #fff; }
.role-admin { background: linear-gradient(135deg, #0284c7, #0369a1); color: #fff; }
.role-reseller { background: linear-gradient(135deg, #059669, #10b981); color: #fff; }

.credits-box {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.86rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* FORMS */
.form-group {
  margin-bottom: 16px;
}
.form-group label, .form-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-control, .form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s;
}
.form-control:focus, .form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}
select.form-control, select.form-input {
  background-color: #0b1120;
  color: #fff;
}
select.form-control option, select.form-input option {
  background-color: #0b1120;
  color: #fff;
}

/* ALERTS */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.88rem;
  line-height: 1.5;
}
.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.alert-danger {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
}
.alert-info {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  background: #0d1222;
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}
.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}
.modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.modal-btns {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.btn-modal {
  flex: 1;
  padding: 11px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: none;
}
.btn-modal-cancel {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.btn-modal-confirm {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #fff;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
  .close-sidebar-btn { display: block; }
  .main-content { margin-left: 0; width: 100%; padding: 16px; }
  .mobile-toggle-btn { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .search-box { width: 100%; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}
