/* ============================================================
   VIP Supply Store — Global Stylesheet
   Mobile-first, fully responsive
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── VIEW TRANSITIONS (transisi halaman halus, cegah menu bawah "lompat") ── */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .18s;
  animation-timing-function: ease-out;
}

:root {
  --teal: #2563EB;        /* MENGUBAH TEAL MENJADI BIRU (Royal Blue) */
  --teal-light: #DBEAFE;  /* MENGUBAH TEAL LIGHT MENJADI BIRU MUDA */
  --teal-dark: #1E40AF;   /* MENGUBAH TEAL DARK MENJADI BIRU TUA */
  --gold: #F59E0B;
  --amber: #D97706;
  --bg: #F3F4F6;
  --white: #FFFFFF;
  --sidebar-w: 200px;
  --text: #111827;
  --muted: #6B7280;
  --border: #E5E7EB;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.05);
  --bottom-nav-h: 64px;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

/* ── SCROLLBAR ───────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 4px; }

/* ── LAYOUT ──────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── SIDEBAR (Desktop) ───────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 200;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  pointer-events: auto;
  visibility: visible;
}

/* ── MOBILE TOPBAR ───────────────────────────────────── */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  z-index: 300;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  box-shadow: var(--shadow);
}
.mobile-topbar .topbar-logo {
  display: flex; align-items: center; gap: 8px; flex: 1;
  text-decoration: none; color: var(--text);
}
.mobile-topbar .topbar-logo-icon {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: white; font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.mobile-topbar .topbar-name { font-weight: 800; font-size: 15px; }
.hamburger {
  background: none; border: none; padding: 6px;
  cursor: pointer; display: flex; flex-direction: column;
  gap: 5px; border-radius: 8px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: all .25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 199;
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }

/* ── MOBILE BOTTOM NAV ───────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--white);
  border-top: 1px solid var(--border);
  z-index: 300;
  box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}
.bottom-nav-inner {
  display: flex;
  height: 100%;
  width: 100%;                  /* PERBAIKAN: Gunakan lebar penuh */
  align-items: center;          /* PERBAIKAN: Rata tengah vertikal */
  justify-content: space-around; /* PERBAIKAN: Sebar 5 menu secara seimbang */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav-item {
  flex: 1;
  display: inline-flex;         /* PERBAIKAN: Agar flexbox bekerja konsisten */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  transition: color .15s;
  padding: 6px 2px;
  min-height: 44px;
  text-align: center;           /* PERBAIKAN: Memastikan teks rata tengah */
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.bottom-nav-item svg { width: 22px; height: 22px; flex-shrink: 0; }
.bottom-nav-item.active { color: var(--teal); }
.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  background: var(--teal);
  border-radius: 0 0 4px 4px;
}
.bottom-nav-more {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px 2px;
  font-family: inherit;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-more svg { width: 22px; height: 22px; }

/* ── MAIN CONTENT ────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 24px;
  max-width: calc(100vw - var(--sidebar-w));
  overflow-x: hidden;
  min-width: 0;
}

/* ── SIDEBAR INTERNALS ───────────────────────────────── */
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 14px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: white; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-name { font-weight: 800; font-size: 14px; color: var(--text); }
.logo-sub  { font-size: 10px; color: var(--muted); }

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #F9FAFB;
  flex-shrink: 0;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, #34D399 100%);
  color: white; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-name  { font-weight: 700; font-size: 12px; color: var(--text); }
.user-level {
  font-size: 9px; font-weight: 700; padding: 1px 6px;
  border-radius: 20px; border: 1px solid; display: inline-block; margin-top: 2px;
}

/* Level badge utility classes */
.bg-gray-50 { background: #F9FAFB; } .text-gray-600 { color: #4B5563; } .border-gray-200 { border-color: #E5E7EB; }
.bg-yellow-50 { background: #FFFBEB; } .text-yellow-700 { color: #B45309; } .border-yellow-300 { border-color: #FCD34D; }
.bg-purple-50 { background: #F5F3FF; } .text-purple-700 { color: #6D28D9; } .border-purple-300 { border-color: #C4B5FD; }
.bg-gray-100 { background: #F3F4F6; } .text-gray-400 { color: #9CA3AF; } .border-gray-300 { border-color: #D1D5DB; }

/* ── SIDEBAR NAV ─────────────────────────────────────── */
.sidebar-nav { flex: 1; padding: 8px 0; overflow-y: auto; overflow-x: hidden; }
.nav-section-label {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  padding: 10px 14px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; text-decoration: none;
  color: #374151; font-size: 13px; font-weight: 500;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
  min-height: 40px;
}
.nav-item:hover  { background: #DBEAFE; color: var(--teal); }
.nav-item.active { background: #DBEAFE; color: var(--teal-dark); font-weight: 700; border-left-color: var(--teal); }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; }

.admin-section { margin-top: 4px; }
.admin-section-label {
  font-size: 10px; font-weight: 700;
  padding: 10px 14px 6px;
  background: #FFF7ED; color: #92400E;
  border-top: 1px solid #FED7AA; border-bottom: 1px solid #FED7AA;
  text-transform: uppercase; letter-spacing: .05em;
}
.admin-nav-item { color: #374151; }
.admin-nav-item:hover { background: #FFF7ED; color: #92400E; }
.admin-nav-item.active-admin { background: #FED7AA; color: #92400E; font-weight: 700; border-left-color: var(--amber); }

.logout-item { color: #DC2626 !important; margin-top: 4px; border-top: 1px solid var(--border); }
.logout-item:hover { background: #FEF2F2 !important; }

/* ── FLASH ───────────────────────────────────────────── */
.flash {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 16px; font-weight: 600; font-size: 13px;
  gap: 10px;
}
.flash button { background: none; border: none; cursor: pointer; font-size: 20px; flex-shrink: 0; min-width: 32px; min-height: 32px; }
.flash-success { background: #D1FAE5; color: #065F46; }
.flash-error   { background: #FEE2E2; color: #991B1B; }
.flash-info    { background: #DBEAFE; color: #1E40AF; }

/* ── PAGE HEADER ─────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.page-header h1 { font-size: 20px; font-weight: 800; color: var(--text); }
.page-back { display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--teal); font-weight: 600; font-size: 13px; margin-bottom: 8px; min-height: 36px; }

/* ── CARDS ───────────────────────────────────────────── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; }
.card-body  { padding: 16px; }

/* ── STAT GRID ───────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--text); }

/* ── HOME BALANCE CARD ───────────────────────────────── */
.balance-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-md);
  overflow: hidden; margin-bottom: 20px;
}
.balance-top { display: flex; align-items: center; }
.balance-col { flex: 1; padding: 16px 20px; border-right: 1px solid var(--border); min-width: 0; }
.balance-col:last-of-type { border-right: none; }
.balance-label { font-size: 11px; color: var(--teal); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.balance-amount { font-size: 22px; font-weight: 800; color: var(--text); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deposit-btn {
  background: var(--teal); color: white;
  padding: 16px 14px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; font-weight: 700; font-size: 11px;
  min-width: 72px; flex-shrink: 0; transition: background .15s;
}
.deposit-btn:hover, .deposit-btn:active { background: var(--teal-dark); }
.deposit-btn svg { width: 20px; height: 20px; }

.quick-links { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--border); }
.quick-link {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 14px 6px; text-decoration: none;
  color: var(--muted); font-size: 11px; font-weight: 600;
  transition: color .15s, background .15s; min-height: 60px;
}
.quick-link:hover, .quick-link:active { color: var(--teal); background: #DBEAFE; }
.quick-link svg { width: 20px; height: 20px; }

/* ── PRODUCTS GRID ───────────────────────────────────── */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.product-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s;
  text-decoration: none; color: inherit; display: block;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-card:active { transform: scale(.98); }
.product-img {
  position: relative; aspect-ratio: 1; background: #F3F4F6;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-placeholder { font-size: 36px; font-weight: 800; color: #D1D5DB; }
.stock-badge {
  position: absolute; top: 6px; left: 6px;
  background: var(--teal-dark); color: white;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
}
.stock-badge.empty { background: rgba(220,38,38,.85); }
.out-of-stock-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
}
.out-of-stock-label {
  color: white; font-weight: 800; font-size: 13px;
  background: #DC2626; padding: 4px 10px; border-radius: 6px;
  transform: rotate(-12deg);
}
.product-info { padding: 10px; }
.product-cat  { font-size: 10px; color: var(--teal); font-weight: 700; text-transform: uppercase; margin-bottom: 2px; }
.product-name { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-sold { font-size: 10px; color: var(--muted); margin-bottom: 6px; }
.product-price {
  display: block; background: var(--teal); color: white;
  font-size: 11px; font-weight: 800; padding: 5px 8px;
  border-radius: 6px; text-align: center;
}

/* ── SEARCH / FILTER ─────────────────────────────────── */
.search-bar {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 8px; display: flex; align-items: center;
  padding: 0 12px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.search-bar input {
  flex: 1; border: none; outline: none; padding: 11px 8px;
  font-size: 14px; font-family: inherit; background: transparent;
}
.search-bar svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; overflow-x: auto; padding-bottom: 2px; }
.filter-bar::-webkit-scrollbar { height: 0; }
.filter-chip {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--white); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s; color: var(--muted);
  white-space: nowrap; flex-shrink: 0; min-height: 32px;
}
.filter-chip.active, .filter-chip:hover { background: var(--teal); color: white; border-color: var(--teal); }
.sort-select {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; font-size: 13px;
  font-family: inherit; outline: none; cursor: pointer; box-shadow: var(--shadow);
}

/* ── TABS ────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs::-webkit-scrollbar { height: 0; }
.tab {
  padding: 10px 16px; font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color .15s; white-space: nowrap;
  text-decoration: none; min-height: 42px; display: flex; align-items: center;
}
.tab.active { color: var(--teal); border-bottom-color: var(--teal); }

/* ── TABLES ──────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 500px; }
thead th {
  background: #F9FAFB; padding: 10px 12px; text-align: left;
  font-weight: 700; font-size: 11px; color: var(--muted);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid #F3F4F6; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FAFAFA; }

/* ── BADGES ──────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-green  { background: #D1FAE5; color: #065F46; }
.badge-red    { background: #FEE2E2; color: #991B1B; }
.badge-yellow { background: #FEF9C3; color: #854D0E; }
.badge-blue   { background: #DBEAFE; color: #1E40AF; }
.badge-gray   { background: #F3F4F6; color: #374151; }
.badge-amber  { background: #FEF3C7; color: #92400E; }
.badge-warning { background: #FEF3C7; color: #92400E; }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: none; cursor: pointer;
  font-size: 13px; font-weight: 700; font-family: inherit;
  transition: all .15s; text-decoration: none;
  min-height: 36px; -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn-primary  { background: var(--teal); color: white; }
.btn-primary:hover, .btn-primary:active { background: var(--teal-dark); }
.btn-amber    { background: var(--gold); color: white; }
.btn-amber:hover, .btn-amber:active { background: var(--amber); }
.btn-danger   { background: #DC2626; color: white; }
.btn-danger:hover, .btn-danger:active { background: #B91C1C; }
.btn-outline  { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover, .btn-outline:active { background: #F9FAFB; }
.btn-warning  { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; min-height: 30px; }
.btn-lg { padding: 13px 24px; font-size: 15px; border-radius: 10px; width: 100%; min-height: 48px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── FORMS ───────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 700; color: #374151; margin-bottom: 5px; }
.form-control {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit;
  outline: none; transition: border-color .15s; background: white;
  -webkit-appearance: none; appearance: none;
}
.form-control:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

/* ── MODAL ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 1000; padding: 0; opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: white; border-radius: 16px 16px 0 0; width: 100%;
  max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 16px; font-weight: 800; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 24px; color: var(--muted); min-width: 40px; min-height: 40px; display: flex; align-items: center; justify-content: center; }
.modal-body { padding: 20px; }

/* ── ADMIN HEADER ────────────────────────────────────── */
.admin-page-header {
  background: linear-gradient(135deg, #FFF7ED 0%, #FEF3C7 100%);
  border: 1px solid #FED7AA; border-radius: 10px;
  padding: 14px 16px; margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 12px;
  flex-wrap: wrap;
}
.admin-page-header > div:first-child { flex: 1; min-width: 0; }
.admin-page-header h1 { font-size: 18px; font-weight: 800; color: #92400E; }
.admin-page-header p  { font-size: 12px; color: #B45309; margin-top: 2px; }

/* ── ACCOUNT PAGE ────────────────────────────────────── */
.account-hero {
  background: linear-gradient(135deg, #F0FDFA 0%, var(--white) 100%);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 24px; text-align: center; margin-bottom: 16px; box-shadow: var(--shadow-md);
}
.account-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, #34D399 100%);
  color: white; font-weight: 800; font-size: 28px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 10px;
}
.account-quick { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.account-quick-item { background: var(--white); padding: 14px 6px; text-align: center; text-decoration: none; color: var(--muted); font-size: 10px; font-weight: 600; transition: background .15s; min-height: 68px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.account-quick-item:hover, .account-quick-item:active { background: #DBEAFE; color: var(--teal); }
.account-quick-item svg { width: 20px; height: 20px; display: block; }
.account-menu-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #F3F4F6; font-size: 13px; min-height: 50px; text-decoration: none; color: var(--text); }
.account-menu-item:last-child { border-bottom: none; }
.account-menu-item-left { display: flex; align-items: center; gap: 10px; }
.account-menu-item-left svg { width: 16px; height: 16px; color: var(--muted); }

/* ── LEADERBOARD ─────────────────────────────────────── */
.leaderboard-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow);
}
.rank-num { font-size: 18px; font-weight: 800; width: 28px; color: var(--muted); text-align: center; flex-shrink: 0; }
.rank-num.top1 { color: #F59E0B; }
.rank-num.top2 { color: #9CA3AF; }
.rank-num.top3 { color: #CD7F32; }
.lb-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--teal), #34D399); color: white; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lb-name  { font-weight: 700; font-size: 14px; }
.lb-sub   { font-size: 11px; color: var(--muted); }
.lb-right { margin-left: auto; text-align: right; }
.lb-tx    { font-size: 12px; font-weight: 700; color: var(--text); }
.lb-tx small { color: var(--muted); font-weight: 400; }

/* ── DEPOSIT METHODS GRID ────────────────────────────── */
.method-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.method-card {
  border: 2px solid var(--border); border-radius: 10px; padding: 12px 8px;
  text-align: center; cursor: pointer; transition: all .15s;
  background: var(--white); min-height: 80px;
}
.method-card:hover, .method-card.selected { border-color: var(--teal); background: #DBEAFE; }
.method-card:active { transform: scale(.97); }
.method-name { font-weight: 700; font-size: 12px; color: var(--text); }
.method-type { font-size: 10px; color: var(--muted); margin-top: 2px; }
.method-icon { font-size: 22px; margin-bottom: 6px; }

/* ── DEPOSIT AMOUNT PRESETS ──────────────────────────── */
.amount-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.preset-btn {
  padding: 10px 4px; border: 2px solid var(--border); border-radius: 8px;
  background: white; font-size: 11px; font-weight: 700; cursor: pointer;
  transition: all .15s; font-family: inherit; color: var(--text);
  min-height: 44px; -webkit-tap-highlight-color: transparent;
}
.preset-btn.selected, .preset-btn:hover { border-color: var(--teal); background: #DBEAFE; color: var(--teal); }

/* ── VOUCHER CARD ────────────────────────────────────── */
.voucher-card {
  background: var(--white); border: 2px dashed var(--teal);
  border-radius: 10px; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 10px;
}
.voucher-code { font-weight: 800; font-size: 15px; color: var(--teal); letter-spacing: .06em; }
.voucher-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── CHAT WIDGET ─────────────────────────────────────── */
.chat-widget { position: fixed; bottom: 24px; right: 16px; z-index: 400; }
.chat-toggle-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--teal); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(37,99,235,.5);
  transition: transform .2s; position: relative;
}
.chat-toggle-btn:hover { transform: scale(1.08); }
.chat-badge {
  position: absolute; top: 0; right: 0;
  background: #DC2626; color: white; border-radius: 50%;
  width: 18px; height: 18px; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.chat-badge.hidden { display: none; }
.chat-box {
  position: absolute; bottom: 64px; right: 0;
  width: min(320px, calc(100vw - 24px));
  background: white; border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  overflow: hidden; display: flex; flex-direction: column;
}
.chat-box.hidden { display: none; }
.chat-header { background: var(--teal); color: white; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 14px; }
.chat-header button { background: none; border: none; color: white; cursor: pointer; font-size: 22px; min-width: 36px; min-height: 36px; }
.chat-messages { flex: 1; height: 240px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 85%; }
.chat-msg.member { align-self: flex-end; }
.chat-msg.admin  { align-self: flex-start; }
.chat-bubble { padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.4; }
.chat-msg.member .chat-bubble { background: var(--teal); color: white; border-bottom-right-radius: 2px; }
.chat-msg.admin  .chat-bubble { background: #F3F4F6; color: var(--text); border-bottom-left-radius: 2px; }
.chat-time { font-size: 10px; color: var(--muted); margin-top: 3px; }
.chat-msg.member .chat-time { text-align: right; }
.chat-input-row { display: flex; border-top: 1px solid var(--border); padding: 8px; gap: 6px; }
.chat-input-row input {
  flex: 1; border: 1px solid var(--border); border-radius: 20px;
  padding: 9px 14px; font-size: 14px; font-family: inherit; outline: none;
}
.chat-input-row input:focus { border-color: var(--teal); }
.chat-input-row button { background: var(--teal); color: white; border: none; border-radius: 20px; padding: 9px 14px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; }

/* Admin chat panel */
.chat-rooms { display: flex; flex-direction: column; gap: 8px; }
.chat-room-item { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; cursor: pointer; display: flex; align-items: center; gap: 12px; transition: border-color .15s; }
.chat-room-item:hover { border-color: var(--teal); }
.chat-room-item.selected { border-color: var(--teal); background: #DBEAFE; }
.chat-panel { display: grid; grid-template-columns: 260px 1fr; gap: 14px; height: 600px; }
.chat-room-list { overflow-y: auto; }
.chat-conversation { background: var(--white); border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; overflow: hidden; }
.chat-conv-header { background: var(--teal); color: white; padding: 12px 16px; font-weight: 700; }
.chat-conv-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-conv-input { display: flex; border-top: 1px solid var(--border); padding: 10px; gap: 8px; }
.chat-conv-input input { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-family: inherit; font-size: 14px; outline: none; }
.chat-conv-input input:focus { border-color: var(--teal); }
.chat-conv-input button { background: var(--teal); color: white; border: none; border-radius: 8px; padding: 10px 18px; font-weight: 700; cursor: pointer; font-family: inherit; }

/* ── INFORMASI ───────────────────────────────────────── */
.announcement-card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.announcement-date { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.announcement-title { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.announcement-body { font-size: 13px; color: #374151; line-height: 1.6; }

/* ── EMPTY STATE ─────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 12px; display: block; opacity: .4; }
.empty-state p { font-size: 14px; font-weight: 500; }

/* ── UTIL ────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-center { text-align: center; }

/* ============================================================
   RESPONSIVE — TABLET (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
  .form-row { grid-template-columns: 1fr; }
  .chat-panel { grid-template-columns: 1fr; height: auto; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {

  /* Show mobile topbar & bottom nav */
  .mobile-topbar { display: flex; }
  .bottom-nav    { display: flex; }

  /* Hide desktop sidebar by default, show as slide-in */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
    z-index: 350;
    width: 240px;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    visibility: hidden;
  }
  .sidebar.open { transform: translateX(0); pointer-events: auto; visibility: visible; }
  .sidebar-overlay { display: block; pointer-events: none; }
  .sidebar-overlay.open { pointer-events: auto; }

  /* Main content adjustments */
  .main-content {
    max-width: 100vw;
    padding: 14px 12px;
    padding-top: calc(56px + 14px);       /* topbar height */
    padding-bottom: calc(var(--bottom-nav-h) + 12px); /* bottom nav */
  }

  /* Balance card smaller font */
  .balance-amount { font-size: 17px; }
  .deposit-btn { min-width: 60px; font-size: 10px; padding: 14px 10px; }

  /* Products grid: 2 columns */
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  /* Admin page header */
  .admin-page-header { flex-direction: column; gap: 10px; }
  .admin-page-header > * { width: 100%; }

  /* Stat grid: 2 columns */
  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  /* Form row: single column */
  .form-row { grid-template-columns: 1fr; }

  /* Form actions: full width buttons */
  .form-actions { justify-content: stretch; }
  .form-actions .btn { flex: 1; justify-content: center; }

  /* Tables: smaller font */
  table { font-size: 12px; }
  thead th { padding: 8px 10px; }
  tbody td { padding: 8px 10px; }

  /* Modal: full bottom sheet */
  .modal { border-radius: 20px 20px 0 0; max-height: 85vh; }

  /* Chat widget: above bottom nav */
  .chat-widget { bottom: calc(var(--bottom-nav-h) + 12px); right: 12px; }
  .chat-box { width: calc(100vw - 24px); right: -4px; }

  /* Page header: stack */
  .page-header { flex-direction: column; align-items: flex-start; }

  /* Quick links: 4 always but smaller */
  .quick-links { grid-template-columns: repeat(4, 1fr); }
  .quick-link { padding: 12px 4px; font-size: 10px; }

  /* Deposit presets: 2 columns */
  .amount-presets { grid-template-columns: repeat(2, 1fr); }

  /* Chat admin panel stacked */
  .chat-panel { grid-template-columns: 1fr; height: auto; }
  .chat-conversation { height: 400px; }

  /* Account quick links */
  .account-quick { grid-template-columns: repeat(4, 1fr); }
  .account-quick-item { padding: 10px 4px; font-size: 9px; }

  /* Tabs scrollable */
  .tabs { overflow-x: auto; }

  /* Buttons in table: icon-only on very small */
  .btn-sm { padding: 5px 8px; }

  /* Voucher card */
  .voucher-card { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   RESPONSIVE — SMALL MOBILE (≤ 380px)
   ============================================================ */
@media (max-width: 380px) {
  .balance-amount { font-size: 15px; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .amount-presets { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .main-content { padding-left: 10px; padding-right: 10px; }
  .account-quick { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   KODE BARU: LAYOUT DETAIL PRODUK RESPONSIVE (MENCEGAH ERROR ORDER MENU)
   ============================================================ */
.product-detail-wrapper {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: flex-start;
  width: 100%;
}

.product-detail-left {
  flex: 1;
  min-width: 0;
}

.product-detail-right {
  width: 360px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  z-index: 10;
}

/* Mencegah gambar berukuran kaku keluar layar */
.product-detail-left img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  object-fit: contain;
}

@media (max-width: 768px) {
  .product-detail-wrapper {
    flex-direction: column;
    gap: 16px;
  }
  .product-detail-right {
    width: 100%;
    position: static;
  }
}
