/* =====================================================
   FlashHost Pro — Premium Panel CSS (v2)
   ===================================================== */

:root,
html[data-theme="dark"] {
  --bg: #080b14;
  --bg2: #0d1117;
  --bg3: #111827;
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(124, 58, 237, 0.4);
  --text: #f8fafc;
  --text2: #94a3b8;
  --text3: #475569;
  --input-bg: rgba(255, 255, 255, 0.06);
  --primary: #7c3aed;
  --primary2: #6d28d9;
  --primary-glow: rgba(124, 58, 237, 0.25);
  --blue: #3b82f6;
  --cyan: #06b6d4;
  --pink: #ec4899;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --grad-main: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  --grad-bg: radial-gradient(
      ellipse at 20% 0%,
      rgba(124, 58, 237, 0.12) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse at 80% 100%,
      rgba(59, 130, 246, 0.08) 0%,
      transparent 60%
    ),
    #080b14;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.2);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --transition: 0.2s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  background: var(--grad-bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* =================== AUTH PAGES ==================== */

.auth-body {
  background: var(--grad-bg);
}

.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: blobFloat 8s ease-in-out infinite alternate;
}
.blob-1 {
  width: 500px;
  height: 500px;
  background: rgba(124, 58, 237, 0.5);
  top: -150px;
  left: -100px;
}
.blob-2 {
  width: 400px;
  height: 400px;
  background: rgba(59, 130, 246, 0.4);
  bottom: -100px;
  right: -80px;
  animation-delay: 2s;
}
.blob-3 {
  width: 300px;
  height: 300px;
  background: rgba(236, 72, 153, 0.3);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 4s;
}

@keyframes blobFloat {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(30px, -30px) scale(1.05);
  }
}
.blob-3 {
  animation-name: blobFloat3;
}
@keyframes blobFloat3 {
  from {
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    transform: translate(calc(-50% + 20px), calc(-50% - 20px)) scale(1.08);
  }
}

.auth-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  animation: cardEntrance 0.4s ease;
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 168px;
  height: 66px;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 1rem;
  padding: 6px 10px;
  box-sizing: border-box;
}

.logo-icon-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 47px;
  background: #fff;
  border-radius: 10px;
  padding: 4px 8px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.logo-icon img,
.logo-icon-sm img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.auth-logo h1 {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.25rem;
}

.auth-logo p {
  color: var(--text2);
  font-size: 0.9rem;
}

/* ===================== FORMS ====================== */

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group label i {
  margin-right: 0.4rem;
  color: var(--primary);
}

.form-group input,
.form-group select,
.select-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition),
    background var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.select-input:focus {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.08);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group input::placeholder {
  color: var(--text3);
}

.form-group small {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--text3);
}

.input-eye {
  position: relative;
}
.input-eye input {
  padding-right: 3rem;
}
.eye-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  padding: 0 1rem;
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  transition: color var(--transition);
}
.eye-btn:hover {
  color: var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== BUTTONS ==================== */

.btn-primary-full {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--grad-main);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition),
    box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
  margin-top: 0.5rem;
}
.btn-primary-full:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(124, 58, 237, 0.45);
}
.btn-primary-full:active {
  transform: translateY(0);
}
.btn-primary-full:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  background: var(--grad-main);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}
.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  background: var(--grad-main);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity var(--transition);
}
.btn-primary-sm:hover {
  opacity: 0.85;
}

.btn-ghost-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.btn-ghost-sm:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-ghost-danger {
  color: var(--red);
}
.btn-ghost-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

/* =================== ALERTS =================== */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert i {
  margin-top: 2px;
  flex-shrink: 0;
}
.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}
.alert-info {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

/* =================== AUTH FOOTER =================== */

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text2);
}
.auth-footer a {
  color: var(--primary);
  font-weight: 600;
}

.forgot-note {
  font-size: 0.8rem;
  color: var(--text3);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* =================== NAVBAR =================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: var(--topbar-h);
  background: rgba(8, 11, 20, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.avatar {
  width: 36px;
  height: 36px;
  background: var(--grad-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.avatar-sm {
  width: 32px;
  height: 32px;
  background: var(--grad-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.nav-redeem-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  color: #1a0d00 !important;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 -1px 0 rgba(0, 0, 0, 0.15) inset, 0 4px 16px rgba(245, 158, 11, 0.4);
  border: 1px solid rgba(255, 200, 80, 0.6);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.nav-redeem-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 -1px 0 rgba(0, 0, 0, 0.15) inset, 0 6px 20px rgba(245, 158, 11, 0.55);
}
.nav-redeem-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
  animation: shineVIP 3s infinite;
  pointer-events: none;
}
.nav-redeem-btn i {
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .nav-redeem-btn span {
    display: none;
  }
  .nav-redeem-btn {
    padding: 0.5rem 0.75rem;
  }
}

.nav-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  flex-shrink: 0;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 9px;
  color: #f87171;
  font-size: 0.95rem;
  transition: all var(--transition);
}
.nav-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  text-decoration: none;
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text2);
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all var(--transition);
}
.nav-back:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

/* =================== MAIN CONTENT =================== */

.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* =================== BANNER =================== */

.banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  position: relative;
  animation: slideDown 0.3s ease;
}
.banner i {
  flex-shrink: 0;
}
.banner span {
  flex: 1;
}
.banner-close {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  padding: 0.2rem;
  margin-left: auto;
  flex-shrink: 0;
}
.banner-close:hover {
  opacity: 1;
}
.banner-info {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}
.banner-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}
.banner-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fcd34d;
}
.banner-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

/* =================== WELCOME ROW =================== */

.welcome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}
.page-title span {
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-sub {
  color: var(--text2);
  font-size: 0.9rem;
}

.membership-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
}
.badge-premium {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}
.badge-free {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  color: var(--text2);
}

/* =================== SHORTLINK CARD =================== */

.shortlink-card {
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.shortlink-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 100%;
}

.shortlink-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  flex: 1;
  min-width: 0;
  font-family: "Courier New", monospace;
  font-size: 0.875rem;
}
.shortlink-display span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text2);
}

.copy-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0.2rem;
  transition: transform var(--transition);
}
.copy-btn:hover {
  transform: scale(1.1);
}

.shortlink-visits {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text2);
  padding: 0.3rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50px;
}
.shortlink-visits strong {
  color: var(--text);
}

/* =================== STATS GRID =================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.stat-data .stat-icon {
  background: rgba(124, 58, 237, 0.15);
  color: var(--primary);
}
.stat-expiry .stat-icon {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
}
.stat-visits .stat-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
}
.stat-theme .stat-icon {
  background: rgba(236, 72, 153, 0.15);
  color: var(--pink);
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text2);
  font-weight: 500;
}

.stat-glow {
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  filter: blur(20px);
  opacity: 0.3;
}
.stat-data .stat-glow {
  background: var(--primary);
}
.stat-expiry .stat-glow {
  background: var(--blue);
}
.stat-visits .stat-glow {
  background: var(--green);
}
.stat-theme .stat-glow {
  background: var(--pink);
}

.text-danger {
  color: var(--red);
}

/* =================== TABS =================== */

