/* ============================================
   قالب مدیریت شعب ووکامرس - استایل‌های اصلی
   RTL - Bootstrap 5.3
   ============================================ */

/* === فونت (لوکال) === */
@import url('../vendor/vazirmatn/Vazirmatn-font-face.css');

/* === متغیرها === */
:root {
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --sidebar-bg: #1e2a3a;
  --sidebar-hover: #263548;
  --sidebar-active: #0d6efd;
  --header-height: 64px;
  --bg-main: #f5f6fa;
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.10);
  --transition: all 0.3s ease;
  --radius: 12px;
  --radius-sm: 8px;
}

/* === ریست و استایل‌های عمومی === */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg-main);
  color: #212529;
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
  min-height: 100vh;
}

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

/* === اسکرول‌بار === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }

/* ============================================
   سایدبار
   ============================================ */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  z-index: 1040;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--header-height);
}

.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--sidebar-active);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.sidebar-logo .logo-sub {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  white-space: nowrap;
}

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

.sidebar-nav .nav-section {
  color: rgba(255, 255, 255, 0.35);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px 20px 6px;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
  border-right: 3px solid transparent;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

.sidebar-nav .nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-nav .nav-item.active {
  background: rgba(13, 110, 253, 0.15);
  color: #fff;
  border-right-color: var(--sidebar-active);
}

.sidebar-nav .nav-item i {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-nav .nav-item .badge-count {
  margin-right: auto;
  background: var(--sidebar-active);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.sidebar-user {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #495b73;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  flex-shrink: 0;
}

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

.sidebar-user .user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .user-branch {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === هدر === */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: var(--sidebar-width);
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1030;
  transition: var(--transition);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  font-size: 22px;
  color: #495057;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.menu-toggle:hover { background: #f0f0f0; }

.header-breadcrumb {
  font-size: 13px;
  color: #6c757d;
}

.header-breadcrumb span { color: #212529; font-weight: 500; }

.header-search {
  position: relative;
  width: 280px;
}

.header-search input {
  width: 100%;
  padding: 8px 36px 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  font-size: 13px;
  font-family: inherit;
  transition: var(--transition);
  background: #f8f9fa;
}

.header-search input:focus {
  outline: none;
  border-color: var(--sidebar-active);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.header-search i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  font-size: 16px;
}

.header-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  font-size: 18px;
  color: #495057;
  cursor: pointer;
  border-radius: 50%;
  transition: var(--transition);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-btn:hover { background: #f0f0f0; }

.header-btn .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #dc3545;
  border-radius: 50%;
  border: 2px solid #fff;
}

/* === محتوای اصلی === */
.main-content {
  margin-right: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 24px;
  min-height: calc(100vh - var(--header-height));
  transition: var(--transition);
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #1e2a3a;
}

/* === کارت‌ها === */
.card {
  background: #fff;
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

.card:hover { box-shadow: var(--card-shadow-hover); }

.card-header {
  background: transparent;
  border-bottom: 1px solid #f0f0f0;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body { padding: 20px; }

/* === کارت‌های آمار داشبورد === */
.stat-card {
  padding: 20px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

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

.stat-card .stat-info { flex: 1; }

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 800;
  color: #1e2a3a;
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 13px;
  color: #6c757d;
  margin-top: 2px;
}

.stat-card .stat-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.stat-card .stat-change.up { color: #198754; }
.stat-card .stat-change.down { color: #dc3545; }

.stat-card .stat-bg {
  position: absolute;
  left: -10px;
  bottom: -15px;
  font-size: 80px;
  opacity: 0.06;
  pointer-events: none;
}

.stat-card.primary .stat-icon { background: #e7f1ff; color: #0d6efd; }
.stat-card.success .stat-icon { background: #d1f2e0; color: #198754; }
.stat-card.warning .stat-icon { background: #fff3cd; color: #ffc107; }
.stat-card.danger  .stat-icon { background: #fde0e4; color: #dc3545; }

/* === جدول === */
.table-container {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.table-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.table-header h5 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

table th {
  background: #fafbfc;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  border-bottom: 1px solid #e9ecef;
  cursor: pointer;
  user-select: none;
}

table th:hover { color: #212529; }

table th i {
  font-size: 10px;
  margin-right: 4px;
  opacity: 0.5;
}

table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid #f5f5f5;
  vertical-align: middle;
}

table tbody tr { transition: var(--transition); }
table tbody tr:hover { background: #fafbfd; }

.product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-cell img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: #f0f0f0;
}

.product-cell .product-name {
  font-weight: 600;
  font-size: 13px;
  color: #212529;
}

.product-cell .product-sku {
  font-size: 11px;
  color: #6c757d;
}

/* === وضعیت‌ها (Badges) === */
.badge-status {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-completed  { background: #d1f2e0; color: #0a6b3c; }
.badge-processing { background: #fff3cd; color: #8a6d00; }
.badge-pending    { background: #e7f1ff; color: #0a4da4; }
.badge-cancelled  { background: #fde0e4; color: #a61b2e; }
.badge-refunded   { background: #e9ecef; color: #495057; }
.badge-shipped    { background: #d6ecfb; color: #0c5fa5; }

.badge-stock-in   { background: #d1f2e0; color: #0a6b3c; }
.badge-stock-low  { background: #fff3cd; color: #8a6d00; }
.badge-stock-out  { background: #fde0e4; color: #a61b2e; }

/* === گرید محصولات === */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.product-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: var(--transition);
}

.product-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.product-card .product-img {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: #f8f9fa;
}

.product-card .product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.product-card:hover .product-img img { transform: scale(1.05); }

.product-card .product-actions-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transition: var(--transition);
  transform: translateX(-10px);
}

.product-card:hover .product-actions-overlay {
  opacity: 1;
  transform: translateX(0);
}

.product-actions-overlay .btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #495057;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.product-actions-overlay .btn-icon:hover { background: #0d6efd; color: #fff; }
.product-actions-overlay .btn-icon.delete:hover { background: #dc3545; color: #fff; }

.product-card .product-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.product-badge.sale { background: #dc3545; color: #fff; }
.product-badge.new  { background: #198754; color: #fff; }

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

.product-card .product-category {
  font-size: 11px;
  color: #6c757d;
  margin-bottom: 4px;
}

.product-card .product-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .product-price {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-card .price-regular {
  font-size: 16px;
  font-weight: 800;
  color: #1e2a3a;
}

.product-card .price-sale {
  font-size: 13px;
  color: #6c757d;
  text-decoration: line-through;
}

.product-card .product-stock {
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
}

/* === فرم === */
.form-section {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}

.form-section .section-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #495057;
  margin-bottom: 6px;
}

.form-control, .form-select {
  font-family: 'Vazirmatn', sans-serif;
  font-size: 13px;
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.form-control::placeholder {
  color: #adb5bd;
  font-size: 12px;
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* === تصاویر === */
.image-upload-area {
  border: 2px dashed #dee2e6;
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: #fafbfc;
}

.image-upload-area:hover {
  border-color: #0d6efd;
  background: #f0f6ff;
}

.image-upload-area i {
  font-size: 40px;
  color: #adb5bd;
  margin-bottom: 10px;
  display: block;
}

.image-upload-area .upload-text {
  font-size: 13px;
  color: #6c757d;
}

.image-upload-area .upload-hint {
  font-size: 11px;
  color: #adb5bd;
  margin-top: 4px;
}

.image-preview {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.image-preview .preview-item {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  border: 1px solid #e9ecef;
}

.image-preview .preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview .preview-remove {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #dc3545;
  color: #fff;
  border: none;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === ویژگی‌ها === */
.attributes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attribute-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.attribute-row input {
  flex: 1;
}

/* === آکاردئون === */
.accordion .accordion-item {
  border: none;
  margin-bottom: 8px;
  border-radius: var(--radius-sm) !important;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.accordion .accordion-button {
  font-family: 'Vazirmatn', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 16px 20px;
  background: #fff;
  box-shadow: none !important;
}

.accordion .accordion-button:not(.collapsed) {
  background: #f0f6ff;
  color: #0d6efd;
}

.accordion .accordion-button::after {
  margin-right: auto;
  margin-left: 0 !important;
}

.accordion .accordion-body {
  font-size: 13px;
  line-height: 2;
  color: #495057;
  padding: 16px 20px;
}

/* === منوی موبایل (Offcanvas) === */
.mobile-offcanvas {
  width: 280px !important;
}

.mobile-offcanvas .offcanvas-header {
  background: var(--sidebar-bg);
  color: #fff;
  padding: 16px;
}

.mobile-offcanvas .offcanvas-header .btn-close {
  filter: invert(1);
}

.mobile-offcanvas .offcanvas-body {
  padding: 0;
  background: var(--sidebar-bg);
}

.mobile-offcanvas .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
  border-right: 3px solid transparent;
  font-size: 14px;
}

.mobile-offcanvas .nav-item:hover,
.mobile-offcanvas .nav-item.active {
  background: rgba(13, 110, 253, 0.15);
  color: #fff;
  border-right-color: #0d6efd;
}

/* === صفحه‌بندی === */
.pagination {
  gap: 4px;
}

.pagination .page-link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm) !important;
  border: 1px solid #e9ecef;
  font-size: 13px;
  font-weight: 500;
  color: #495057;
  background: #fff;
  cursor: pointer;
  transition: var(--transition);
  margin: 0 2px;
}

.pagination .page-link:hover {
  background: #f0f6ff;
  border-color: #0d6efd;
  color: #0d6efd;
}

.pagination .page-item.active .page-link {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}

.pagination .page-item.disabled .page-link {
  color: #adb5bd;
  pointer-events: none;
}

/* === دکمه شناور (FAB) === */
.fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #0d6efd;
  color: #fff;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(13, 110, 253, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 1020;
}

.fab:hover {
  background: #0b5ed7;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.5);
}

/* === مودال === */
.modal-content {
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.modal-body { padding: 20px; }

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #f0f0f0;
}

/* === تایم‌لاین (جزئیات سفارش) === */
.timeline {
  position: relative;
  padding-right: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  right: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e9ecef;
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  right: -26px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0d6efd;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px #0d6efd;
}

.timeline-item.completed::before { background: #198754; box-shadow: 0 0 0 3px #198754; }
.timeline-item.cancelled::before { background: #dc3545; box-shadow: 0 0 0 3px #dc3545; }

.timeline-item .time {
  font-size: 11px;
  color: #6c757d;
}

.timeline-item .event {
  font-size: 13px;
  font-weight: 600;
  color: #212529;
}

.timeline-item .detail {
  font-size: 12px;
  color: #6c757d;
}

/* === صفحه لاگین === */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e2a3a 0%, #2c4060 50%, #1e3a5f 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-card .login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-card .login-logo .logo-circle {
  width: 64px;
  height: 64px;
  background: #0d6efd;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  margin-bottom: 12px;
}

.login-card .login-logo h3 {
  font-size: 20px;
  font-weight: 800;
  color: #1e2a3a;
}

.login-card .login-logo p {
  font-size: 12px;
  color: #6c757d;
  margin-top: 4px;
}

.login-card .form-group {
  margin-bottom: 18px;
}

.login-card .form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #495057;
  margin-bottom: 6px;
  display: block;
}

.login-card .input-group {
  position: relative;
}

.login-card .input-group i {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #adb5bd;
  font-size: 18px;
  z-index: 5;
}

.login-card .input-group .form-control {
  padding-right: 44px;
  height: 48px;
  font-size: 14px;
}

.login-card .btn-login {
  width: 100%;
  height: 48px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

.login-error {
  background: #fde0e4;
  color: #a61b2e;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
}

/* === اعلان Toast === */
.toast-container {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  animation: slideInLeft 0.3s ease;
  min-width: 280px;
  max-width: 400px;
}

.toast-success { background: #198754; }
.toast-error   { background: #dc3545; }
.toast-warning { background: #ffc107; color: #212529; }
.toast-info    { background: #0d6efd; }

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* === وضعیت خالی === */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-state i {
  font-size: 56px;
  color: #dee2e6;
  margin-bottom: 16px;
  display: block;
}

.empty-state h5 {
  font-size: 16px;
  color: #495057;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13px;
  color: #adb5bd;
}

/* === لودینگ === */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e9ecef;
  border-top-color: #0d6efd;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   ریسپانسیو
   ============================================ */

/* Tablet Large (≤1199px) */
@media (max-width: 1199px) {
  .main-header { right: 0; }
  .main-content { margin-right: 0; }
  .sidebar { right: -100%; }
  .sidebar.open { right: 0; }
  .menu-toggle { display: flex; }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
    display: none;
  }
  .sidebar-overlay.show { display: block; }
  .products-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Tablet (≤991px) */
@media (max-width: 991px) {
  .header-search { display: none; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card { padding: 16px; }
  .stat-card .stat-value { font-size: 22px; }
}

/* Mobile (≤767px) */
@media (max-width: 767px) {
  .main-content { padding: 16px; }
  .page-title { font-size: 18px; }
  .products-grid { grid-template-columns: repeat(1, 1fr); gap: 14px; }
  .table-header { flex-direction: column; align-items: flex-start; }
  .table-actions { width: 100%; }
  .table-actions .form-select,
  .table-actions input { flex: 1; }
  .header-breadcrumb { display: none; }
  .login-card { padding: 24px; }
  .form-section .section-body { padding: 14px; }
  .stat-card .stat-value { font-size: 20px; }
  .stat-card .stat-icon { width: 42px; height: 42px; font-size: 20px; }
}

/* Mobile Small (≤400px) */
@media (max-width: 400px) {
  .products-grid { grid-template-columns: 1fr; }
  .header-right { gap: 4px; }
  .fab { width: 48px; height: 48px; font-size: 20px; bottom: 16px; left: 16px; }
}

/* === Print === */
@media print {
  .sidebar, .main-header, .fab, .no-print { display: none !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
}
