@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-base: #080808;
  --bg-card: #111111;
  --bg-card-hover: #161616;
  --bg-sidebar: #0d0d0d;
  --border: #1e1e1e;
  --border-hover: #2e2e2e;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-glow: rgba(124, 58, 237, 0.15);
  --accent-2: #3b82f6;
  --text-primary: #f5f5f5;
  --text-secondary: #888;
  --text-muted: #555;
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.08);
  --red: #ef4444;
  --yellow: #f59e0b;
  --sidebar-width: 220px;
  --radius: 10px;
  --radius-sm: 6px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  padding: 20px 12px;
  gap: 4px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar-brand img {
  width: 32px; height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.sidebar-brand span {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 10px 4px;
  margin-top: 8px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.sidebar a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.sidebar a.active {
  background: var(--accent-glow);
  color: #a78bfa;
}

.sidebar a svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
}

.sidebar-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Main Content ─── */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ─── Top Bar ─── */
.topbar {
  position: sticky;
  top: 0;
  background: rgba(8,8,8,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  padding: 0 28px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.topbar-left span { color: var(--text-primary); font-weight: 500; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text-primary); }

/* ─── Profile Banner ─── */
.profile-banner {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.profile-banner img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.profile-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--bg-base) 100%);
}

/* ─── Profile Info ─── */
.profile-info {
  padding: 0 32px;
  margin-top: -40px;
  position: relative;
  z-index: 2;
}

.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 14px;
  border: 3px solid var(--bg-base);
  object-fit: cover;
  display: block;
  margin-bottom: 14px;
}

.profile-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.profile-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.profile-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.profile-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.profile-meta-item svg { width: 14px; height: 14px; }

/* ─── Tab Navigation ─── */
.tab-nav {
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  margin-top: 16px;
  display: flex;
  gap: 0;
}

.tab-btn {
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 7px;
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.tab-count {
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 99px;
  font-weight: 600;
}

/* ─── Page Content ─── */
.page-content { padding: 28px 32px; }

/* ─── Section Title ─── */
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

/* ─── Product Grid ─── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.product-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.product-card-img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  background: linear-gradient(135deg, #1a0533 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  position: relative;
  overflow: hidden;
}

.product-card-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-glow), rgba(59,130,246,0.1));
}

.product-card-emoji {
  font-size: 40px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 16px rgba(124,58,237,0.4));
}

.product-card-body { padding: 14px 16px 16px; }

.product-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-price {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.product-card-price strong {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
}

.btn-buy {
  width: 100%;
  padding: 9px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}

.btn-buy:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ─── Stats Grid ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.stat-accent { color: var(--accent); }
.stat-green { color: var(--green); }
.stat-blue { color: var(--accent-2); }

/* ─── Table ─── */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}

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

.table-title {
  font-size: 14px;
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 13px 20px;
  font-size: 13.5px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-secondary);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

td.td-primary { color: var(--text-primary); font-weight: 500; }

/* ─── Badge ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: rgba(239,68,68,0.08); color: var(--red); }
.badge-yellow { background: rgba(245,158,11,0.08); color: var(--yellow); }

/* ─── Loading ─── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-muted);
  font-size: 14px;
  gap: 10px;
}

.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state h3 { font-size: 16px; margin-bottom: 6px; color: var(--text-secondary); }
.empty-state p { font-size: 13px; }

/* ─── Mobile hamburger ─── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-primary);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .hamburger { display: flex; }
  .product-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 20px 16px; }
  .profile-info { padding: 0 16px; }
  .tab-nav { padding: 0 16px; }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
}
