:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --bg-input: #1a1a24;
  --border: #2a2a3a;
  --border-light: #333345;
  --text-primary: #f0f0f8;
  --text-secondary: #9090aa;
  --text-muted: #666680;
  --accent: #6c63ff;
  --accent-hover: #5a52e0;
  --accent-light: rgba(108,99,255,0.15);
  --accent-glow: rgba(108,99,255,0.3);
  --success: #22c55e;
  --success-light: rgba(34,197,94,0.15);
  --warning: #f59e0b;
  --warning-light: rgba(245,158,11,0.15);
  --danger: #ef4444;
  --danger-light: rgba(239,68,68,0.15);
  --info: #3b82f6;
  --info-light: rgba(59,130,246,0.15);
  --gold: #f59e0b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-accent: 0 4px 20px rgba(108,99,255,0.25);
  --header-height: 60px;
  --bottom-nav-height: 64px;
  --transition: all 0.2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

ul { list-style: none; }

button { cursor: pointer; font-family: var(--font); border: none; background: none; }

input, textarea, select {
  font-family: var(--font);
  font-size: 1rem;
  outline: none;
  border: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.app-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.app-loader.hidden { opacity: 0; pointer-events: none; }

.loader-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loader-dots { display: flex; gap: 6px; align-items: center; }
.loader-dots span {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: dots 1.4s infinite ease-in-out both;
}
.loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dots { 0%,80%,100%{transform:scale(0);opacity:.3} 40%{transform:scale(1);opacity:1} }

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 500;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.header-logo {
  display: flex; align-items: center; gap: 8px;
}

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

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.header-icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: var(--transition);
  font-size: 1rem;
}

.header-icon-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.header-icon-btn .badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg-primary);
}

.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 600;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-overlay.active { opacity: 1; pointer-events: all; }

.side-drawer {
  position: fixed;
  top: 0; right: -320px;
  width: 300px; height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: 700;
  overflow-y: auto;
  transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
}

.side-drawer.open { right: 0; }

.drawer-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.drawer-user { display: flex; align-items: center; gap: 12px; flex: 1; }

.drawer-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
  overflow: hidden;
  flex-shrink: 0;
}

.drawer-avatar img { width: 100%; height: 100%; object-fit: cover; }

.drawer-username { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.drawer-balance { font-size: 0.8rem; color: var(--success); font-weight: 600; margin-top: 2px; }

.drawer-guest { display: flex; gap: 8px; flex: 1; }

.drawer-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: var(--transition);
}

.drawer-close:hover { color: var(--danger); border-color: var(--danger); }

.drawer-menu { padding: 8px 0; flex: 1; }

.drawer-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  border-radius: 0;
}

.drawer-menu li a:hover, .drawer-menu li a.active {
  color: var(--text-primary);
  background: var(--accent-light);
  padding-left: 20px;
}

.drawer-menu li a i { width: 16px; text-align: center; color: var(--accent); }

.drawer-divider { height: 1px; background: var(--border); margin: 6px 16px; }

.badge-inline {
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  margin-left: auto;
}

.admin-link { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }

.main-content {
  padding-top: var(--header-height);
  min-height: calc(100vh - var(--bottom-nav-height));
  padding-bottom: 20px;
}

.bottom-nav-spacer { height: var(--bottom-nav-height); }

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-height);
  background: rgba(17,17,24,0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 400;
}

.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  position: relative;
  transition: var(--transition);
  padding: 8px 4px;
}

.bnav-item i { font-size: 1.1rem; }
.bnav-item.active { color: var(--accent); }
.bnav-item:hover { color: var(--text-secondary); }

.bnav-badge {
  position: absolute;
  top: 6px; right: calc(50% - 18px);
  background: var(--danger);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg-primary);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  border: 1.5px solid transparent;
  white-space: nowrap; text-align: center;
}

.btn-primary {
  background: var(--accent); color: white; border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover); border-color: var(--accent-hover);
  box-shadow: var(--shadow-accent); transform: translateY(-1px);
  color: white;
}

.btn-outline {
  background: transparent; color: var(--text-primary); border-color: var(--border-light);
}
.btn-outline:hover {
  background: var(--bg-card); border-color: var(--accent); color: var(--accent);
}

