/* ==========================================================================
   NexusPanel - Modern Member & Admin Area Stylesheet
   Design System: HSL Variables, Glassmorphism, Responsive Grid & Flex layout
   ========================================================================== */

:root {
  /* Color Tokens */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(31, 41, 55, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.3);

  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  /* Accent Colors */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.15);
  
  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.12);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --rose: #ef4444;
  --rose-bg: rgba(239, 68, 68, 0.12);
  --purple: #8b5cf6;
  --purple-bg: rgba(139, 92, 246, 0.12);

  /* Layout dimensions */
  --sidebar-width: 270px;
  --header-height: 72px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* Shadow & Blur */
  --glass-backdrop: blur(16px);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography & Links */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

.whatsapp-floating {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #25d366;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.35);
  z-index: 9000;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: whatsappPulse 2.2s ease-in-out infinite;
}

.whatsapp-floating::before {
  content: "";
  position: absolute;
  inset: -7px;
  border: 2px solid rgba(37, 211, 102, 0.55);
  border-radius: 50%;
  animation: whatsappRing 2.2s ease-out infinite;
  pointer-events: none;
}

.whatsapp-floating:hover,
.whatsapp-floating:focus-visible {
  color: #ffffff;
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 30px rgba(37, 211, 102, 0.48);
}

.whatsapp-floating svg {
  width: 31px;
  height: 31px;
  fill: currentColor;
  position: relative;
  z-index: 1;
  animation: whatsappIcon 2.2s ease-in-out infinite;
}

@keyframes whatsappPulse {
  0%, 100% {
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.35);
  }
  50% {
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.58);
  }
}

@keyframes whatsappRing {
  0% {
    opacity: 0.75;
    transform: scale(0.92);
  }
  70%, 100% {
    opacity: 0;
    transform: scale(1.32);
  }
}

@keyframes whatsappIcon {
  0%, 84%, 100% {
    transform: rotate(0deg) scale(1);
  }
  88% {
    transform: rotate(-8deg) scale(1.06);
  }
  92% {
    transform: rotate(8deg) scale(1.06);
  }
  96% {
    transform: rotate(-4deg) scale(1.03);
  }
}

@media (max-width: 640px) {
  .whatsapp-floating {
    right: 1rem;
    bottom: 1rem;
    width: 52px;
    height: 52px;
  }

  .whatsapp-floating svg {
    width: 28px;
    height: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .whatsapp-floating,
  .whatsapp-floating::before,
  .whatsapp-floating svg {
    animation: none;
  }
}

/* App Layout Grid */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ================= SIDEBAR ================= */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: var(--glass-backdrop);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 800;
}

.brand-accent {
  color: var(--primary);
}

.brand-tagline {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mobile-sidebar-close {
  display: none;
  color: var(--text-secondary);
}

/* Sidebar Content & Nav Items */
.sidebar-content {
  flex: 1;
  padding: 1.25rem 1rem;
  overflow-y: auto;

  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.current-role-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.role-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}

.role-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.role-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.role-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.role-switch-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.role-switch-btn:hover {
  background: var(--primary);
  color: white;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 0.5rem;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition-fast);
  position: relative;
}

.nav-item i {
  width: 20px;
  height: 20px;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, var(--primary) 0%, rgba(99, 102, 241, 0.7) 100%);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
  font-weight: 600;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.nav-badge.active-badge {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.nav-badge.pending-badge {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Sidebar Footer Profile */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
}

.user-profile-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--primary);
}

.user-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Overlay for Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 90;
}

/* ================= MAIN WRAPPER ================= */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Header */
.top-header {
  height: var(--header-height);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: var(--glass-backdrop);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 80;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-toggle-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
}

.page-header-title h1 {
  font-size: 1.35rem;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Balance Chip */
.balance-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.5rem 0.35rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.balance-chip i {
  color: var(--emerald);
  width: 18px;
  height: 18px;
}

.balance-text {
  display: flex;
  flex-direction: column;
}

.chip-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.chip-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--emerald);
}

