:root {
  /* --- DEFAULT BASE THEME (Mere User) --- */
  --bg-body: #f3f5f9;
  --bg-card: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;

  /* Default Blue Brand */
  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  --color-primary: #2563eb;
  --color-glow: rgba(37, 99, 235, 0.3);

  /* Brand Colors (Fixed) */
  --gradient-mtn: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  --gradient-telecel: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  --gradient-at: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);

  --btn-blue: #3b82f6;
  --btn-pink: #d946ef;
  --btn-green: #10b981;
  --btn-orange: #f97316;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --radius: 16px;
}

/* --- RANK THEMES --- */

/* 0. DEFAULT / MERE USER */
body.rank-user {
  --bg-body: #f8fafc;
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* 1. ADMIN - ALMIGHTY PREMIUM (True Black & Neon Gold) */
body.rank-admin {
  --bg-body: #000000; /* Pure Black */
  --bg-card: #111111; /* Almost Black */
  --text-main: #ffffff;
  --text-muted: #a1a1aa;
  --border: #333333;
  /* Vibrant Gold Gradient */
  --gradient-primary: linear-gradient(
    135deg,
    #ffd700 0%,
    #fdb931 50%,
    #b8860b 100%
  );
  --color-primary: #fbbf24;
  --color-glow: rgba(251, 191, 36, 0.6);
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.7);
}
body.rank-admin .welcome-banner {
  /* Glassmorphism Dark */
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.15) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  border: 1px solid rgba(255, 215, 0, 0.3);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
body.rank-admin .sidebar,
body.rank-admin .navbar {
  border-right: 1px solid #222;
  border-bottom: 1px solid #222;
}
body.rank-admin .product-card:hover {
  border-color: #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}
body.rank-admin .wallet-card {
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid rgba(255, 215, 0, 0.2);
}
body.rank-admin .badge-3d-container {
  background: rgba(255, 215, 0, 0.1);
  border-color: rgba(255, 215, 0, 0.3);
}

/* 2. SUPER AGENTS (Hexagonal, Metallic, Glossy) */
body[class*="rank-super"] {
  --bg-body: #ffffff;
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body.rank-super-bronze {
  --gradient-primary: linear-gradient(135deg, #b45309 0%, #78350f 100%);
  --bg-body: #fff7ed;
  --color-primary: #b45309;
}
body.rank-super-silver {
  --gradient-primary: linear-gradient(135deg, #94a3b8 0%, #475569 100%);
  --bg-body: #f8fafc;
  --color-primary: #475569;
}
body.rank-super-gold {
  --gradient-primary: linear-gradient(135deg, #fbbf24 0%, #b45309 100%);
  --bg-body: #fffbeb;
  --color-primary: #d97706;
}
body.rank-super-platinum {
  --gradient-primary: linear-gradient(135deg, #38bdf8 0%, #0369a1 100%);
  --bg-body: #f0f9ff;
  --color-primary: #0284c7;
}
body.rank-super-diamond {
  --gradient-primary: linear-gradient(135deg, #818cf8 0%, #4338ca 100%);
  --bg-body: #eef2ff;
  --color-primary: #4f46e5;
}

/* 3. SUB AGENTS (Circular, Matte, Soft) */
body[class*="rank-sub"] {
  --bg-card: #ffffff;
}
body.rank-sub-bronze {
  --gradient-primary: linear-gradient(to right, #fdba74, #fb923c);
  --color-primary: #f97316;
  --bg-body: #fffaf5;
}
body.rank-sub-silver {
  --gradient-primary: linear-gradient(to right, #cbd5e1, #94a3b8);
  --color-primary: #64748b;
  --bg-body: #f1f5f9;
}
body.rank-sub-gold {
  --gradient-primary: linear-gradient(to right, #fcd34d, #fbbf24);
  --color-primary: #d97706;
  --bg-body: #fffbeeb0;
}
body.rank-sub-platinum {
  --gradient-primary: linear-gradient(to right, #7dd3fc, #38bdf8);
  --color-primary: #0ea5e9;
  --bg-body: #f0f9ff;
}
body.rank-sub-diamond {
  --gradient-primary: linear-gradient(to right, #a78bfa, #8b5cf6);
  --color-primary: #7c3aed;
  --bg-body: #f5f3ff;
}

/* --- BADGE ARCHITECTURE --- */
.badge-3d-container {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: transform 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
.badge-3d-container:hover {
  transform: scale(1.05);
}

/* Base Badge Icon Wrapper */
.badge-icon-wrapper {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 1.3rem;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  z-index: 1;
}

/* TYPE 1: SUB AGENT (CIRCLE - MATTE) */
.badge-type-sub {
  border-radius: 50%;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.4),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

/* TYPE 2: SUPER AGENT (HEXAGON - GLOSSY/METALLIC) */
.badge-type-super {
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background-size: 200% 200%;
  animation: metalShine 3s infinite linear;
  box-shadow: none; /* clip-path hides box-shadow, handled via filter on container if needed */
}
/* Add an inner shine for Super Agents */
.badge-type-super::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.5) 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.2) 100%
  );
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  z-index: -1;
}

/* TYPE 3: ADMIN (CROWN/STARBURST - ALMIGHTY) */
.badge-type-admin,
.badge-admin {
  width: 50px;
  height: 50px;
  background: radial-gradient(circle at 30% 30%, #ffd700, #b8860b);
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  animation: pulseAdmin 2s infinite ease-in-out;
  box-shadow: 0 0 15px #ffd700;
}

.badge-text-col,
.badge-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.badge-label-sm {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
}
.badge-label-lg {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@keyframes metalShine {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulseAdmin {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
  }
  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
  }
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
  }
}

/* --- INLINE PURCHASE DROPDOWN --- */
.purchase-dropdown {
  display: none;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.purchase-dropdown.active {
  display: block;
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
    height: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    height: auto;
  }
}

.card-input {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
  background: var(--bg-body);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}
.card-input:focus {
  border-color: var(--color-primary);
}

.btn-row {
  display: flex;
  gap: 0.5rem;
}
.btn-confirm-sm {
  flex: 2;
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 0.6rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}
.btn-confirm-sm:hover {
  opacity: 0.9;
}

.btn-cancel-sm {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.btn-cancel-sm:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}

.btn-buy-now.hidden {
  display: none;
}

/* Standard CSS Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
}
body {
  background-color: var(--bg-body);
  color: var(--text-main);
  padding-bottom: 2rem;
  overflow-x: hidden;
  transition: background-color 0.5s ease;
}

/* --- SIDEBAR --- */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1100;
  display: none;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active {
  display: block;
}
.sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  height: 100vh;
  background: var(--bg-card);
  z-index: 1200;
  box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar.active {
  left: 0;
}
.sidebar-header {
  padding: 1.5rem;
  background: var(--gradient-primary);
  color: white;
  position: relative;
}
.close-sidebar-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-profile-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}
.user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid white;
  object-fit: cover;
  background: #fff;
}
.user-info h4 {
  font-size: 1rem;
  margin-bottom: 0.1rem;
  font-weight: 700;
}
.user-info p {
  font-size: 0.8rem;
  opacity: 0.9;
}
.sidebar-nav {
  padding: 1rem 0;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  padding: 0.8rem 1.5rem;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  transition:
    background 0.2s,
    color 0.2s;
  gap: 1rem;
  font-size: 0.95rem;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-primary);
}
.nav-item.active {
  background: rgba(var(--color-primary), 0.1);
  color: var(--color-primary);
  border-left-color: var(--color-primary);
}
.nav-item i {
  width: 20px;
  text-align: center;
  color: var(--text-muted);
}
.nav-item:hover i,
.nav-item.active i {
  color: var(--color-primary);
}
.divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 1.5rem;
}
.nav-item.logout {
  color: #ef4444;
}
.nav-item.logout:hover {
  background: #fef2f2;
  color: #dc2626;
}
.nav-item.logout i {
  color: #ef4444;
}

/* --- NAVBAR --- */
.nav-icon-box {
  display: flex;
  width: 20px;
  justify-content: center;
}

.navbar {
  background: var(--bg-card);
  padding: 0.6rem 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color 0.3s;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-main);
}
.logo-icon {
  width: 35px;
  height: 35px;
  background: transparent;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  font-size: 1.2rem;
  cursor: pointer;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.balance-pill {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-primary);
  padding: 0.3rem 0.6rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 0;
  cursor: pointer;
  border: 1px solid var(--border);
}
.topup-text {
  font-size: 0.65rem;
  background: var(--color-primary);
  color: white;
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.notification-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  background: transparent;
}
.notification-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}
.notification-dot {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  border: 1px solid var(--bg-card);
}
.profile-pic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e5e7eb;
  overflow: hidden;
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 0 2px #e5e7eb;
  margin-left: 0;
}
.profile-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.container {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}

/* --- DASHBOARD --- */
.welcome-banner {
  background: var(--gradient-primary);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  transition: background 0.5s;
}
.welcome-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(
      circle at 20% 50%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 20%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 20%
    );
  pointer-events: none;
}
.banner-text h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.banner-text p {
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.wallet-card {
  background: rgba(255, 255, 255, 0.15);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 16px;
  min-width: 250px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.wallet-title {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}
.wallet-amount {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.btn-topup {
  background: white;
  color: var(--color-primary);
  border: none;
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.btn-topup:hover {
  transform: translateY(-2px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.2s;
  border: 1px solid var(--border);
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}
.stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-main);
}
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.action-btn {
  border: none;
  border-radius: 12px;
  padding: 1.5rem;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--shadow-md);
  border-bottom: 4px solid rgba(0, 0, 0, 0.1);
}
.action-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.action-btn i {
  font-size: 1.5rem;
}

.btn-buy-data {
  background: var(--btn-blue);
}
.btn-bulk {
  background: var(--btn-pink);
}
.btn-view {
  background: var(--btn-green);
}

/* Rank Switcher Button for Demo */
.btn-rank-switcher {
  background: var(--text-main);
}

.network-selector {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  background: var(--bg-card);
  padding: 0.5rem;
  border-radius: 50px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.network-tab {
  padding: 0.75rem 2rem;
  border-radius: 40px;
  border: none;
  background: transparent;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.network-tab.active {
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.network-tab.active[data-net="mtn"] {
  background: var(--gradient-mtn);
}
.network-tab.active[data-net="telecel"] {
  background: var(--gradient-telecel);
}
.network-tab.active[data-net="at"] {
  background: var(--gradient-at);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
.product-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 1.5rem;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}
.data-amount {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}
.network-name {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.price-tag {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

/* Updated Buy Now Button */
.btn-buy-now {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 12px;
  background: var(--gradient-primary);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px -3px var(--color-glow);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-buy-now:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -3px var(--color-glow);
  filter: brightness(1.1);
}

/* --- ADMIN VIEW --- */
.admin-view {
  display: none;
}
.admin-view.active {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s;
}
.admin-header {
  margin-bottom: 1.5rem;
}
.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.admin-header h2 {
  font-size: 1.5rem;
  margin: 0;
}
.admin-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.icon-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 0.85rem;
}
.icon-action-btn:hover,
.icon-action-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.admin-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.admin-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.2s;
  font-size: 0.85rem;
}
.admin-tab-btn:hover,
.admin-tab-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.admin-content-pane {
  display: none;
}
.admin-content-pane.active {
  display: block;
  animation: fadeIn 0.3s;
}
.admin-table-container {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: auto;
}
th,
td {
  padding: 0.4rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-main);
}
th {
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.user-row-actions {
  display: flex;
  gap: 0.25rem;
}
.icon-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  background: transparent;
}
.icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}
.btn-trans:hover {
  color: #3b82f6;
  background: #eff6ff;
}
.btn-orders:hover {
  color: #10b981;
  background: #ecfdf5;
}
.btn-funds:hover {
  color: #f59e0b;
  background: #fffbeb;
}
.btn-msg:hover {
  color: #8b5cf6;
  background: #f5f3ff;
}
.btn-badge:hover {
  color: #ec4899;
  background: #fdf2f8;
}
.btn-del:hover {
  color: #ef4444;
  background: #fef2f2;
}

.network-accordion {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.accordion-header {
  background: var(--bg-card);
  padding: 0.8rem 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.9rem;
}
.accordion-header:hover {
  background: rgba(0, 0, 0, 0.02);
}
.accordion-body {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.02);
  display: none;
  border-top: 1px solid var(--border);
}
.accordion-body.active {
  display: block;
}
.plan-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.plan-item:last-child {
  border-bottom: none;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--color-primary);
}
input:checked + .slider:before {
  transform: translateX(16px);
}

.admin-form-group {
  margin-bottom: 1rem;
}
.admin-form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}
.admin-input {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: border 0.2s;
}
.admin-input:focus {
  outline: none;
  border-color: var(--color-primary);
  ring: 2px solid rgba(37, 99, 235, 0.1);
}
.admin-btn {
  padding: 0.6rem 1.2rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

/* --- TOGGLE SWITCH (iOS Style) --- */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 24px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--color-primary);
}
input:checked + .slider:before {
  transform: translateX(16px);
}

/* --- ADMIN TABS INNER --- */
.admin-tabs-inner {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.tab-inner-btn {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.tab-inner-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* --- STORE DASHBOARD REDESIGN --- */
.store-dashboard-header {
  background:
    linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.8)),
    url("C:/Users/NEWLINK/.gemini/antigravity/brain/55fe4651-727a-4900-bd5c-5406378d935f/uploaded_media_1769896707611.jpg"); /* Using uploaded image as possible bg or fallback */
  background-size: cover;
  background-position: center;
  padding: 3rem 2rem;
  color: white;
  text-align: center;
  position: relative;
  border-radius: 0 0 30px 30px;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.header-btn {
  position: absolute;
  top: 2rem;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}
.header-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}
.header-btn.left {
  left: 2rem;
}
.header-btn.right {
  right: 2rem;
}

.store-dashboard-logo-wrapper {
  width: 100px;
  height: 100px;
  background: white;
  border-radius: 20px;
  padding: 5px;
  margin: 0 auto 1rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  position: relative;
}
.store-dashboard-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 15px;
}
.store-badge-sm {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background: #111;
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
  border: 1px solid white;
}

