/* =====================================
   BizShop Admin Panel - Modern Design
   ===================================== */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary: #f97316;
  --primary-dark: #ea580c;
  --primary-light: #fb923c;
  --secondary: #3b82f6;
  --success: #22c55e;
  --success-dark: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark: #0a0a0a;
  --darker: #000000;
  --light: #1a1a1a;
  --white: #f0f0f0;
  --gray-50: #1a1a1a;
  --gray-100: #222222;
  --gray-200: #2a2a2a;
  --gray-300: #444444;
  --gray-400: #666666;
  --gray-500: #888888;
  --gray-600: #aaaaaa;
  --gray-700: #cccccc;
  --gray-800: #e0e0e0;
  --sidebar-width: 250px;
  --header-height: 64px;
  --bottom-nav-height: 60px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Vazirmatn', sans-serif;
}
  --sidebar-width: 250px;
  --header-height: 64px;
  --bottom-nav-height: 60px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Vazirmatn', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--dark);
  color: var(--white);
  direction: rtl;
  overflow-x: hidden;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
input, textarea, select { color: var(--white); }
::placeholder { color: var(--gray-500); }

/* =====================================
   LAYOUT
   ===================================== */
.admin-body { display: flex; }

/* ---- Sidebar ---- */
.sidebar {
  position: fixed; top: 0; right: 0;
  width: var(--sidebar-width); height: 100vh;
  background: #080808;
  color: var(--gray-600);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: var(--transition);
  overflow-y: auto;
}
.sidebar-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sidebar-logo {
  font-size: 1.4rem; font-weight: 900; color: var(--white);
}
.logo-accent { color: var(--primary); }
.sidebar-close { display: none; background: none; border: none; color: var(--gray-500); font-size: 1.5rem; cursor: pointer; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section-label {
  padding: 16px 24px 8px;
  font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--gray-500); font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; margin: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--gray-500);
  transition: var(--transition);
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--white); }
.nav-item.active { background: rgba(249,115,22,0.12); color: var(--primary); }
.nav-icon { font-size: 1.1rem; width: 24px; text-align: center; }
.nav-text { font-size: 0.88rem; font-weight: 500; }
.nav-badge {
  margin-right: auto; background: var(--danger); color: white;
  font-size: 0.65rem; font-weight: 700;
  padding: 2px 8px; border-radius: 50px;
  min-width: 20px; text-align: center;
}
.sidebar-footer {
  padding: 12px 0; border-top: 1px solid rgba(255,255,255,0.05);
}

/* ---- Main ---- */
.main-content {
  flex: 1; margin-right: var(--sidebar-width);
  min-height: 100vh; display: flex; flex-direction: column;
}

/* ---- Header ---- */
.admin-header {
  height: var(--header-height);
  background: var(--light);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 28px;
  display: flex; align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  width: 22px; height: 2.5px;
  background: var(--gray-600); border-radius: 4px;
  transition: var(--transition);
}
.page-title { font-size: 1.15rem; font-weight: 800; color: var(--white); }
.header-right { display: flex; align-items: center; gap: 20px; }
.header-icon-btn {
  position: relative; width: 40px; height: 40px;
  border-radius: 50%; border: none;
  background: var(--gray-100); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.header-icon-btn:hover { background: var(--gray-200); }
.header-icon-btn svg { width: 20px; height: 20px; fill: var(--gray-500); }
.notif-dot {
  position: absolute; top: 8px; left: 8px;
  width: 8px; height: 8px; background: var(--danger);
  border-radius: 50%; border: 2px solid var(--light);
}
.admin-profile {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.profile-avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--gray-200);
}
.profile-info { line-height: 1.3; }
.profile-name { font-size: 0.85rem; font-weight: 700; display: block; color: var(--white); }
.profile-role { font-size: 0.7rem; color: var(--gray-500); }

/* ---- Page Content ---- */
.page-content { padding: 28px; flex: 1; }

/* =====================================
   STATS
   ===================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px; margin-bottom: 30px;
}
.stat-card {
  background: var(--light); border-radius: var(--radius);
  padding: 22px 24px; border: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: 16px;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.stat-icon {
  width: 50px; height: 50px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.stat-icon.purple { background: rgba(249,115,22,0.1); }
.stat-icon.green { background: rgba(34,197,94,0.15); }
.stat-icon.yellow { background: rgba(245,158,11,0.2); }
.stat-icon.red { background: rgba(239,68,68,0.15); }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 0.8rem; color: var(--gray-600); }

/* =====================================
   CARDS
   ===================================== */
.card {
  background: var(--light); border-radius: var(--radius);
  border: 1px solid var(--gray-200); overflow: hidden;
  margin-bottom: 24px;
}
.card-header {
  padding: 18px 24px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--gray-200);
}
.card-header h3 { font-size: 0.95rem; font-weight: 700; }
.card-body { padding: 24px; }
.card-body-no-pad { padding: 0; }

