:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #10b981;
  --bg: #0f172a;
  --card-bg: #1e293b;
  --card-border: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px;
  width: 100%;
}

header {
  border-bottom: 1px solid var(--card-border);
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #60a5fa;
  text-decoration: none;
}

.brand-logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 2px 6px rgba(37, 99, 235, 0.35));
}

.brand:hover .brand-logo-img {
  transform: scale(1.08) rotate(-2deg);
}

.nav-links {
  display: flex;
  gap: 16px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  background: var(--card-border);
}

.badge-affiliate {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #cbd5e1;
}

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

.form-input {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 14px 16px;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.operator-badge {
  position: absolute;
  right: 12px;
  background: #2563eb;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab-btn {
  background: #0f172a;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.client-brand-chip {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.client-brand-chip:hover {
  background: #334155;
  color: #fff;
}

.client-brand-chip.active {
  background: #0284c7;
  color: #fff;
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.client-pkg-chip {
  background: #0f172a;
  border: 1px solid #475569;
  color: #cbd5e1;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.client-pkg-chip:hover {
  background: #1e293b;
  color: #fff;
  border-color: #64748b;
}

.client-pkg-chip.active {
  background: #7c3aed;
  color: #fff;
  border-color: #a855f7;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.product-card {
  background: #0f172a;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-card:hover {
  border-color: #60a5fa;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.product-card.selected {
  border-color: var(--accent);
  background: #064e3b;
}

.prod-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.prod-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.prod-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #38bdf8;
}

.btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}

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

.btn-success {
  background: var(--accent);
}
.btn-success:hover {
  background: #059669;
}

/* Modal Checkout */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  max-width: 440px;
  width: 100%;
  padding: 24px;
  text-align: center;
  max-height: 90vh;
  overflow-y: auto;
}

.qr-box {
  background: white;
  padding: 16px;
  border-radius: 12px;
  display: inline-block;
  margin: 16px 0;
}

.qr-box img {
  width: 220px;
  height: 220px;
  display: block;
}

.tree-node {
  border-left: 2px solid #3b82f6;
  padding-left: 16px;
  margin-left: 12px;
  margin-top: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: #0f172a;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
}

.stat-val {
  font-size: 1.4rem;
  font-weight: 700;
  color: #38bdf8;
  margin-top: 6px;
}

/* Data Table Styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--card-border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.data-table th {
  background: #0f172a;
  color: #94a3b8;
  padding: 12px 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  background: #1e293b;
}

.data-table tr:hover td {
  background: #273549;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-info {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-secondary {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* ==========================================================================
   MOBILE-FIRST & HP APP OPTIMIZATION
   ========================================================================== */

/* Hidden by default on desktop/tablet */
.mobile-checkout-bar {
  display: none;
}

.mobile-bottom-nav {
  display: none;
}