.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; box-shadow: 0 4px 15px rgba(239,68,68,0.3); color: white; }

.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: #16a34a; color: white; }

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-xs { padding: 5px 10px; font-size: 0.75rem; border-radius: 6px; }
.btn-lg { padding: 13px 28px; font-size: 1rem; }
.btn-full { width: 100%; }

.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

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

.form-label {
  display: block;
  font-size: 0.85rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 7px;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text-muted); }
.form-control.is-invalid { border-color: var(--danger); }

.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 5px; }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

textarea.form-control { resize: vertical; min-height: 100px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.card-hover:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
  transform: translateY(-2px);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

.card-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); }

.page-section { padding: 24px 0; }

.section-title {
  font-size: 1.3rem; font-weight: 800;
  color: var(--text-primary); margin-bottom: 4px;
}

.section-subtitle {
  font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px;
}

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

@media (min-width: 480px) { .products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .products-grid { grid-template-columns: repeat(4, 1fr); } }

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  display: flex; flex-direction: column;
}

.product-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
  transform: translateY(-3px);
}

.product-card-img-wrap {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  display: block;
}

.product-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-card-img { transform: scale(1.05); }

.badge-featured {
  position: absolute; top: 8px; left: 8px;
  background: linear-gradient(135deg, var(--gold), #f97316);
  color: #fff;
  font-size: 0.65rem; font-weight: 700;
  padding: 3px 8px; border-radius: var(--radius-full);
  text-transform: uppercase; letter-spacing: 0.5px;
}

.product-card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; }

.product-card-cat {
  font-size: 0.7rem; font-weight: 600;
  color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 4px; display: block;
}

.product-card-title {
  font-size: 0.88rem; font-weight: 700;
  margin-bottom: 6px; line-height: 1.3;
  flex: 1;
}

.product-card-title a { color: var(--text-primary); }
.product-card-title a:hover { color: var(--accent); }

.product-card-caption { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 10px; line-height: 1.4; }

.product-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: auto;
}

.product-price {
  font-size: 1rem; font-weight: 800; color: var(--accent);
}

.product-card-actions { display: flex; align-items: center; gap: 6px; }

.product-rating { font-size: 0.75rem; color: var(--gold); }
.product-rating i { margin-right: 2px; }

.hero-slider {
  position: relative;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin: 16px;
  height: 200px;
}

@media (min-width: 640px) { .hero-slider { height: 260px; } }
@media (min-width: 1024px) { .hero-slider { height: 340px; } }

.hero-slide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 28px 32px;
  background: linear-gradient(135deg, rgba(108,99,255,0.25) 0%, rgba(10,10,15,0.8) 60%);
  opacity: 0; transition: opacity 0.6s ease;
}

.hero-slide.active { opacity: 1; }

.hero-slide-bg {
  position: absolute; inset: 0;
  object-fit: cover; width: 100%; height: 100%;
  opacity: 0.25;
}

.hero-content { position: relative; z-index: 1; max-width: 500px; }

.hero-title {
  font-size: 1.4rem; font-weight: 800; line-height: 1.2;
  margin-bottom: 8px; color: var(--text-primary);
}

@media (min-width: 640px) { .hero-title { font-size: 1.8rem; } }
@media (min-width: 1024px) { .hero-title { font-size: 2.4rem; } }

.hero-subtitle { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }

.hero-dots {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 2;
}

.hero-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.3); cursor: pointer; transition: var(--transition);
  border: none;
}

.hero-dot.active { background: var(--accent); width: 18px; border-radius: 3px; }

.categories-strip {
  display: flex; gap: 10px;
  overflow-x: auto; padding: 0 16px 8px;
  scrollbar-width: none;
}

.categories-strip::-webkit-scrollbar { display: none; }

.cat-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary); font-size: 0.82rem; font-weight: 500;
  white-space: nowrap; transition: var(--transition); flex-shrink: 0;
}

.cat-chip:hover, .cat-chip.active {
  background: var(--accent-light); border-color: var(--accent); color: var(--accent);
}

.cat-chip i { font-size: 0.8rem; }