.tab-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}
.tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(124, 58, 237, 0.05);
}

.tab-content {
  display: none;
  padding: 2rem;
}
.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* =================== SETTINGS =================== */

.settings-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.settings-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-title i {
  color: var(--primary);
}
.section-hint {
  font-size: 0.82rem;
  color: var(--text3);
  margin-top: -0.75rem;
  margin-bottom: 1rem;
}

.form-actions {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* =================== THEMES SECTION =================== */

.themes-intro {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.themes-intro > i {
  font-size: 2rem;
  color: var(--primary);
  flex-shrink: 0;
}
.themes-intro > div {
  flex: 1;
}
.themes-intro h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}
.themes-intro p {
  font-size: 0.85rem;
  color: var(--text2);
}
.btn-open-themes {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  background: var(--grad-main);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
  transition: opacity var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.btn-open-themes:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.current-theme-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
.ctc-icon {
  width: 44px;
  height: 44px;
  background: rgba(16, 185, 129, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  font-size: 1.25rem;
  flex-shrink: 0;
}
.ctc-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--green);
  font-weight: 600;
}
.ctc-name {
  font-size: 0.95rem;
  font-weight: 700;
}
.badge-live {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--green);
  margin-left: auto;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
}
.badge-live i {
  font-size: 0.45rem;
  animation: pulse 1.5s ease infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.theme-grid-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all var(--transition);
  cursor: pointer;
}
.theme-grid-card:hover {
  border-color: var(--border-glow);
  background: rgba(124, 58, 237, 0.06);
  transform: translateY(-2px);
}
.theme-grid-card.active {
  border-color: var(--green);
  background: rgba(16, 185, 129, 0.05);
}

.tgc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.tgc-icon {
  width: 44px;
  height: 44px;
  background: rgba(124, 58, 237, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.25rem;
}
.badge-active-sm {
  font-size: 0.7rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--green);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}
.tgc-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.tgc-desc {
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 1rem;
}
.tgc-apply {
  width: 100%;
  padding: 0.6rem;
  background: var(--grad-main);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: opacity var(--transition);
  margin-top: 0.75rem;
}
.tgc-apply:hover:not(:disabled) {
  opacity: 0.85;
}
.tgc-apply.applied {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
  cursor: default;
}
.tgc-apply:disabled {
  cursor: default;
}

/* =================== THEME DRAWER =================== */

.theme-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.theme-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.theme-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 340px;
  max-width: 90vw;
  background: #0d1117;
  border-right: 1px solid var(--border);
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 40px rgba(0, 0, 0, 0.5);
}
.theme-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}
.drawer-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  font-weight: 700;
}
.drawer-title i {
  color: var(--primary);
}
.drawer-close {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 1rem;
}
.drawer-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.theme-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.theme-card:hover {
  border-color: var(--border-glow);
  background: rgba(124, 58, 237, 0.06);
}
.theme-card.active {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.05);
}

.theme-icon {
  width: 44px;
  height: 44px;
  background: rgba(124, 58, 237, 0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.theme-info {
  flex: 1;
  min-width: 0;
}
.theme-info strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
}
.theme-info small {
  font-size: 0.75rem;
  color: var(--text2);
}
.theme-badge-active {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  color: var(--green);
  margin-top: 0.2rem;
}

.btn-apply {
  padding: 0.45rem 0.85rem;
  background: var(--grad-main);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: opacity var(--transition);
}
.btn-apply:hover:not(:disabled) {
  opacity: 0.85;
}
.btn-applied {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
}
.btn-applied:disabled {
  cursor: default;
}

.no-themes {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text3);
}
.no-themes i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}
.no-themes p {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

/* =================== MEMBERSHIP MODAL =================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: #111827;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-card);
  animation: cardEntrance 0.3s ease;
  transform: scale(1);
}
.modal-overlay.show .modal-box {
  animation: cardEntrance 0.3s ease;
}

.modal-box.modal-lg {
  max-width: 620px;
  padding: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
  padding: 0.2rem;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 1rem;
  flex-shrink: 0;
}
.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.modal-form {
  padding: 1.5rem;
}

.modal-icon {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 1rem;
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.modal-box h3 {
  text-align: center;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}
.modal-box > p {
  text-align: center;
  color: var(--text2);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.modal-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 1rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.mtab {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text2);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}
.mtab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}
.mtab.active {
  color: var(--primary);
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.3);
}

.mtab-content {
  display: none;
}
.mtab-content.active {
  display: block;
}

/* =================== TOAST =================== */

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.875rem 1.25rem;
  background: #1e2535;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 999;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.3s ease;
  max-width: 320px;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast-success {
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.toast-success i {
  color: var(--green);
}
.toast-error {
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.toast-error i {
  color: var(--red);
}

/* =================== CARD =================== */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.card-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-header h3 i {
  color: var(--primary);
}
.card-link {
  font-size: 0.8rem;
  color: var(--primary);
}

/* =================== EMPTY STATE =================== */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text3);
}
.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
  opacity: 0.5;
}
.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text2);
  margin-bottom: 0.5rem;
}
.empty-state p {
  font-size: 0.875rem;
}

/* =================== REDEEM PAGE =================== */

.membership-tiers {
  margin-top: 2rem;
}
.membership-tiers h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.tiers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
@media (max-width: 600px) {
  .tiers-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.tier {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
  text-align: center;
}
.tier i {
  font-size: 1.5rem;
  color: var(--text3);
}
.tier-popular {
  border-color: rgba(124, 58, 237, 0.3);
  background: rgba(124, 58, 237, 0.08);
}
.tier-popular i {
  color: var(--primary);
}
.tier-popular span {
  color: var(--text);
}

/* =================== ADMIN LAYOUT =================== */

.admin-layout {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}
@media (max-width: 900px) {
  .admin-layout {
    margin-left: 0;
  }
}

.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #0d1117;
  border-right: 1px solid var(--border);
  z-index: 150;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  overflow-y: auto;
}
@media (max-width: 900px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 149;
  display: none;
}
.sidebar-overlay.show {
  display: block;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-nav {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  font-weight: 600;
  padding: 0.75rem 0.75rem 0.25rem;
  margin-top: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text2);
  transition: all var(--transition);
  text-decoration: none;
}
.sidebar-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
.sidebar-link.active {
  color: var(--primary);
  background: rgba(124, 58, 237, 0.12);
}
.sidebar-link i {
  width: 18px;
  text-align: center;
}
.sidebar-link-danger:hover {
  color: var(--red);
  background: rgba(239, 68, 68, 0.1);
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  height: var(--topbar-h);
  background: rgba(8, 11, 20, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.sidebar-toggle {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  display: none;
}
@media (max-width: 900px) {
  .sidebar-toggle {
    display: flex;
  }
}
.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
  flex-shrink: 0;
}
.topbar-right > * {
  flex-shrink: 0;
}
.nav-right > * {
  flex-shrink: 0;
}

.admin-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
}