.dashboard-card {
  background: white;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  border: 1px solid #f1f5f9;
  transition: transform 0.2s;
  position: relative;
  overflow: hidden;
}
.dashboard-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-pill.open {
  background: #dcfce7;
  color: #166534;
}
.status-pill.closed {
  background: #fee2e2;
  color: #991b1b;
}

.icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
.icon-box.green {
  background: #dcfce7;
  color: #166534;
}
.icon-box.purple {
  background: #f3e8ff;
  color: #7e22ce;
}
.icon-box.orange {
  background: #ffedd5;
  color: #c2410c;
}
.icon-box.blue {
  background: #e0f2fe;
  color: #0369a1;
}

.manage-hours-btn {
  background: #0f172a;
  color: white;
  width: 100%;
  padding: 0.8rem;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  margin-top: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.action-buttons-group {
  display: flex;
  gap: 10px;
  position: absolute;
  top: 20px;
  right: 20px;
}
.circle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.currency-large {
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
}
.card-label-top {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  .wallet-card {
    min-width: 100%;
    margin-top: 1rem;
  }
  .welcome-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .wallet-card {
    width: 100%;
  }
}
@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  .navbar {
    padding: 0.8rem;
  }
  .logo {
    font-size: 0.9rem;
  }
}

/* --- ADMIN PLANS GRID --- */
.admin-plans-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  padding: 1rem 0;
}
.admin-plan-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  text-align: center;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.admin-plan-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.admin-plan-edit-input {
  width: 60px;
  padding: 4px;
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  text-align: center;
  font-weight: bold;
}
.admin-edit-btn {
  background: #eff6ff;
  color: var(--color-primary);
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}
.admin-edit-btn:hover {
  background: #dbeafe;
}