.topup-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--emerald);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.topup-btn:hover {
  transform: scale(1.1);
}

/* Role Selector Pill */
.role-selector-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  display: flex;
  gap: 0.25rem;
}

.role-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.role-option i {
  width: 15px;
  height: 15px;
}

.role-option.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

/* Notification Button */
.notification-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.notification-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.notif-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 8px var(--rose);
}

/* Content Body */
.content-body {
  padding: 2rem;
  flex: 1;
}

/* View Panel Switching */
.view-panel {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.view-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= DASHBOARD COMPONENTS ================= */

/* Welcome Banner */
.welcome-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.2) 100%),
              radial-gradient(circle at top right, rgba(99, 102, 241, 0.4), transparent 60%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.welcome-text h2 {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}

.welcome-text p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 540px;
  margin-bottom: 1.5rem;
}

.welcome-actions {
  display: flex;
  gap: 1rem;
}

.banner-hero-icon {
  width: 140px;
  height: 140px;
  color: rgba(99, 102, 241, 0.25);
  transform: rotate(-15deg);
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition-fast);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-emerald {
  background: var(--emerald);
  color: #fff;
}

.btn-emerald:hover {
  background: #059669;
}

.btn-danger {
  background: var(--rose-bg);
  color: var(--rose);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--rose);
  color: #fff;
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: var(--transition-fast);
}

.stat-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
  background: var(--bg-card-hover);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon i {
  width: 26px;
  height: 26px;
}

.icon-blue { background: var(--primary-light); color: var(--primary); }
.icon-purple { background: var(--purple-bg); color: var(--purple); }
.icon-emerald { background: var(--emerald-bg); color: var(--emerald); }
.icon-amber { background: var(--amber-bg); color: var(--amber); }

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0.2rem 0;
}

.stat-trend {
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.trend-up { color: var(--emerald); }
.trend-warning { color: var(--amber); }
.text-muted { color: var(--text-muted); }

/* Dashboard Two Column Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.panel-box {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.panel-title i {
  color: var(--primary);
}

.panel-title h3 {
  font-size: 1rem;
}

.link-btn {
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  transition: var(--transition-fast);
}

.link-btn:hover {
  text-decoration: underline;
}

.panel-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Item Cards inside Dashboard Panels */
.dash-item-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-item-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.dash-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-item-meta h4 {
  font-size: 0.92rem;
  margin-bottom: 0.2rem;
}

.dash-item-meta span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Badges */
.badge {
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-success { background: var(--emerald-bg); color: var(--emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: var(--rose-bg); color: var(--rose); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-info { background: var(--primary-light); color: var(--primary); border: 1px solid rgba(99, 102, 241, 0.3); }

/* ================= KATALOG VIEW ================= */
.catalog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.search-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: var(--transition-fast);
}

.search-box.sm {
  padding: 0.5rem 1rem;
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

.search-box i {
  color: var(--text-muted);
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  width: 100%;
}

.category-pills {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.pill {
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

.catalog-card {
  background: linear-gradient(180deg, rgba(26, 34, 53, 0.75) 0%, rgba(17, 24, 39, 0.9) 100%);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.catalog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.8), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.catalog-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 25px rgba(99, 102, 241, 0.2);
}

.catalog-card:hover::before {
  opacity: 1;
}

.catalog-card-tag {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 2;
}

.catalog-card-img-wrapper {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.2rem;
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.15) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.catalog-card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.75rem;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.catalog-card:hover .catalog-card-img-wrapper img {
  transform: scale(1.08);
}

.catalog-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.catalog-title-box h3 {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  letter-spacing: -0.2px;
}

.catalog-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.35rem;
}

.catalog-card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.catalog-card-feature-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.catalog-card-footer {
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.price-box {
  display: flex;
  flex-direction: column;
}

.price-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.6px;
  margin-bottom: 2px;
}

.price-amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.price-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ================= LAYANAN AKTIF VIEW ================= */
.sub-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-group {
  display: flex;
  gap: 0.5rem;
}

.btn-filter {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-filter.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  border-color: var(--primary);
}

.active-services-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.active-service-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.svc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.svc-title-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.svc-card-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 1.25rem;
  border-radius: var(--radius-md);
}

.svc-meta-item {
  display: flex;
  flex-direction: column;
}

.meta-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.meta-val {
  font-size: 0.92rem;
  font-weight: 600;
  margin-top: 0.2rem;
}

/* Progress bar for active service days */
.duration-progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.progress-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--primary));
  border-radius: var(--radius-full);
}