/* =====================================
   TABLES
   ===================================== */
.table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%; border-collapse: collapse;
}
.admin-table th {
  text-align: right; padding: 14px 16px;
  font-size: 0.78rem; color: var(--gray-600);
  font-weight: 600; border-bottom: 2px solid var(--gray-200);
  background: #151515; white-space: nowrap;
}
.admin-table td {
  padding: 14px 16px; font-size: 0.85rem;
  border-bottom: 1px solid var(--gray-200); vertical-align: middle;
}
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
.status-badge {
  display: inline-flex; padding: 4px 12px;
  border-radius: 50px; font-size: 0.75rem; font-weight: 600;
}
.status-badge.active { background: rgba(34,197,94,0.15); color: var(--success); }
.status-badge.pending { background: rgba(245,158,11,0.15); color: var(--warning); }
.status-badge.cancelled { background: rgba(239,68,68,0.15); color: var(--danger); }

/* =====================================
   FORMS
   ===================================== */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-weight: 600;
  font-size: 0.85rem; margin-bottom: 6px; color: var(--gray-700);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 12px 16px;
  border: 2px solid var(--gray-200); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.9rem;
  transition: var(--transition); background: #111;
  color: var(--white);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 50px;
  font-family: var(--font); font-weight: 700;
  font-size: 0.88rem; border: none; cursor: pointer;
  transition: var(--transition); justify-content: center;
}
.btn-primary {
  background: var(--primary);
  color: #111;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-danger { background: var(--danger); color: #111; }
.btn-sm { padding: 8px 18px; font-size: 0.8rem; }

/* =====================================
   CHECKOUT FORM (used in settings)
   ===================================== */
.checkout-form {
  background: var(--light);
  border-radius: var(--radius);
  padding: 30px;
  border: 1px solid var(--gray-200);
}
.checkout-form h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 20px;
}

/* =====================================
   ADMIN TOOLBAR
   ===================================== */
.admin-toolbar {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
  gap: 12px;
}
.admin-toolbar h3 {
  font-size: 1rem;
  font-weight: 700;
}

/* =====================================
   CARD VIEW (جایگزین جدول در موبایل)
   ===================================== */
.card-view { display: none; }

/* =====================================
   LOGIN PAGE
   ===================================== */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: #000;
  padding: 20px;
}
.login-card {
  background: var(--light); border-radius: var(--radius-lg);
  padding: 40px 36px; width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
}
.login-card .login-logo {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), #ea580c);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: #111; font-size: 1.6rem; font-weight: 900;
  margin: 0 auto 16px;
}
.login-card h2 {
  text-align: center; font-size: 1.3rem; font-weight: 800; margin-bottom: 6px;
  color: var(--white);
}
.login-card p {
  text-align: center; font-size: 0.85rem;
  color: var(--gray-500); margin-bottom: 28px;
}
.login-card .login-footer {
  text-align: center; margin-top: 18px;
  font-size: 0.78rem; color: var(--gray-500);
}

/* =====================================
   MOBILE SIDEBAR OVERLAY
   ===================================== */
.sidebar-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99; opacity: 0; visibility: hidden;
  transition: var(--transition);
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

/* =====================================
   BOTTOM NAV
   ===================================== */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-height);
  background: #111;
  border-top: 1px solid var(--gray-200);
  z-index: 100;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}
