/* ============================================================
   پت‌شاپ پلاس — پلتفرم مدیریت تأمین‌کنندگان پت‌شاپ
   طراحی: زرد طلایی لوکس / مشکی، فونت وزیرمتن، کاملاً RTL
   ============================================================ */

:root {
  /* پالت رنگ سازمانی - زرد طلایی */
  --gold-50: #fffbeb;
  --gold-100: #fef3c7;
  --gold-200: #fde68a;
  --gold-300: #fcd34d;
  --gold-400: #fbbf24;
  --gold-500: #f59e0b;
  --gold-600: #d97706;
  --gold-700: #b45309;
  --gold-800: #92400e;
  --gold-900: #78350f;

  /* رنگ اصلی برند (جایگزین سبز) */
  --brand-50: #fffbeb;
  --brand-100: #fef3c7;
  --brand-200: #fde68a;
  --brand-300: #fcd34d;
  --brand-400: #fbbf24;
  --brand-500: #f59e0b;
  --brand-600: #d97706;
  --brand-700: #b45309;
  --brand-800: #92400e;
  --brand-900: #78350f;

  /* مشکی / خاکستری */
  --ink-950: #0a0a0a;
  --ink-900: #171717;
  --ink-800: #262626;
  --ink-700: #404040;
  --ink-600: #525252;
  --ink-500: #737373;
  --ink-400: #a3a3a3;
  --ink-300: #d4d4d4;
  --ink-200: #e5e5e5;
  --ink-100: #f5f5f5;
  --ink-50: #fafafa;

  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #0ea5e9;
  --success: #22c55e;

  /* سایه‌ها */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .1);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .15);
  --shadow-gold: 0 10px 30px rgba(245, 158, 11, .3);
  --shadow-gold-lg: 0 20px 50px rgba(245, 158, 11, .4);
  --shadow-dark: 0 8px 24px rgba(0, 0, 0, .2);

  /* شعاع */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --sidebar-w: 270px;
  --sidebar-w-collapsed: 76px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  background: var(--ink-50);
  color: var(--ink-800);
  direction: rtl;
}

body { margin: 0; overflow-x: hidden; }

a { color: var(--gold-700); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--gold-800); }

/* اسکرول‌بار سفارشی */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-100); }
::-webkit-scrollbar-thumb { background: var(--gold-400); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-500); }

/* ===== بوت‌استرپ اورراید ===== */
.btn { border-radius: var(--radius-sm); font-weight: 600; padding: .6rem 1.2rem; transition: all .2s ease; border: none; }
.btn-brand {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: #fff; box-shadow: var(--shadow-gold);
}
.btn-brand:hover {
  background: linear-gradient(135deg, var(--gold-600), var(--gold-700));
  color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-gold-lg);
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: var(--ink-900); font-weight: 700;
}
.btn-gold:hover { background: linear-gradient(135deg, var(--gold-500), var(--gold-600)); color: var(--ink-900); transform: translateY(-2px); }
.btn-dark {
  background: linear-gradient(135deg, var(--ink-800), var(--ink-900));
  color: var(--gold-400);
}
.btn-dark:hover { background: linear-gradient(135deg, var(--ink-900), var(--ink-950)); color: var(--gold-300); transform: translateY(-2px); }
.btn-outline-brand { color: var(--gold-700); border: 2px solid var(--gold-400); background: #fff; }
.btn-outline-brand:hover { background: var(--gold-50); color: var(--gold-800); border-color: var(--gold-500); }
.btn-outline-dark { color: var(--ink-800); border: 2px solid var(--ink-300); background: #fff; }
.btn-outline-dark:hover { background: var(--ink-900); color: var(--gold-400); border-color: var(--ink-900); }

.btn-sm { padding: .4rem .8rem; font-size: .82rem; }
.btn-lg { padding: .9rem 1.8rem; font-size: 1.05rem; }

.card {
  border: none; border-radius: var(--radius); box-shadow: var(--shadow-md);
  background: #fff; transition: box-shadow .2s, transform .2s;
}
.card-header {
  background: linear-gradient(135deg, var(--ink-900), var(--ink-800));
  color: var(--gold-400); border: none; font-weight: 700;
  padding: 1rem 1.25rem; border-radius: var(--radius) var(--radius) 0 0 !important;
  display: flex; align-items: center; gap: .5rem;
}
.card-header i { color: var(--gold-400); }
.card-body { padding: 1.25rem; }

.form-control, .form-select {
  border-radius: var(--radius-sm); border: 2px solid var(--ink-200);
  padding: .6rem .9rem; font-size: .95rem; transition: all .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--gold-400); box-shadow: 0 0 0 .25rem rgba(245, 158, 11, .15);
}
.form-label { font-weight: 600; color: var(--ink-700); margin-bottom: .35rem; font-size: .9rem; }
.text-muted { color: var(--ink-500) !important; }

.badge { font-weight: 600; padding: .4em .7em; border-radius: 8px; font-size: .78rem; }

.alert { border-radius: var(--radius-sm); border: none; padding: .85rem 1.1rem; }
.alert-success { background: #f0fdf4; color: #166534; }
.alert-danger { background: #fef2f2; color: #991b1b; }
.alert-warning { background: var(--gold-50); color: var(--gold-800); }
.alert-info { background: #f0f9ff; color: #075985; }

/* ===== Layout ===== */
.app-shell { display: flex; min-height: 100vh; }

/* ساید‌بار - تم مشکی/طلایی لوکس */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--ink-950) 0%, var(--ink-900) 100%);
  color: var(--ink-300);
  position: fixed; inset-block: 0; inset-inline-end: 0;
  display: flex; flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease;
  border-inline-start: 1px solid rgba(245, 158, 11, .15);
}
.sidebar-brand {
  padding: 1.5rem 1.5rem;
  display: flex; align-items: center; gap: .75rem;
  border-bottom: 1px solid rgba(245, 158, 11, .15);
  background: linear-gradient(135deg, rgba(245, 158, 11, .08), transparent);
}
.sidebar-brand .logo {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  display: grid; place-items: center; color: var(--ink-900); font-weight: 800; font-size: 1.3rem;
  box-shadow: var(--shadow-gold);
}
.sidebar-brand .title { font-weight: 800; color: var(--gold-400); font-size: 1.05rem; line-height: 1.2; }
.sidebar-brand .subtitle { font-size: .72rem; color: var(--ink-500); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: .85rem .75rem; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(245, 158, 11, .2); }

.nav-section-title {
  font-size: .68rem; color: var(--gold-600); text-transform: uppercase;
  letter-spacing: .1em; padding: 1rem 1rem .4rem; font-weight: 700;
}
.nav-link-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1rem; border-radius: var(--radius-sm);
  color: var(--ink-300); font-weight: 500; font-size: .92rem;
  margin-bottom: .15rem; transition: all .15s ease; position: relative;
}
.nav-link-item i { font-size: 1.1rem; width: 22px; text-align: center; }
.nav-link-item:hover { background: rgba(245, 158, 11, .08); color: var(--gold-400); }
.nav-link-item.active {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: var(--ink-900); box-shadow: var(--shadow-gold); font-weight: 700;
}
.nav-link-item .badge-count {
  margin-inline-start: auto; background: var(--gold-400); color: var(--ink-900);
  font-size: .68rem; padding: .15em .5em; border-radius: 20px; font-weight: 700;
}
.nav-link-item.active::before {
  content: ''; position: absolute; inset-inline-end: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: var(--ink-900); border-radius: 3px 0 0 3px;
}