.admin-main {
  padding: 2rem 1.5rem 3rem;
  max-width: 1200px;
}

/* =================== ADMIN STATS =================== */

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.astat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform var(--transition);
}
.astat-card:hover {
  transform: translateY(-2px);
}

.astat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.astat-val {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}
.astat-label {
  font-size: 0.75rem;
  color: var(--text2);
  font-weight: 500;
}

.admin-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 700px) {
  .admin-two-col {
    grid-template-columns: 1fr;
  }
}

/* =================== TABLES =================== */

.table-wrapper {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.admin-table th {
  padding: 0.875rem 1.25rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}
.admin-table tr:last-child td {
  border-bottom: none;
}
.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.user-cell small {
  font-size: 0.75rem;
  color: var(--text3);
}

/* =================== BADGES =================== */

.badge-success {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.badge-danger {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.badge-warning {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.badge-muted {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text3);
  border: 1px solid var(--border);
}
.badge-info {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.badge-danger-sm {
  color: var(--red);
  font-size: 0.75rem;
}

/* =================== ACTION BUTTONS =================== */

.action-btns {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.action-btn {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all var(--transition);
}
.action-btn:hover {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.3);
  color: var(--primary);
}
.action-btn-danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--red);
}

/* =================== SEARCH =================== */

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.search-form {
  display: flex;
  gap: 0.5rem;
}
.search-form input {
  padding: 0.6rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  min-width: 200px;
}
.search-form input:focus {
  border-color: var(--primary);
}
.search-form button {
  padding: 0.6rem 0.875rem;
  background: var(--grad-main);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 0.875rem;
}

/* =================== FILTER BAR =================== */

.table-filter-bar {
  display: flex;
  gap: 0.25rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.filter-link {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  transition: all var(--transition);
}
.filter-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
.filter-link.active {
  color: var(--primary);
  background: rgba(124, 58, 237, 0.1);
}

/* =================== REDEEM CODES =================== */

.generated-codes-card {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.gc-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.gc-header i {
  color: var(--green);
  font-size: 1.25rem;
}
.gc-header h3 {
  flex: 1;
  font-size: 0.95rem;
}
.gc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.gc-code {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.8rem;
}
.gc-code:hover {
  border-color: var(--green);
  background: rgba(16, 185, 129, 0.08);
}
.gc-code code {
  font-family: "Courier New", monospace;
  letter-spacing: 1px;
}
.gc-code i {
  color: var(--text3);
  font-size: 0.75rem;
}

.days-selector {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.day-option {
  cursor: pointer;
}
.day-option input {
  display: none;
}
.day-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
  transition: all var(--transition);
  cursor: pointer;
}
.day-option input:checked + .day-label {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.4);
  color: var(--primary);
}
.day-label:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.mini-stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.mini-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 0.75rem;
  text-align: center;
}
.ms-val {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}
.ms-label {
  font-size: 0.72rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* =================== THEMES ADMIN =================== */

.themes-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.theme-admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all var(--transition);
}
.theme-admin-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}
.card-disabled {
  opacity: 0.55;
}

.tac-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.tac-icon {
  width: 48px;
  height: 48px;
  background: rgba(124, 58, 237, 0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.3rem;
}
.icon-missing {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
}
.tac-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}
.tac-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.tac-folder {
  font-size: 0.75rem;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}
.tac-folder i {
  color: var(--amber);
}
.tac-desc {
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 0.75rem;
}
.tac-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* =================== INFO CARD =================== */

.info-card {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}
.info-card i {
  font-size: 1.1rem;
  margin-top: 2px;
  flex-shrink: 0;
}

/* =================== RESPONSIVE =================== */

@media (max-width: 640px) {
  .auth-card {
    padding: 1.75rem;
  }
  .main-content {
    padding: 1.25rem 1rem 2rem;
  }
  .tab-btn {
    font-size: 0.8rem;
    padding: 0.875rem 1rem;
  }
  .shortlink-card {
    flex-direction: column;
  }
  .page-title {
    font-size: 1.25rem;
  }
  .admin-main {
    padding: 1.25rem 1rem 2rem;
  }
  .themes-intro {
    flex-direction: column;
  }
  .admin-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

code {
  font-family: "Courier New", Courier, monospace;
  background: rgba(255, 255, 255, 0.07);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--cyan);
}

/* ============================================
   LIGHT MODE
   ============================================ */

html[data-theme="light"] {
  --bg: #f8fafc;
  --bg2: #ffffff;
  --bg3: #f1f5f9;
  --card: rgba(255, 255, 255, 0.9);
  --card-hover: rgba(255, 255, 255, 1);
  --border: rgba(0, 0, 0, 0.08);
  --border-glow: rgba(124, 58, 237, 0.3);
  --text: #0f172a;
  --text2: #475569;
  --text3: #94a3b8;
  --input-bg: rgba(0, 0, 0, 0.04);
  --grad-bg: radial-gradient(
      ellipse at 20% 0%,
      rgba(124, 58, 237, 0.08) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse at 80% 100%,
      rgba(59, 130, 246, 0.06) 0%,
      transparent 60%
    ),
    #f8fafc;
  --shadow-card: 0 2px 12px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .navbar,
html[data-theme="light"] .admin-topbar {
  background: rgba(255, 255, 255, 0.85);
}
html[data-theme="light"] .admin-sidebar,
html[data-theme="light"] .theme-drawer {
  background: #ffffff;
}
html[data-theme="light"] .modal-box {
  background: #ffffff;
}
html[data-theme="light"] code {
  background: rgba(0, 0, 0, 0.05);
  color: #6d28d9;
}
html[data-theme="light"] .shortlink-display {
  background: rgba(0, 0, 0, 0.04);
}
html[data-theme="light"] .form-group input,
html[data-theme="light"] .form-group select,
html[data-theme="light"] .select-input,
html[data-theme="light"] textarea {
  background: var(--input-bg);
}
html[data-theme="light"] .toast {
  background: #ffffff;
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */

.theme-toggle {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 0.95rem;
}
.theme-toggle:hover {
  background: rgba(124, 58, 237, 0.12);
  color: var(--primary);
  border-color: rgba(124, 58, 237, 0.3);
}
html[data-theme="light"] .theme-toggle {
  background: rgba(0, 0, 0, 0.04);
}

/* ============================================
   VIP / TIER BADGES
   ============================================ */

.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-radius: 5px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  color: #1a0d00;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 200, 80, 0.6);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}
.vip-badge::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
  animation: shineVIP 3s infinite;
}
@keyframes shineVIP {
  0% {
    left: -100%;
  }
  60%,
  100% {
    left: 100%;
  }
}
.vip-badge i {
  font-size: 0.65rem;
}

.vip-badge-lg {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  border-radius: 8px;
  gap: 0.5rem;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.vip-badge-lg i {
  font-size: 0.9rem;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-radius: 4px;
}
.tier-free {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text2);
  border: 1px solid var(--border);
}
.tier-vip {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #1a0d00;
  border: 1px solid rgba(255, 200, 80, 0.6);
}
.tier-gold {
  background: linear-gradient(135deg, #facc15, #ca8a04);
  color: #1f1300;
  border: 1px solid rgba(250, 204, 21, 0.6);
}
.tier-platinum {
  background: linear-gradient(135deg, #e5e7eb, #94a3b8);
  color: #0f172a;
  border: 1px solid rgba(229, 231, 235, 0.7);
}

/* User name with VIP glow */
.user-with-vip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.user-with-vip.is-vip {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* Avatar with VIP ring */
.avatar.is-vip,
.avatar-sm.is-vip {
  box-shadow: 0 0 0 2px var(--bg2), 0 0 0 4px #fbbf24,
    0 0 16px rgba(251, 191, 36, 0.5);
  position: relative;
}
.avatar.is-vip::after,
.avatar-sm.is-vip::after {
  content: "\f521"; /* crown */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #1a0d00;
  font-size: 0.55rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg2);
}

/* ============================================
   PROFILE AVATAR IMAGE
   ============================================ */

.avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--grad-main);
}
.avatar-img-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--grad-main);
}
.avatar-img-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--grad-main);
}