/* ================= TABLES (TRANSAKSI & ADMIN) ================= */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.table-container {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

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

.data-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
}

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

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

.text-right { text-align: right; }
.text-emerald { color: var(--emerald) !important; }
.text-accent { color: var(--primary) !important; }

.select-input {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  outline: none;
}

/* Admin Specific */
.admin-top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-stats-strip {
  display: flex;
  gap: 1.5rem;
}

.strip-item {
  display: flex;
  flex-direction: column;
}

.strip-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.strip-value {
  font-size: 1.25rem;
  font-weight: 800;
}

/* ================= MODALS ================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.modal-card.modal-lg {
  max-width: 680px;
}

.modal-card form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  flex: 1;
  min-height: 0;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.85rem;
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

/* Modal Form Controls */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
  width: 100%;
}

select.form-input option {
  background: #111827;
  color: #f3f4f6;
  padding: 0.5rem;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.subdomain-input-group {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.subdomain-input-group .form-input {
  border: none;
  background: transparent;
  flex: 1;
  min-width: 0;
  border-radius: 0;
}

.subdomain-suffix {
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border-left: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  cursor: pointer;
}

/* Checkout Details Box */
.checkout-summary-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.svc-preview-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.svc-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkout-price-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-top: 0.5rem;
  color: var(--text-secondary);
}

.checkout-price-row.total {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.85rem;
}

.divider {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 0.75rem 0;
}

.payment-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.pay-option {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.pay-option:hover, .pay-option.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.pay-option input[type="radio"] {
  accent-color: var(--primary);
}

.pay-option-content {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.pay-option-content i {
  color: var(--primary);
}

.pay-option-content div {
  display: flex;
  flex-direction: column;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 4rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 10000;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-success { border-left-color: var(--emerald); }
.toast-error { border-left-color: var(--rose); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ================= RESPONSIVE DESIGN ================= */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ================= LOGIN SCREEN OVERLAY ================= */
.login-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 15% 15%, rgba(99, 102, 241, 0.2) 0px, transparent 55%),
    radial-gradient(at 85% 85%, rgba(139, 92, 246, 0.16) 0px, transparent 55%),
    radial-gradient(at 50% 50%, rgba(16, 185, 129, 0.08) 0px, transparent 60%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1.5rem;
  overflow-y: auto;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-screen-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card {
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 35px rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 2.25rem;
  animation: fadeInModal 0.3s ease-out;
}

.login-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-logo-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
  margin-bottom: 0.85rem;
}

.login-header h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
}

.login-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

.demo-login-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.demo-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.demo-btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.demo-btn-group button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.login-form .form-group {
  margin-bottom: 1.15rem;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.input-with-icon input {
  padding-left: 2.75rem !important;
}

.login-footer {
  text-align: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* Invoice Watermark & Stamps */
.invoice-card-wrapper {
  position: relative;
  overflow: hidden;
}

.watermark-draft {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  font-size: 3.5rem;
  font-weight: 900;
  color: rgba(239, 68, 68, 0.22);
  border: 6px dashed rgba(239, 68, 68, 0.35);
  padding: 0.4rem 1.75rem;
  border-radius: 12px;
  pointer-events: none;
  letter-spacing: 0.12em;
  white-space: nowrap;
  user-select: none;
  z-index: 10;
}

.stamp-lunas {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border: 2px solid var(--emerald);
  color: var(--emerald);
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  transform: rotate(-5deg);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stamp-pending {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border: 2px dashed var(--amber);
  color: var(--amber);
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  transform: rotate(-5deg);
  text-transform: uppercase;
}

/* Print Clean Stylesheet */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  
  body * {
    visibility: hidden;
  }
  
  #invoiceModal, #invoiceModal * {
    visibility: visible;
  }
  
  #invoiceModal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: #ffffff !important;
    color: #000000 !important;
    display: block !important;
    padding: 0 !important;
  }

  #invoiceModal .modal-card {
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    background: #ffffff !important;
    color: #000000 !important;
    max-width: 100% !important;
  }

  #invoiceModal .modal-header h3 {
    color: #000000 !important;
  }

  #invoiceModal .modal-footer, #invoiceModal .modal-close-btn {
    display: none !important;
  }

  .watermark-draft {
    color: rgba(220, 38, 38, 0.3) !important;
    border-color: rgba(220, 38, 38, 0.4) !important;
  }
}

