/* ============================================================
   SHOP ADMIN CSS - PREMIUM DARK THEME
   Admin panel cho chủ quán quản lý gian hàng
   ============================================================ */

/* ============ RESET & BASE ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* Colors */
  --primary: #8b5cf6;
  --primary-dark: #7c3aed;
  --primary-light: #a78bfa;
  --primary-glow: rgba(139, 92, 246, 0.4);
  
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.4);
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  
  --info: #3b82f6;
  
  /* Dark Theme */
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --bg-card: #1a1a24;
  --bg-hover: #232330;
  --bg-sidebar: #0f0f18;
  
  /* Text */
  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  /* Border */
  --border: #2d2d3d;
  --border-light: #3d3d4d;
  
  /* Effects */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px var(--primary-glow);
  
  /* Radius */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  
  --sidebar-width: 260px;
  --top-bar-height: 64px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  position: relative;
}

/* Ambient background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.hidden { display: none !important; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
}

a { color: inherit; text-decoration: none; }

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

/* ============ LOADING ============ */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  z-index: 9999;
}

.spinner {
  width: 60px;
  height: 60px;
  position: relative;
}

.spinner::before,
.spinner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
}

.spinner::before {
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  animation: spin 1s linear infinite;
}

.spinner::after {
  border-bottom-color: var(--accent);
  border-left-color: var(--accent);
  animation: spin 1.5s linear reverse infinite;
  inset: 8px;
}

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

.loading-screen p {
  color: var(--text-secondary);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  animation: pulse 2s ease-in-out infinite;
}

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

/* ============ NO SHOP SCREEN ============ */
.no-shop-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.no-shop-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.no-shop-card i {
  font-size: 80px;
  color: var(--primary);
  margin-bottom: 24px;
  opacity: 0.7;
}

.no-shop-card h2 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.no-shop-card p {
  color: var(--text-secondary);
  margin-bottom: 30px;
  font-size: 15px;
}

/* ============ LAYOUT ============ */
.shop-admin-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.logo i {
  font-size: 24px;
  color: var(--primary);
  filter: drop-shadow(0 0 12px var(--primary-glow));
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition);
  position: relative;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.1));
  color: var(--primary-light);
  border-left: 3px solid var(--primary);
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 15px;
}

.nav-item span:not(.badge) {
  flex: 1;
}

.badge {
  background: var(--bg-hover);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

.badge-new {
  background: var(--danger);
  color: white;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.view-shop-btn,
.back-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.view-shop-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
}

.view-shop-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.back-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ============ MAIN CONTENT ============ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding-bottom: 40px;
}