.avatar-upload-area {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.avatar-upload-preview {
  position: relative;
}
.avatar-upload-preview .avatar-img-lg {
  box-shadow: 0 0 0 3px var(--bg2), 0 0 0 5px rgba(124, 58, 237, 0.3);
}
.avatar-upload-controls {
  flex: 1;
}
.avatar-upload-controls h4 {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}
.avatar-upload-controls p {
  font-size: 0.78rem;
  color: var(--text2);
  margin-bottom: 0.75rem;
}
.avatar-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--grad-main);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.avatar-upload-btn input {
  display: none;
}

/* ============================================
   SKELETON LOADERS
   ============================================ */

.skeleton {
  display: block;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes skeletonShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
.skeleton-text {
  height: 1em;
  margin-bottom: 0.5rem;
}
.skeleton-title {
  height: 1.5em;
  width: 60%;
  margin-bottom: 0.75rem;
}
.skeleton-line {
  height: 0.85em;
}
.skeleton-line.w-90 {
  width: 90%;
}
.skeleton-line.w-70 {
  width: 70%;
}
.skeleton-line.w-50 {
  width: 50%;
}
.skeleton-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.skeleton-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.skeleton-stat {
  height: 80px;
}

/* ============================================
   CHART CONTAINER
   ============================================ */

.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.chart-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.chart-header h3 i {
  color: var(--primary);
}
.chart-range {
  display: flex;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.25rem;
  border-radius: 8px;
}
.chart-range button {
  background: none;
  border: none;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.chart-range button.active {
  background: var(--primary);
  color: #fff;
}
.chart-wrapper {
  position: relative;
  height: 280px;
}

/* ============================================
   CATEGORY FILTER (themes)
   ============================================ */

.category-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.category-chip:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}
.category-chip.active {
  background: var(--grad-main);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}

/* ============================================
   THEME CARDS V2 (with thumbnails)
   ============================================ */

.theme-thumb {
  width: 100%;
  height: 140px;
  border-radius: 10px;
  object-fit: cover;
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.2),
    rgba(59, 130, 246, 0.1)
  );
  margin-bottom: 0.75rem;
  display: block;
}
.theme-thumb-placeholder {
  width: 100%;
  height: 140px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.15),
    rgba(59, 130, 246, 0.1)
  );
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.theme-grid-card .lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 5;
}
.theme-grid-card {
  position: relative;
}
.theme-grid-card.is-locked:hover .lock-overlay {
  opacity: 1;
}
.lock-overlay i {
  font-size: 2rem;
  color: #fbbf24;
  margin-bottom: 0.5rem;
}
.lock-overlay span {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  padding: 0 1rem;
}

/* ============================================
   DROPZONE (drag & drop upload)
   ============================================ */

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
}
.dropzone:hover,
.dropzone.drag-active {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.06);
}
.dropzone i {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1rem;
}
.dropzone h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}
.dropzone p {
  font-size: 0.85rem;
  color: var(--text2);
}
.dropzone input[type="file"] {
  display: none;
}
.dropzone .file-info {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  color: var(--green);
  font-size: 0.85rem;
}

/* ============================================
   LEADERBOARD
   ============================================ */

