/* ═══════════════════════════════════════════════════════
   Memargram Admin Panel — Professional Design System v2
   ═══════════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
  /* Core Palette */
  --mg-bg: #06080d;
  --mg-bg-elevated: #0c0f16;
  --mg-surface: #111520;
  --mg-surface-hover: #161b28;
  --mg-surface-active: #1a2030;
  --mg-surface-card: #12161f;
  --mg-overlay: rgba(0,0,0,0.6);

  /* Borders */
  --mg-border: rgba(255,255,255,0.06);
  --mg-border-subtle: rgba(255,255,255,0.04);
  --mg-border-strong: rgba(255,255,255,0.1);
  --mg-border-interactive: rgba(99,102,241,0.3);

  /* Text */
  --mg-text-primary: #f1f5f9;
  --mg-text-secondary: #94a3b8;
  --mg-text-tertiary: #64748b;
  --mg-text-muted: #475569;
  --mg-text-inverse: #0f172a;

  /* Brand Accent */
  --mg-accent: #818cf8;
  --mg-accent-bold: #6366f1;
  --mg-accent-dim: rgba(99,102,241,0.12);
  --mg-accent-glow: rgba(99,102,241,0.2);
  --mg-gradient-accent: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);

  /* Status Colors */
  --mg-success: #34d399;
  --mg-success-dim: rgba(52,211,153,0.1);
  --mg-warning: #fbbf24;
  --mg-warning-dim: rgba(251,191,36,0.1);
  --mg-danger: #f87171;
  --mg-danger-dim: rgba(248,113,113,0.1);
  --mg-info: #60a5fa;
  --mg-info-dim: rgba(96,165,250,0.1);

  /* Spacing */
  --mg-space-xs: 4px;
  --mg-space-sm: 8px;
  --mg-space-md: 16px;
  --mg-space-lg: 24px;
  --mg-space-xl: 32px;
  --mg-space-2xl: 48px;

  /* Radii */
  --mg-radius-sm: 8px;
  --mg-radius-md: 12px;
  --mg-radius-lg: 16px;
  --mg-radius-xl: 20px;
  --mg-radius-full: 9999px;

  /* Shadows */
  --mg-shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --mg-shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --mg-shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
  --mg-shadow-glow: 0 0 20px rgba(99,102,241,0.15);
  --mg-shadow-card: 0 1px 3px rgba(0,0,0,0.12), 0 0 0 1px var(--mg-border);

  /* Sidebar */
  --sidebar-width: 270px;
  --sidebar-bg: linear-gradient(180deg, #0d1117 0%, #0a0e18 40%, #080c14 100%);

  /* ─── Legacy aliases (backward compatibility with inline-styled templates) ─── */
  --surface: var(--mg-surface-card);
  --surface2: var(--mg-surface);
  --surface3: var(--mg-surface-hover);
  --border: var(--mg-border);
  --border2: var(--mg-border-strong);
  --accent: var(--mg-accent);
  --accent2: var(--mg-accent-bold);
  --text: var(--mg-text-primary);
  --text2: var(--mg-text-secondary);
  --text3: var(--mg-text-tertiary);
  --text-secondary: var(--mg-text-secondary);
  --muted: var(--mg-text-muted);
  --green: var(--mg-success);
  --red: var(--mg-danger);
  --orange: var(--mg-warning);
  --bg: var(--mg-bg);
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--mg-bg);
  color: var(--mg-text-primary);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  direction: rtl;
  font-size: 14px;
}