.sidebar-footer { padding: .9rem 1.25rem; border-top: 1px solid rgba(245, 158, 11, .15); font-size: .76rem; color: var(--ink-500); }

/* محتوای اصلی */
.main-area { flex: 1; margin-inline-end: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: linear-gradient(135deg, #fff, var(--gold-50));
  border-bottom: 2px solid var(--gold-200);
  padding: .75rem 1.5rem; display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 1020;
  box-shadow: var(--shadow-sm);
}
.topbar .page-title { font-weight: 800; color: var(--ink-900); font-size: 1.05rem; margin: 0; }
.topbar .menu-toggle { display: none; background: none; border: none; font-size: 1.4rem; color: var(--ink-700); }

.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: .75rem; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--gold-200);
  background: #fff; display: grid; place-items: center; color: var(--ink-600);
  position: relative; transition: all .15s ease; cursor: pointer;
}
.icon-btn:hover { background: var(--gold-50); border-color: var(--gold-400); color: var(--gold-700); }
.icon-btn .dot {
  position: absolute; top: 6px; inset-inline-start: 6px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--danger);
  border: 2px solid #fff;
}

.user-chip {
  display: flex; align-items: center; gap: .55rem; padding: .35rem .75rem .35rem .35rem;
  border-radius: 30px; border: 2px solid var(--gold-200); background: #fff; cursor: pointer;
  transition: all .15s ease;
}
.user-chip:hover { border-color: var(--gold-400); background: var(--gold-50); }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: var(--ink-900); display: grid; place-items: center; font-weight: 800; font-size: .9rem;
}
.user-chip .uname { font-size: .85rem; font-weight: 600; color: var(--ink-700); }

.content { padding: 1.75rem; flex: 1; }
.page-header { margin-bottom: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.page-header h1 { font-size: 1.6rem; font-weight: 800; color: var(--ink-900); margin: 0; }
.page-header .sub { color: var(--ink-500); font-size: .9rem; margin-top: .2rem; }
.page-header .actions { margin-inline-start: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

/* کارت آمار - تم طلایی */
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--shadow-md); position: relative; overflow: hidden;
  border: 1px solid var(--ink-100); height: 100%;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card .stat-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.5rem; margin-bottom: .85rem;
}
.stat-card .stat-value { font-size: 1.75rem; font-weight: 800; color: var(--ink-900); line-height: 1; }
.stat-card .stat-label { color: var(--ink-500); font-size: .85rem; margin-top: .3rem; font-weight: 500; }
.stat-card .stat-trend { font-size: .78rem; margin-top: .6rem; font-weight: 600; }
.stat-card .stat-mini-bar { height: 4px; border-radius: 4px; background: var(--ink-100); margin-top: .85rem; overflow: hidden; }
.stat-card .stat-mini-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-400), var(--gold-600)); border-radius: 4px; }

.bg-brand-soft { background: var(--gold-100); color: var(--gold-700); }
.bg-gold-soft { background: var(--gold-100); color: var(--gold-700); }
.bg-info-soft { background: #f0f9ff; color: var(--info); }
.bg-danger-soft { background: #fef2f2; color: var(--danger); }
.bg-success-soft { background: #f0fdf4; color: var(--success); }

/* جدول */
.table-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-md); overflow: hidden; }
.table { margin: 0; }
.table thead th { background: var(--ink-900); color: var(--gold-400); font-weight: 700; font-size: .82rem; border-bottom: 2px solid var(--gold-500); padding: .85rem 1rem; white-space: nowrap; }
.table tbody td { padding: .85rem 1rem; border-bottom: 1px solid var(--ink-100); vertical-align: middle; font-size: .9rem; }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: var(--gold-50); }

/* فیلترها */
.filter-bar { background: #fff; border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow-sm); margin-bottom: 1.25rem; display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; border: 1px solid var(--ink-100); }
.filter-bar .form-group { min-width: 160px; flex: 1; }
.filter-bar .form-group .form-label { font-size: .78rem; }

/* فرم احراز هویت - تم لوکس */
.auth-wrap {
  min-height: 100vh; display: grid;
  background: linear-gradient(135deg, var(--ink-950), var(--ink-800));
  position: relative; overflow: hidden;
}
.auth-wrap::before {
  content: ''; position: absolute; width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, .3), transparent 70%);
  top: -200px; inset-inline-start: -150px;
}
.auth-wrap::after {
  content: ''; position: absolute; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, .15), transparent 70%);
  bottom: -150px; inset-inline-end: -100px;
}
.auth-card {
  background: rgba(255, 255, 255, .98); backdrop-filter: blur(20px);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 2.5rem; width: 100%; max-width: 460px; margin: auto; position: relative; z-index: 2;
  border: 1px solid rgba(245, 158, 11, .2);
}
.auth-card.wide { max-width: 760px; }
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand .logo {
  width: 72px; height: 72px; border-radius: 20px; margin: 0 auto .85rem;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  display: grid; place-items: center; color: var(--ink-900); font-weight: 800; font-size: 2rem;
  box-shadow: var(--shadow-gold);
}
.auth-brand h1 { font-size: 1.5rem; font-weight: 800; color: var(--ink-900); margin: 0; }
.auth-brand p { color: var(--ink-500); font-size: .9rem; margin: .3rem 0 0; }