/* ============ TOP BAR ============ */
.top-bar {
  height: var(--top-bar-height);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.menu-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.top-bar h1 {
  flex: 1;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: rotate(180deg);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 0 20px var(--primary-glow);
}

/* ============ PAGES ============ */
.page {
  display: none;
  padding: 24px;
  animation: pageFadeIn 0.3s ease-out;
}

.page.active {
  display: block;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============ STATS GRID ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-primary::before { background: linear-gradient(90deg, var(--primary), var(--primary-dark)); }
.stat-success::before { background: linear-gradient(90deg, var(--success), #059669); }
.stat-info::before { background: linear-gradient(90deg, var(--info), #2563eb); }
.stat-warning::before { background: linear-gradient(90deg, var(--warning), #d97706); }

.stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

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

.stat-primary .stat-icon {
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary);
}

.stat-success .stat-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.stat-info .stat-icon {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info);
}

.stat-warning .stat-icon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.stat-info {
  flex: 1;
  min-width: 0;
}

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

.stat-value {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot-new {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* ============ STATUS BANNER ============ */
.status-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 182, 212, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  transition: var(--transition);
}

.status-banner.off {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
  border-color: rgba(239, 68, 68, 0.3);
}

.status-icon {
  font-size: 20px;
  color: var(--success);
  animation: pulseDot 2s ease-in-out infinite;
}

.status-banner.off .status-icon {
  color: var(--danger);
}

.status-info {
  flex: 1;
}

.status-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.status-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

.status-toggle-btn {
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  transition: var(--transition);
  white-space: nowrap;
}

.status-toggle-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* ============ SECTION CARD ============ */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

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

.section-header h2 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header h2 i {
  color: var(--primary);
}

.link-btn {
  color: var(--primary-light);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.link-btn:hover {
  color: var(--primary);
  gap: 10px;
}

/* ============ RECENT ORDERS ============ */
.recent-orders-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-order-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
}

.recent-order-item:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}

.recent-order-item .order-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot-new { background: var(--danger); }
.status-dot-confirmed { background: var(--warning); }
.status-dot-shipping { background: var(--info); }
.status-dot-delivered { background: var(--success); }
.status-dot-cancelled { background: var(--text-muted); }

.recent-order-item .order-info {
  flex: 1;
  min-width: 0;
}

.recent-order-item .order-code {
  font-weight: 700;
  font-size: 13px;
  color: var(--primary-light);
  margin-bottom: 2px;
}

.recent-order-item .order-customer {
  font-size: 12px;
  color: var(--text-muted);
}

.recent-order-item .order-total {
  font-weight: 800;
  color: var(--buy, #ff6b35);
  font-size: 14px;
  white-space: nowrap;
}

/* ============ TOP PRODUCTS ============ */
.top-products-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.top-product-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.top-product-item:hover {
  border-color: var(--primary);
}

.top-product-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.top-product-item .product-info {
  flex: 1;
  min-width: 0;
}

.top-product-item .product-name {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-product-item .product-sales {
  font-size: 12px;
  color: var(--text-muted);
}

.top-product-item .product-revenue {
  font-weight: 800;
  color: var(--success);
  font-size: 14px;
  white-space: nowrap;
}

/* ============ PAGE ACTIONS ============ */
.page-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.search-filter {
  flex: 1;
  display: flex;
  gap: 12px;
  min-width: 280px;
}

.search-filter input,
.search-filter select {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  transition: var(--transition);
}

.search-filter input {
  flex: 1;
}

.search-filter input:focus,
.search-filter select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ============ PRODUCTS ADMIN GRID ============ */
.products-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

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

.product-admin-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.product-admin-image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-elevated);
}

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

.product-admin-image .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 42px;
  opacity: 0.3;
}

.product-admin-status {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(10px);
}

.status-active {
  background: rgba(16, 185, 129, 0.9);
  color: white;
}

.status-inactive {
  background: rgba(100, 116, 139, 0.9);
  color: white;
}

.product-admin-featured {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}

.product-admin-info {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-admin-name {
  font-size: 14px;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}

.product-admin-category {
  font-size: 11px;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.product-admin-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
}

.product-admin-price .price {
  font-size: 16px;
  font-weight: 800;
  color: var(--warning);
}

.product-admin-price .price-old {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-admin-actions {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.product-admin-actions button {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-edit {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-edit:hover {
  background: var(--info);
  color: white;
  border-color: var(--info);
}

.btn-delete {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-delete:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 80px;
  opacity: 0.2;
  color: var(--primary);
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 24px;
  font-size: 14px;
}

/* ============ ORDERS TABS ============ */
.orders-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.orders-tabs::-webkit-scrollbar { display: none; }

.order-tab {
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-tab span {
  background: var(--bg-hover);
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  min-width: 22px;
  text-align: center;
}

.order-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.order-tab.active span {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.order-tab:hover:not(.active) {
  border-color: var(--primary);
  color: var(--primary-light);
}

/* ============ ORDERS LIST ============ */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.order-item:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}

.order-code-block {
  flex: 1;
  min-width: 0;
}

.order-code-block .code {
  font-family: 'Space Mono', monospace;
  font-weight: 800;
  font-size: 14px;
  color: var(--primary-light);
  margin-bottom: 4px;
}

.order-code-block .time {
  font-size: 11px;
  color: var(--text-muted);
}

.order-status-badge {
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.status-new {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-confirmed {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-preparing {
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.status-shipping {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-delivered {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-cancelled {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.order-customer-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 12px;
  font-size: 13px;
}

.order-customer-info span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.order-customer-info i {
  color: var(--primary);
  width: 14px;
  font-size: 12px;
}

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

.order-items-count {
  font-size: 12px;
  color: var(--text-muted);
}

.order-total {
  font-weight: 800;
  font-size: 16px;
  color: var(--warning);
}

/* ============ CUSTOMERS LIST ============ */
.customers-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

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

.customer-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.customer-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.customer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}

.customer-info h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.customer-info p {
  font-size: 12px;
  color: var(--text-muted);
}

.customer-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.customer-stat {
  text-align: center;
}

.customer-stat .value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-light);
  margin-bottom: 4px;
}

.customer-stat .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* ============ FORM CARD ============ */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.form-section {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.form-section h3 i {
  color: var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-group-full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  transition: var(--transition);
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group input[type="color"] {
  padding: 4px;
  height: 46px;
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.checkbox-label:hover {
  border-color: var(--primary);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-label span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
}

.form-actions {
  padding: 20px 24px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* ============ UPLOAD BOX ============ */
.upload-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
}

@media (max-width: 640px) {
  .upload-row { grid-template-columns: 1fr; }
}

.upload-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-item > label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.upload-box {
  width: 100%;
  aspect-ratio: 1;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-box-banner {
  aspect-ratio: 3 / 1;
  max-height: 200px;
}

.upload-box:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.upload-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-align: center;
  padding: 16px;
}

.upload-placeholder i {
  font-size: 32px;
  color: var(--primary);
  opacity: 0.6;
}

.upload-placeholder span {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============ QR CODE PAGE ============ */
.qrcode-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.qrcode-header {
  text-align: center;
  margin-bottom: 30px;
}

.qrcode-header h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.qrcode-header h2 i {
  color: var(--primary);
}

.qrcode-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.qrcode-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 30px;
  align-items: start;
}

@media (max-width: 768px) {
  .qrcode-container { grid-template-columns: 1fr; }
}

.qrcode-image-wrapper {
  background: white;
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qrcode-image-wrapper img {
  width: 100%;
  max-width: 280px;
  height: auto;
}

.qrcode-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.link-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-box label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.link-input-group {
  display: flex;
  gap: 8px;
}

.link-input-group input {
  flex: 1;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 13px;
}

.copy-icon-btn {
  width: 46px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.copy-icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.link-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 4px;
}

.link-stats i {
  color: var(--primary);
}

.qrcode-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.qrcode-actions button {
  flex: 1;
  min-width: 160px;
}

/* ============ BUTTONS ============ */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 15px var(--primary-glow);
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

/* ============ MODAL ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
}

.modal-sm { max-width: 420px; }
.modal-md { max-width: 600px; }
.modal-lg { max-width: 800px; }

@keyframes modalSlide {
  from { transform: translateY(30px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.modal-header h3 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h3 i {
  color: var(--primary);
}

.close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-hover);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition);
}

.close-btn:hover {
  background: var(--danger);
  color: white;
  transform: rotate(90deg);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  -webkit-overflow-scrolling: touch;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.modal-footer button {
  min-width: 120px;
}

/* ============ PRODUCT IMAGE UPLOAD IN MODAL ============ */
.product-image-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.product-image-upload .upload-box {
  width: 180px;
  height: 180px;
  aspect-ratio: 1;
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 26, 36, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text);
  padding: 14px 24px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  z-index: 2000;
  animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg), 0 0 30px var(--primary-glow);
  max-width: 90vw;
  text-align: center;
  border: 1px solid var(--border);
}

.toast.success {
  background: rgba(16, 185, 129, 0.95);
  border-color: var(--success);
  box-shadow: 0 0 30px var(--success-glow);
}

.toast.error {
  background: rgba(239, 68, 68, 0.95);
  border-color: var(--danger);
  box-shadow: 0 0 30px var(--danger-glow);
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 30px) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

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

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 640px) {
  .page {
    padding: 16px;
  }

  .top-bar {
    padding: 0 16px;
  }

  .top-bar h1 {
    font-size: 17px;
  }

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

  .stat-value {
    font-size: 20px;
  }

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

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

  .product-admin-info {
    padding: 10px;
  }

  .product-admin-name {
    font-size: 13px;
    min-height: 34px;
  }

  .customers-list {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal-content {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 92vh;
  }

  .modal-footer {
    flex-direction: column-reverse;
  }

  .modal-footer button {
    width: 100%;
  }

  .qrcode-card {
    padding: 20px 16px;
  }

  .qrcode-actions button {
    flex: 1 1 100%;
  }
}

/* ============ ANIMATIONS ============ */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   COMBOS - Combo sản phẩm
   ============================================================ */

/* Product Picker (chọn sản phẩm cho combo) */
.combo-product-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.combo-product-picker::-webkit-scrollbar {
  width: 6px;
}

.combo-product-picker::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.combo-product-item {
  position: relative;
  padding: 10px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.combo-product-item:hover {
  border-color: var(--primary-light);
}

.combo-product-item.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.1));
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.combo-product-item.selected::after {
  content: '✓';
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.combo-product-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--bg-elevated);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 24px;
}

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

.combo-product-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 32px;
}

.combo-product-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--warning);
}

/* Combo Summary */
.combo-summary {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.combo-summary strong {
  color: var(--primary-light);
  font-weight: 700;
}

/* Combo Card (hiển thị trong danh sách) */
.combo-admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}

.combo-admin-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.combo-admin-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.combo-admin-image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-elevated);
}

.combo-admin-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.combo-admin-image .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 48px;
  opacity: 0.4;
}

.combo-admin-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  z-index: 2;
}

.combo-admin-featured {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  z-index: 2;
}

.combo-admin-discount {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.95);
  color: white;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  z-index: 2;
}

.combo-admin-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.combo-admin-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}

.combo-admin-products {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.combo-admin-products .mini-tag {
  padding: 2px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 10px;
}

.combo-admin-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.combo-admin-price .price-current {
  font-size: 17px;
  font-weight: 800;
  color: var(--buy, #ff6b35);
}

.combo-admin-price .price-old {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.combo-admin-actions {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.combo-admin-actions button {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
/* ============================================================
   GALLERY - Upload nhiều ảnh
   ============================================================ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.gallery-grid:empty {
  display: none;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  transition: var(--transition);
}

.gallery-item.is-primary {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.gallery-item:hover {
  transform: scale(1.02);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-primary-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.95);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  z-index: 2;
}

/* Thay chữ bằng icon sao */
.gallery-primary-badge::before {
  content: '★';
  font-size: 11px;
}

.gallery-saved {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(16, 185, 129, 0.95);
  color: white;
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  z-index: 2;
  line-height: 1;
}

.gallery-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: var(--transition);
  z-index: 3;
}

.gallery-item:hover .gallery-actions {
  opacity: 1;
}

.gallery-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.gallery-btn:hover {
  background: var(--primary);
  transform: scale(1.1);
}

.gallery-btn-danger:hover {
  background: var(--danger);
}

/* Nút upload nhiều ảnh */
.btn-upload-multiple {
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 2px dashed var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.btn-upload-multiple:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg-hover);
}

.btn-upload-multiple:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-upload-multiple i {
  font-size: 22px;
}

.btn-upload-multiple .upload-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.btn-upload-multiple:hover .upload-hint {
  color: var(--primary-light);
}

/* Responsive */
@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
  }
  
  .gallery-primary-badge {
    font-size: 8px;
    padding: 2px 6px;
  }
  
  .gallery-btn {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }
}
/* ═══════════════════════════════════════════════════════════════ */
/* v2.0 — CSS CHO TAB GIAO DIỆN + NỘI DUNG WEB                     */
/* ═══════════════════════════════════════════════════════════════ */

/* Nav divider */
.nav-divider {
  padding: 16px 14px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.nav-item-highlight {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(139, 92, 246, 0.15);
}

.nav-item-highlight.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.15));
  border-color: var(--primary);
}

/* Info banner */
.info-banner {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius);
  margin-bottom: 20px;
  align-items: flex-start;
}
.info-banner > i {
  font-size: 20px;
  color: var(--primary);
  margin-top: 2px;
}
.info-banner strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}
.info-banner p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* Form section desc */
.form-section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  margin-top: -12px;
}

/* ═══ SECTION TOGGLE LIST ═══ */
.section-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-toggle-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  /* ✅ Chỉ transition màu — không transition transform/layout */
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  cursor: grab;
  user-select: none;
}