/* --- RANK MODAL --- */
.rank-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s;
}
.rank-modal.active {
  display: flex;
  opacity: 1;
}

.modal {
  background: white;
  width: 90%;
  max-width: 400px;
  padding: 2rem;
  border-radius: 20px;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rank-modal.active .modal {
  transform: scale(1);
}

.rank-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}
.rank-section-title {
  grid-column: span 2;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
  margin-top: 1rem;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 4px;
}
.rank-option {
  padding: 0.8rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  font-weight: 500;
  color: #475569;
}
.rank-option:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1e40af;
  transform: translateY(-2px);
}

.btn-cancel {
  background: #f1f5f9;
  color: #64748b;
  border: none;
  padding: 0.8rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-cancel:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* --- PROFILE ICON BUTTONS --- */
.profile-icon-btn {
  padding: 1rem;
  border: 2px solid var(--border);
  background: var(--bg-body);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.profile-icon-btn:hover {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-primary);
}

.profile-icon-btn.selected {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: white;
}

/* --- SETTINGS DROPDOWN MENU --- */
.settings-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  z-index: 1000;
  overflow: hidden;
}

.settings-menu-item {
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.95rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
}

.settings-menu-item:last-child {
  border-bottom: none;
}

.settings-menu-item:hover {
  background: var(--bg-body);
  color: var(--color-primary);
}

.settings-menu-item i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}