/* Base enhancements for touch & mobile */
body {
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Horizontal scroll styling for tabs and chip bars across devices */
.tabs, #clientProviderBar, #clientPackageTypeBar {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar,
#clientProviderBar::-webkit-scrollbar,
#clientPackageTypeBar::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Mobile Breakpoint: screens 640px and below */
@media (max-width: 640px) {
  body {
    padding-bottom: 70px; /* Space for bottom nav */
  }

  .container {
    padding: 12px 10px 140px 10px; /* Generous bottom spacing for floating bar + nav */
    max-width: 100%;
  }

  /* Compact modern mobile header */
  header {
    padding-top: env(safe-area-inset-top);
  }

  .nav-bar {
    padding: 10px 12px;
    gap: 8px;
  }

  .brand {
    font-size: 1.05rem;
    gap: 6px;
  }

  .brand-logo-img {
    width: 32px;
    height: 32px;
  }

  #brandTagline {
    display: none; /* Hide tagline to preserve horizontal space */
  }

  .nav-links {
    gap: 6px;
  }

  .nav-link {
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
  }

  #btnDownloadApkNav {
    padding: 4px 10px;
    font-size: 0.72rem;
  }

  #btnMemberLoginModal {
    padding: 5px 10px !important;
    font-size: 0.78rem !important;
  }

  #statusBadge {
    display: none !important; /* Hide to save top bar clutter on mobile */
  }

  /* Card padding on mobile */
  .card {
    padding: 16px 12px;
    border-radius: 12px;
    margin-bottom: 14px;
  }

  /* Form inputs: min 16px font-size to prevent iOS / Android auto-zoom */
  .form-input {
    font-size: 16px !important;
    padding: 12px 14px;
    border-radius: 10px;
  }

  .form-label {
    font-size: 0.82rem;
    margin-bottom: 6px;
  }

  /* Segmented mode switcher (Prabayar vs Pascabayar) */
  #btnModePrepaid, #btnModePostpaid {
    padding: 10px 8px !important;
    font-size: 0.8rem !important;
    border-radius: 10px;
  }

  /* Category tabs on mobile: smooth pill buttons */
  .tabs {
    gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 4px;
  }

  .tab-btn {
    padding: 8px 14px;
    font-size: 0.82rem;
    border-radius: 20px;
  }

  .client-brand-chip, .client-pkg-chip {
    padding: 5px 12px;
    font-size: 0.75rem;
    border-radius: 16px;
  }

  /* Product Grid: 2 Columns on Mobile */
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .product-card {
    padding: 10px 8px;
    border-radius: 10px;
    min-height: 125px;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
  }

  .product-card:active {
    transform: scale(0.96) !important;
  }

  .product-card.selected {
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.12) !important;
    box-shadow: 0 0 0 2px #10b981, 0 4px 12px rgba(16, 185, 129, 0.25);
  }

  .prod-title {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.1em;
  }

  .prod-desc {
    font-size: 0.7rem;
    line-height: 1.2;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .prod-price {
    font-size: 0.95rem;
    font-weight: 800;
  }

  /* Bottom-Sheet Modals on Mobile */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal-content {
    border-radius: 24px 24px 0 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    max-height: 88vh !important;
    padding: 20px 16px max(24px, calc(16px + env(safe-area-inset-bottom))) 16px !important;
    margin: 0 !important;
    animation: sheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    border-bottom: none !important;
    position: relative;
  }

  /* Drag indicator pill at the top of bottom-sheet */
  .modal-content::before {
    content: "";
    display: block;
    width: 44px;
    height: 5px;
    background: #475569;
    border-radius: 3px;
    margin: 0 auto 14px auto;
  }

  .qr-box img {
    width: 180px !important;
    height: 180px !important;
  }

  /* Floating Sticky Checkout Action Bar */
  .mobile-checkout-bar {
    display: flex;
    position: fixed;
    bottom: calc(56px + env(safe-area-inset-bottom));
    left: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.15);
    border-radius: 16px;
    padding: 10px 14px;
    z-index: 85;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transform: translateY(120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  }

  .mobile-checkout-bar.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-checkout-info {
    flex: 1;
    min-width: 0;
  }

  .mobile-checkout-name {
    font-size: 0.78rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-checkout-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: #10b981;
    line-height: 1.2;
  }

  .mobile-checkout-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
  }

  .mobile-checkout-btn {
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  }

  .mobile-checkout-btn:active {
    transform: scale(0.96);
  }

  /* Native Mobile Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(51, 65, 85, 0.7);
    z-index: 90;
    justify-content: space-around;
    align-items: center;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: color 0.15s ease;
    gap: 2px;
  }

  .mobile-nav-item .nav-icon {
    font-size: 1.25rem;
    line-height: 1;
    transition: transform 0.15s ease;
  }

  .mobile-nav-item:active .nav-icon {
    transform: scale(0.9);
  }

  .mobile-nav-item.active {
    color: #38bdf8;
  }

  .mobile-nav-item.active .nav-icon {
    transform: scale(1.1);
  }

  /* Reseller & Dashboard Stats Grid on Mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .stat-card {
    padding: 12px 10px !important;
  }
  .stat-val {
    font-size: 1.15rem !important;
  }
}

@keyframes sheetSlideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* ==========================================================================
   BERANDA BARU: SALDO & TOP UP, TRANSAKSI TERBARU & SERING, KATEGORI
   ========================================================================== */