/* ================= TOPUP FORM & PAYMENT MODAL STYLING ================= */
.topup-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.preset-chip {
  padding: 0.75rem 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.preset-chip:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

.preset-chip.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: #818cf8;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.topup-method-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.topup-method-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(99, 102, 241, 0.4);
}

.topup-method-card.selected {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

.topup-method-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.icon-qris {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald);
}

.icon-va {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.icon-ewallet {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber);
}

.qris-display-box {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  text-align: center;
  color: #1e293b;
  margin: 1rem 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.qris-code-img {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  background: #ffffff;
  padding: 0.5rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
}

.va-copy-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
  margin-top: 0.5rem;
}

.va-number {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #818cf8;
}

.copy-btn {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid var(--primary);
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.copy-btn:hover {
  background: var(--primary);
}

@keyframes pulseBorder {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.qris-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-full);
  color: var(--amber);
  font-size: 0.82rem;
  font-weight: 600;
}

/* ================= PROFESSIONAL GLOBAL LOADING POPUP ================= */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 11, 22, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-card {
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-xl, 20px);
  padding: 2.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), 0 0 40px rgba(99, 102, 241, 0.25);
  max-width: 380px;
  width: 90%;
  transform: scale(0.9) translateY(10px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.loading-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899, #6366f1);
  background-size: 200% 100%;
  animation: gradientSlide 2s linear infinite;
}

@keyframes gradientSlide {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.loading-overlay.active .loading-card {
  transform: scale(1) translateY(0);
}

.loading-spinner-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.glow-orb {
  position: absolute;
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.45) 0%, transparent 70%);
  filter: blur(10px);
  animation: pulseOrb 2s ease-in-out infinite alternate;
}

@keyframes pulseOrb {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(1.3); opacity: 0.9; }
}

.loading-spinner-ring {
  position: relative;
  width: 64px;
  height: 64px;
}

.loading-spinner-ring div {
  box-sizing: border-box;
  display: block;
  position: absolute;
  width: 54px;
  height: 54px;
  margin: 5px;
  border: 4px solid #818cf8;
  border-radius: 50%;
  animation: lds-ring 1.1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  border-color: #818cf8 transparent transparent transparent;
}

.loading-spinner-ring div:nth-child(1) { animation-delay: -0.45s; }
.loading-spinner-ring div:nth-child(2) { animation-delay: -0.3s; }
.loading-spinner-ring div:nth-child(3) { animation-delay: -0.15s; }

@keyframes lds-ring {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}

.loading-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ================= PROFESSIONAL CUSTOM CONFIRMATION MODAL ================= */
.modal-confirm-card {
  max-width: 440px !important;
  text-align: center;
  padding: 2.25rem 2rem !important;
  border-radius: var(--radius-xl, 20px) !important;
  background: rgba(17, 24, 39, 0.96) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.85), 0 0 30px rgba(0, 0, 0, 0.5) !important;
  position: relative;
  overflow: hidden;
}

.confirm-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 2px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.2);
  animation: pulseConfirm 2s infinite ease-in-out;
}

.confirm-icon-box.icon-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.2);
}

