/* Admin Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: #2d3436;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
  font-size: 20px;
  color: var(--primary);
}

.sidebar-header small {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  transition: all 0.2s;
  text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.sidebar-nav a.active {
  border-right: 3px solid var(--primary);
}

.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 14px;
  padding: 8px 0;
  width: 100%;
  text-align: left;
}

.sidebar-footer button:hover {
  color: #fff;
}

/* Main content */
.admin-main {
  flex: 1;
  margin-left: 250px;
  padding: 24px 32px;
  min-height: 100vh;
}

.admin-header {
  margin-bottom: 24px;
}

.admin-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 200;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  width: 40px; height: 40px;
  font-size: 20px;
  cursor: pointer;
}

/* Stat cards */
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

/* Product cards */
.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.product-card-media {
  height: 160px;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-card-media img,
.product-card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-media .no-media {
  color: var(--text-light);
  font-size: 14px;
}

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

.product-card-body h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.product-card-body .category {
  font-size: 12px;
  color: var(--text-light);
  text-transform: uppercase;
}

.product-card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* QR code display */
.qr-container {
  text-align: center;
  padding: 20px;
}

.qr-container img {
  max-width: 256px;
  border: 4px solid #fff;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

/* Detail page */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.detail-field {
  margin-bottom: 16px;
}

.detail-field label {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

.detail-field p {
  font-size: 15px;
  margin-top: 4px;
}

/* Chart container */
.chart-container {
  position: relative;
  height: 300px;
}

/* File upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(255, 102, 0, 0.05);
}

.upload-zone input[type="file"] {
  display: none;
}

.upload-zone p {
  color: var(--text-light);
  font-size: 14px;
}

.upload-zone .upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.upload-progress {
  margin-top: 12px;
  display: none;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s;
  width: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .admin-main {
    margin-left: 0;
    padding: 16px;
    padding-top: 64px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}