/* 1. Kartu Saldo & Top Up */
.home-balance-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #334155;
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.home-balance-card::after {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 110px;
  height: 110px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.home-balance-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.home-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-user-avatar {
  width: 38px;
  height: 38px;
  background: #334155;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  border: 1px solid #475569;
}

.home-user-greeting {
  font-size: 0.78rem;
  color: #94a3b8;
}

.home-user-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: #f8fafc;
}

.home-balance-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 14px;
  margin-bottom: 14px;
}

.home-balance-item-label {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 2px;
}

.home-balance-item-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #10b981;
}

.home-balance-actions {
  display: flex;
  gap: 10px;
}

.home-topup-btn {
  flex: 1;
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.home-topup-btn:active {
  transform: scale(0.96);
}

.home-auth-btn {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #475569;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 2. Section Headers */
.home-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0 10px 0;
}

.home-section-title {
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.home-section-subtitle {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* 3. Transaksi Paling Sering (Chips / Quick Reorder) */
.home-frequent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.home-frequent-item {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.home-frequent-item:active {
  transform: scale(0.96);
  border-color: #38bdf8;
}

.home-frequent-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.25;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-frequent-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-bottom: 6px;
  font-family: monospace;
}

.home-frequent-price {
  font-size: 0.85rem;
  font-weight: 800;
  color: #38bdf8;
}

/* 4. Transaksi Terbaru (Recent Transactions List) */
.home-recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
}

.home-recent-item {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.home-recent-info {
  flex: 1;
  min-width: 0;
}

.home-recent-prod {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-recent-dest {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 2px 0 4px 0;
}

.home-recent-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
}

.home-reorder-btn {
  background: #0284c7;
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s ease;
}

.home-reorder-btn:active {
  transform: scale(0.92);
}

/* 5. Kartu Kategori Layanan & Folder Menu */
.home-category-card {
  background: transparent !important;
  color: #f8fafc !important;
  border-radius: 18px !important;
  padding: 0 !important;
  margin-bottom: 20px !important;
  border: none !important;
  box-shadow: none !important;
}

.home-category-card-title {
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  color: #f8fafc !important;
  margin-bottom: 14px !important;
  letter-spacing: -0.2px;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* =========================================================
   6. TAMPILAN FOLDER DENGAN ICON (STOREFRONT FOLDER CARDS)
   DESAIN RINGKAS, MINIMALIS, & ESTETIK (KOMPAK & MODERN)
   ========================================================= */
.store-folder-group {
  margin-bottom: 16px;
}

.store-folder-group-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.store-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 10px;
}

@media (max-width: 640px) {
  .store-folder-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
}

@media (max-width: 360px) {
  .store-folder-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
}

.store-folder-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px 6px 10px 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  user-select: none;
  min-height: 82px;
}

.store-folder-card::before {
  display: none !important;
}

.store-folder-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.store-folder-card:active {
  transform: scale(0.95);
}

.store-folder-icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  margin-bottom: 6px;
  transition: transform 0.2s ease;
}

.store-folder-card:hover .store-folder-icon-wrapper {
  transform: scale(1.08);
}

.store-folder-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  text-align: center;
  width: 100%;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Banner Folder Aktif di Transaction View */
.active-store-folder-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border: 1px solid #38bdf8;
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.15);
}

.active-store-folder-banner .folder-big-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.active-store-folder-banner .folder-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
}

.tab-btn .tab-count-badge {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 6px;
  font-weight: 700;
}





/* ==========================================================================
   SISTEM MULTI-TEMA WARNA (ADVANCED MULTI-THEME ENGINE)
   1. Midnight Cyber (Dark)
   2. Clean Light (Light)
   3. Emerald Green (Emerald)
   4. Ocean Sapphire (Ocean)
   5. Sultan Gold (Gold)
   6. Cyber Violet (Purple)
   ========================================================================== */