/* تایم‌لاین */
.timeline { position: relative; padding-inline-start: 1.5rem; }
.timeline::before { content: ''; position: absolute; inset-inline-start: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--gold-200); }
.timeline-item { position: relative; padding-bottom: 1.25rem; }
.timeline-item::before {
  content: ''; position: absolute; inset-inline-start: -1.5rem; top: 4px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  border: 3px solid var(--gold-500); box-shadow: 0 0 0 4px var(--gold-50);
}
.timeline-item .t-content { background: #fff; border: 1px solid var(--ink-200); border-radius: var(--radius-sm); padding: .85rem 1rem; box-shadow: var(--shadow-sm); }

/* اعلان‌ها */
.notif-item { padding: .85rem 1rem; border-bottom: 1px solid var(--ink-100); display: flex; gap: .75rem; cursor: pointer; transition: background .12s; }
.notif-item:hover { background: var(--gold-50); }
.notif-item.unread { background: var(--gold-50); border-inline-start: 3px solid var(--gold-500); }
.notif-item .n-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }

/* فوتر */
.app-footer {
  background: linear-gradient(135deg, var(--ink-900), var(--ink-950));
  color: var(--ink-400); padding: 1rem 1.5rem; text-align: center; font-size: .82rem;
  margin-top: auto; border-top: 2px solid var(--gold-500);
}
.app-footer span { color: var(--gold-400); font-weight: 600; }

/* خالی */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--ink-500); }
.empty-state i { font-size: 3rem; color: var(--gold-300); margin-bottom: 1rem; }
.empty-state h4 { color: var(--ink-600); font-weight: 700; }
.empty-state p { margin: .5rem 0 1.25rem; }