.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.lb-row:hover {
  background: var(--card-hover);
  border-color: rgba(124, 58, 237, 0.2);
}
.lb-rank {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text2);
  flex-shrink: 0;
}
.lb-row.top-1 .lb-rank {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #1a0d00;
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.4);
}
.lb-row.top-2 .lb-rank {
  background: linear-gradient(135deg, #e5e7eb, #94a3b8);
  color: #0f172a;
}
.lb-row.top-3 .lb-rank {
  background: linear-gradient(135deg, #fb923c, #c2410c);
  color: #fff;
}
.lb-user {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.lb-user-info {
  min-width: 0;
  flex: 1;
}
.lb-user-info strong {
  display: block;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-user-info small {
  font-size: 0.75rem;
  color: var(--text2);
}
.lb-stat {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
}
.lb-stat small {
  font-size: 0.7rem;
  color: var(--text2);
  font-weight: 500;
  display: block;
  text-align: right;
}

/* ============================================
   NOTIFICATIONS BELL
   ============================================ */

.notif-bell {
  position: relative;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.notif-bell:hover {
  background: rgba(124, 58, 237, 0.12);
  color: var(--primary);
}
.notif-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   MOBILE SIDEBAR POLISH
   ============================================ */

@media (max-width: 900px) {
  .admin-sidebar {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
  }
  .sidebar-overlay {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s;
  }
  .sidebar-overlay.show {
    opacity: 1;
  }
}

/* Drag handle for swipe-to-close on mobile */
.drawer-handle {
  display: none;
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  margin: 0.5rem auto 0;
}
@media (max-width: 640px) {
  .drawer-handle {
    display: block;
  }
}

/* ============================================
   BETTER EMPTY STATES
   ============================================ */

.empty-state-v2 {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state-v2 .empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.15),
    rgba(59, 130, 246, 0.08)
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--primary);
}
.empty-state-v2 h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.empty-state-v2 p {
  font-size: 0.9rem;
  color: var(--text2);
  max-width: 380px;
  margin: 0 auto 1.5rem;
}

/* ============================================
   INLINE FORM VALIDATION
   ============================================ */

.form-group input.invalid,
.form-group select.invalid,
.form-group textarea.invalid {
  border-color: var(--red);
  background: rgba(239, 68, 68, 0.05);
}
.form-group input.valid {
  border-color: var(--green);
}
.field-error {
  color: var(--red);
  font-size: 0.75rem;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  animation: slideDown 0.2s ease;
}
.field-success {
  color: var(--green);
  font-size: 0.75rem;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Password strength meter */
.pw-strength {
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}
.pw-strength-bar {
  height: 100%;
  width: 0;
  transition: width 0.25s, background 0.25s;
}
.pw-strength.weak .pw-strength-bar {
  width: 33%;
  background: var(--red);
}
.pw-strength.medium .pw-strength-bar {
  width: 66%;
  background: var(--amber);
}
.pw-strength.strong .pw-strength-bar {
  width: 100%;
  background: var(--green);
}
.pw-strength-label {
  font-size: 0.7rem;
  margin-top: 0.25rem;
  color: var(--text2);
}

textarea {
  font-family: inherit;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.75rem 1rem;
  width: 100%;
  resize: vertical;
  font-size: 0.95rem;
  outline: none;
}
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ===================================================
   OWNER / ADMIN BADGE (premium red-crimson gradient)
   =================================================== */

.admin-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  border-radius: 5px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #991b1b 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 120, 120, 0.6);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
  vertical-align: middle;
}
.admin-badge-pill::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: shineAdmin 3.5s infinite;
}
@keyframes shineAdmin {
  0% {
    left: -100%;
  }
  60%,
  100% {
    left: 100%;
  }
}
.admin-badge-pill i {
  font-size: 0.65rem;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

/* Larger variant */
.admin-badge-pill.lg {
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  gap: 0.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.admin-badge-pill.lg i {
  font-size: 0.9rem;
}

/* Owner avatar ring (red instead of gold) */
.avatar.is-owner,
.avatar-sm.is-owner,
.avatar-img.is-owner,
.avatar-img-sm.is-owner,
.avatar-img-lg.is-owner {
  box-shadow: 0 0 0 2px var(--bg2), 0 0 0 4px #ef4444,
    0 0 18px rgba(239, 68, 68, 0.55);
  position: relative;
}
.avatar.is-owner::after,
.avatar-sm.is-owner::after,
.avatar-img.is-owner::after,
.avatar-img-sm.is-owner::after {
  content: "\f3ed"; /* shield-halved */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #ef4444, #991b1b);
  color: #fff;
  font-size: 0.55rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg2);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
}

/* ===================================================
   GLASSMORPHISM — premium frosted glass effects
   Applied across all major surfaces
   =================================================== */

/* Base body now has subtle texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(
      circle at 15% 20%,
      rgba(124, 58, 237, 0.1),
      transparent 40%
    ),
    radial-gradient(
      circle at 85% 80%,
      rgba(59, 130, 246, 0.08),
      transparent 40%
    ),
    radial-gradient(
      circle at 50% 50%,
      rgba(236, 72, 153, 0.04),
      transparent 60%
    );
  pointer-events: none;
  z-index: -1;
}
html[data-theme="light"] body::before {
  background: radial-gradient(
      circle at 15% 20%,
      rgba(124, 58, 237, 0.07),
      transparent 40%
    ),
    radial-gradient(
      circle at 85% 80%,
      rgba(59, 130, 246, 0.05),
      transparent 40%
    );
}

/* Glass navbar */
.navbar,
.admin-topbar {
  background: rgba(13, 17, 23, 0.65) !important;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 32px rgba(0, 0, 0, 0.2);
}
html[data-theme="light"] .navbar,
html[data-theme="light"] .admin-topbar {
  background: rgba(255, 255, 255, 0.7) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Glass sidebar */
.admin-sidebar,
.theme-drawer {
  background: rgba(13, 17, 23, 0.75) !important;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.03) inset;
}
html[data-theme="light"] .admin-sidebar,
html[data-theme="light"] .theme-drawer {
  background: rgba(255, 255, 255, 0.8) !important;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}

/* Glass cards (stronger frosted look) */
.card,
.stat-card,
.astat-card,
.theme-grid-card,
.theme-admin-card,
.shortlink-card,
.chart-card,
.tab-panel,
.lb-row,
.mini-stat,
.tier,
.info-card,
.generated-codes-card,
.current-theme-card,
.themes-intro,
.empty-state-v2 {
  background: rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 32px rgba(0, 0, 0, 0.15);
  position: relative;
}
html[data-theme="light"] .card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .astat-card,
html[data-theme="light"] .theme-grid-card,
html[data-theme="light"] .theme-admin-card,
html[data-theme="light"] .shortlink-card,
html[data-theme="light"] .chart-card,
html[data-theme="light"] .tab-panel,
html[data-theme="light"] .lb-row,
html[data-theme="light"] .mini-stat,
html[data-theme="light"] .tier,
html[data-theme="light"] .info-card,
html[data-theme="light"] .generated-codes-card,
html[data-theme="light"] .current-theme-card,
html[data-theme="light"] .themes-intro,
html[data-theme="light"] .empty-state-v2 {
  background: rgba(255, 255, 255, 0.65) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 4px 24px rgba(15, 23, 42, 0.06);
}

/* Glow border on hover */
.stat-card:hover,
.astat-card:hover,
.theme-grid-card:hover,
.theme-admin-card:hover {
  border-color: rgba(124, 58, 237, 0.35) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 40px rgba(124, 58, 237, 0.18) !important;
}

/* Subtle gradient top highlight on cards */
.card::before,
.stat-card::before,
.astat-card::before,
.theme-grid-card::before,
.theme-admin-card::before,
.shortlink-card::before,
.chart-card::before,
.tab-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  pointer-events: none;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* Glass modals — heavier blur */
.modal-overlay {
  background: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.modal-box {
  background: rgba(17, 24, 39, 0.85) !important;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 24px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(124, 58, 237, 0.15);
}
html[data-theme="light"] .modal-box {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 24px 80px rgba(15, 23, 42, 0.15);
}

/* Glass form inputs */
.form-group input,
.form-group select,
.select-input,
textarea,
.search-form input {
  background: rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
html[data-theme="light"] .form-group input,
html[data-theme="light"] .form-group select,
html[data-theme="light"] .select-input,
html[data-theme="light"] textarea,
html[data-theme="light"] .search-form input {
  background: rgba(255, 255, 255, 0.6) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

/* Glass tab nav */
.tab-nav {
  background: rgba(0, 0, 0, 0.15) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
html[data-theme="light"] .tab-nav {
  background: rgba(15, 23, 42, 0.04) !important;
  border-bottom-color: rgba(15, 23, 42, 0.06) !important;
}

/* Glass toasts */
.toast {
  background: rgba(30, 37, 53, 0.85) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
html[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  color: var(--text);
}

/* Glass action buttons */
.action-btn,
.btn-ghost-sm,
.nav-logout,
.theme-toggle,
.notif-bell,
.drawer-close,
.modal-close-btn,
.sidebar-toggle {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Glass alerts (more transparent) */
.alert {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Glass banners */
.banner {
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 4px 24px rgba(0, 0, 0, 0.08);
}

/* Glass dropzone */
.dropzone {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.03) !important;
}

/* Stat icon glow upgrade */
.stat-icon,
.astat-icon,
.tac-icon,
.tgc-icon,
.theme-icon,
.ctc-icon {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 4px 16px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
}

/* Buttons with frosted feel */
.btn-primary,
.btn-primary-full,
.btn-primary-sm,
.btn-open-themes {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 -1px 0 rgba(0, 0, 0, 0.2) inset, 0 4px 16px rgba(124, 58, 237, 0.35);
  position: relative;
  overflow: hidden;
}
.btn-primary::after,
.btn-primary-full::after,
.btn-primary-sm::after,
.btn-open-themes::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent);
  pointer-events: none;
}

/* Glass membership badges */
.membership-badge,
.vip-badge,
.admin-badge-pill,
.tier-badge {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Glass category chips */
.category-chip {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.04) !important;
}
html[data-theme="light"] .category-chip {
  background: rgba(15, 23, 42, 0.04) !important;
}

/* Make light mode body inherit gradient */
html[data-theme="light"] body {
  background: var(--grad-bg);
}

/* Smooth all transitions */
.card,
.stat-card,
.astat-card,
.theme-grid-card,
.theme-admin-card,
.btn-primary,
.btn-primary-full,
.btn-ghost-sm,
.action-btn,
.sidebar-link,
.tab-btn,
.category-chip,
.lb-row {
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease,
    box-shadow 0.25s ease, color 0.2s ease;
}

/* ===================================================
   COMPREHENSIVE MOBILE RESPONSIVE FIXES
   =================================================== */

/* TABLET — ≤ 900px */
@media (max-width: 900px) {
  .main-content {
    padding: 1.5rem 1rem 2.5rem;
  }
  .welcome-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .page-title {
    font-size: 1.35rem;
    line-height: 1.3;
    flex-wrap: wrap;
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }
  .vip-badge-lg {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
  }
  .themes-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* MOBILE — ≤ 640px */
@media (max-width: 640px) {
  /* ---- Body & main spacing ---- */
  body {
    font-size: 14px;
  }
  .main-content {
    padding: 1rem 0.75rem 2rem;
  }

  /* ---- NAVBAR ---- */
  .navbar {
    padding: 0 0.75rem;
    height: 56px;
    gap: 0.25rem;
  }
  .nav-brand {
    gap: 0.5rem;
    min-width: 0;
    flex-shrink: 1;
  }
  .nav-brand span {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 130px;
  }
  .nav-right {
    gap: 0.4rem;
  }

  /* Hide username and badges from navbar on phones (still visible in welcome row) */
  .nav-user span,
  .nav-user .vip-badge,
  .nav-user .admin-badge-pill {
    display: none;
  }
  .nav-user {
    gap: 0;
  }

  /* Hide leaderboard icon button in navbar on very small screens */
  .nav-right .theme-toggle[title="Leaderboard"] {
    display: none;
  }

  .theme-toggle,
  .nav-logout,
  .notif-bell {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }
  .avatar,
  .avatar-img {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }

  /* ---- Welcome row ---- */
  .page-title {
    font-size: 1.2rem;
  }
  .page-title .vip-badge-lg {
    display: inline-flex;
    padding: 0.25rem 0.55rem;
    font-size: 0.65rem;
  }
  .page-sub {
    font-size: 0.82rem;
  }
  .membership-badge {
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
  }

  /* ---- Banner ---- */
  .banner {
    padding: 0.75rem 0.9rem;
    font-size: 0.82rem;
    gap: 0.5rem;
  }

  /* ---- Shortlink card ---- */
  .shortlink-card {
    padding: 1rem;
    gap: 0.75rem;
  }
  .shortlink-label {
    font-size: 0.72rem;
  }
  .shortlink-display {
    padding: 0.55rem 0.75rem;
    font-size: 0.72rem;
    width: 100%;
    min-width: 0;
  }
  .shortlink-display span {
    font-size: 0.72rem;
  }
  .shortlink-visits {
    font-size: 0.76rem;
    padding: 0.35rem 0.7rem;
    align-self: flex-start;
  }

  /* ---- Stats grid: 2 columns on tiny screens not 1 ---- */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }
  .stat-card {
    padding: 0.9rem;
    gap: 0.65rem;
    flex-direction: column;
    align-items: flex-start;
  }
  .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }
  .stat-value {
    font-size: 1rem;
    line-height: 1.2;
    word-break: break-word;
  }
  .stat-label {
    font-size: 0.68rem;
  }

  /* ---- Chart ---- */
  .chart-card {
    padding: 1rem;
  }
  .chart-header h3 {
    font-size: 0.85rem;
  }
  .chart-range button {
    padding: 0.3rem 0.65rem;
    font-size: 0.7rem;
  }
  .chart-wrapper {
    height: 220px;
  }

  /* ---- Tabs ---- */
  .tab-btn {
    padding: 0.75rem 0.5rem;
    font-size: 0.78rem;
    gap: 0.3rem;
  }
  .tab-btn i {
    font-size: 0.85rem;
  }
  .tab-content {
    padding: 1.25rem 1rem;
  }

  /* ---- Settings form ---- */
  .settings-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
  }
  .section-title {
    font-size: 0.9rem;
  }
  .form-group label {
    font-size: 0.72rem;
  }
  .form-group input,
  .form-group select,
  textarea,
  .select-input {
    padding: 0.65rem 0.85rem;
    font-size: 0.88rem;
  }
  .btn-primary,
  .btn-primary-full,
  .btn-primary-sm {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
  }

  /* ---- Avatar upload area ---- */
  .avatar-upload-area {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 1.25rem 0.75rem;
  }
  .avatar-img-lg {
    width: 80px;
    height: 80px;
    font-size: 2rem;
  }

  /* ---- Themes intro ---- */
  .themes-intro {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 1.25rem 1rem;
    gap: 1rem;
  }
  .themes-intro > i {
    margin: 0 auto;
  }
  .btn-open-themes {
    width: 100%;
    justify-content: center;
  }

  /* ---- Current theme card ---- */
  .current-theme-card {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
  }
  .ctc-name {
    font-size: 0.85rem;
  }
  .badge-live {
    font-size: 0.65rem;
  }

  /* ---- Category filter — horizontal scroll ---- */
  .category-filter {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: nowrap;
  }
  .category-filter::-webkit-scrollbar {
    display: none;
  }
  .category-chip {
    padding: 0.4rem 0.85rem;
    font-size: 0.76rem;
  }

  /* ---- Themes grid: 1 column on phones ---- */
  .themes-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .theme-grid-card {
    padding: 1rem;
  }
  .theme-thumb,
  .theme-thumb-placeholder {
    height: 110px;
  }
  .tgc-name {
    font-size: 0.92rem;
  }
  .tgc-apply {
    padding: 0.65rem;
    font-size: 0.82rem;
  }

  /* ---- Theme drawer (mobile bottom sheet feel) ---- */
  .theme-drawer {
    width: 88vw;
    max-width: 340px;
  }
  .drawer-header {
    padding: 1rem 1.1rem;
  }
  .drawer-body {
    padding: 0.75rem;
  }
  .theme-card {
    padding: 0.7rem 0.85rem;
    gap: 0.6rem;
  }
  .theme-info strong {
    font-size: 0.82rem;
  }
  .theme-icon {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }
  .btn-apply {
    padding: 0.4rem 0.7rem;
    font-size: 0.72rem;
  }

  /* ---- Modals: full-width on mobile ---- */
  .modal-overlay {
    padding: 0.75rem;
    align-items: flex-end;
  }
  .modal-box {
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 16px 16px;
    max-height: 90vh;
    overflow-y: auto;
  }
  .modal-box.modal-lg {
    max-width: 100%;
  }
  .modal-form {
    padding: 1.25rem 1rem;
  }
  .modal-header {
    padding: 1rem 1.1rem;
  }
  .modal-header h3 {
    font-size: 0.92rem;
  }
  .modal-tabs {
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding: 0.75rem 1rem 0.5rem;
  }
  .modal-tabs::-webkit-scrollbar {
    display: none;
  }
  .mtab {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.76rem;
  }

  /* ---- Toast ---- */
  .toast {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
    font-size: 0.82rem;
  }

  /* ---- Auth pages ---- */
  .auth-container {
    padding: 1rem 0.75rem;
    min-height: 100dvh;
  }
  .auth-card {
    padding: 1.5rem 1.25rem;
    max-width: 100%;
    border-radius: 18px;
  }
  .auth-logo {
    margin-bottom: 1.25rem;
  }
  .auth-logo h1 {
    font-size: 1.35rem;
  }
  .auth-logo p {
    font-size: 0.82rem;
  }
  .logo-icon {
    width: 52px;
    height: 52px;
    font-size: 1.4rem;
    border-radius: 14px;
    margin-bottom: 0.75rem;
  }

  /* ---- Admin pages on mobile ---- */
  .admin-main {
    padding: 1.25rem 0.85rem 2rem;
  }
  .admin-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }
  .astat-card {
    padding: 0.9rem;
    gap: 0.65rem;
  }
  .astat-val {
    font-size: 1.2rem;
  }
  .astat-label {
    font-size: 0.68rem;
  }
  .admin-two-col {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Admin sidebar */
  .admin-sidebar {
    width: 78vw;
    max-width: 280px;
  }
  .sidebar-brand {
    padding: 1rem 1.1rem;
    font-size: 0.88rem;
  }
  .sidebar-brand .admin-badge-pill {
    padding: 0.15rem 0.4rem;
    font-size: 0.58rem;
  }

  /* Admin tables — horizontal scroll */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .admin-table {
    min-width: 600px;
  }
  .admin-table th,
  .admin-table td {
    padding: 0.65rem 0.8rem;
    font-size: 0.78rem;
  }

  /* Topbar */
  .admin-topbar {
    padding: 0 0.85rem;
    height: 56px;
    gap: 0.4rem;
  }
  .topbar-title {
    font-size: 0.9rem;
  }
  .topbar-right {
    gap: 0.35rem;
  }
  .topbar-right .btn-primary-sm,
  .topbar-right .btn-ghost-sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.72rem;
  }
  .topbar-right .btn-ghost-sm span,
  .topbar-right .btn-primary-sm span {
    display: none;
  }
  .topbar-right .admin-badge-pill {
    display: none;
  }

  /* ---- Generated codes / mini stats ---- */
  .mini-stat-cards {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
  }
  .ms-val {
    font-size: 1.15rem;
  }
  .ms-label {
    font-size: 0.62rem;
  }
  .gc-code {
    font-size: 0.72rem;
    padding: 0.35rem 0.6rem;
  }

  /* ---- Days selector ---- */
  .days-selector {
    grid-template-columns: 1fr 1fr;
    display: grid;
  }
  .day-label {
    padding: 0.55rem 0.65rem;
    font-size: 0.78rem;
    justify-content: center;
  }

  /* ---- Leaderboard ---- */
  .lb-row {
    padding: 0.75rem 1rem;
    gap: 0.65rem;
  }
  .lb-rank {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
  .lb-user {
    gap: 0.55rem;
  }
  .lb-user-info strong {
    font-size: 0.82rem;
  }
  .lb-stat {
    font-size: 0.95rem;
  }
  .lb-stat small {
    font-size: 0.62rem;
  }

  /* ---- Themes admin grid ---- */
  .themes-admin-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .tac-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  /* ---- Filter bar ---- */
  .table-filter-bar {
    padding: 0.65rem 0.85rem;
    gap: 0.2rem;
    overflow-x: auto;
  }

  /* ---- Search form ---- */
  .page-header-row {
    flex-direction: column;
    align-items: stretch;
  }
  .search-form {
    width: 100%;
  }
  .search-form input {
    flex: 1;
    min-width: 0;
  }

  /* ---- Action buttons row ---- */
  .action-btns {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .action-btn {
    width: 30px;
    height: 30px;
    font-size: 0.72rem;
  }

  /* ---- Empty states ---- */
  .empty-state-v2 {
    padding: 2.5rem 1rem;
  }
  .empty-state-v2 .empty-icon {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
  }
  .empty-state-v2 h3 {
    font-size: 1rem;
  }
  .empty-state-v2 p {
    font-size: 0.82rem;
  }
}

/* EXTRA SMALL — ≤ 380px (small phones, iPhone SE) */
@media (max-width: 380px) {
  .stats-grid,
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }
  .nav-brand span {
    max-width: 90px;
    font-size: 0.82rem;
  }
  .nav-redeem-btn {
    padding: 0.45rem 0.6rem;
  }
  .page-title {
    font-size: 1.1rem;
  }
  .vip-badge-lg,
  .admin-badge-pill {
    font-size: 0.6rem !important;
    padding: 0.2rem 0.5rem;
  }
}

/* ===================================================
   HAMBURGER BUTTON (animated)
   =================================================== */
.nav-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.hamburger-btn {
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
}
.hamburger-btn:hover {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.3);
}
.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
}
.hamburger-btn.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
html[data-theme="light"] .hamburger-btn {
  background: rgba(0, 0, 0, 0.04);
}

/* ===================================================
   USER NAV DRAWER (slides from left)
   =================================================== */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 250;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.nav-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 251;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 8px 0 48px rgba(0, 0, 0, 0.5);
}
.nav-drawer.open {
  transform: translateX(0);
}
html[data-theme="light"] .nav-drawer {
  background: rgba(255, 255, 255, 0.92);
  border-right-color: rgba(0, 0, 0, 0.08);
}

.nav-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.nav-drawer-user {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}
.nav-drawer-user .avatar-img-lg {
  width: 52px;
  height: 52px;
  font-size: 1.3rem;
}
.nav-drawer-name {
  min-width: 0;
}
.nav-drawer-name strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-drawer-menu {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.nav-drawer-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 0.9rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text2);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  width: 100%;
  text-decoration: none;
  transition: all var(--transition);
}
.nav-drawer-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-decoration: none;
}
.nav-drawer-link.active {
  background: rgba(124, 58, 237, 0.15);
  color: var(--primary);
}
.nav-drawer-link i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}
.nav-drawer-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
}