/* 1. Midnight Cyber (Default Gelap) */
:root,
[data-theme="dark"],
html.theme-dark,
body.theme-dark {
  --primary: #38bdf8;
  --primary-hover: #0284c7;
  --primary-light: rgba(56, 189, 248, 0.15);
  --accent: #10b981;
  --bg: #0b0f19;
  --header-bg: rgba(15, 23, 42, 0.88);
  --card-bg: #151d30;
  --card-border: #23314d;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --input-bg: #0f172a;
  --input-border: #334155;
  color-scheme: dark;
}

/* 2. Clean Light (Cerah Bersih) */
[data-theme="light"],
html.theme-light,
body.theme-light {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #059669;
  --bg: #f8fafc;
  --header-bg: rgba(255, 255, 255, 0.94);
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  color-scheme: light;
}

/* 3. Emerald Green (Hijau Zamrud Segar) */
[data-theme="emerald"],
html.theme-emerald,
body.theme-emerald {
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-light: rgba(16, 185, 129, 0.16);
  --accent: #34d399;
  --bg: #061913;
  --header-bg: rgba(9, 36, 29, 0.9);
  --card-bg: #0d2b23;
  --card-border: #164e3f;
  --text-main: #f0fdf4;
  --text-muted: #86efac;
  --input-bg: #08211b;
  --input-border: #1a5646;
  color-scheme: dark;
}

/* 4. Ocean Sapphire (Biru Samudra Dalam) */
[data-theme="ocean"],
html.theme-ocean,
body.theme-ocean {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: rgba(59, 130, 246, 0.16);
  --accent: #60a5fa;
  --bg: #061124;
  --header-bg: rgba(11, 26, 54, 0.9);
  --card-bg: #0f2042;
  --card-border: #1c366e;
  --text-main: #eff6ff;
  --text-muted: #93c5fd;
  --input-bg: #081730;
  --input-border: #1e3a75;
  color-scheme: dark;
}

/* 5. Sultan Gold (Emas Mewah Elegan) */
[data-theme="gold"],
html.theme-gold,
body.theme-gold {
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --primary-light: rgba(245, 158, 11, 0.16);
  --accent: #fbbf24;
  --bg: #181208;
  --header-bg: rgba(33, 24, 11, 0.9);
  --card-bg: #2a1f0d;
  --card-border: #4a3717;
  --text-main: #fffbeb;
  --text-muted: #fde68a;
  --input-bg: #1c1509;
  --input-border: #523d19;
  color-scheme: dark;
}

/* 6. Cyber Violet (Ungu Neon Eksklusif) */
[data-theme="purple"],
html.theme-purple,
body.theme-purple {
  --primary: #a855f7;
  --primary-hover: #9333ea;
  --primary-light: rgba(168, 85, 247, 0.16);
  --accent: #c084fc;
  --bg: #11091d;
  --header-bg: rgba(25, 13, 41, 0.9);
  --card-bg: #1f1233;
  --card-border: #38205c;
  --text-main: #faf5ff;
  --text-muted: #d8b4fe;
  --input-bg: #150b24;
  --input-border: #44276f;
  color-scheme: dark;
}

/* Penyesuaian Global untuk Semua Tema Gelap Khusus */
body[data-theme="emerald"],
body[data-theme="ocean"],
body[data-theme="gold"],
body[data-theme="purple"],
body.theme-emerald,
body.theme-ocean,
body.theme-gold,
body.theme-purple {
  background-color: var(--bg) !important;
  color: var(--text-main) !important;
}

body.theme-emerald header,
body.theme-ocean header,
body.theme-gold header,
body.theme-purple header {
  background: var(--header-bg) !important;
  border-bottom: 1px solid var(--card-border) !important;
}