.notice-bar {
  background: linear-gradient(135deg, var(--accent-light), rgba(108,99,255,0.05));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin: 12px 16px 0;
  overflow: hidden;
}

.notice-bar-inner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; font-size: 0.83rem; color: var(--text-secondary);
}

.notice-bar-inner i { color: var(--warning); flex-shrink: 0; }

.notice-bar-inner span { flex: 1; }

.notice-bar-close {
  color: var(--text-muted); padding: 0; background: none; border: none;
  flex-shrink: 0; cursor: pointer; transition: var(--transition);
}

.notice-bar-close:hover { color: var(--danger); }

.search-bar-wrap { position: relative; margin: 0 16px; }

.search-form { display: flex; gap: 10px; }

.search-input-wrap {
  flex: 1; position: relative;
  background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); display: flex; align-items: center;
  transition: var(--transition);
}

.search-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.search-icon { position: absolute; left: 12px; color: var(--text-muted); font-size: 0.9rem; }

.search-input {
  flex: 1; padding: 11px 40px 11px 38px;
  background: none; color: var(--text-primary); font-size: 0.9rem;
}

.search-input::placeholder { color: var(--text-muted); }

.search-clear {
  position: absolute; right: 10px;
  color: var(--text-muted); padding: 4px; border-radius: 4px;
  transition: var(--transition); font-size: 0.85rem;
}

.search-clear:hover { color: var(--danger); }

.live-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); z-index: 300;
  box-shadow: var(--shadow-lg); max-height: 360px; overflow-y: auto;
}

.live-search-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; transition: var(--transition); cursor: pointer;
}

.live-search-item:hover { background: var(--bg-card-hover); }

.live-search-item:not(:last-child) { border-bottom: 1px solid var(--border); }

.live-search-thumb {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  object-fit: cover; background: var(--bg-input); flex-shrink: 0;
}

.live-search-info { flex: 1; }
.live-search-title { font-size: 0.88rem; font-weight: 600; color: var(--text-primary); }
.live-search-price { font-size: 0.8rem; color: var(--accent); font-weight: 700; }
.live-search-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.88rem; }

.page-hero {
  padding: 28px 16px 0;
  text-align: center;
}

.page-hero-title {
  font-size: 1.6rem; font-weight: 800;
  color: var(--text-primary); margin-bottom: 6px;
}

.page-hero-subtitle { font-size: 0.9rem; color: var(--text-muted); }

.section-pad { padding: 20px 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
  display: flex; align-items: center; gap: 14px;
}

.stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}

.stat-icon.accent { background: var(--accent-light); color: var(--accent); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }

.stat-value { font-size: 1.2rem; font-weight: 800; color: var(--text-primary); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.88rem; display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px; border: 1px solid transparent;
}

.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-success { background: var(--success-light); border-color: var(--success); color: #4ade80; }
.alert-danger { background: var(--danger-light); border-color: var(--danger); color: #f87171; }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: #fbbf24; }
.alert-info { background: var(--info-light); border-color: var(--info); color: #60a5fa; }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 8px; border-radius: var(--radius-full);
  font-size: 0.7rem; font-weight: 700;
}

.badge-primary { background: var(--accent-light); color: var(--accent); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-muted { background: var(--bg-input); color: var(--text-muted); }

.tag {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 600;
  background: var(--bg-input); color: var(--text-secondary); border: 1px solid var(--border);
  transition: var(--transition);
}

.tag:hover { border-color: var(--accent); color: var(--accent); }

.toast-container {
  position: fixed; bottom: calc(var(--bottom-nav-height) + 12px); right: 12px;
  z-index: 1000; display: flex; flex-direction: column; gap: 8px;
}

.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  font-size: 0.88rem; color: var(--text-primary);
  max-width: 320px; min-width: 220px;
  animation: slideInRight 0.3s ease;
  border-left: 3px solid var(--accent);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }

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

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 800; display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); width: 100%; max-width: 460px;
  max-height: 90vh; overflow-y: auto;
  animation: scaleIn 0.2s ease;
}