/* اعلام موجودی سریع */
.quick-inv-card {
  background: linear-gradient(135deg, #fff, var(--gold-50));
  border: 2px solid var(--gold-200); border-radius: var(--radius);
  padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1rem;
}
.quick-inv-card .qi-icon { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: var(--ink-900); display: grid; place-items: center; font-size: 1.3rem; }

/* چارت ساده */
.bar-chart { display: flex; align-items: flex-end; gap: .5rem; height: 140px; padding: .5rem 0; }
.bar-chart .bar { flex: 1; background: linear-gradient(180deg, var(--gold-300), var(--gold-600)); border-radius: 6px 6px 0 0; position: relative; min-height: 4px; transition: all .2s; }
.bar-chart .bar:hover { filter: brightness(1.15); }
.bar-chart .bar .bar-label { position: absolute; bottom: -22px; inset-inline: 0; text-align: center; font-size: .7rem; color: var(--ink-500); }

/* پالس زنگوله */
@keyframes ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(12deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
.icon-btn:hover .fa-bell { animation: ring .8s ease; }

/* اسکلتون */
.skeleton { background: linear-gradient(90deg, var(--ink-100), var(--ink-50), var(--ink-100)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* واکنش‌گرا */
@media (max-width: 992px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.show { transform: translateX(0); }
  .main-area { margin-inline-end: 0; }
  .topbar .menu-toggle { display: block; }
  .content { padding: 1.25rem 1rem; }
}

.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 1035;
  opacity: 0; visibility: hidden; transition: all .25s;
}
.sidebar-backdrop.show { opacity: 1; visibility: visible; }

/* اعداد فارسی */
.fa-num { font-feature-settings: 'ss01'; }

/* متن کمکی */
.text-brand { color: var(--gold-700) !important; }
.text-gold { color: var(--gold-600) !important; }
.bg-brand { background: linear-gradient(135deg, var(--gold-500), var(--gold-600)) !important; }
.text-dark { color: var(--ink-900) !important; }

.divider { height: 1px; background: var(--ink-200); margin: 1.25rem 0; }

/* لینک‌های متمایز */
.link-card {
  display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem;
  background: #fff; border: 2px solid var(--ink-200); border-radius: var(--radius);
  transition: all .18s ease; color: var(--ink-700);
}
.link-card:hover { border-color: var(--gold-400); box-shadow: var(--shadow-md); color: var(--ink-900); transform: translateY(-2px); }
.link-card .lc-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; }

/* ============================================================
   بهبودهای فاز ۲ — استایل پیشرفته
   ============================================================ */

.stat-card .stat-top { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-card .stat-trend.up { color: var(--success); }
.stat-card .stat-trend.down { color: var(--danger); }

.chart-card { background: #fff; border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-md); }
.chart-card .chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.chart-card .chart-head h5 { margin: 0; font-weight: 700; font-size: 1rem; color: var(--ink-900); }
.chart-legend { display: flex; gap: .85rem; font-size: .75rem; color: var(--ink-500); }
.chart-legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: .35rem; }

.donut {
  --p: 65; --c: var(--gold-500); --b: 12px; --s: var(--ink-100);
  width: 130px; aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--s) 0);
  display: grid; place-items: center; position: relative; margin: 0 auto;
}
.donut::before { content: ''; position: absolute; inset: var(--b); background: #fff; border-radius: 50%; }
.donut .donut-label { position: relative; text-align: center; z-index: 1; }
.donut .donut-label .v { font-size: 1.4rem; font-weight: 800; color: var(--ink-900); }
.donut .donut-label .l { font-size: .7rem; color: var(--ink-500); }

.progress-stack { display: flex; flex-direction: column; gap: .9rem; }
.progress-row { }
.progress-row .pr-head { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: .35rem; }
.progress-row .pr-head .pr-label { color: var(--ink-600); font-weight: 600; }
.progress-row .pr-head .pr-val { color: var(--ink-500); font-weight: 700; }
.progress { height: 8px; border-radius: 6px; background: var(--ink-100); overflow: hidden; }
.progress-bar { background: linear-gradient(90deg, var(--gold-400), var(--gold-600)); border-radius: 6px; transition: width 1s ease; }
.progress-bar.gold { background: linear-gradient(90deg, var(--gold-300), var(--gold-600)); }
.progress-bar.info { background: linear-gradient(90deg, #38bdf8, var(--info)); }
.progress-bar.danger { background: linear-gradient(90deg, #fb7185, var(--danger)); }

.badge.bg-success { background: linear-gradient(135deg, var(--success), #16a34a) !important; }
.badge.bg-warning { background: linear-gradient(135deg, var(--gold-400), var(--gold-600)) !important; color: var(--ink-900) !important; }
.badge.bg-info { background: linear-gradient(135deg, #38bdf8, var(--info)) !important; }
.badge.bg-danger { background: linear-gradient(135deg, #fb7185, var(--danger)) !important; }

.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .9rem; flex-shrink: 0; }
.avatar.a1 { background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: var(--ink-900); }
.avatar.a2 { background: linear-gradient(135deg, #fbbf24, #d97706); color: var(--ink-900); }
.avatar.a3 { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.avatar.a4 { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.avatar.a5 { background: linear-gradient(135deg, #fb7185, #e11d48); }
.avatar.sm { width: 32px; height: 32px; font-size: .78rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.2rem; }

.image-upload-area {
  border: 2px dashed var(--gold-300); border-radius: var(--radius);
  padding: 1.5rem; text-align: center; cursor: pointer; transition: all .2s;
  background: var(--gold-50); position: relative; min-height: 160px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.image-upload-area:hover { border-color: var(--gold-500); background: var(--gold-100); }
.image-upload-area.has-image { padding: 0; border-style: solid; }
.image-upload-area .iu-icon { font-size: 2.2rem; color: var(--gold-500); margin-bottom: .5rem; }
.image-upload-area .iu-text { font-size: .85rem; color: var(--ink-500); }
.image-upload-area .iu-text strong { color: var(--gold-700); }
.image-upload-area img.preview { width: 100%; height: 160px; object-fit: cover; border-radius: var(--radius); }
.image-upload-area input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.global-search { position: relative; width: 280px; max-width: 35vw; }
.global-search input { padding-inline-start: 2.4rem; border-radius: 30px; background: var(--ink-50); border-color: transparent; }
.global-search input:focus { background: #fff; border-color: var(--gold-400); }
.global-search .gs-icon { position: absolute; inset-inline-start: .9rem; top: 50%; transform: translateY(-50%); color: var(--ink-400); }
.global-search .gs-results { position: absolute; top: calc(100% + 6px); inset-inline: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 360px; overflow-y: auto; display: none; z-index: 1050; }
.global-search .gs-results.show { display: block; }
.global-search .gs-group-title { padding: .5rem 1rem .25rem; font-size: .7rem; color: var(--gold-700); font-weight: 700; text-transform: uppercase; }
.global-search .gs-item { padding: .65rem 1rem; display: flex; gap: .65rem; align-items: center; cursor: pointer; }
.global-search .gs-item:hover { background: var(--gold-50); }
.global-search .gs-item .gs-icon-wrap { width: 32px; height: 32px; border-radius: 8px; background: var(--gold-100); display: grid; place-items: center; color: var(--gold-700); }
.global-search .gs-empty { padding: 1.5rem; text-align: center; color: var(--ink-400); font-size: .85rem; }

.activity-feed { display: flex; flex-direction: column; gap: .15rem; }
.activity-item { display: flex; gap: .85rem; padding: .75rem 0; border-bottom: 1px solid var(--ink-100); }
.activity-item:last-child { border-bottom: none; }
.activity-item .a-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: .9rem; }
.activity-item .a-body { flex: 1; min-width: 0; }
.activity-item .a-title { font-size: .88rem; color: var(--ink-800); font-weight: 600; }
.activity-item .a-meta { font-size: .75rem; color: var(--ink-500); margin-top: .15rem; }

.hero-card {
  background: linear-gradient(135deg, var(--ink-950), var(--ink-800));
  border-radius: var(--radius); padding: 1.75rem; color: #fff;
  position: relative; overflow: hidden;
  border: 1px solid rgba(245, 158, 11, .2);
}
.hero-card::before {
  content: ''; position: absolute; inset-inline-start: -100px; bottom: -100px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, .35), transparent 70%);
}
.hero-card::after {
  content: ''; position: absolute; inset-inline-end: -50px; top: -50px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, .2), transparent 70%);
}
.hero-card > * { position: relative; z-index: 1; }
.hero-card h2 { font-weight: 800; margin: 0 0 .3rem; color: #fff; }
.hero-card p { opacity: .85; margin: 0 0 1rem; }
.hero-card .hero-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1rem; }
.hero-card .hero-stat { background: rgba(245, 158, 11, .15); backdrop-filter: blur(10px); border-radius: 12px; padding: .65rem 1rem; border: 1px solid rgba(245, 158, 11, .3); }
.hero-card .hero-stat .v { font-size: 1.3rem; font-weight: 800; color: var(--gold-400); }
.hero-card .hero-stat .l { font-size: .72rem; opacity: .8; }

.sidebar-user { padding: 1rem 1.25rem; border-top: 1px solid rgba(245, 158, 11, .15); display: flex; align-items: center; gap: .65rem; color: var(--ink-300); }

.spinner-brand { width: 18px; height: 18px; border: 2px solid rgba(245, 158, 11, .3); border-top-color: var(--gold-500); border-radius: 50%; animation: spin .6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeInUp .35s ease; }

.sticky-filter { position: sticky; top: 64px; z-index: 1010; }

.card-accent { border-inline-start: 4px solid var(--gold-500); }
.card-accent.gold { border-inline-start-color: var(--gold-500); }
.card-accent.info { border-inline-start-color: var(--info); }
.card-accent.danger { border-inline-start-color: var(--danger); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.product-card { background: #fff; border: 2px solid var(--ink-200); border-radius: var(--radius); overflow: hidden; transition: all .2s; }
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--gold-400); }
.product-card .pc-img { width: 100%; height: 140px; object-fit: cover; background: var(--ink-100); }
.product-card .pc-body { padding: .9rem; }
.product-card .pc-name { font-weight: 700; color: var(--ink-800); margin-bottom: .25rem; }
.product-card .pc-meta { font-size: .75rem; color: var(--ink-500); }
.product-card .pc-footer { padding: .65rem .9rem; border-top: 1px solid var(--ink-100); display: flex; justify-content: space-between; align-items: center; }

.workflow { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.workflow-step { display: flex; align-items: center; gap: .5rem; color: var(--ink-400); font-size: .82rem; }
.workflow-step .ws-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--ink-100); display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--ink-500); }
.workflow-step.active .ws-dot { background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: var(--ink-900); }
.workflow-step.active { color: var(--gold-700); font-weight: 600; }
.workflow-step.done .ws-dot { background: var(--success); color: #fff; }
.workflow-step.done { color: var(--ink-700); }
.workflow-arrow { color: var(--ink-300); margin: 0 .5rem; font-size: .7rem; }

[data-tooltip] { position: relative; }
[data-tooltip]:hover::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 6px); inset-inline-start: 50%; transform: translateX(50%); background: var(--ink-900); color: var(--gold-400); padding: .35rem .65rem; border-radius: 6px; font-size: .72rem; white-space: nowrap; z-index: 1070; }

.code-chip { font-family: 'Vazirmatn', monospace; background: var(--gold-100); color: var(--gold-800); padding: .15em .5em; border-radius: 6px; font-size: .82em; }

.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--ink-100); border: 1px solid var(--gold-200); }
.thumb-placeholder { width: 44px; height: 44px; border-radius: 8px; background: var(--gold-50); display: grid; place-items: center; color: var(--gold-500); border: 1px solid var(--gold-200); }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }

.mobile-bottom-nav { display: none; position: fixed; bottom: 0; inset-inline: 0; background: #fff; border-top: 2px solid var(--gold-200); padding: .35rem; z-index: 1020; }
.mobile-bottom-nav a { flex: 1; text-align: center; padding: .4rem; color: var(--ink-500); font-size: .68rem; border-radius: 10px; }
.mobile-bottom-nav a i { display: block; font-size: 1.2rem; margin-bottom: .15rem; }
.mobile-bottom-nav a.active { color: var(--gold-700); background: var(--gold-100); }
@media (max-width: 768px) {
  .mobile-bottom-nav { display: flex; }
  .app-footer { padding-bottom: 4.5rem; }
  .content { padding-bottom: 4rem; }
}

/* ============================================================
   حالت تاریک (Dark Mode) - تم طلایی
   ============================================================ */
html[data-bs-theme="dark"] {
  --ink-50: #0a0a0a;
  --ink-100: #171717;
  --ink-200: #262626;
  --ink-300: #404040;
  --ink-400: #525252;
  --ink-500: #737373;
  --ink-600: #a3a3a3;
  --ink-700: #d4d4d4;
  --ink-800: #e5e5e5;
  --ink-900: #f5f5f5;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .5);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
}

html[data-bs-theme="dark"] body { background: #0a0a0a; color: var(--ink-700); }
html[data-bs-theme="dark"] .card, html[data-bs-theme="dark"] .topbar, html[data-bs-theme="dark"] .app-footer { background: #171717; }
html[data-bs-theme="dark"] .card-header { background: linear-gradient(135deg, #0a0a0a, #171717) !important; }
html[data-bs-theme="dark"] .table thead th { background: #0a0a0a; color: var(--gold-400); }
html[data-bs-theme="dark"] .table-hover tbody tr:hover { background: rgba(245, 158, 11, .08); }
html[data-bs-theme="dark"] .form-control, html[data-bs-theme="dark"] .form-select { background: #0a0a0a; border-color: var(--ink-200); color: var(--ink-700); }
html[data-bs-theme="dark"] .form-control:focus, html[data-bs-theme="dark"] .form-select:focus { background: #0a0a0a; color: var(--ink-700); }
html[data-bs-theme="dark"] .input-group-text { background: var(--ink-100); border-color: var(--ink-200); color: var(--ink-500); }
html[data-bs-theme="dark"] .stat-card { background: #171717; border-color: var(--ink-200); }
html[data-bs-theme="dark"] .chart-card { background: #171717; }
html[data-bs-theme="dark"] .notif-item:hover { background: var(--ink-100); }
html[data-bs-theme="dark"] .notif-item.unread { background: rgba(245, 158, 11, .12); }
html[data-bs-theme="dark"] .dropdown-menu { background: #171717; border-color: var(--ink-200); }
html[data-bs-theme="dark"] .dropdown-item { color: var(--ink-600); }
html[data-bs-theme="dark"] .dropdown-item:hover { background: var(--ink-100); }
html[data-bs-theme="dark"] .user-chip { background: #171717; border-color: var(--ink-200); }
html[data-bs-theme="dark"] .icon-btn { background: #171717; border-color: var(--ink-200); color: var(--ink-500); }
html[data-bs-theme="dark"] .link-card { background: #171717; border-color: var(--ink-200); color: var(--ink-600); }
html[data-bs-theme="dark"] .image-upload-area { background: var(--ink-100); border-color: var(--gold-700); }
html[data-bs-theme="dark"] .donut::before { background: #171717; }
html[data-bs-theme="dark"] .code-chip { background: var(--ink-100); color: var(--gold-400); }
html[data-bs-theme="dark"] .alert-info { background: rgba(14, 165, 233, .12); color: #7dd3fc; }
html[data-bs-theme="dark"] .alert-success { background: rgba(34, 197, 94, .12); color: #86efac; }
html[data-bs-theme="dark"] .alert-warning { background: rgba(245, 158, 11, .12); color: var(--gold-300); }
html[data-bs-theme="dark"] .alert-danger { background: rgba(239, 68, 68, .12); color: #fca5a5; }
html[data-bs-theme="dark"] .quick-inv-card { background: linear-gradient(135deg, #171717, rgba(245, 158, 11, .08)); }
html[data-bs-theme="dark"] .timeline-item .t-content { background: #171717; border-color: var(--ink-200); }
html[data-bs-theme="dark"] .text-muted { color: var(--ink-400) !important; }
html[data-bs-theme="dark"] .bg-light { background: var(--ink-100) !important; }

.theme-toggle {
  width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--gold-200);
  background: #fff; display: grid; place-items: center; color: var(--ink-600);
  cursor: pointer; transition: all .2s ease; position: relative;
}
.theme-toggle:hover { background: var(--gold-50); border-color: var(--gold-400); color: var(--gold-700); }
.theme-toggle .sun-icon, .theme-toggle .moon-icon { transition: transform .4s ease, opacity .2s; }
html[data-bs-theme="dark"] .theme-toggle { background: #171717; border-color: var(--ink-200); color: var(--gold-400); }
.theme-toggle .moon-icon { display: none; }
html[data-bs-theme="dark"] .theme-toggle .sun-icon { display: none; }
html[data-bs-theme="dark"] .theme-toggle .moon-icon { display: block; }

@media print {
  .sidebar, .topbar, .app-footer, .mobile-bottom-nav, .no-print { display: none !important; }
  .main-area { margin: 0 !important; }
  .content { padding: 0 !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}

/* ============================================================
   بهبودهای فاز ۳ — انیمیشن‌ها، polish
   ============================================================ */

.filter-chip {
  display: inline-block; padding: .45rem 1rem; border-radius: 20px;
  background: #fff; color: var(--ink-600); font-size: .82rem; font-weight: 600;
  border: 2px solid var(--ink-200); cursor: pointer; transition: all .15s;
  margin-inline-end: .35rem; margin-bottom: .35rem; text-decoration: none;
}
.filter-chip:hover { border-color: var(--gold-400); color: var(--gold-700); background: var(--gold-50); }
.filter-chip.active { background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: var(--ink-900); border-color: var(--gold-500); box-shadow: var(--shadow-gold); }

input[type="date"] { cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }

.note-item { transition: all .15s; }
.note-item:hover { box-shadow: var(--shadow-sm); }
.note-item .note-body { white-space: pre-wrap; line-height: 1.6; color: var(--ink-700); }

.ticket-message { border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.ticket-message.staff { background: linear-gradient(135deg, var(--gold-50), #fff); border-inline-start: 4px solid var(--gold-500); }
.ticket-message.user { background: linear-gradient(135deg, #f0f9ff, #fff); border-inline-start: 4px solid var(--info); }

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-inline-end: .4rem; }
.status-dot.online { background: var(--success); box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.status-dot.offline { background: var(--ink-400); }
.status-dot.pending { background: var(--gold-500); box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }

@keyframes pulse-gold { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .4); } 50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); } }
.status-pulse { animation: pulse-gold 2s infinite; }

@keyframes badge-bounce { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.badge-count { animation: badge-bounce 1s ease-in-out infinite; }

*:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }

.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.quick-action {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 1rem .75rem; background: #fff; border: 2px solid var(--ink-200);
  border-radius: var(--radius); text-decoration: none; color: var(--ink-700);
  transition: all .2s ease; text-align: center;
}
.quick-action:hover { border-color: var(--gold-400); box-shadow: var(--shadow-md); transform: translateY(-3px); color: var(--gold-700); }
.quick-action .qa-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; transition: transform .2s; }
.quick-action:hover .qa-icon { transform: scale(1.1); }
.quick-action .qa-label { font-size: .82rem; font-weight: 600; }

.fade-in > .row > * { animation: fadeInUp .4s ease backwards; }
.fade-in > .row > *:nth-child(1) { animation-delay: .05s; }
.fade-in > .row > *:nth-child(2) { animation-delay: .1s; }
.fade-in > .row > *:nth-child(3) { animation-delay: .15s; }
.fade-in > .row > *:nth-child(4) { animation-delay: .2s; }
.fade-in > .row > *:nth-child(5) { animation-delay: .25s; }
.fade-in > .row > *:nth-child(6) { animation-delay: .3s; }

/* Holoo integration badge */
.holoo-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .65rem; border-radius: 20px; font-size: .72rem; font-weight: 700;
  background: linear-gradient(135deg, var(--gold-100), var(--gold-200));
  color: var(--gold-800); border: 1px solid var(--gold-300);
}
.holoo-badge.connected { background: linear-gradient(135deg, #f0fdf4, #dcfce7); color: #166534; border-color: #86efac; }
.holoo-badge.disconnected { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }

/* Pet shop icon accents */
.paw-accent { color: var(--gold-500); }

/* ============================================================
   ریسپانسیو جامع - موبایل / تبلت / دسکتاپ
   اصلاح باگ RTL: سایدبار در RTL از سمت چپ باز می‌شود
   ============================================================ */

/* --- تبلت و موبایل (≤ 992px) --- */
@media (max-width: 992px) {
  /* سایدبار: در RTL، inset-inline-end=0 یعنی چپ.
     پس برای مخفی‌کردن باید به چپ (translateX(-100%)) حرکت کند. */
  .sidebar {
    transform: translateX(-100%);
    z-index: 1050;
    box-shadow: 4px 0 32px rgba(0,0,0,.4);
    max-width: 85vw;
  }
  .sidebar.show { transform: translateX(0); }
  .main-area { margin-inline-end: 0; }
  .topbar .menu-toggle {
    display: flex !important;
    align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--ink-100); color: var(--ink-700);
    border: none; font-size: 1.2rem; cursor: pointer;
  }
  .content { padding: 1rem .75rem 5rem; }
  .topbar { padding: .6rem 1rem; }
  .global-search { width: 180px; max-width: 25vw; }
  .page-header h1 { font-size: 1.3rem; }
  .stat-card .stat-value { font-size: 1.4rem; }
  .hero-card { padding: 1.25rem; }
  .hero-card h2 { font-size: 1.3rem; }
  .chart-card { padding: 1rem; }
  .bar-chart { height: 120px; }
  .card-body { padding: 1rem; }
  .table thead th, .table tbody td { padding: .6rem .5rem; font-size: .82rem; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .user-chip .uname { display: none; }
  .icon-btn { width: 38px; height: 38px; }
  .theme-toggle { width: 38px; height: 38px; }
  .btn-lg { padding: .7rem 1.2rem; font-size: .95rem; }
}

/* --- موبایل (≤ 768px) --- */
@media (max-width: 768px) {
  .mobile-bottom-nav { display: flex !important; }
  .app-footer { padding-bottom: 4.5rem; font-size: .75rem; }
  .content { padding: .75rem .5rem 5rem; }
  .topbar { padding: .5rem .75rem; gap: .5rem; flex-wrap: nowrap; }
  .topbar .page-title {
    font-size: .85rem; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 45vw;
  }
  .global-search { display: none !important; }
  .page-header {
    margin-bottom: 1rem;
    flex-direction: column; align-items: stretch; gap: .5rem;
  }
  .page-header h1 { font-size: 1.1rem; }
  .page-header .sub { font-size: .78rem; }
  .page-header .actions { margin-inline-start: 0; }
  .page-header .actions .btn {
    flex: 1; font-size: .82rem; padding: .5rem .75rem;
  }

  /* کارت‌های آمار - ۲ ستونه در موبایل */
  .row.g-3 > [class*="col-"] { padding: .35rem; }

  .stat-card { padding: .85rem; }
  .stat-card .stat-top { flex-direction: column; gap: .5rem; }
  .stat-card .stat-icon { width: 38px; height: 38px; font-size: 1.1rem; margin-bottom: .4rem; }
  .stat-card .stat-value { font-size: 1.15rem; }
  .stat-card .stat-label { font-size: .72rem; }
  .stat-card .stat-trend { font-size: .68rem; }
  .stat-card .stat-mini-bar { margin-top: .5rem; }

  .hero-card { padding: 1rem; }
  .hero-card h2 { font-size: 1.1rem; }
  .hero-card p { font-size: .82rem; }
  .hero-card .hero-stats { gap: .5rem; flex-wrap: wrap; }
  .hero-card .hero-stat { padding: .4rem .6rem; }
  .hero-card .hero-stat .v { font-size: 1rem; }
  .hero-card .hero-stat .l { font-size: .62rem; }
  .hero-card .hero-cta { flex-direction: column; }
  .hero-card .hero-cta .btn { width: 100%; }

  .card { border-radius: 12px; margin-bottom: .75rem; }
  .card-header { padding: .75rem 1rem; font-size: .85rem; }
  .card-body { padding: .75rem; }

  /* جداول - اسکرول افقی */
  .table { font-size: .75rem; min-width: 500px; }
  .table thead th { padding: .45rem .3rem; font-size: .68rem; white-space: nowrap; }
  .table tbody td { padding: .45rem .3rem; font-size: .75rem; }
  .table-responsive { -webkit-overflow-scrolling: touch; }

  .filter-bar {
    padding: .5rem; flex-direction: column; gap: .5rem;
  }
  .filter-bar .form-group { min-width: 100%; }
  .filter-bar .form-group .form-label { font-size: .72rem; }
  .filter-bar .btn { width: 100%; }

  .chart-card { padding: .75rem; }
  .chart-card .chart-head h5 { font-size: .85rem; }
  .chart-card .chart-head { flex-wrap: wrap; gap: .5rem; }
  .bar-chart { height: 100px; gap: .3rem; }
  .bar-chart .bar .bar-label { font-size: .6rem; }
  .donut { width: 90px; }
  .donut .donut-label .v { font-size: 1rem; }
  .donut .donut-label .l { font-size: .62rem; }

  .btn { padding: .5rem .8rem; font-size: .82rem; }
  .btn-sm { padding: .3rem .55rem; font-size: .72rem; }
  .btn-lg { padding: .6rem 1rem; font-size: .88rem; }

  .badge { font-size: .68rem; padding: .3em .5em; }
  .alert { padding: .6rem .8rem; font-size: .8rem; }
  .form-control, .form-select { padding: .5rem .7rem; font-size: .85rem; }
  .form-label { font-size: .8rem; }

  .quick-actions { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .quick-action { padding: .7rem .5rem; }
  .quick-action .qa-icon { width: 34px; height: 34px; font-size: .95rem; }
  .quick-action .qa-label { font-size: .68rem; }

  .link-card { padding: .75rem; }
  .link-card .lc-icon { width: 36px; height: 36px; font-size: 1rem; }

  .product-card .pc-img-wrap { height: 120px; }
  .product-card .pc-body { padding: .6rem; }
  .product-card .pc-name { font-size: .8rem; }
  .product-card .pc-footer { padding: .5rem .6rem; }

  .icon-btn { width: 36px; height: 36px; font-size: .82rem; }
  .theme-toggle { width: 36px; height: 36px; font-size: .82rem; }
  .user-chip { padding: .2rem .4rem .2rem .2rem; border-radius: 24px; }
  .user-avatar { width: 28px; height: 28px; font-size: .72rem; }

  .sidebar { width: 250px; max-width: 80vw; }
  .sidebar-brand { padding: 1rem; }
  .sidebar-brand .logo { width: 38px; height: 38px; font-size: 1rem; }
  .sidebar-brand .title { font-size: .9rem; }
  .nav-link-item { padding: .55rem .75rem; font-size: .82rem; }
  .nav-link-item i { font-size: 1rem; }
  .nav-section-title { font-size: .62rem; padding: .7rem .75rem .3rem; }

  .timeline { padding-inline-start: 1.25rem; }
  .timeline-item .t-content { padding: .6rem .75rem; }
  .timeline-item::before { width: 14px; height: 14px; }

  .empty-state { padding: 2rem 1rem; }
  .empty-state i { font-size: 2.2rem; }
  .empty-state h4 { font-size: .9rem; }
  .empty-state p { font-size: .78rem; }

  .row { --bs-gutter-x: .5rem; --bs-gutter-y: .5rem; }
  .dropdown-menu { min-width: 180px; font-size: .82rem; }
  .image-upload-area { min-height: 110px; padding: .75rem; }
  .image-upload-area .iu-icon { font-size: 1.6rem; }
  .quick-inv-card { padding: .75rem; flex-wrap: wrap; }
  .quick-inv-card .btn { width: 100%; margin-top: .5rem; }
  .note-item { padding: .6rem; }
  .progress-stack { gap: .6rem; }
  .progress { height: 6px; }
  .notif-item { padding: .6rem .75rem; }
  .notif-item .n-icon { width: 32px; height: 32px; }
}

/* --- موبایل کوچک (≤ 576px) --- */
@media (max-width: 576px) {
  .content { padding: .5rem .4rem 5rem; }
  .topbar { padding: .4rem .5rem; }
  .topbar .page-title { font-size: .78rem; max-width: 38vw; }
  .page-header h1 { font-size: .95rem; }
  .stat-card { padding: .65rem; }
  .stat-card .stat-value { font-size: .95rem; }
  .stat-card .stat-icon { width: 32px; height: 32px; font-size: .9rem; }
  .stat-card .stat-label { font-size: .65rem; }
  .card-header { padding: .6rem .75rem; font-size: .78rem; }
  .card-body { padding: .5rem; }
  .table { font-size: .7rem; min-width: 400px; }
  .table thead th { padding: .35rem .2rem; font-size: .62rem; }
  .table tbody td { padding: .35rem .2rem; font-size: .7rem; }
  .hero-card { padding: .75rem; }
  .hero-card h2 { font-size: .95rem; }
  .hero-card p { font-size: .75rem; }
  .hero-card .hero-stat .v { font-size: .85rem; }
  .hero-card .hero-stat .l { font-size: .55rem; }
  .btn { padding: .42rem .65rem; font-size: .76rem; }
  .filter-bar { padding: .35rem; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .bar-chart { height: 80px; }
  .donut { width: 75px; }
  .badge { font-size: .6rem; padding: .2em .35em; }
  .form-control, .form-select { padding: .42rem .55rem; font-size: .78rem; }
  .alert { padding: .5rem .6rem; font-size: .75rem; }
  .empty-state { padding: 1.5rem .5rem; }
  .empty-state i { font-size: 1.8rem; }
  .image-upload-area { min-height: 90px; }
  .nav-link-item { padding: .5rem .6rem; font-size: .76rem; }
  .sidebar-brand { padding: .7rem; }
  .sidebar-brand .logo { width: 34px; height: 34px; }
  .sidebar-brand .title { font-size: .82rem; }
}

/* --- Home page responsive --- */
@media (max-width: 768px) {
  .hero-section { padding: 2rem 1rem; }
  .hero-title { font-size: 1.5rem !important; }
  .hero-subtitle { font-size: .88rem; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
  .hero-stats { gap: 1rem; }
  .hero-stat .v { font-size: 1.4rem; }
  .feature-section { padding: 2rem 1rem; }
  .section-title h2 { font-size: 1.3rem; }
  .product-section { padding: 1.5rem .75rem; }
  .home-nav .nav-links { display: none !important; }
  .home-nav { padding: .5rem .75rem; }
  .home-footer { padding: 2rem 1rem 1rem; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-card { padding: 1.5rem .75rem; }
  .feature-icon { width: 48px; height: 48px; font-size: 1.4rem; }
  .product-section-header h3 { font-size: 1rem; }
  .product-section-header .view-all { font-size: .78rem; }
}
@media (max-width: 576px) {
  .hero-section { padding: 1.5rem .75rem; }
  .hero-title { font-size: 1.2rem !important; }
  .hero-subtitle { font-size: .8rem; }
  .hero-stats { flex-wrap: wrap; justify-content: center; }
  .hero-stat .v { font-size: 1.1rem; }
  .section-title h2 { font-size: 1.1rem; }
  .section-title p { font-size: .8rem; }
  .feature-card { padding: 1rem .5rem; }
  .feature-card h4 { font-size: .85rem; }
  .feature-card p { font-size: .75rem; }
  .category-grid { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .category-card { padding: 1rem .5rem; }
  .category-card i { font-size: 1.5rem; }
  .product-card .pc-img-wrap { height: 100px; }
  .home-nav .nav-logo span { font-size: 1rem; }
}

/* --- Auth pages responsive --- */
@media (max-width: 576px) {
  .auth-card { padding: 1.5rem 1rem; margin: .5rem; }
  .auth-card.wide { max-width: 100%; }
  .auth-brand .logo { width: 56px; height: 56px; font-size: 1.5rem; }
  .auth-brand h1 { font-size: 1.2rem; }
  .auth-brand p { font-size: .82rem; }
  .auth-wrap { padding: 0; }
}

/* --- Storefront responsive --- */
@media (max-width: 768px) {
  .catalog-hero { padding: 2rem 1rem; }
  .catalog-hero h1 { font-size: 1.5rem; }
  .catalog-search { max-width: 100%; }
  .catalog-topbar { padding: .5rem .75rem; }
  .catalog-topbar .ct-logo span { font-size: 1rem; }
  .product-detail-img, .product-detail-img-placeholder { height: 250px; }
}
@media (max-width: 576px) {
  .catalog-hero { padding: 1.5rem .75rem; }
  .catalog-hero h1 { font-size: 1.2rem; }
  .catalog-hero p { font-size: .8rem; }
  .filter-chip { font-size: .72rem; padding: .35rem .7rem; }
  .product-detail-img, .product-detail-img-placeholder { height: 200px; }
}

/* --- Print --- */
@media print {
  .sidebar, .topbar, .app-footer, .mobile-bottom-nav, .no-print,
  .page-header .actions, .filter-bar { display: none !important; }
  .main-area { margin: 0 !important; }
  .content { padding: 0 !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}

/* --- Touch devices --- */
@media (hover: none) {
  .stat-card:hover, .product-card:hover, .link-card:hover, .feature-card:hover { transform: none; }
  .btn:hover { transform: none; }
}

/* --- Particle canvas --- */
#particle-canvas, #particle-catalog {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}

/* --- Checkout progress steps --- */
.checkout-steps {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem; position: relative;
}
.checkout-steps::before {
  content: ''; position: absolute; top: 50%; left: 10%; right: 10%;
  height: 3px; background: var(--ink-200); z-index: 0;
}
.checkout-step {
  position: relative; z-index: 1; display: flex; flex-direction: column;
  align-items: center; gap: .35rem; flex: 1;
}
.checkout-step .step-circle {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ink-100); color: var(--ink-400);
  display: grid; place-items: center; font-weight: 700; font-size: .9rem;
  border: 3px solid var(--ink-200); transition: all .2s;
}
.checkout-step.active .step-circle {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: var(--ink-900); border-color: var(--gold-500);
  box-shadow: var(--shadow-gold);
}
.checkout-step.done .step-circle {
  background: var(--success); color: #fff; border-color: var(--success);
}
.checkout-step .step-label {
  font-size: .72rem; color: var(--ink-500); font-weight: 600;
}
.checkout-step.active .step-label { color: var(--gold-700); }
@media (max-width: 576px) {
  .checkout-steps { flex-wrap: wrap; gap: .5rem; }
  .checkout-step { flex: 1 1 45%; }
}

/* --- Payment receipt upload --- */
.receipt-upload-area {
  border: 3px dashed var(--gold-300); border-radius: var(--radius);
  padding: 2rem; text-align: center; cursor: pointer; transition: all .2s;
  background: var(--gold-50); min-height: 160px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.receipt-upload-area:hover { border-color: var(--gold-500); background: var(--gold-100); }
.receipt-upload-area i { font-size: 2.5rem; color: var(--gold-500); margin-bottom: .5rem; }

/* --- Admin order review --- */
.order-review-card {
  border: 2px solid var(--gold-200); border-radius: var(--radius);
  padding: 1.25rem; background: var(--gold-50);
}
.receipt-preview {
  max-width: 100%; max-height: 400px; border-radius: var(--radius-sm);
  border: 2px solid var(--ink-200);
}