body.theme-emerald .card,
body.theme-ocean .card,
body.theme-gold .card,
body.theme-purple .card {
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  color: var(--text-main) !important;
}

body.theme-emerald .form-input,
body.theme-ocean .form-input,
body.theme-gold .form-input,
body.theme-purple .form-input {
  background: var(--input-bg) !important;
  border: 1px solid var(--input-border) !important;
  color: var(--text-main) !important;
}

body.theme-emerald .form-label,
body.theme-ocean .form-label,
body.theme-gold .form-label,
body.theme-purple .form-label {
  color: var(--text-muted) !important;
}

body.theme-emerald .home-balance-card,
body.theme-ocean .home-balance-card,
body.theme-gold .home-balance-card,
body.theme-purple .home-balance-card {
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg) 100%) !important;
  border: 1px solid var(--card-border) !important;
}

body.theme-emerald .home-balance-values,
body.theme-ocean .home-balance-values,
body.theme-gold .home-balance-values,
body.theme-purple .home-balance-values {
  background: var(--bg) !important;
  border: 1px solid var(--card-border) !important;
}

body.theme-emerald .home-balance-item-label,
body.theme-ocean .home-balance-item-label,
body.theme-gold .home-balance-item-label,
body.theme-purple .home-balance-item-label {
  color: var(--text-muted) !important;
}

body.theme-emerald .home-user-name,
body.theme-ocean .home-user-name,
body.theme-gold .home-user-name,
body.theme-purple .home-user-name {
  color: var(--text-main) !important;
}

body.theme-emerald .store-folder-card,
body.theme-ocean .store-folder-card,
body.theme-gold .store-folder-card,
body.theme-purple .store-folder-card {
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
}

body.theme-emerald .store-folder-icon-wrapper,
body.theme-ocean .store-folder-icon-wrapper,
body.theme-gold .store-folder-icon-wrapper,
body.theme-purple .store-folder-icon-wrapper {
  background: var(--primary-light) !important;
  border: 1px solid var(--primary) !important;
}

body.theme-emerald .store-folder-title,
body.theme-ocean .store-folder-title,
body.theme-gold .store-folder-title,
body.theme-purple .store-folder-title {
  color: var(--text-main) !important;
}

body.theme-emerald .btn-theme-toggle,
body.theme-ocean .btn-theme-toggle,
body.theme-gold .btn-theme-toggle,
body.theme-purple .btn-theme-toggle {
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  color: var(--primary) !important;
}

/* Styling Modal & Grid Theme Picker */
.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  text-align: left;
}

@media (max-width: 480px) {
  .theme-picker-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.theme-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.theme-picker-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-picker-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary);
}

.theme-swatch-box {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.theme-swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

.theme-picker-text {
  flex: 1;
  min-width: 0;
}

.theme-picker-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.theme-picker-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 2px;
}

/* 2. Styling Tombol Toggle Tema */
.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  text-decoration: none;
}

.btn-theme-toggle:hover {
  background: #334155;
  border-color: #64748b;
  transform: translateY(-1px);
}

body.theme-light .btn-theme-toggle {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

body.theme-light .btn-theme-toggle:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
}

/* 3. Penyesuaian Komponen Halaman di Tema Cerah */
body.theme-light {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

body.theme-light header {
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

body.theme-light .brand {
  color: #1d4ed8 !important;
}

body.theme-light #brandName {
  color: #0f172a !important;
}

body.theme-light #brandTagline {
  color: #64748b !important;
}

body.theme-light #btnDownloadApkNav {
  background: #ffffff !important;
  color: #0284c7 !important;
  border: 1px solid #bae6fd !important;
}

body.theme-light #btnMemberLoginModal {
  background: #2563eb !important;
  color: #ffffff !important;
}

body.theme-light .card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
  color: #0f172a !important;
}

body.theme-light .form-label {
  color: #334155 !important;
}

body.theme-light .form-input {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

body.theme-light .form-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2) !important;
}

body.theme-light .tab-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

body.theme-light .tab-btn.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