@keyframes scaleIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-header {
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close { color: var(--text-muted); font-size: 1rem; transition: var(--transition); padding: 4px; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead th {
  padding: 10px 14px; text-align: left;
  background: var(--bg-input); color: var(--text-secondary);
  font-weight: 600; font-size: 0.8rem; border-bottom: 1px solid var(--border);
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-primary); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-card-hover); }

.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg-primary); padding: 20px;
}

.auth-box {
  width: 100%; max-width: 400px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 32px 28px;
}

.auth-logo {
  text-align: center; margin-bottom: 28px;
}

.auth-logo .logo-text { font-size: 1.5rem; }

.auth-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 4px; }
.auth-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 24px; }

.auth-footer { text-align: center; margin-top: 20px; font-size: 0.85rem; color: var(--text-muted); }

.empty-state {
  text-align: center; padding: 50px 20px;
  color: var(--text-muted);
}

.empty-icon { font-size: 3rem; margin-bottom: 14px; opacity: 0.4; }
.empty-title { font-size: 1.1rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-message { font-size: 0.88rem; margin-bottom: 20px; }

.divider {
  height: 1px; background: var(--border); margin: 20px 0;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex-1 { flex: 1; }

.rating-stars { display: flex; gap: 3px; }
.star-btn { color: var(--text-muted); font-size: 1.2rem; transition: var(--transition); cursor: pointer; }
.star-btn.active, .star-btn:hover { color: var(--gold); }

.order-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 700; text-transform: capitalize;
}

.status-pending { background: var(--warning-light); color: var(--warning); }
.status-processing { background: var(--info-light); color: var(--info); }
.status-completed { background: var(--success-light); color: var(--success); }
.status-cancelled { background: var(--danger-light); color: var(--danger); }
.status-approved { background: var(--success-light); color: var(--success); }
.status-rejected { background: var(--danger-light); color: var(--danger); }

.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 20px 16px;
}

.page-btn {
  min-width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); transition: var(--transition); cursor: pointer;
}

.page-btn:hover, .page-btn.active {
  background: var(--accent); border-color: var(--accent); color: white;
}

.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.product-detail-imgs {
  display: flex; flex-direction: column; gap: 10px; padding: 16px;
}

.product-main-img {
  aspect-ratio: 4/3; background: var(--bg-card);
  border-radius: var(--radius-md); overflow: hidden;
}

.product-main-img img { width: 100%; height: 100%; object-fit: cover; }

.product-thumbs {
  display: flex; gap: 8px; overflow-x: auto;
}

.product-thumb {
  width: 64px; height: 64px; flex-shrink: 0;
  border-radius: var(--radius-sm); overflow: hidden;
  cursor: pointer; border: 2px solid transparent; transition: var(--transition);
  background: var(--bg-card);
}

.product-thumb.active { border-color: var(--accent); }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-info { padding: 0 16px; }

.product-info-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; line-height: 1.3; }

.product-info-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.82rem; color: var(--text-muted); margin-bottom: 14px;
  flex-wrap: wrap;
}

.product-info-price {
  font-size: 1.8rem; font-weight: 900; color: var(--accent);
  margin-bottom: 16px;
}

.product-description { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 20px; }

.product-description h1, .product-description h2, .product-description h3 {
  color: var(--text-primary); margin: 16px 0 8px;
}

.product-description p { margin-bottom: 10px; }

.product-description ul, .product-description ol { padding-left: 20px; margin-bottom: 10px; }

.product-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }

.dynamic-inputs-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; margin: 0 16px 20px;
}

.dynamic-inputs-title {
  font-size: 0.95rem; font-weight: 700;
  color: var(--text-primary); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

.dynamic-inputs-title i { color: var(--accent); }

.cart-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}

.cart-item:last-child { border-bottom: none; }

.cart-item-img {
  width: 64px; height: 64px; border-radius: var(--radius-sm);
  object-fit: cover; flex-shrink: 0; background: var(--bg-input);
}

.cart-item-info { flex: 1; }
.cart-item-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.cart-item-price { font-size: 0.85rem; color: var(--accent); font-weight: 700; }

.cart-item-qty {
  display: flex; align-items: center; gap: 8px;
}

.qty-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 0.85rem; transition: var(--transition);
}

.qty-btn:hover { background: var(--accent); border-color: var(--accent); color: white; }