/* ===================================================
   DASH SECTIONS (toggle via hamburger)
   =================================================== */
.dash-section {
  display: none;
  animation: fadeIn 0.25s ease;
}
.dash-section.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.section-head .page-title {
  margin-bottom: 0;
  font-size: 1.35rem;
}
.back-btn {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.back-btn:hover {
  background: rgba(124, 58, 237, 0.12);
  color: var(--primary);
  border-color: rgba(124, 58, 237, 0.3);
}

/* ===================================================
   WEB URL CARD (premium)
   =================================================== */
.weburl-card {
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.1),
    rgba(59, 130, 246, 0.05)
  );
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 8px 32px rgba(124, 58, 237, 0.12);
}
.weburl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.weburl-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.weburl-visits {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text2);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.35rem 0.8rem;
  border-radius: 50px;
}
.weburl-visits strong {
  color: var(--text);
}

.weburl-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.4rem 0.4rem 0.4rem 1rem;
}
html[data-theme="light"] .weburl-display {
  background: rgba(255, 255, 255, 0.7);
}
.weburl-icon {
  color: var(--primary);
  flex-shrink: 0;
}
.weburl-display input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  padding: 0.5rem 0;
  cursor: pointer;
}
.weburl-copy {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  background: var(--grad-main);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
  transition: all var(--transition);
}
.weburl-copy:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.45);
}
.weburl-copy.copied {
  background: linear-gradient(135deg, #10b981, #059669);
}
.weburl-hint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--text2);
}
.weburl-hint i {
  color: var(--primary);
}