/* Balance Card di Tema Cerah */
body.theme-light .home-balance-card {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%) !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06) !important;
}

body.theme-light .home-balance-values {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

body.theme-light .home-balance-item-label {
  color: #64748b !important;
}

body.theme-light .home-user-name {
  color: #0f172a !important;
}

body.theme-light .home-user-greeting {
  color: #64748b !important;
}

body.theme-light .home-user-avatar {
  background: #e2e8f0 !important;
  border: 1px solid #cbd5e1 !important;
}

body.theme-light .home-auth-btn {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

/* Transaksi Paling Sering & Terbaru di Tema Cerah */
body.theme-light .home-section-title {
  color: #0f172a !important;
}

body.theme-light .home-section-subtitle {
  color: #64748b !important;
}

body.theme-light .home-frequent-item {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.theme-light .home-frequent-title {
  color: #0f172a !important;
}

body.theme-light .home-frequent-sub {
  color: #64748b !important;
}

body.theme-light .home-recent-item {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.theme-light .home-recent-prod {
  color: #0f172a !important;
}

body.theme-light .home-recent-dest {
  color: #64748b !important;
}

/* Folder Kategori Kartu di Tema Cerah */
body.theme-light .store-folder-group-title {
  color: #475569 !important;
}

body.theme-light .store-folder-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.theme-light .store-folder-card:hover {
  background: #f8fafc !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12) !important;
}

body.theme-light .store-folder-icon-wrapper {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(14, 165, 233, 0.06)) !important;
  border: 1px solid rgba(37, 99, 235, 0.18) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
}

body.theme-light .store-folder-title {
  color: #0f172a !important;
}

/* Banner Folder Aktif di Transaction View */
body.theme-light .active-store-folder-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%) !important;
  border: 1px solid #bfdbfe !important;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08) !important;
}

body.theme-light .active-store-folder-banner .folder-title,
body.theme-light #activeFolderStoreName {
  color: #0f172a !important;
}

body.theme-light #activeFolderStoreDesc {
  color: #475569 !important;
}

/* Product Cards di Tema Cerah */
body.theme-light .product-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.theme-light .product-card:hover {
  background: #f8fafc !important;
  border-color: #3b82f6 !important;
}

body.theme-light .product-card.selected {
  border-color: #2563eb !important;
  background: #eff6ff !important;
}

body.theme-light .product-title {
  color: #0f172a !important;
}

body.theme-light .product-desc {
  color: #64748b !important;
}

/* Provider Chips di Tema Cerah */
body.theme-light .client-brand-chip {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.theme-light .client-brand-chip:hover {
  background: #f1f5f9 !important;
  border-color: #3b82f6 !important;
}

body.theme-light .client-brand-chip.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

/* Mobile Bottom Navigation & Checkout Bar di Tema Cerah */
body.theme-light .mobile-bottom-nav {
  background: rgba(255, 255, 255, 0.96) !important;
  border-top: 1px solid #e2e8f0 !important;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06) !important;
}

body.theme-light .mobile-nav-item {
  color: #64748b !important;
}

body.theme-light .mobile-nav-item.active {
  color: #2563eb !important;
}

body.theme-light #mobileCheckoutBar {
  background: rgba(255, 255, 255, 0.98) !important;
  border-top: 1px solid #e2e8f0 !important;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08) !important;
}

/* Modals di Tema Cerah */
body.theme-light .modal-content {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15) !important;
}

body.theme-light .modal-header h3 {
  color: #0f172a !important;
}

