:root {
  --primary: #6c5ce7;
  --primary-2: #a855f7;
  --accent: #ff9f1c;
  --accent-dark: #e88400;
  --dark: #1f2029;
  --bg: #ffffff;
  --bg-soft: #f7f7fb;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --text: #1f2029;
  --muted: #6b7280;
  --success: #16a34a;
  --pending: #d97706;
  --rejected: #dc2626;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Hind Siliguri', 'Poppins', 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  position: relative;
}

#bgStars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  display: block;
}
h1, h2, h3, .logo, .tab-btn, .product-name, .btn, .btn-buy { font-family: 'Poppins', 'Hind Siliguri', sans-serif; }
a { text-decoration: none; color: inherit; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px; }
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 24px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(135deg, var(--accent), var(--primary-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-transform: uppercase; font-family: 'Poppins', sans-serif;
}
.logo img { max-height: 42px; border-radius: 8px; }
.main-nav { display: flex; align-items: center; }
.nav-btn {
  margin-left: 10px; padding: 9px 16px; border-radius: 10px; font-size: 13px; font-weight: 700;
  background: linear-gradient(180deg, #fff, #f3f3f8);
  border: 1px solid var(--border); box-shadow: 0 2px 0 rgba(0,0,0,.04), 0 4px 10px rgba(0,0,0,.05);
  transition: transform .12s, box-shadow .12s;
}
.nav-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 0 rgba(0,0,0,.05), 0 8px 16px rgba(108,92,231,.15); color: var(--primary); }
.nav-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.nav-btn-outline {
  background: linear-gradient(180deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent;
  box-shadow: 0 3px 0 #5a48c9, 0 6px 14px rgba(108,92,231,.35);
}
.nav-btn-outline:hover { color: #fff; opacity: .95; }

.wallet-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 10px;
  background: linear-gradient(180deg, #fff, #f3f0ff); color: var(--primary); font-weight: 800; font-size: 13px;
  padding: 8px 14px; border-radius: 30px; border: 1px solid #ded8ff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 3px 8px rgba(108,92,231,.15);
  transition: transform .12s;
}
.wallet-badge:hover { transform: translateY(-1px); }
.wallet-badge svg { flex-shrink: 0; }
.coin-badge { background: linear-gradient(180deg, #fffaf0, #fff2d6); color: var(--accent-dark); border-color: #ffe2ad; }
.coin-badge svg circle[fill="currentColor"] { color: var(--accent); }

.menu-wrap { position: relative; margin-left: 10px; }
.menu-toggle {
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 10px; border: 1px solid var(--border); background: linear-gradient(180deg, #fff, #f3f3f8);
  color: var(--text); cursor: pointer; box-shadow: 0 2px 0 rgba(0,0,0,.04), 0 4px 10px rgba(0,0,0,.05);
  transition: transform .12s;
}
.menu-toggle:hover { color: var(--primary); transform: translateY(-1px); }
.menu-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 180px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 28px rgba(0,0,0,.14);
  padding: 8px; display: none; flex-direction: column; gap: 2px; z-index: 50;
}
.menu-dropdown.open { display: flex; }
.menu-dropdown a { padding: 10px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.menu-dropdown a:hover { background: var(--bg-soft); color: var(--primary); }

.avatar-circle {
  width: 38px; height: 38px; border-radius: 50%; margin-left: 10px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(108,92,231,.35);
}

.profile-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 90; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.profile-overlay.open { opacity: 1; pointer-events: auto; }

.profile-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 300px; max-width: 85vw; background: #fff; z-index: 91;
  padding: 28px 20px; box-shadow: -10px 0 30px rgba(0,0,0,.15); overflow-y: auto;
  transform: translateX(100%); transition: transform .25s ease;
}
.profile-panel.open { transform: translateX(0); }
.profile-close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border); background: #fff; font-size: 18px; cursor: pointer; color: var(--muted);
}
.profile-avatar-lg {
  width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 12px; background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 800; font-size: 26px; display: flex; align-items: center; justify-content: center;
}
.profile-name { text-align: center; font-weight: 800; font-size: 16px; }
.profile-email { text-align: center; font-size: 12px; color: var(--muted); margin-top: 2px; }
.profile-logout {
  display: flex; align-items: center; justify-content: center; gap: 6px; margin: 16px auto 20px;
  width: fit-content; padding: 8px 18px; border-radius: 30px; background: var(--bg-soft); border: 1px solid var(--border);
  font-size: 12px; font-weight: 700;
}
.profile-logout:hover { color: var(--rejected); }

.profile-menu { display: flex; flex-direction: column; gap: 8px; }
.profile-menu a {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--bg-soft);
  font-size: 13px; font-weight: 700; color: var(--text); border: 1px solid transparent;
}
.profile-menu a:hover { border-color: var(--primary); color: var(--primary); }
.profile-menu-icon { font-size: 15px; }
.profile-menu-highlight { background: #ecfdf5 !important; color: var(--success) !important; }

/* Bottom navigation bar */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #fff; border-top: 1px solid var(--border);
  display: flex; box-shadow: 0 -4px 16px rgba(0,0,0,.06);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 8px;
  color: var(--muted); font-size: 10.5px; font-weight: 700; transition: color .15s;
}
.bottom-nav-item:hover, .bottom-nav-item:active { color: var(--primary); }
body.has-bottom-nav { padding-bottom: 90px; }

/* Floating "সাহায্য লাগবে?" Telegram help bubble */
.help-bubble {
  position: fixed; right: 18px; bottom: 90px; z-index: 70;
  display: flex; align-items: center; gap: 8px;
  background: #fff; color: var(--text); padding: 10px 16px 10px 14px; border-radius: 30px;
  box-shadow: 0 6px 20px rgba(0,0,0,.15); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 700; transition: transform .15s;
}
.help-bubble:hover { transform: translateY(-2px); }
.help-bubble-icon {
  width: 30px; height: 30px; border-radius: 50%; background: #229ED9; color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* "File & Setup" popup modal */
.setup-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 95; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.setup-modal-overlay.open { opacity: 1; pointer-events: auto; }
.setup-modal {
  position: fixed; left: 50%; top: 50%; z-index: 96; width: 320px; max-width: 88vw; background: #fff;
  border-radius: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.25); overflow: hidden;
  transform: translate(-50%, -50%) scale(.9); opacity: 0; pointer-events: none; transition: transform .2s, opacity .2s;
}
.setup-modal.open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.setup-modal-head {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 18px;
  border-bottom: 1px solid var(--border); font-weight: 800; font-size: 14px;
}
.setup-modal-close {
  width: 28px; height: 28px; border-radius: 50%; border: none; background: var(--bg-soft);
  font-size: 18px; cursor: pointer; color: var(--muted); flex-shrink: 0;
}
.setup-modal-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.setup-modal-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px; border-radius: 10px; font-weight: 800; font-size: 13px; color: #fff;
  transition: opacity .15s;
}
.setup-modal-btn:hover { opacity: .92; }
.setup-modal-files { background: linear-gradient(135deg, #16a34a, #15803d); box-shadow: 0 4px 12px rgba(22,163,74,.3); }
.setup-modal-video { background: linear-gradient(135deg, #dc2626, #b91c1c); box-shadow: 0 4px 12px rgba(220,38,38,.3); }
body:not(.has-bottom-nav) .help-bubble { bottom: 18px; }

.notice-bar { background: var(--bg-soft); color: var(--primary); padding: 9px 0; font-size: 13px; text-align: center; font-weight: 600; border-bottom: 1px solid var(--border); }

/* Hero (fallback when no banners uploaded) */
.hero { background: linear-gradient(135deg, #f3f0ff 0%, #fff7ec 100%); color: var(--text); padding: 50px 0; text-align: center; border-bottom: 1px solid var(--border); }
.hero h1 { margin: 0 0 8px; font-size: 30px; color: var(--primary); font-weight: 800; }
.hero p { margin: 0; color: var(--muted); }

/* Banner slider */
.slider { position: relative; max-width: 1100px; margin: 18px auto 0; border-radius: 16px; overflow: hidden; aspect-ratio: 3/1; background: var(--bg-soft); box-shadow: 0 8px 24px rgba(0,0,0,.08); border: 1px solid var(--border); }
.slider-track { display: flex; height: 100%; transition: transform .5s ease; }
.slide { flex: 0 0 100%; height: 100%; display: block; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slider-dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.7); border: 1px solid rgba(0,0,0,.1); cursor: pointer; transition: all .2s; }
.dot.active { background: var(--accent); width: 22px; border-radius: 6px; border-color: transparent; }

.slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.85); color: var(--text); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.15); transition: background .15s;
}
.slider-arrow:hover { background: #fff; }
.slider-arrow-left { left: 12px; }
.slider-arrow-right { right: 12px; }

/* Category tabs */
.category-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; margin: 26px 0 22px; }
.tab-btn {
  padding: 12px 10px; border-radius: 12px; border: 1px solid var(--border); cursor: pointer;
  background: #fff; color: var(--text); font-weight: 700; font-size: 13px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(0,0,0,.04); transition: all .2s;
}
.tab-btn:hover { border-color: var(--primary); }
.tab-btn.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(108,92,231,.35); }

.category-panel { display: none; }
.category-panel.active { display: block; }
.empty-msg { color: var(--muted); padding: 20px 0; }

/* Category / Products */
.category-title { border-left: 4px solid var(--accent); padding-left: 10px; margin: 32px 0 16px; font-size: 20px; font-weight: 700; }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.product-card {
  background: #fff; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; position: relative;
  transition: transform .18s, box-shadow .18s; border: 1px solid var(--border);
}
.product-card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 14px 28px rgba(0,0,0,.1); }
.product-image { aspect-ratio: 1/1; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.no-image { color: var(--muted); font-size: 13px; }
.product-info { padding: 12px; background: #fff; display: flex; flex-direction: column; gap: 6px; flex: 1; text-align: center; }
.product-name { font-weight: 700; font-size: 13px; color: var(--text); line-height: 1.3; }
.product-short { font-size: 11.5px; color: var(--muted); }
.product-price {
  font-weight: 800; font-size: 15px; color: var(--success);
}
.product-actions { display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding-top: 6px; }
.btn-setup, .btn-buynow {
  display: block; text-align: center; padding: 9px 10px; border-radius: 8px; font-size: 12px; font-weight: 700;
  transition: opacity .15s, transform .1s;
}
.btn-setup { background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.3); }
.btn-setup:hover { opacity: .92; }
.btn-buynow { background: linear-gradient(135deg, #ec4899, #db2777); color: #fff; box-shadow: 0 4px 12px rgba(219,39,119,.3); }
.btn-buynow:hover { opacity: .92; }
.btn-buynow:active, .btn-setup:active { transform: scale(.97); }

/* Product detail */
.product-page { padding-bottom: 60px; }
.product-detail { display: flex; gap: 24px; margin: 28px 0; flex-wrap: wrap; }
.product-detail-image { flex: 0 0 280px; aspect-ratio: 1/1; background: var(--bg-soft); border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.product-detail-image img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-info { flex: 1; min-width: 260px; }
.product-detail-info h1 { font-size: 24px; margin-bottom: 6px; }
.product-price-large { font-size: 24px; font-weight: 800; color: var(--primary); margin: 8px 0 16px; }

.variant-select { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.variant-btn {
  padding: 9px 18px; border-radius: 10px; border: 1.5px solid var(--border); cursor: pointer;
  background: #fff; color: var(--text); font-weight: 700; font-size: 13px; transition: all .15s;
}
.variant-btn:hover { border-color: var(--primary); }
.variant-btn.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(108,92,231,.3); }

.product-details-html { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.product-details-html a { color: var(--primary); font-weight: 600; }

/* Recharge-style product page */
.recharge-header { display: flex; align-items: center; gap: 14px; margin: 20px 0; }
.recharge-thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); }
.recharge-header h1 { font-size: 20px; margin: 0; }

.recharge-section { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.recharge-section-title { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; margin-bottom: 14px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; background: var(--rejected); color: #fff;
  font-size: 12px; font-weight: 800;
}

.recharge-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.recharge-card {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px;
  cursor: pointer; transition: all .15s; position: relative;
}
.recharge-card:hover { border-color: var(--primary); }
.recharge-card.selected { border-color: var(--primary); background: #f4f0ff; box-shadow: 0 0 0 2px rgba(108,92,231,.15); }
.recharge-card.sold-out { opacity: .55; cursor: not-allowed; }
.recharge-dot { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; }
.recharge-card.selected .recharge-dot { background: var(--primary); border-color: var(--primary); }
.recharge-name { flex: 1; font-weight: 700; font-size: 13px; }
.recharge-price { font-weight: 800; color: var(--rejected); font-size: 13px; }
.stock-out-tag {
  display: inline-block; margin-left: 6px; background: var(--rejected); color: #fff; font-size: 9px; font-weight: 800;
  padding: 2px 6px; border-radius: 6px; vertical-align: middle;
}

.payment-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.payment-card {
  border: 1.5px solid var(--border); border-radius: 12px; padding: 16px 10px; text-align: center; cursor: pointer; transition: all .15s;
}
.payment-card:hover { border-color: var(--primary); }
.payment-card.active { border-color: var(--primary); background: #f4f0ff; box-shadow: 0 0 0 2px rgba(108,92,231,.15); }
.payment-card.sold-out { opacity: .5; cursor: not-allowed; }
.payment-card-icon { font-size: 24px; margin-bottom: 6px; }
.payment-card-label { font-weight: 800; font-size: 12px; }
.payment-card-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }

.recharge-section label { display: block; margin: 10px 0 4px; font-size: 13px; font-weight: 600; }
.recharge-section input, .recharge-section select {
  width: 100%; padding: 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit;
}

.order-box { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 22px; max-width: 480px; box-shadow: 0 6px 20px rgba(0,0,0,.05); }
.order-box h2 { margin-top: 0; }
.payment-info { background: #f4f0ff; border: 1px dashed var(--primary); border-radius: 10px; padding: 14px; margin-bottom: 16px; font-size: 14px; }
.order-box form label { display: block; margin: 10px 0 4px; font-size: 13px; font-weight: 600; }
.order-box form input, .order-box form select, .auth-form input {
  width: 100%; padding: 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit;
}
.btn-buy {
  margin-top: 18px; width: 100%; padding: 13px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); border: none; border-radius: 10px;
  color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; transition: opacity .15s;
}
.btn-buy:hover { opacity: .9; }

.alert { padding: 11px 16px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.alert-success { background: #ecfdf5; color: var(--success); border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: var(--rejected); border: 1px solid #fecaca; }

/* Latest orders */
.orders-list { display: flex; flex-direction: column; gap: 10px; }
.order-item { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.order-customer { font-weight: 700; font-size: 14px; }
.order-product { font-size: 12px; color: var(--muted); }
.order-status { margin-left: auto; font-size: 12px; padding: 4px 12px; border-radius: 20px; text-transform: capitalize; font-weight: 600; }
.status-completed { background: #ecfdf5; color: var(--success); }
.status-pending { background: #fffbeb; color: var(--pending); }
.status-rejected { background: #fef2f2; color: var(--rejected); }

/* Auth */
.auth-page { max-width: 420px; margin: 40px auto; }
.auth-form button { margin-top: 16px; }

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--text); font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background .15s, box-shadow .15s; margin-top: 8px;
}
.btn-google:hover { background: var(--bg-soft); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.btn-google img { width: 18px; height: 18px; }

.divider { display: flex; align-items: center; text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border); }
.divider span { padding: 0 12px; }

/* Tables */
.orders-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.orders-table th, .orders-table td { padding: 12px; border: 1px solid var(--border); font-size: 13px; text-align: left; }

/* Footer */
.site-footer { background: #fff; color: var(--muted); padding: 26px 0; margin-top: 50px; text-align: center; font-size: 13px; border-top: 1px solid var(--border); }
.site-footer a { color: var(--primary); font-weight: 600; }

/* ===== Admin ===== */
.admin-body { background: var(--bg-soft); font-family: 'Hind Siliguri', 'Poppins', sans-serif; }
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar { width: 230px; background: #fff; border-right: 1px solid var(--border); flex-shrink: 0; }
.admin-sidebar .logo { display: block; padding: 20px; font-size: 18px; border-bottom: 1px solid var(--border); }
.admin-sidebar a { display: block; padding: 13px 20px; color: var(--text); font-size: 14px; font-weight: 600; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--bg-soft); color: var(--primary); }
.admin-main { flex: 1; padding: 26px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.admin-header h1 { margin: 0; }
.admin-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 22px; margin-bottom: 22px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 11px; border-bottom: 1px solid var(--border); font-size: 13px; text-align: left; vertical-align: middle; }
.admin-table img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; }
.btn { display: inline-block; padding: 9px 16px; border-radius: 8px; border: none; cursor: pointer; font-size: 13px; font-weight: 700; text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.btn-primary:hover { opacity: .9; }
.btn-danger { background: #fee2e2; color: var(--rejected); }
.btn-success { background: #dcfce7; color: var(--success); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.admin-form label { display: block; margin: 12px 0 4px; font-size: 13px; font-weight: 700; }
.admin-form input, .admin-form select, .admin-form textarea {
  width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit;
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-box { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.stat-box .num { font-size: 28px; font-weight: 800; color: var(--primary); }
.stat-box .label { color: var(--muted); font-size: 13px; margin-top: 4px; }

@media (max-width: 700px) {
  .admin-wrap { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; }
  .admin-sidebar .logo { display: none; }
  .admin-sidebar a { white-space: nowrap; }
}

/* ===== Mobile responsiveness (site-facing pages) ===== */
@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .header-inner { flex-wrap: nowrap; gap: 6px; padding: 10px 12px; }
  .logo { font-size: 15px; gap: 6px; flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .logo img { max-height: 30px; }
  .main-nav { flex-wrap: nowrap; gap: 5px; width: auto; justify-content: flex-end; flex-shrink: 0; }
  .nav-btn { margin-left: 0; font-size: 10.5px; padding: 6px 10px; }
  .wallet-badge { margin-left: 0; font-size: 10.5px; padding: 5px 8px; gap: 3px; }
  .avatar-circle { width: 32px; height: 32px; font-size: 13px; margin-left: 4px; }

  .hero { padding: 32px 0; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 13px; }

  .slider { aspect-ratio: 16/9; border-radius: 10px; margin-top: 12px; }

  .category-tabs { gap: 6px; margin: 18px 0 16px; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
  .tab-btn { padding: 10px 6px; font-size: 11.5px; }

  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-name { font-size: 11.5px; }
  .product-short { font-size: 10.5px; }
  .product-price { font-size: 10.5px; padding: 3px 9px; }
  .btn-setup, .btn-buynow { font-size: 11px; padding: 7px 6px; }

  .help-bubble { right: 12px; bottom: 82px; padding: 8px 12px 8px 8px; font-size: 11px; }
  .help-bubble-icon { width: 26px; height: 26px; }

  .product-detail { flex-direction: column; gap: 16px; margin: 16px 0; }
  .product-detail-image { flex: none; width: 100%; }
  .product-detail-info h1 { font-size: 19px; }
  .product-price-large { font-size: 19px; }

  .order-box { max-width: 100%; padding: 16px; }
  .auth-page { max-width: 100%; margin: 20px auto; padding: 0 16px; }

  .orders-table { display: block; overflow-x: auto; white-space: nowrap; }

  .admin-main { padding: 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .admin-header { flex-wrap: wrap; gap: 10px; }
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 380px) {
  .product-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .container { padding: 0 12px; }
  .logo { font-size: 12px; }
  .wallet-badge { font-size: 9.5px; padding: 4px 7px; }
  .avatar-circle { width: 28px; height: 28px; font-size: 12px; }
}