/* ===================================================
   QUICK ACTIONS (overview)
   =================================================== */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  width: 100%;
  backdrop-filter: blur(16px);
  transition: all var(--transition);
}
.quick-action:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, 0.3);
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.15);
}
.qa-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.qa-text {
  flex: 1;
  min-width: 0;
}
.qa-text strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
}
.qa-text small {
  font-size: 0.78rem;
  color: var(--text2);
}
.qa-arrow {
  color: var(--text3);
  transition: transform var(--transition);
}
.quick-action:hover .qa-arrow {
  transform: translateX(4px);
  color: var(--primary);
}

/* tgc-cat label */
.tgc-cat {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* 3-stat grid */
.stats-3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 700px) {
  .stats-3 {
    grid-template-columns: 1fr;
  }
}

/* ===================================================
   ADMIN QUICK LINKS GRID
   =================================================== */
.admin-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.admin-quick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.25rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  text-decoration: none;
  backdrop-filter: blur(16px);
  transition: all var(--transition);
}
.admin-quick:hover {
  transform: translateY(-2px);
  color: var(--primary);
  border-color: rgba(124, 58, 237, 0.3);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15);
}
.admin-quick i {
  font-size: 1.5rem;
}
.admin-quick span {
  font-size: 0.8rem;
  font-weight: 600;
}