body.theme-light .history-item {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

/* Portal Mitra & Admin Cards di Tema Cerah */
body.theme-light .cat-pill {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.theme-light .cat-pill.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

body.theme-light .brand-pill {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.theme-light .brand-pill.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}

body.theme-light .pkg-pill {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.theme-light .pkg-pill.active {
  background: #7c3aed !important;
  color: #ffffff !important;
  border-color: #7c3aed !important;
}

body.theme-light table th {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-bottom: 2px solid #e2e8f0 !important;
}

body.theme-light table td {
  border-bottom: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

/* =========================================================
   7. STYLING ESTETIK & MINIMALIS (AESTHETIC & SIMPLE UPGRADES)
   ========================================================= */

/* Pill Buttons di Header Navigasi */
.nav-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  user-select: none;
  white-space: nowrap;
}

.nav-pill-apk {
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.nav-pill-apk:hover {
  background: rgba(2, 132, 199, 0.25);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.nav-pill-wa {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.3);
}

.nav-pill-member {
  background: #2563eb;
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.nav-pill-member:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

/* Light Mode Overrides for Nav Pills */
body.theme-light .nav-pill-apk {
  background: #f0f9ff;
  color: #0284c7;
  border-color: #bae6fd;
}

body.theme-light .nav-pill-member {
  background: #2563eb;
  color: #ffffff;
}

/* Tombol Kembali Ringkas di Formulir Transaksi */
.btn-back-compact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-back-compact:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: var(--primary);
}

body.theme-light .btn-back-compact {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.theme-light .btn-back-compact:hover {
  background: #f1f5f9;
}

/* Mode Segmented Control: Prabayar vs Pascabayar */
.mode-segmented-control {
  display: flex;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 16px;
  gap: 4px;
}

.mode-seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 9px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mode-seg-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

body.theme-light .mode-segmented-control {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

body.theme-light .mode-seg-btn {
  color: #64748b;
}

body.theme-light .mode-seg-btn.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Transaksi Terbaru Minimalis & Estetik */
.home-recent-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.home-recent-item:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

.home-reorder-btn {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.home-reorder-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.home-reorder-btn:active {
  transform: scale(0.95);
}

/* Chip Transaksi Sering */
.home-frequent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.home-frequent-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.home-frequent-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.home-frequent-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-frequent-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}


/* Keadaan Belum Login: Web transaksi terbuka publik */
body.state-unauthenticated .mobile-bottom-nav,
body.state-unauthenticated #mobileBottomNav,
body.state-unauthenticated .mobile-checkout-bar,
body.state-unauthenticated #mobileCheckoutBar,
body.state-unauthenticated #storeAnnouncementBanner,
body.state-unauthenticated #statusBadge {
  /* Diizinkan tampil publik tanpa wajib login */
}

/* --- 2 Alternatif Metode Pembayaran (QRIS & Saldo Topup) --- */
.payment-method-card {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.payment-method-card:hover {
  border-color: var(--primary);
}
.payment-method-card.active {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.2);
}
.pay-radio-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.payment-method-card.active .pay-radio-circle {
  border-color: var(--primary);
}
.pay-radio-inner {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s ease;
}
.payment-method-card.active .pay-radio-inner {
  background: var(--primary);
}

/* --- Site Footer & Compliance Sections (Duitku / Bank Indonesia Standards) --- */
.site-footer {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px 24px 24px 24px;
  margin-top: 36px;
  margin-bottom: 24px;
  color: var(--text-muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 28px;
  margin-bottom: 28px;
}
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
.footer-col h4 {
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col li {
  margin-bottom: 9px;
  font-size: 0.85rem;
}
.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.footer-col a:hover {
  color: var(--primary);
  text-decoration: underline;
}
.footer-trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 6px 0;
}
.trust-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  color: #38bdf8;
  font-weight: 600;
}
.footer-payment-methods {
  padding-top: 18px;
  border-top: 1px solid var(--card-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.payment-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.pay-badge {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-border);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
}
.footer-bottom {
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Modal Legalitas Kepatuhan */
.policy-modal-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}
.policy-tab-btn {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.policy-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.policy-content-scroll {
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 6px;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-main);
}
.policy-content-scroll h3 {
  font-size: 1.05rem;
  color: #38bdf8;
  margin-top: 16px;
  margin-bottom: 8px;
}
.policy-content-scroll ul, .policy-content-scroll ol {
  padding-left: 20px;
  margin-bottom: 12px;
}