.qty-value { font-weight: 700; font-size: 0.9rem; min-width: 24px; text-align: center; }

.cart-summary-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; font-size: 0.9rem;
}

.cart-summary-row.total {
  border-top: 1px solid var(--border); margin-top: 6px; padding-top: 14px;
  font-size: 1.05rem; font-weight: 800; color: var(--text-primary);
}

.cart-summary-row .val { font-weight: 700; color: var(--accent); }

.wallet-card {
  background: linear-gradient(135deg, #1a1a35 0%, #0f0f25 100%);
  border: 1px solid rgba(108,99,255,0.3);
  border-radius: var(--radius-xl); padding: 24px;
  text-align: center; position: relative; overflow: hidden;
}

.wallet-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(108,99,255,0.15), transparent 70%);
}

.wallet-label { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 8px; }
.wallet-amount { font-size: 2.4rem; font-weight: 900; color: white; position: relative; }
.wallet-amount span { font-size: 1.4rem; font-weight: 600; color: var(--accent); }

.order-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 14px; transition: var(--transition);
}

.order-card:hover { border-color: var(--accent); }

.order-icon {
  width: 44px; height: 44px;
  background: var(--accent-light); color: var(--accent);
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}

.order-number { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }
.order-date { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.order-amount { font-size: 1rem; font-weight: 800; color: var(--accent); }

.ticket-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px;
  transition: var(--transition);
}

.ticket-card:hover { border-color: var(--accent); }

.ticket-message {
  background: var(--bg-input); border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 10px;
}

.ticket-message.admin-msg { background: var(--accent-light); border: 1px solid rgba(108,99,255,0.2); }

.ticket-msg-meta {
  font-size: 0.75rem; color: var(--text-muted); margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}

.ticket-msg-text { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--accent);
}

.section-loader {
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}

.filter-bar {
  display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 4px; scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-full);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 0.8rem; font-weight: 600;
  white-space: nowrap; cursor: pointer; transition: var(--transition); flex-shrink: 0;
}

.filter-chip:hover, .filter-chip.active {
  background: var(--accent-light); border-color: var(--accent); color: var(--accent);
}

.sticky-buy-bar {
  position: fixed; bottom: var(--bottom-nav-height); left: 0; right: 0;
  background: rgba(17,17,24,0.97); backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 12px 16px; z-index: 300;
  display: flex; gap: 12px; align-items: center;
}

.product-slider-wrap { padding: 0 16px; overflow: hidden; }

.product-slider-track {
  display: flex; gap: 12px; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-bottom: 8px;
}

.product-slider-track::-webkit-scrollbar { display: none; }

.product-slider-track .product-card {
  flex-shrink: 0; width: 160px; scroll-snap-align: start;
}

@media (min-width: 480px) { .product-slider-track .product-card { width: 180px; } }

.admin-sidebar {
  width: 240px; background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  height: 100vh; position: fixed; top: 0; left: 0;
  overflow-y: auto; z-index: 300;
  transition: transform 0.3s ease;
}

.admin-main {
  margin-left: 240px; min-height: 100vh;
  background: var(--bg-primary);
}

@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
}

.admin-header {
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 200;
}

.admin-content { padding: 20px; }

.admin-nav-item a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--text-secondary);
  font-size: 0.88rem; font-weight: 500; transition: var(--transition);
}

.admin-nav-item a:hover, .admin-nav-item a.active {
  color: var(--text-primary); background: var(--accent-light); border-right: 3px solid var(--accent);
}

.admin-nav-item a i { width: 16px; color: var(--accent); }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th {
  padding: 10px 14px; text-align: left;
  background: var(--bg-secondary); color: var(--text-secondary);
  font-weight: 600; font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: var(--bg-card-hover); }

.input-group-row { display: flex; gap: 10px; align-items: flex-end; }
.input-group-row .form-group { flex: 1; }
.input-row-remove { margin-bottom: 18px; }

@media (max-width: 640px) {
  .hero-slider { margin: 10px; }
  .product-info-title { font-size: 1.1rem; }
  .wallet-amount { font-size: 2rem; }
  .auth-box { padding: 24px 20px; }
  .admin-content { padding: 12px; }
}