/* smaller dropzone variant */
.dropzone-sm {
  padding: 1.5rem 1rem;
}
.dropzone-sm i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.dropzone-sm h4 {
  font-size: 0.9rem;
}
.dropzone-sm p {
  font-size: 0.78rem;
}

/* ===== Responsive for new components ===== */
@media (max-width: 640px) {
  .nav-brand span {
    max-width: 110px;
  }
  .quick-actions {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .admin-quick-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
  }
  .admin-quick {
    padding: 1rem 0.5rem;
  }
  .admin-quick i {
    font-size: 1.25rem;
  }
  .admin-quick span {
    font-size: 0.72rem;
  }
  .weburl-card {
    padding: 1.1rem;
  }
  .weburl-display {
    flex-wrap: nowrap;
  }
  .weburl-copy span {
    display: none;
  }
  .weburl-copy {
    padding: 0.65rem 0.8rem;
  }
  .weburl-display input {
    font-size: 0.78rem;
  }
  .section-head .page-title {
    font-size: 1.15rem;
  }
}
@media (max-width: 380px) {
  .admin-quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===================================================
   TOGGLE SWITCH (banner active on/off) + STATUS PILL
   =================================================== */
.toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.6rem 0.3rem 0.35rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 50px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text2);
  transition: all 0.2s ease;
  min-width: 64px;
}
.toggle-btn .toggle-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text3);
  transition: transform 0.25s ease, background 0.25s ease;
  flex-shrink: 0;
}
.toggle-btn.on {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
  flex-direction: row-reverse;
  padding: 0.3rem 0.35rem 0.3rem 0.6rem;
}
.toggle-btn.on .toggle-knob {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}
.toggle-btn:hover {
  filter: brightness(1.15);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
}
.status-pill.status-on {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.status-pill.status-off {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text2);
  border: 1px solid var(--border);
}
.status-pill.status-on i {
  font-size: 0.7rem;
}
.status-pill.status-off i {
  font-size: 0.5rem;
}

/* PREVENT HORIZONTAL SCROLL */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}
* {
  max-width: 100%;
}

/* SAFE AREA INSETS for notched phones */
@supports (padding: max(0px)) {
  .navbar,
  .admin-topbar {
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
  }
  .main-content,
  .admin-main {
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
  }
}