.confirm-icon-box.icon-info {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.2);
}

.confirm-icon-box.icon-success {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.2);
}

.confirm-icon-box svg {
  width: 32px;
  height: 32px;
}

@keyframes pulseConfirm {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.confirm-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.confirm-message {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.75rem;
  padding: 0 0.5rem;
}

.confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.confirm-actions button {
  flex: 1;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  justify-content: center;
}

/* ==========================================================================
   MOBILE RESPONSIVE & TABLET LAYOUT OPTIMIZATIONS
   ========================================================================== */

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99990;
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active,
.sidebar-overlay.open,
.sidebar-overlay.mobile-active {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ================= VIEW MODE TOGGLE (PC vs HP) ================= */
.view-mode-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.15rem;
  gap: 0.15rem;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  background: transparent;
  outline: none;
}

.mode-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.mode-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover)) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* Force Mode PC Overrides */
html.mode-pc body,
body.mode-pc {
  overflow-x: auto !important;
  min-width: 1024px !important;
}

html.mode-pc .sidebar,
body.mode-pc .sidebar {
  position: fixed !important;
  transform: translateX(0) !important;
  width: 270px !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
}

html.mode-pc .main-wrapper,
body.mode-pc .main-wrapper {
  margin-left: 270px !important;
  width: calc(100% - 270px) !important;
  min-width: 900px !important;
}

html.mode-pc .mobile-toggle-btn,
body.mode-pc .mobile-toggle-btn,
html.mode-pc .mobile-sidebar-close,
body.mode-pc .mobile-sidebar-close,
html.mode-pc .sidebar-overlay,
body.mode-pc .sidebar-overlay {
  display: none !important;
}

html.mode-pc .stats-grid,
body.mode-pc .stats-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
}

html.mode-pc .grid-2col,
body.mode-pc .grid-2col {
  grid-template-columns: 1fr 1fr !important;
}

html.mode-pc .chip-label,
body.mode-pc .chip-label {
  display: inline-block !important;
}

/* Force Mode HP Overrides */
html.mode-hp body,
body.mode-hp {
  overflow-x: hidden !important;
  width: 100% !important;
}

html.mode-hp .sidebar,
body.mode-hp .sidebar {
  position: fixed !important;
  z-index: 99999 !important;
  width: 270px !important;
}

html.mode-hp:not(.sidebar-open):not(.active) .sidebar,
body.mode-hp:not(.sidebar-open):not(.active) .sidebar {
  transform: translateX(-105%) !important;
}

html.mode-hp.active .sidebar,
html.mode-hp.open .sidebar,
body.mode-hp.active .sidebar,
body.mode-hp.open .sidebar {
  transform: translateX(0) !important;
}

html.mode-hp .main-wrapper,
body.mode-hp .main-wrapper {
  margin-left: 0 !important;
  width: 100% !important;
}

html.mode-hp .mobile-toggle-btn,
body.mode-hp .mobile-toggle-btn {
  display: flex !important;
}

html.mode-hp .stats-grid,
body.mode-hp .stats-grid,
html.mode-hp .dashboard-grid,
body.mode-hp .dashboard-grid,
html.mode-hp .grid-2col,
body.mode-hp .grid-2col {
  grid-template-columns: 1fr !important;
}

html.mode-hp .chip-label,
body.mode-hp .chip-label {
  display: none !important;
}

/* Media Query: Tablets & Mobile Screens (<= 1024px) */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 270px;
  }

  body {
    overflow-x: hidden !important;
    width: 100% !important;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    z-index: 99999;
    transform: translateX(-105%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.8);
  }

  .sidebar.mobile-active,
  .sidebar.active,
  .sidebar.open {
    transform: translateX(0) !important;
  }

  .mobile-sidebar-close {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    cursor: pointer;
  }

  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .mobile-toggle-btn {
    display: flex !important;
    cursor: pointer !important;
    z-index: 10 !important;
  }
}