.bottom-nav-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  color: var(--gray-500); transition: var(--transition);
  position: relative; min-width: 50px;
}
.bottom-nav-item .bnav-icon { font-size: 1.3rem; transition: var(--transition); }
.bottom-nav-item .bnav-label { font-size: 0.6rem; font-weight: 600; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active .bnav-icon { transform: scale(1.1); }
.bnav-badge {
  position: absolute; top: 2px; left: 50%;
  transform: translateX(-50%);
  background: var(--danger); color: white;
  font-size: 0.55rem; font-weight: 700;
  padding: 1px 6px; border-radius: 50px;
  min-width: 16px; text-align: center;
}

/* =====================================
   STAT INFO
   ===================================== */
.stat-card .stat-info h4 {
  font-size: 1.6rem;
  font-weight: 800;
}
.stat-card .stat-info p {
  font-size: 0.82rem;
  color: var(--gray-600);
}

/* =====================================
   ADMIN TABLE WRAP
   ===================================== */
.admin-table-wrap {
  background: var(--light);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

/* =====================================
   PRODUCT CELL IN TABLES
   ===================================== */
.admin-table .product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-table .product-cell img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
}
.admin-table .product-cell .prod-name {
  font-weight: 600;
}

/* =====================================
   ACTION BUTTONS IN TABLES
   ===================================== */
.admin-table .action-btns {
  display: flex;
  gap: 6px;
}
.admin-table .action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
.admin-table .action-btn.edit {
  background: rgba(249,115,22,0.15);
  color: var(--primary);
}
.admin-table .action-btn.edit:hover {
  background: var(--primary);
  color: #111;
}
.admin-table .action-btn.delete {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
}
.admin-table .action-btn.delete:hover {
  background: var(--danger);
  color: #111;
}

/* =====================================
   BADGE STATUS
   ===================================== */
.badge-status {
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-status.active { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-status.pending { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-status.inactive { background: rgba(239,68,68,0.15); color: var(--danger); }

/* =====================================
   BTN OUTLINE
   ===================================== */
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #111;
}

/* =====================================
   TOAST NOTIFICATIONS
   ===================================== */
.toast-container {
  position: fixed;
  bottom: 100px;
  right: 30px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: #1a1a1a;
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  animation: slideInRight 0.4s ease;
  border-right: 4px solid var(--primary);
  color: var(--white);
}
.toast.success { border-right-color: var(--success); }
.toast.error { border-right-color: var(--danger); }
.toast.warning { border-right-color: var(--warning); }
.toast .toast-icon { font-size: 1.3rem; }
.toast .toast-msg { flex: 1; font-size: 0.88rem; }

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

/* =====================================
   MODAL
   ===================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal {
  background: #1a1a1a;
  border-radius: var(--radius-lg);
  padding: 30px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: var(--transition);
  border: 1px solid var(--gray-200);
}
.modal-overlay.active .modal {
  transform: scale(1);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-500);
}
.modal-body {  }
.modal-body .form-group { margin-bottom: 14px; }

/* Slider mode toggle */
.slider-mode-btn {
  padding: 6px 18px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  background: transparent;
  color: var(--gray-600);
  transition: var(--transition);
}
.slider-mode-btn.active {
  background: var(--primary);
  color: #fff;
}

/* =====================================
   MOBILE: max 768px
   ===================================== */
@media (max-width: 768px) {
  .sidebar { right: -280px; box-shadow: none; }
  .sidebar.active { right: 0; box-shadow: var(--shadow-lg); }
  .sidebar-close { display: flex; }
  .main-content { margin-right: 0; }
  .admin-header { padding: 0 16px; }
  .hamburger { display: flex; }
  .admin-profile .profile-info { display: none; }
  .page-content { padding: 16px; padding-bottom: calc(var(--bottom-nav-height) + 20px); }
  .bottom-nav { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 16px; gap: 12px; }
  .stat-icon { width: 42px; height: 42px; font-size: 1.1rem; }
  .stat-value { font-size: 1.2rem; }
  .table-view { display: none; }
  .card-view { display: block; }
  .card-view-item {
    background: var(--light); border: 1px solid var(--gray-200);
    border-radius: var(--radius); padding: 16px;
    margin-bottom: 12px; display: flex; flex-direction: column;
    gap: 8px; transition: var(--transition);
  }
  .card-view-item:active { transform: scale(0.98); }
  .card-view-row { display: flex; justify-content: space-between; align-items: center; }
  .card-view-row .label { font-size: 0.78rem; color: var(--gray-500); }
  .card-view-row .value { font-size: 0.85rem; font-weight: 600; }
  .card-view-row .value.price { color: var(--primary); font-weight: 800; }
  .form-row { grid-template-columns: 1fr; }
  .page-title { font-size: 1rem; }

  /* Responsive inline-style grids */
  #adminContent > div[style*="grid-template-columns"],
  #adminContent [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  #adminContent [style*="flex:2"] { flex: 1 1 100% !important; min-width: 0 !important; }
  #adminContent [style*="flex:1;min-width:160px"] { flex: 1 1 100% !important; min-width: 0 !important; }

  /* Toast on mobile */
  .toast-container { right: 10px; left: 10px; bottom: calc(var(--bottom-nav-height) + 10px); }
  .toast { min-width: 0; padding: 12px 16px; font-size: 0.82rem; }

  /* Modal on mobile */
  .modal { padding: 20px; }
}

/* ─── Language Dropdown ─── */
.lang-dropdown {
  position: relative;
  display: inline-block;
}
.lang-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: inherit;
  color: rgba(255,255,255,0.7);
  transition: var(--transition);
  font-weight: 500;
  white-space: nowrap;
}
.lang-dropdown-toggle:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.lang-dropdown-toggle.lang-btn-icon {
  background: none;
  border: none;
  padding: 4px;
  color: rgba(255,255,255,0.7);
}
.lang-dropdown-toggle.lang-btn-icon:hover {
  color: #fff;
}
.lang-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 130px;
  background: var(--dark);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 1000;
  overflow: hidden;
  margin-top: 4px;
}
.lang-dropdown.open .lang-dropdown-menu {
  display: block;
}
.lang-option {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  color: rgba(255,255,255,0.7);
  text-align: right;
  transition: var(--transition);
}
.lang-option:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.lang-option.active {
  background: var(--primary);
  color: #fff;
}