a { color: var(--mg-accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--mg-accent-bold); }
img { max-width: 100%; height: auto; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* ═══════ LAYOUT ═══════ */
.admin-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.admin-side {
  background: var(--sidebar-bg);
  border-left: 1px solid var(--mg-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

.admin-brand {
  padding: 16px 14px;
  border-bottom: 1px solid var(--mg-border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(99,102,241,0.03);
}

.admin-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--mg-gradient-accent);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 17px;
  box-shadow: 0 6px 20px rgba(99,102,241,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
  position: relative;
}
.admin-brand-mark::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  background: var(--mg-gradient-accent);
  opacity: 0.2;
  filter: blur(8px);
  z-index: -1;
}

.admin-brand-text { display: flex; flex-direction: column; gap: 2px; }
.admin-brand-text strong { color: #fff; font-size: 0.95rem; font-weight: 800; letter-spacing: -0.01em; }
.admin-brand-text small { color: #a5b4fc; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; }

/* ─── Sidebar Navigation ─── */
.admin-nav {
  padding: 10px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-group-label {
  font-size: 0.56rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mg-accent);
  padding: 14px 12px 5px;
  opacity: 0.6;
}
.nav-group-label:first-child { padding-top: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border-radius: var(--mg-radius-sm);
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 500;
  transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.nav-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--mg-gradient-accent);
  opacity: 0;
  transition: opacity .2s;
}

.nav-item:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,0.04);
}

.nav-item.active {
  color: #fff;
  font-weight: 600;
  background: rgba(99,102,241,0.12);
  box-shadow: inset 0 0 0 1px rgba(129,140,248,0.2);
}
.nav-item.active::after {
  content: '';
  position: absolute;
  right: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--mg-gradient-accent);
  border-radius: 3px 0 0 3px;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.5;
  color: var(--mg-accent);
  flex-shrink: 0;
  transition: opacity .2s, transform .2s;
}
.nav-item:hover svg { opacity: 0.8; transform: scale(1.05); }
.nav-item.active svg { opacity: 1; color: #c7d2fe; }

/* ─── Sidebar Footer ─── */
.admin-side-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--mg-border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--mg-gradient-accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.admin-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.admin-user-info { display: flex; flex-direction: column; min-width: 0; }
.admin-user-info strong { color: #fff; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-user-info small { color: #a5b4fc; font-size: 0.65rem; font-weight: 600; }

.logout-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--mg-radius-sm);
  display: grid;
  place-items: center;
  color: #64748b;
  transition: all .2s;
}
.logout-btn:hover { background: var(--mg-danger-dim); color: var(--mg-danger); }

/* ═══════ MAIN CONTENT ═══════ */
.admin-main {
  padding: 32px 36px;
  min-width: 0;
  background: var(--mg-bg);
}

/* ─── Page Headers ─── */
.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 28px;
  letter-spacing: -0.02em;
  color: var(--mg-text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 14px;
}
.page-head-row .page-title { margin-bottom: 0; }

.section-head {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--mg-border);
}
.section-head h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--mg-text-primary);
}