.section-toggle-item:active {
  cursor: grabbing;
}





.section-toggle-item.dragging {
  opacity: 0.3;
  transform: scale(0.98);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.4);
}


.section-toggle-item.is-enabled {
  border-color: rgba(139, 92, 246, 0.4);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(6, 182, 212, 0.02));
}
.section-toggle-item:hover {
  border-color: var(--primary-light);
}



.section-toggle-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.section-toggle-info {
  flex: 1;
  min-width: 0;
}
.section-toggle-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
}
.section-toggle-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 26px;
  cursor: pointer;
  transition: var(--transition);
}
.switch .slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}
.switch input:checked + .slider {
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* ═══ MARQUEE ITEMS EDITOR ═══ */
.marquee-items-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.marquee-item-editor {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.marquee-item-editor:hover {
  border-color: var(--primary-light);
}
.marquee-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.1));
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.marquee-item-text {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hot-badge {
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.marquee-item-actions {
  display: flex;
  gap: 4px;
}
.mini-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.mini-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.mini-btn-danger:hover {
  background: var(--danger);
  border-color: var(--danger);
}

.empty-inline {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

/* ═══ COLOR PICKER ═══ */
.color-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}
.color-input-wrapper input[type="color"] {
  width: 60px;
  height: 46px;
  padding: 4px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.color-input-wrapper input[type="text"] {
  flex: 1;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  text-transform: uppercase;
}

/* ═══ STICKY ACTIONS ═══ */
.sticky-actions {
  position: sticky;
  bottom: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  padding: 16px 24px;
  margin: 0 -24px -24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  z-index: 10;
  border-radius: 0 0 var(--radius) var(--radius);
}
.sticky-actions button {
  min-width: 160px;
}

/* ═══ HERO SLIDES EDITOR ═══ */
.hero-slides-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-slide-editor {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.hero-slide-editor:hover {
  border-color: var(--primary-light);
}
.hero-slide-preview {
  width: 80px;
  height: 60px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 4px;
}
.slide-number {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.hero-slide-info {
  flex: 1;
  min-width: 0;
}
.hero-slide-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-slide-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-slide-actions {
  display: flex;
  gap: 4px;
}

/* ═══ ICON PICKER ═══ */
.icon-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 6px;
}
.icon-option {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-option:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.icon-option.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.1));
  color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Form hint */
.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 640px) {
  .section-toggle-item {
    padding: 12px;
    gap: 8px;
  }
  .section-toggle-icon {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  .section-toggle-desc {
    display: none;
  }
  .switch {
    width: 40px;
    height: 22px;
  }
  .switch .slider::before {
    height: 16px;
    width: 16px;
  }
  .switch input:checked + .slider::before {
    transform: translateX(18px);
  }
  .hero-slide-preview {
    width: 60px;
    height: 50px;
  }
  .sticky-actions {
    flex-direction: column;
  }
  .sticky-actions button {
    width: 100%;
  }
}


/* ═══════════════════════════════════════════════════════════════ */
/* DRAG & DROP SECTION TOGGLE v3 — Windows Explorer Style         */
/* ═══════════════════════════════════════════════════════════════ */

/* Item đang kéo — mờ đi như Windows */
.section-toggle-item.dragging {
  opacity: 0.4;
  /* KHÔNG dùng transform/scale để tránh giật */
}

/* Item đang bị kéo qua — highlight nhẹ */
.section-toggle-item.drag-over {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(6, 182, 212, 0.04));
}

/* ═══ ĐƯỜNG LINE NGANG — giống Windows Explorer ═══ */
.section-drop-indicator {
  position: relative;
  height: 0;
  pointer-events: none;
  z-index: 100;
}

.section-drop-indicator::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -2px;
  height: 4px;
  background: linear-gradient(90deg, #8b5cf6, #06b6d4);
  border-radius: 2px;
  box-shadow: 
    0 0 8px rgba(139, 92, 246, 0.8),
    0 0 16px rgba(6, 182, 212, 0.5);
  animation: dropLinePulse 1s ease-in-out infinite;
}

/* Chấm tròn 2 đầu line */
.section-drop-indicator::after {
  content: '';
  position: absolute;
  left: -4px;
  top: -4px;
  width: 8px;
  height: 8px;
  background: #8b5cf6;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.8);
  animation: dropDotPulse 1s ease-in-out infinite;
}

@keyframes dropLinePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes dropDotPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* ═══ DRAG HANDLE ═══ */
.section-drag-handle {
  width: 28px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 16px;
  cursor: grab;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.section-drag-handle:hover {
  color: var(--primary);
  background: rgba(139, 92, 246, 0.1);
}

.section-toggle-item:active .section-drag-handle {
  cursor: grabbing;
}

/* ═══ SỐ THỨ TỰ ═══ */
.section-order-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--primary-glow);
  font-family: 'Space Grotesk', sans-serif;
}

/* Mobile: tắt drag */
@media (max-width: 640px) {
  .section-toggle-item {
    cursor: default;
  }
  .section-drag-handle {
    cursor: default;
    opacity: 0.3;
  }
}
/* ═══════════════════════════════════════════════════════════════ */
/* PRICING / PROCESS / FAQ EDITORS                                */
/* ═══════════════════════════════════════════════════════════════ */

.pricing-materials-editor,
.pricing-services-editor,
.process-steps-editor,
.faq-items-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pricing-item-editor {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pricing-item-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pricing-item-info strong {
  font-size: 13px;
  color: var(--text);
}

.pricing-item-info span {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.pricing-item-actions {
  display: flex;
  gap: 4px;
}

.process-step-editor {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.process-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.process-step-info {
  flex: 1;
  min-width: 0;
}

.process-step-info strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
  color: var(--text);
}

.process-step-info span {
  font-size: 12px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.process-step-actions {
  display: flex;
  gap: 4px;
}

.faq-item-editor {
  padding: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
}

.faq-item-q {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.faq-item-q i {
  color: var(--primary);
  font-size: 14px;
  margin-top: 2px;
}

.faq-item-q strong {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
}

.faq-item-a {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  padding-left: 22px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.faq-item-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
}
/* ═══════════════════════════════════════════════════════════════ */
/* MỞ RỘNG Ô MÔ TẢ SẢN PHẨM TRONG ADMIN                           */
/* ═══════════════════════════════════════════════════════════════ */

/* Tăng chiều cao tối thiểu cho tất cả các ô textarea */
textarea {
  min-height: 120px !important; 
  resize: vertical !important; /* Cho phép kéo giãn */
}

/* Riêng ô Mô tả sản phẩm (dựa vào id) */
#productDescription {
  min-height: 150px !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  padding: 12px !important;
}