/* Media Query: Smartphones & Small Tablets (<= 768px) */
@media (max-width: 768px) {
  .top-header {
    height: auto;
    min-height: 64px;
    padding: 0.65rem 0.85rem;
    gap: 0.5rem;
  }

  .header-left {
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
  }

  .page-header-title {
    min-width: 0;
    flex: 1;
  }

  .page-header-title h1 {
    font-size: 1.05rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page-subtitle {
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-right {
    gap: 0.4rem;
    flex-shrink: 0;
  }

  /* Compact Balance Chip on Mobile */
  .balance-chip {
    display: flex !important;
    padding: 0.25rem 0.4rem 0.25rem 0.55rem !important;
    gap: 0.35rem !important;
  }

  .chip-label {
    display: none !important;
  }

  .chip-value {
    font-size: 0.78rem !important;
  }

  .topup-btn {
    width: 24px !important;
    height: 24px !important;
  }

  .content-body {
    padding: 0.85rem !important;
  }

  /* Stack Welcome Banner & Grids */
  .welcome-banner {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1.1rem !important;
    padding: 1.25rem 1rem !important;
  }

  .welcome-banner-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .welcome-banner-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .stats-grid,
  .dashboard-grid,
  .grid-2col,
  .grid-3col,
  .grid-4col {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  /* Admin Top Actions & Toolbars */
  .admin-top-actions,
  .table-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .admin-top-actions > div,
  .table-toolbar > div {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }

  .admin-top-actions button,
  .table-toolbar button {
    width: 100% !important;
    justify-content: center !important;
  }

  .search-wrap,
  #memberSearchInput,
  #adminActiveServicesSearch {
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Data Table Container Horizontal Scroll */
  .table-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    margin-top: 0.75rem;
  }

  .data-table {
    min-width: 580px;
  }

  .data-table th,
  .data-table td {
    padding: 0.65rem 0.75rem !important;
    font-size: 0.8rem !important;
  }

  /* Modals on Mobile */
  .modal-overlay {
    padding: 0.65rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box !important;
  }

  .modal-card {
    width: calc(100vw - 1.25rem) !important;
    max-width: 100% !important;
    max-height: 86vh !important;
    overflow-y: auto !important;
    margin: 0 !important;
    border-radius: var(--radius-lg) !important;
    box-sizing: border-box !important;
  }

  .modal-body {
    padding: 0.85rem 1rem !important;
  }

  .modal-footer {
    padding: 0.75rem 1rem !important;
    flex-direction: column-reverse !important;
    gap: 0.5rem !important;
  }

  .modal-footer button {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Active Service Cards (Member View) */
  .active-service-card {
    padding: 1rem !important;
  }

  .active-svc-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.65rem !important;
  }

  .service-meta-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
  }

  .active-svc-actions {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  .active-svc-actions button,
  .active-svc-actions a {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Member Cards (Admin Kelola Saldo) */
  .member-card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    padding: 0.85rem 1rem !important;
  }

  .member-card > div:nth-child(2) {
    text-align: left !important;
  }

  .member-card > div:nth-child(3) {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }

  .member-card > div:nth-child(3) button {
    flex: 1;
    justify-content: center;
  }

  /* Form Layouts */
  .form-group {
    margin-bottom: 0.85rem !important;
  }

  .form-input, select, textarea {
    font-size: 0.88rem !important;
    padding: 0.6rem 0.75rem !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  /* Confirm Modal */
  .modal-confirm-card {
    padding: 1.35rem 1rem !important;
    width: calc(100vw - 1.5rem) !important;
  }

  .confirm-actions {
    flex-direction: column-reverse;
  }

  .confirm-actions button {
    width: 100%;
  }
}

/* Media Query: Extra Small Mobile Screens (<= 480px) */
@media (max-width: 480px) {
  .page-subtitle {
    display: none !important;
  }

  .service-meta-grid {
    grid-template-columns: 1fr !important;
  }

  .stat-card {
    padding: 0.85rem !important;
  }

  .stat-value {
    font-size: 1.15rem !important;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  .brand-tagline {
    font-size: 0.6rem;
  }
}