/* ─── Grid Utilities ─── */
.grid { display: grid; gap: 20px; }
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* ═══════ CARDS ═══════ */
.card {
  background: var(--mg-surface-card);
  border: 1px solid var(--mg-border);
  border-radius: var(--mg-radius-lg);
  padding: 24px;
  transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.card:hover {
  border-color: var(--mg-border-strong);
  box-shadow: var(--mg-shadow-md);
}
.card-header { margin-bottom: 18px; }
.card-header h3 { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; }
.card-header p { font-size: 0.78rem; color: var(--mg-text-tertiary); margin-top: 4px; }

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

.stat-card {
  background: var(--mg-surface-card);
  border: 1px solid var(--mg-border);
  border-radius: var(--mg-radius-lg);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.06;
  pointer-events: none;
}
.stat-card:hover {
  border-color: var(--mg-border-strong);
  transform: translateY(-2px);
  box-shadow: var(--mg-shadow-md);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--mg-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.stat-icon.blue { background: rgba(96,165,250,0.1); color: #60a5fa; box-shadow: 0 0 20px rgba(96,165,250,0.08); }
.stat-icon.green { background: rgba(52,211,153,0.1); color: #34d399; box-shadow: 0 0 20px rgba(52,211,153,0.08); }
.stat-icon.purple { background: rgba(167,139,250,0.1); color: #a78bfa; box-shadow: 0 0 20px rgba(167,139,250,0.08); }
.stat-icon.orange { background: rgba(251,191,36,0.1); color: #fbbf24; box-shadow: 0 0 20px rgba(251,191,36,0.08); }

.stat-card:nth-child(1)::before { background: #60a5fa; }
.stat-card:nth-child(2)::before { background: #34d399; }
.stat-card:nth-child(3)::before { background: #a78bfa; }
.stat-card:nth-child(4)::before { background: #fbbf24; }

.stat-value { font-size: 1.75rem; font-weight: 900; line-height: 1; letter-spacing: -0.02em; }
.stat-label { font-size: 0.72rem; color: var(--mg-text-tertiary); margin-top: 6px; font-weight: 500; }

/* ═══════ TABLES ═══════ */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--mg-surface-card);
  border: 1px solid var(--mg-border);
  border-radius: var(--mg-radius-lg);
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 14px 18px;
  text-align: right;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--mg-border-subtle);
}

.data-table th {
  background: var(--mg-surface);
  color: var(--mg-text-tertiary);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background .15s;
}
.data-table tbody tr:hover td {
  background: rgba(99,102,241,0.03);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td { color: var(--mg-text-secondary); }

.actions { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }

/* ═══════ BADGES ═══════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--mg-radius-full);
  letter-spacing: 0.02em;
}
.badge-completed, .badge-approved { background: var(--mg-success-dim); color: var(--mg-success); }
.badge-pending { background: var(--mg-warning-dim); color: var(--mg-warning); }
.badge-rejected, .badge-suspended { background: var(--mg-danger-dim); color: var(--mg-danger); }
.badge-info { background: var(--mg-info-dim); color: var(--mg-info); }

.badge-icon {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.8rem; padding: 0.2rem 0.6rem;
  border-radius: 20px; font-weight: 500;
}
.badge-bronze { background: rgba(205,127,50,0.12); color: #CD7F32; }
.badge-silver { background: rgba(192,192,192,0.12); color: #a0a0a0; }
.badge-gold { background: rgba(255,215,0,0.12); color: #d4a017; }
.badge-diamond { background: rgba(185,242,255,0.12); color: #0099CC; }
.badge-vip { background: rgba(155,89,182,0.12); color: #c084fc; }
.badge-icon .badge-svg { width: 14px; height: 14px; flex-shrink: 0; }
.badge-icon .badge-svg path, .badge-icon .badge-svg polygon { fill: currentColor; }

/* ═══════ BUTTONS ═══════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--mg-radius-sm);
  font-weight: 600;
  font-size: 0.82rem;
  border: none;
  cursor: pointer;
  transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--mg-gradient-accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99,102,241,0.3), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99,102,241,0.4);
  transform: translateY(-1px);
  color: #fff;
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--mg-text-secondary);
  border: 1px solid var(--mg-border-strong);
}
.btn-outline:hover {
  border-color: var(--mg-accent);
  color: var(--mg-accent);
  background: var(--mg-accent-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--mg-text-tertiary);
}
.btn-ghost:hover {
  color: var(--mg-text-primary);
  background: rgba(255,255,255,0.04);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239,68,68,0.25);
}
.btn-danger:hover { box-shadow: 0 4px 14px rgba(239,68,68,0.35); transform: translateY(-1px); }

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}
.btn-success:hover { box-shadow: 0 4px 14px rgba(16,185,129,0.35); }

.btn-sm { padding: 8px 14px; font-size: 0.78rem; }
.btn-xs { padding: 5px 10px; font-size: 0.72rem; border-radius: 6px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--mg-radius-sm); }

/* ═══════ FORMS ═══════ */
.admin-form { max-width: 680px; }

.form-group { margin-bottom: 1.4rem; }

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

.form-input {
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--mg-radius-sm);
  border: 1px solid var(--mg-border);
  background: var(--mg-bg-elevated);
  color: var(--mg-text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: all .2s;
  direction: rtl;
  font-family: inherit;
}
.form-input:focus {
  border-color: var(--mg-accent-bold);
  box-shadow: 0 0 0 3px var(--mg-accent-dim), var(--mg-shadow-glow);
  background: var(--mg-surface);
}
.form-input::placeholder { color: var(--mg-text-muted); }
textarea.form-input { min-height: 130px; resize: vertical; line-height: 1.8; }
select.form-input { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 14px center; padding-left: 36px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─── Grouped Form Sections ─── */
.form-section {
  background: var(--mg-surface-card);
  border: 1px solid var(--mg-border);
  border-radius: var(--mg-radius-lg);
  padding: 22px;
  margin-bottom: 20px;
}
.form-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--mg-border);
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--mg-text-primary);
}
.form-section-title svg { color: var(--mg-accent); width: 18px; height: 18px; }
.checkbox-grid { display: flex; flex-wrap: wrap; gap: 18px; }
.checkbox-pill {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; cursor: pointer;
  padding: 8px 14px; border-radius: var(--mg-radius-sm);
  border: 1px solid var(--mg-border); background: var(--mg-bg-elevated);
  transition: all .18s;
}
.checkbox-pill:hover { border-color: var(--mg-border-interactive); }
.checkbox-pill input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--mg-accent-bold); }
.form-check { display: flex; align-items: center; gap: 10px; font-size: 0.84rem; cursor: pointer; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--mg-accent-bold); border-radius: 4px; cursor: pointer; }
.form-actions { display: flex; gap: 10px; margin-top: 12px; padding-top: 20px; border-top: 1px solid var(--mg-border); }
.form-hint { font-size: 0.7rem; color: var(--mg-text-muted); margin-top: 5px; }

/* ─── Search Bar ─── */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}
.search-bar .form-input {
  flex: 1;
  padding: 10px 16px;
  background: var(--mg-surface);
  border-color: var(--mg-border);
}

/* ═══════ ALERTS ═══════ */
.flash-wrap { margin-bottom: 24px; }
.alert {
  padding: 12px 18px;
  border-radius: var(--mg-radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDown .3s ease-out;
}
.alert-error { background: var(--mg-danger-dim); color: var(--mg-danger); border: 1px solid rgba(248,113,113,0.15); }
.alert-success { background: var(--mg-success-dim); color: var(--mg-success); border: 1px solid rgba(52,211,153,0.15); }
.alert-warning { background: var(--mg-warning-dim); color: var(--mg-warning); border: 1px solid rgba(251,191,36,0.15); }
.alert-info { background: var(--mg-info-dim); color: var(--mg-info); border: 1px solid rgba(96,165,250,0.15); }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════ PRODUCT CARDS (Admin Grid) ═══════ */
.admin-product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.admin-product-card {
  background: var(--mg-surface-card);
  border: 1px solid var(--mg-border);
  border-radius: var(--mg-radius-lg);
  overflow: hidden;
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.admin-product-card:hover {
  border-color: var(--mg-border-interactive);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2), var(--mg-shadow-glow);
  transform: translateY(-3px);
}

.admin-product-cover {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--mg-surface) 0%, var(--mg-bg) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.admin-product-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.admin-product-card:hover .admin-product-cover img { transform: scale(1.04); }
.admin-product-cover .placeholder-icon { color: var(--mg-text-muted); opacity: 0.3; }

.admin-product-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.admin-product-title { font-size: 0.88rem; font-weight: 700; margin-bottom: 10px; line-height: 1.5; }

.admin-product-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.admin-product-price {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--mg-accent);
}
.admin-product-price del {
  color: var(--mg-text-muted);
  font-size: 0.72rem;
  font-weight: 400;
  margin-left: 6px;
}
.admin-product-category {
  font-size: 0.66rem;
  padding: 3px 10px;
  border-radius: var(--mg-radius-full);
  background: var(--mg-accent-dim);
  color: var(--mg-accent);
  font-weight: 700;
}

.admin-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--mg-border-subtle);
  margin-top: auto;
}

/* ═══════ TABS ═══════ */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--mg-border); margin-bottom: 24px; }
.tab-link {
  padding: 12px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mg-text-tertiary);
  border-bottom: 2px solid transparent;
  transition: all .2s;
  text-decoration: none;
  margin-bottom: -1px;
}
.tab-link:hover { color: var(--mg-text-primary); }
.tab-link.active { color: var(--mg-accent); border-bottom-color: var(--mg-accent-bold); }

/* ═══════ PAGINATION ═══════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 2.5rem 0;
}
.pagination a, .pagination .current, .pagination span.page-info {
  padding: 8px 14px;
  border-radius: var(--mg-radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
}
.pagination a {
  border: 1px solid var(--mg-border);
  color: var(--mg-text-secondary);
  text-decoration: none;
  transition: all .2s;
  background: var(--mg-surface-card);
}
.pagination a:hover {
  background: var(--mg-accent-dim);
  color: var(--mg-accent);
  border-color: var(--mg-border-interactive);
}
.pagination .current {
  background: var(--mg-gradient-accent);
  color: white;
  border: 1px solid transparent;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.pagination span.page-info {
  font-size: 0.75rem;
  color: var(--mg-text-muted);
}

/* ═══════ EMPTY STATE ═══════ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--mg-text-muted);
  font-size: 0.88rem;
}
.empty-state svg { margin-bottom: 16px; opacity: 0.3; }

/* ═══════ LOGIN ═══════ */
.login-body {
  background: linear-gradient(135deg, #06080d 0%, #0f172a 40%, #1e1b4b 80%, #312e81 100%);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}
.login-body::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(99,102,241,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.login-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(12,15,22,0.85);
  backdrop-filter: blur(24px) saturate(120%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--mg-radius-xl);
  padding: 2.8rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.login-brand { text-align: center; margin-bottom: 2.2rem; }
.login-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--mg-gradient-accent);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 22px;
  margin: 0 auto 14px;
  box-shadow: 0 10px 30px rgba(99,102,241,0.4);
  position: relative;
}
.login-mark::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 20px;
  background: var(--mg-gradient-accent);
  opacity: 0.15;
  filter: blur(12px);
}
.login-brand h1 { font-size: 1.2rem; font-weight: 800; color: #fff; }
.login-brand p { color: var(--mg-text-tertiary); font-size: 0.82rem; margin-top: 4px; }

.btn-login {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: var(--mg-radius-md);
  background: var(--mg-gradient-accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
  margin-top: 8px;
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.5);
}

/* ═══════ MOBILE TOGGLE ═══════ */
.admin-sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1100;
  width: 42px;
  height: 42px;
  border-radius: var(--mg-radius-sm);
  background: var(--mg-surface);
  border: 1px solid var(--mg-border);
  color: var(--mg-text-secondary);
  cursor: pointer;
  place-items: center;
  box-shadow: var(--mg-shadow-md);
  transition: all .2s;
}
.admin-sidebar-toggle:hover { background: var(--mg-surface-hover); }

.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--mg-overlay);
  z-index: 1040;
  backdrop-filter: blur(4px);
}
.admin-sidebar-overlay.show { display: block; }

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 1200px) {
  .admin-product-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .admin-product-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 270px;
    z-index: 1050;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .admin-side.open { transform: translateX(0); }
  .admin-sidebar-toggle { display: grid; }
  .admin-main { padding: 64px 16px 24px; }
  .form-row { grid-template-columns: 1fr; }
  .admin-product-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 1.2rem; }
  /* Horizontal scroll for wide data tables on mobile */
  .data-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .page-head-row { flex-wrap: wrap; gap: 12px; }
  .tabs { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .admin-main { padding: 60px 12px 20px; }
}
