/*
  my-overrides.css  —  اورراید سراسری پنل ادمین (Bootstrap 5.3 + تم)
  =========================================================================
  فقط این فایل را از master.html لود کن. هیچ استایل inline دیگری لازم نیست.

  پالت رنگی مطابق styles.css پروژه‌ی فرانت (Camelot): مشکی + نارنجی (hsl 24 95% 53%).
  دارک عیناً از styles.css می‌آید؛ لایت همان تُن نارنجی با روشنایی کمتر (برای کنتراست AA)
  روی سطوح سفید/کرم گرم است. همه‌ی مقادیر hsl هستند تا مستقیماً با styles.css قابل مقایسه باشند.

  ۰) پایه      → radius و نکات سفارشی‌سازی
  ۱) توکن‌ها    → لایت / دارک (همه چیز از --my-* می‌خواند)
  ۲) بازتعریف متغیرهای Bootstrap/تم
  ۳) کامپوننت‌های تم (دکمه، کارت، فرم، جدول، منو، dropdown، modal ...)
  ۴) Select2 (شامل پنجره‌ی dropdown که به body اضافه می‌شود)
  ۵) کتابخانه‌ی .pa-*  (لیست و فرم محصول)
  ۶) تقویم شمسی (.jdp) و تکمیل dropdownها

  تم سیستم: master.html وقتی data-bs-theme="system" باشد با JS آن را به light/dark
  تبدیل می‌کند؛ پس فقط همین دو حالت لازم است.
  ========================================================================= */


/* ============================================================== ۰) پایه */
:root {
  --my-radius-sm: 8px;
  --my-radius: 10px;
  --my-radius-lg: 14px;
  /* اگر می‌خواهی ظاهر تیزِ استور (radius: 2px در styles.css) را داشته باشی، این سه خط را جایگزین کن:
     --my-radius-sm: 2px;  --my-radius: 2px;  --my-radius-lg: 3px;  */
}


/* ============================================================ ۱) توکن‌ها */
/* ---------- لایت: صفحه = کرم گرم، کارت‌ها = سفید، برند = نارنجیِ عمیق ----------
   نارنجی استور (hsl 24 95% 53%) روی سفید کنتراست کافی ندارد (~۲.۸:۱)؛
   پس در لایت همان تُن (hue 24) با روشنایی کمتر استفاده می‌شود تا هم متن و هم دکمه AA بماند. */
:root,
[data-bs-theme="light"] {
  color-scheme: light;

  --my-sand: hsl(24 80% 93%);           /* پس‌زمینه‌ی ملایم نارنجی: آیتم فعال / انتخاب‌شده */
  --my-taupe: hsl(24 95% 53%);          /* = --primary استور؛ فقط برای رینگ فوکوس و انتخاب متن */

  --my-brand: hsl(24 95% 36%);          /* هم‌تُن --primary، تیره‌تر برای کنتراست روی سفید */
  --my-brand-rgb: 179, 74, 5;           /* معادل RGB همان رنگ بالا (برای rgba و --bs-*-rgb) */
  --my-brand-hover: hsl(24 95% 29%);
  --my-brand-soft: hsl(24 70% 96%);
  --my-brand-soft-2: var(--my-sand);
  --my-on-brand: hsl(0 0% 100%);        /* = --primary-foreground */
  --my-on-status: hsl(0 0% 100%);       /* متن روی پس‌زمینه‌ی پر موفق/خطا/هشدار */

  --my-bg: hsl(30 14% 96%);
  --my-surface: hsl(0 0% 100%);
  --my-surface-2: hsl(30 14% 98%);
  --my-surface-3: hsl(30 10% 92%);
  --my-border: hsl(30 10% 89%);
  --my-border-strong: hsl(30 6% 62%);

  --my-text: hsl(20 14% 8%);
  --my-muted: hsl(25 8% 38%);
  --my-faint: hsl(25 6% 46%);

  --my-success: hsl(150 60% 26%);
  --my-success-soft: hsl(150 50% 94%);
  --my-warn: hsl(40 90% 26%);           /* کهربایی؛ عمداً از نارنجی برند جدا است */
  --my-warn-soft: hsl(45 90% 92%);
  --my-danger: hsl(0 72% 42%);          /* هم‌خانواده‌ی --destructive */
  --my-danger-soft: hsl(0 86% 96%);

  --my-shadow-sm: 0 1px 2px rgba(40, 24, 10, .07);
  --my-shadow: 0 1px 2px rgba(40, 24, 10, .05), 0 6px 20px rgba(40, 24, 10, .06);
  --my-shadow-lg: 0 18px 44px rgba(40, 24, 10, .18);
  --my-ring-color: color-mix(in oklab, var(--my-taupe) 40%, transparent);
  --my-ring: 0 0 0 3px var(--my-ring-color);
  --my-overlay: rgba(10, 10, 10, .45);
}

/* ---------- دارک: مستقیماً از theme تیره‌ی styles.css (Camelot) ----------
   پس‌زمینه مشکی، کارت = ۱۰٪ خاکستری، برند = نارنجی اصلی استور. */
[data-bs-theme="dark"],
.dark-style {
  color-scheme: dark;

  --my-sand: hsl(24 40% 17%);
  --my-taupe: hsl(24 95% 53%);

  --my-brand: hsl(24 95% 53%);          /* = --primary */
  --my-brand-rgb: 249, 112, 21;
  --my-brand-hover: hsl(24 95% 65%);    /* = --primary-light */
  --my-brand-soft: hsl(24 35% 13%);
  --my-brand-soft-2: var(--my-sand);
  --my-on-brand: hsl(0 0% 4%);          /* مهم: روی نارنجیِ روشن، متن تیره (سفید فقط ~۲.۸:۱ می‌شد) */
  --my-on-status: hsl(0 0% 4%);

  --my-bg: hsl(0 0% 0%);                /* = --background */
  --my-surface: hsl(0 0% 10%);          /* = --card */
  --my-surface-2: hsl(0 0% 13%);
  --my-surface-3: hsl(0 0% 15%);        /* = --card-secondary / --muted */
  --my-border: hsl(0 0% 100% / 0.1);    /* = --border */
  --my-border-strong: hsl(0 0% 40%);

  --my-text: hsl(0 0% 98%);
  --my-muted: hsl(0 0% 63%);            /* = --muted-foreground */
  --my-faint: hsl(0 0% 52%);

  --my-success: hsl(150 60% 50%);       /* = --chart-4 */
  --my-success-soft: hsl(150 40% 14%);
  --my-warn: hsl(45 93% 58%);
  --my-warn-soft: hsl(45 60% 14%);
  --my-danger: hsl(0 84% 60%);          /* = --destructive (نسخه‌ی روشن؛ نسخه‌ی .dark برای متن بیش‌ازحد تیره است) */
  --my-danger-soft: hsl(0 50% 15%);

  --my-shadow-sm: 0 1px 2px rgba(0, 0, 0, .6);
  --my-shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 20px rgba(0, 0, 0, .5);
  --my-shadow-lg: 0 18px 44px rgba(0, 0, 0, .8);
  --my-ring-color: color-mix(in oklab, var(--my-taupe) 55%, transparent);
  --my-ring: 0 0 0 3px var(--my-ring-color);
  --my-overlay: rgba(0, 0, 0, .7);
}


/* ================================================= ۲) متغیرهای Bootstrap */
html:root,
html[data-bs-theme] {
  --bs-primary: var(--my-brand);
  --bs-primary-rgb: var(--my-brand-rgb);
  --bs-primary-bg-subtle: var(--my-brand-soft);
  --bs-primary-border-subtle: var(--my-brand-soft-2);
  --bs-primary-text-emphasis: var(--my-brand);
  --bs-link-color: var(--my-brand);
  --bs-link-color-rgb: var(--my-brand-rgb);
  --bs-link-hover-color: var(--my-brand-hover);
  --bs-body-bg: var(--my-bg);
  --bs-body-color: var(--my-text);
  --bs-heading-color: var(--my-text);
  --bs-emphasis-color: var(--my-text);
  --bs-secondary-color: var(--my-muted);
  --bs-secondary-bg: var(--my-surface-3);
  --bs-tertiary-bg: var(--my-surface-2);
  --bs-border-color: var(--my-border);
  --bs-border-color-translucent: var(--my-border);
  --bs-focus-ring-color: var(--my-ring-color);
  --bs-card-bg: var(--my-surface);
  --bs-paper-bg: var(--my-surface);
  --bs-success: var(--my-success);
  --bs-danger: var(--my-danger);
  --bs-warning: var(--my-warn);
}


/* ================================================ ۳) کامپوننت‌های تم */
body {
  background-color: var(--my-bg);
  color: var(--my-text);
}

a { color: var(--my-brand); }
a:hover, a:focus { color: var(--my-brand-hover); }

:focus-visible {
  outline: 2px solid var(--my-brand);
  outline-offset: 2px;
}

::selection { background: color-mix(in oklab, var(--my-taupe) 45%, transparent); }

/* دکمه‌ها */
.btn-primary {
  --bs-btn-bg: var(--my-brand);
  --bs-btn-border-color: var(--my-brand);
  --bs-btn-color: var(--my-on-brand);
  --bs-btn-hover-bg: var(--my-brand-hover);
  --bs-btn-hover-border-color: var(--my-brand-hover);
  --bs-btn-active-bg: var(--my-brand-hover);
  --bs-btn-active-border-color: var(--my-brand-hover);
  --bs-btn-focus-shadow-rgb: var(--my-brand-rgb);
  background-color: var(--my-brand) !important;
  border-color: var(--my-brand) !important;
  color: var(--my-on-brand) !important;
  box-shadow: none !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  background-color: var(--my-brand-hover) !important;
  border-color: var(--my-brand-hover) !important;
}
.btn-outline-primary {
  color: var(--my-brand) !important;
  border-color: var(--my-brand) !important;
}
.btn-outline-primary:hover,
.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary {
  background-color: var(--my-brand) !important;
  border-color: var(--my-brand) !important;
  color: var(--my-on-brand) !important;
}
.btn-label-primary {
  background-color: var(--my-brand-soft) !important;
  color: var(--my-brand) !important;
}
.btn-outline-secondary, .btn-label-secondary {
  color: var(--my-muted) !important;
  border-color: var(--my-border-strong) !important;
}

/* متن و پس‌زمینه‌های معنایی */
.text-primary { color: var(--my-brand) !important; }
.text-success { color: var(--my-success) !important; }
.text-danger  { color: var(--my-danger) !important; }
.text-warning { color: var(--my-warn) !important; }
.text-muted, .text-body-secondary { color: var(--my-muted) !important; }
.bg-primary   { background-color: var(--my-brand) !important; color: var(--my-on-brand) !important; }
.bg-success   { background-color: var(--my-success) !important; }
.bg-danger    { background-color: var(--my-danger) !important; }
.badge.bg-label-primary { background-color: var(--my-brand-soft) !important; color: var(--my-brand) !important; }
.badge.bg-label-success { background-color: var(--my-success-soft) !important; color: var(--my-success) !important; }
.badge.bg-label-danger  { background-color: var(--my-danger-soft) !important; color: var(--my-danger) !important; }
.badge.bg-label-warning { background-color: var(--my-warn-soft) !important; color: var(--my-warn) !important; }
.badge.bg-label-secondary, .badge.bg-label-info, .badge.bg-label-dark { background-color: var(--my-surface-3) !important; color: var(--my-muted) !important; }

/* کارت‌ها */
.card {
  background-color: var(--my-surface) !important;
  border: 1px solid var(--my-border) !important;
  border-radius: var(--my-radius-lg) !important;
  box-shadow: var(--my-shadow) !important;
  color: var(--my-text);
}
.card-header, .card-footer {
  background-color: transparent !important;
  border-color: var(--my-border) !important;
}
hr, .border, .border-top, .border-bottom, .border-start, .border-end {
  border-color: var(--my-border) !important;
}
.bg-white, .bg-body { background-color: var(--my-surface) !important; }

/* فرم‌ها */
.form-control, .form-select {
  background-color: var(--my-surface) !important;
  color: var(--my-text) !important;
  border: 1px solid var(--my-border-strong) !important;
  border-radius: var(--my-radius) !important;
}
.form-control::placeholder { color: var(--my-faint); }
.form-control:focus, .form-select:focus {
  border-color: var(--my-brand) !important;
  box-shadow: var(--my-ring) !important;
}
.form-control:disabled, .form-select:disabled { background-color: var(--my-surface-3) !important; opacity: .7; }
.form-check-input { background-color: var(--my-surface); border-color: var(--my-border-strong); }
.form-check-input:checked {
  background-color: var(--my-brand) !important;
  border-color: var(--my-brand) !important;
}
.form-switch .form-check-input:checked {
  background-color: var(--my-success) !important;
  border-color: var(--my-success) !important;
}
.input-group-text {
  background-color: var(--my-surface-3) !important;
  border-color: var(--my-border-strong) !important;
  color: var(--my-muted) !important;
}

/* جدول‌های عمومی */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--my-text);
  --bs-table-border-color: var(--my-border);
  --bs-table-striped-bg: var(--my-surface-2);
  --bs-table-hover-bg: var(--my-surface-2);
  --bs-table-hover-color: var(--my-text);
}
.table thead th {
  background-color: var(--my-surface-2) !important;
  color: var(--my-muted) !important;
}

/* صفحه‌بندی */
.pagination {
  --bs-pagination-bg: var(--my-surface);
  --bs-pagination-color: var(--my-muted);
  --bs-pagination-border-color: var(--my-border);
  --bs-pagination-hover-bg: var(--my-brand-soft);
  --bs-pagination-hover-color: var(--my-brand);
  --bs-pagination-hover-border-color: var(--my-border-strong);
  --bs-pagination-focus-bg: var(--my-brand-soft);
  --bs-pagination-disabled-bg: var(--my-surface-2);
  --bs-pagination-disabled-color: var(--my-faint);
  --bs-pagination-disabled-border-color: var(--my-border);
}
.pagination .page-item.active .page-link {
  background-color: var(--my-brand) !important;
  border-color: var(--my-brand) !important;
  color: var(--my-on-brand) !important;
  box-shadow: none !important;
}

/* Dropdown (منوی کاربر، اکشن‌ها، ...) */
.dropdown-menu {
  --bs-dropdown-bg: var(--my-surface);
  --bs-dropdown-color: var(--my-text);
  --bs-dropdown-border-color: var(--my-border);
  --bs-dropdown-link-color: var(--my-text);
  --bs-dropdown-link-hover-color: var(--my-brand);
  --bs-dropdown-link-hover-bg: var(--my-brand-soft);
  --bs-dropdown-link-active-color: var(--my-brand);
  --bs-dropdown-link-active-bg: var(--my-brand-soft-2);
  --bs-dropdown-divider-bg: var(--my-border);
  --bs-dropdown-header-color: var(--my-faint);
  background-color: var(--my-surface) !important;
  border: 1px solid var(--my-border) !important;
  border-radius: var(--my-radius) !important;
  box-shadow: var(--my-shadow-lg) !important;
  padding: .4rem !important;
}
.dropdown-item {
  border-radius: var(--my-radius-sm);
  padding: .5rem .75rem;
  color: var(--my-text);
}
.dropdown-item:hover, .dropdown-item:focus {
  background-color: var(--my-brand-soft) !important;
  color: var(--my-brand) !important;
}
.dropdown-item.active, .dropdown-item:active {
  background-color: var(--my-brand-soft-2) !important;
  color: var(--my-brand) !important;
}
.dropdown-divider { border-color: var(--my-border) !important; margin: .35rem .2rem; }

/* Modal / SweetAlert2 / Toast */
.modal-content {
  background-color: var(--my-surface);
  color: var(--my-text);
  border: 1px solid var(--my-border);
  border-radius: var(--my-radius-lg);
  box-shadow: var(--my-shadow-lg);
}
.modal-header, .modal-footer { border-color: var(--my-border); }
.modal-backdrop { --bs-backdrop-bg: #000; }
.swal2-popup {
  background: var(--my-surface) !important;
  color: var(--my-text) !important;
  border: 1px solid var(--my-border);
  border-radius: var(--my-radius-lg) !important;
}
.swal2-title, .swal2-html-container { color: var(--my-text) !important; }
.swal2-styled.swal2-confirm { background: var(--my-brand) !important; color: var(--my-on-brand) !important; box-shadow: none !important; }
.swal2-container.swal2-backdrop-show { background: var(--my-overlay) !important; }

/* نوار بالا (navbar) */
.layout-navbar, .navbar-detached, .bg-navbar-theme {
  background-color: color-mix(in srgb, var(--my-surface) 88%, transparent) !important;
  backdrop-filter: saturate(1.4) blur(10px);
  border: 1px solid var(--my-border) !important;
  box-shadow: var(--my-shadow-sm) !important;
  color: var(--my-text);
}
.layout-navbar .nav-link, .layout-navbar .navbar-nav i { color: var(--my-muted); }
.layout-navbar .nav-link:hover { color: var(--my-brand); }

/* منوی کناری */
.layout-menu, .menu-vertical, .bg-menu-theme {
  background-color: var(--my-surface) !important;
  color: var(--my-text) !important;
  border-inline-end: 1px solid var(--my-border);
  box-shadow: none !important;
}
.menu-inner-shadow { display: none !important; }
.app-brand-text { color: var(--my-text) !important; }
.menu-header .menu-header-text { color: var(--my-faint) !important; }
.menu-link, .menu-sub .menu-link { color: var(--my-muted) !important; }
.menu-item .menu-link:hover {
  background-color: var(--my-brand-soft) !important;
  color: var(--my-text) !important;
  border-radius: var(--my-radius);
}
.menu-item.open > .menu-link.menu-toggle {
  background: var(--my-brand-soft) !important;
  background-image: none !important;
  color: var(--my-text) !important;
  border-radius: var(--my-radius);
  box-shadow: none !important;
  font-weight: 600;
}
.menu-item.active > .menu-link {
  background: var(--my-brand-soft-2) !important;
  background-image: none !important;
  color: var(--my-brand) !important;
  border-radius: var(--my-radius);
  box-shadow: none !important;
  font-weight: 600;
}
.menu-item.active > .menu-link i,
.menu-item.active > .menu-link .menu-icon { color: var(--my-brand) !important; }
.menu-sub > .menu-item.active > .menu-link::before { background-color: var(--my-brand) !important; }
.footer, .content-footer { color: var(--my-muted); }

/* اسکرول‌بار */
* { scrollbar-width: thin; scrollbar-color: var(--my-border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--my-border-strong);
  border-radius: 10px;
  border: 2px solid var(--my-bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--my-brand); }


/* ============================================================= ۴) Select2 */
/* پنجره‌ی dropdown داخل body رندر می‌شود، پس این قوانین عمداً سراسری‌اند. */
.select2-container { font-size: .875rem; }
.select2-container--default .select2-selection--single {
  height: 42px !important;
  background-color: var(--my-surface) !important;
  border: 1px solid var(--my-border-strong) !important;
  border-radius: var(--my-radius) !important;
  transition: border-color .15s, box-shadow .15s;
}
.select2-container--default .select2-selection--single:hover { border-color: var(--my-faint) !important; }
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 40px !important;
  padding-inline: 12px 34px !important;
  color: var(--my-text) !important;
  text-align: start;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--my-faint) !important; }
.select2-container--default .select2-selection--single .select2-selection__clear {
  color: var(--my-muted); margin-inline: 0 6px; font-size: 1.1rem;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 40px !important;
  left: auto !important; right: auto !important;
  inset-inline-end: 8px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: var(--my-muted) transparent transparent transparent !important;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent var(--my-brand) transparent !important;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--my-brand) !important;
  box-shadow: var(--my-ring) !important;
}
.select2-dropdown {
  background-color: var(--my-surface) !important;
  border: 1px solid var(--my-border) !important;
  border-radius: var(--my-radius) !important;
  box-shadow: var(--my-shadow-lg);
  overflow: hidden;
  color: var(--my-text);
  margin-block: 4px;
}
.select2-container--default .select2-search--dropdown { padding: 8px; background: var(--my-surface-2); }
.select2-container--default .select2-search--dropdown .select2-search__field {
  background: var(--my-surface) !important;
  color: var(--my-text) !important;
  border: 1px solid var(--my-border-strong) !important;
  border-radius: var(--my-radius-sm);
  padding: 7px 10px;
  outline: none;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: var(--my-brand) !important;
  box-shadow: var(--my-ring);
}
.select2-results__options { padding: 4px; max-height: 260px; }
.select2-results__option {
  font-size: .84rem;
  padding: 8px 10px !important;
  border-radius: 6px;
  color: var(--my-text);
}
.select2-container--default .select2-results__option--selected,
.select2-container--default .select2-results__option[aria-selected="true"] {
  background-color: var(--my-brand-soft) !important;
  color: var(--my-brand) !important;
  font-weight: 600;
}
.select2-container--default .select2-results__option--highlighted,
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: var(--my-brand) !important;
  color: var(--my-on-brand) !important;
}
.select2-container--default .select2-results__message,
.select2-results__option.loading-results { color: var(--my-muted); }
.select2-container--default .select2-results__option--disabled { color: var(--my-faint); }


/* ====================================================== ۵) کتابخانه‌ی .pa-* */
.pa {
  direction: rtl;
  color: var(--my-text);
  font-size: .9rem;
}
.pa *, .pa *::before, .pa *::after { box-sizing: border-box; }
.pa h1, .pa h2, .pa p { margin-top: 0; }
.pa-page { max-width: 1440px; margin: 0 auto; padding: 4px 0 96px; }

/* ---- سرصفحه ---- */
.pa-head, .pa-form-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.pa-head h1, .pa-form-head h1 {
  margin: 0; font-size: 1.55rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.3;
}
.pa-sub { margin: 4px 0 0; color: var(--my-muted); font-size: .85rem; }
.pa-crumb { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--my-muted); margin: 0 0 4px; }
.pa-crumb a { color: var(--my-brand); text-decoration: none; }
.pa-crumb a:hover { text-decoration: underline; }
.pa-crumb .sep { opacity: .5; }

/* ---- دکمه‌ها ---- */
.pa-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--my-radius);
  font: inherit; font-size: .85rem; font-weight: 700; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.pa-btn:active { transform: translateY(1px); }
.pa-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.pa-btn-clay { background: var(--my-brand); color: var(--my-on-brand); box-shadow: 0 1px 2px rgba(var(--my-brand-rgb), .35); }
.pa-btn-clay:hover { background: var(--my-brand-hover); color: var(--my-on-brand); }
.pa-btn-ghost { background: var(--my-surface); color: var(--my-text); border-color: var(--my-border-strong); }
.pa-btn-ghost:hover { background: var(--my-surface-2); border-color: var(--my-faint); color: var(--my-text); }
.pa-btn-danger-ghost { background: var(--my-surface); color: var(--my-danger); border-color: color-mix(in srgb, var(--my-danger) 35%, var(--my-border)); }
.pa-btn-danger-ghost:hover { background: var(--my-danger-soft); border-color: var(--my-danger); color: var(--my-danger); }
.pa-btn-icon {
  width: 34px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--my-surface); border: 1px solid var(--my-border);
  border-radius: var(--my-radius-sm); color: var(--my-muted);
  cursor: pointer; text-decoration: none; transition: all .15s;
}
.pa-btn-icon:hover { background: var(--my-brand-soft); border-color: var(--my-brand-soft-2); color: var(--my-brand); }
.pa-btn-icon.danger:hover { background: var(--my-danger-soft); border-color: var(--my-danger); color: var(--my-danger); }

/* ---- نوار ابزار لیست ---- */
.pa-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px; margin-bottom: 12px;
  background: var(--my-surface); border: 1px solid var(--my-border);
  border-radius: var(--my-radius-lg); box-shadow: var(--my-shadow-sm);
}
.pa-search { position: relative; flex: 1 1 260px; min-width: 200px; }
.pa-search input {
  width: 100%; height: 42px; padding: 0 40px 0 12px;
  background: var(--my-surface-2); color: var(--my-text);
  border: 1px solid transparent; border-radius: var(--my-radius);
  font: inherit; font-size: .86rem; transition: all .15s;
}
.pa-search input::placeholder { color: var(--my-faint); }
.pa-search input:hover { border-color: var(--my-border-strong); }
.pa-search input:focus { outline: none; background: var(--my-surface); border-color: var(--my-brand); box-shadow: var(--my-ring); }
.pa-search svg { position: absolute; inset-inline-start: auto; inset-inline-end: 13px; top: 50%; transform: translateY(-50%); color: var(--my-faint); pointer-events: none; }
.pa-toolbar > .select2-container, .pa-toolbar > .pa-select2-mini { flex: 0 0 210px; width: 210px !important; }

/* فیلتر وضعیت به‌صورت segmented control */
.pa-chips { display: inline-flex; gap: 2px; padding: 3px; background: var(--my-surface-3); border-radius: var(--my-radius); }
.pa-chip {
  border: 0; background: transparent; color: var(--my-muted);
  padding: 0 14px; height: 36px; border-radius: 8px;
  font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; transition: all .15s;
}
.pa-chip:hover { color: var(--my-text); }
.pa-chip.is-active { background: var(--my-surface); color: var(--my-brand); box-shadow: var(--my-shadow-sm); font-weight: 800; }

/* ---- انتخاب گروهی ---- */
.pa-bulkbar {
  display: none; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 12px; margin-bottom: 12px;
  background: var(--my-brand-soft); border: 1px solid var(--my-brand-soft-2);
  border-radius: var(--my-radius); font-size: .84rem;
}
.pa-bulkbar.is-visible { display: flex; animation: pa-drop .18s ease-out; }
.pa-bulkbar .pa-btn { min-height: 34px; padding: 0 12px; font-size: .8rem; }
.pa-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 6px; margin-inline-end: 4px;
  background: var(--my-brand); color: var(--my-on-brand); border-radius: 7px; font-weight: 800;
}
.pa-spacer { flex: 1; }
@keyframes pa-drop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---- جدول ---- */
.pa-table-wrap {
  background: var(--my-surface); border: 1px solid var(--my-border);
  border-radius: var(--my-radius-lg); box-shadow: var(--my-shadow);
  overflow-x: auto; overflow-y: hidden;
}
.pa-table, table.pa-table {
  width: 100%; margin: 0 !important; font-size: .85rem; color: var(--my-text);
  border-collapse: separate !important; border-spacing: 0 !important;
}
.pa-table thead th {
  padding: 12px 14px !important; text-align: start !important;
  background: var(--my-surface-2) !important; color: var(--my-muted) !important;
  font-size: .76rem !important; font-weight: 700 !important; white-space: nowrap;
  border-bottom: 1px solid var(--my-border) !important;
}
.pa-table thead th::before, .pa-table thead th::after { opacity: .35 !important; }
.pa-table tbody td {
  padding: 12px 14px !important; vertical-align: middle !important;
  background: transparent !important; color: var(--my-text);
  border-bottom: 1px solid var(--my-border) !important;
}
.pa-table tbody tr { transition: background .12s; }
.pa-table tbody tr:hover td { background: var(--my-surface-2) !important; }
.pa-table tbody tr.selected td, .pa-table tbody tr.is-selected td { background: var(--my-brand-soft) !important; }
.pa-table tbody tr:last-child td { border-bottom: 0 !important; }
.pa-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--my-brand); cursor: pointer; }
.pa-table td.dataTables_empty {
  padding: 56px 12px !important; text-align: center !important;
  color: var(--my-muted); font-size: .9rem;
}

.pa-cell-product { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.pa-thumb {
  width: 48px; height: 48px; flex: 0 0 48px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--my-border); background: var(--my-surface-3);
}
.pa-thumb-empty { display: flex; align-items: center; justify-content: center; color: var(--my-faint); font-size: .7rem; }
.pa-title { display: block; max-width: 280px; font-weight: 700; line-height: 1.5; color: var(--my-text); text-decoration: none; }
a.pa-title:hover { color: var(--my-brand); }
.pa-meta { display: block; margin-top: 1px; font-size: .74rem; color: var(--my-muted); }

.pa-price { display: flex; flex-direction: column; gap: 2px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pa-price .old { font-size: .74rem; font-weight: 400; color: var(--my-faint); text-decoration: line-through; margin: 0; }
.pa-badge-discount {
  display: inline-flex; width: max-content; padding: 2px 7px; margin: 0;
  background: var(--my-danger-soft); color: var(--my-danger);
  border-radius: 6px; font-size: .7rem; font-weight: 800;
}

.pa-stock {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; white-space: nowrap;
}
.pa-stock::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pa-stock.ok  { background: var(--my-success-soft); color: var(--my-success); }
.pa-stock.low { background: var(--my-warn-soft); color: var(--my-warn); }
.pa-stock.out { background: var(--my-danger-soft); color: var(--my-danger); }

.pa-row-actions { display: flex; justify-content: flex-end; gap: 6px; }

/* سوییچ (فرم و جدول) */
.pa-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.pa-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.pa-switch .track {
  position: relative; width: 40px; height: 22px; border-radius: 999px;
  background: var(--my-border-strong); transition: background .18s;
}
.pa-switch .track::before {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: var(--my-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: inset-inline-start .18s;
}
.pa-switch input:checked + .track { background: var(--my-success); }
.pa-switch input:checked + .track::before { inset-inline-start: 21px; }
.pa-switch input:focus-visible + .track { box-shadow: var(--my-ring); }

/* ---- DataTables ---- */
.pa .dataTables_wrapper .dataTables_length,
.pa .dataTables_wrapper .dataTables_filter { display: none; }
.pa .dataTables_wrapper .row:has(.dataTables_filter) { display: none; }
.pa .dataTables_wrapper > .row { margin: 0; --bs-gutter-x: 0; }
.pa .dataTables_wrapper > .row > [class*="col-"] { padding: 0; }
.pa .dataTables_wrapper > .row:last-child {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--my-border); background: var(--my-surface-2);
}
.pa .dataTables_wrapper > .row:last-child > [class*="col-"] { width: auto; flex: 0 1 auto; }
.pa .dataTables_info { padding: 0 !important; font-size: .78rem; color: var(--my-muted); }
.pa .dataTables_paginate { padding: 0 !important; margin: 0 !important; }
.pa .dataTables_paginate .pagination { margin: 0; gap: 4px; }
.pa .dataTables_paginate .page-link,
.pa .dataTables_paginate .paginate_button {
  min-width: 34px; height: 34px; padding: 0 10px !important;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--my-border) !important; border-radius: var(--my-radius-sm) !important;
  background: var(--my-surface) !important; color: var(--my-muted) !important;
  font-size: .8rem; cursor: pointer; box-shadow: none !important;
}
.pa .dataTables_paginate .page-item { margin: 0; }
.pa .dataTables_paginate .page-link:hover,
.pa .dataTables_paginate .paginate_button:hover { background: var(--my-brand-soft) !important; color: var(--my-brand) !important; }
.pa .dataTables_paginate .page-item.active .page-link,
.pa .dataTables_paginate .paginate_button.current {
  background: var(--my-brand) !important; border-color: var(--my-brand) !important; color: var(--my-on-brand) !important; font-weight: 800;
}
.pa .dataTables_paginate .page-item.disabled .page-link,
.pa .dataTables_paginate .paginate_button.disabled { opacity: .4; pointer-events: none; }
.pa-pagination { padding: 12px 16px; border-top: 1px solid var(--my-border); background: var(--my-surface-2); }
.pa-pagination .dataTables_paginate { float: none !important; text-align: center !important; }
.dataTables_processing {
  top: 50% !important; inset-inline-start: 50% !important; left: auto !important; width: auto !important; margin: 0 !important;
  transform: translate(-50%, -50%); padding: 12px 20px !important;
  background: var(--my-surface) !important; color: var(--my-text) !important;
  border: 1px solid var(--my-border) !important; border-radius: var(--my-radius) !important;
  box-shadow: var(--my-shadow-lg); font-size: .85rem;
}

/* ---- چیدمان فرم ---- */
.pa-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 18px; align-items: start; }
.pa-grid > div { min-width: 0; }
.pa-card {
  background: var(--my-surface); border: 1px solid var(--my-border);
  border-radius: var(--my-radius-lg); padding: 20px 22px; margin-bottom: 16px;
  box-shadow: var(--my-shadow-sm);
}
.pa-card > h2 {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px;
  margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--my-border);
  font-size: 1rem; font-weight: 800; color: var(--my-text);
}
.pa-card > h2 small { font-size: .75rem; font-weight: 500; color: var(--my-muted); }

.pa-field { margin-bottom: 16px; }
.pa-field:last-child { margin-bottom: 0; }
.pa-field label { display: block; margin: 0 0 6px; font-size: .8rem; font-weight: 700; color: var(--my-text); }
.pa-field .hint, .pa-hint { margin: 6px 2px 0; font-size: .74rem; line-height: 1.7; color: var(--my-muted); }
.pa-field .err { display: none; margin: 6px 2px 0; font-size: .76rem; color: var(--my-danger); }
.pa-field.has-error .err:not(:empty) { display: block; }
.pa-field.has-error .pa-input, .pa-field.has-error .pa-textarea,
.pa-field.has-error .select2-selection--single {
  border-color: var(--my-danger) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--my-danger) 16%, transparent) !important;
}

.pa-input, .pa-textarea, .pa-select2-mini { width: 100%; }
.pa-input, .pa-textarea {
  background: var(--my-surface); color: var(--my-text);
  border: 1px solid var(--my-border-strong); border-radius: var(--my-radius);
  font: inherit; font-size: .88rem; transition: border-color .15s, box-shadow .15s, background .15s;
}
.pa-input { height: 42px; padding: 0 13px; }
.pa-input[type="number"] { font-variant-numeric: tabular-nums; }
.pa-textarea { min-height: 100px; padding: 11px 13px; resize: vertical; line-height: 1.85; }
.pa-input::placeholder, .pa-textarea::placeholder { color: var(--my-faint); }
.pa-input:hover, .pa-textarea:hover { border-color: var(--my-faint); }
.pa-input:focus, .pa-textarea:focus { outline: none; border-color: var(--my-brand); box-shadow: var(--my-ring); }

.pa-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pa-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pa-slug-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.pa-suggest-btn { font-size: .78rem; }

.pa-check { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; cursor: pointer; }
.pa-check input { width: 16px; height: 16px; accent-color: var(--my-brand); }

.pa-discount-preview { min-height: 0; margin-top: 12px; font-size: .8rem; font-weight: 700; color: var(--my-success); }
.pa-discount-preview:not(:empty) { padding: 9px 12px; border-radius: var(--my-radius-sm); background: var(--my-success-soft); }

.pa-counter { margin-top: 4px; font-size: .72rem; color: var(--my-faint); text-align: end; font-variant-numeric: tabular-nums; }
.pa-counter.is-over { color: var(--my-danger); font-weight: 700; }

.pa-status-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border: 1px solid var(--my-border);
  border-radius: var(--my-radius); background: var(--my-surface-2);
}
.pa-status-label { font-size: .84rem; font-weight: 700; }
.pa-meta-list { list-style: none; margin: 14px 0 0; padding: 0; }
.pa-meta-list li {
  display: flex; justify-content: space-between; gap: 12px; padding: 9px 0;
  border-bottom: 1px dashed var(--my-border); font-size: .78rem; color: var(--my-muted);
}
.pa-meta-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.pa-meta-list li span:last-child { color: var(--my-text); font-weight: 700; }

.pa-color-dot {
  display: inline-block; width: 12px; height: 12px; margin-inline-end: 8px; vertical-align: -1px;
  border-radius: 50%; border: 1px solid rgba(128, 128, 128, .45);
}

/* مشخصات فنی */
.pa-spec-row {
  display: grid; grid-template-columns: 1fr 1.4fr 38px; gap: 8px; margin-bottom: 8px;
  padding: 8px; background: var(--my-surface-2); border: 1px solid var(--my-border); border-radius: var(--my-radius);
}
.pa-spec-row .pa-input { height: 38px; background: var(--my-surface); }
.pa-btn-icon.spec-remove { align-self: center; color: var(--my-faint); }
.pa-btn-icon.spec-remove:hover { color: var(--my-danger); background: var(--my-danger-soft); border-color: var(--my-danger); }
.pa-spec-empty {
  margin: 0 0 10px; padding: 18px; text-align: center; font-size: .8rem; color: var(--my-muted);
  border: 1px dashed var(--my-border-strong); border-radius: var(--my-radius); background: var(--my-surface-2);
}

/* گالری */
.pa-dropzone {
  min-height: 120px; padding: 20px; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: .84rem; line-height: 1.9; color: var(--my-muted); cursor: pointer;
  border: 1.5px dashed var(--my-border-strong); border-radius: var(--my-radius-lg);
  background: var(--my-surface-2); transition: all .15s;
}
.pa-dropzone:hover, .pa-dropzone.is-drag {
  border-color: var(--my-brand); background: var(--my-brand-soft); color: var(--my-brand);
}
.pa-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-top: 14px; }
.pa-image-item {
  position: relative; overflow: hidden; padding-bottom: 36px; cursor: grab;
  background: var(--my-surface-3); border: 1px solid var(--my-border); border-radius: var(--my-radius);
  transition: box-shadow .15s, border-color .15s;
}
.pa-image-item:hover { box-shadow: var(--my-shadow); }
.pa-image-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.pa-image-item.is-primary { border: 2px solid var(--my-brand); }
.pa-image-item.is-primary::before {
  content: "تصویر اصلی"; position: absolute; z-index: 2; top: 6px; inset-inline-start: 6px;
  padding: 3px 8px; background: var(--my-brand); color: var(--my-on-brand);
  border-radius: 6px; font-size: .66rem; font-weight: 800;
}
.pa-image-item .rm {
  position: absolute; z-index: 2; top: 6px; inset-inline-end: 6px; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center; padding: 0;
  border: 0; border-radius: 7px; background: rgba(0, 0, 0, .62); color: #fff;
  cursor: pointer; backdrop-filter: blur(4px); transition: background .15s;
}
.pa-image-item .rm:hover { background: var(--my-danger); }
.pa-image-item .alt-input {
  position: absolute; inset-inline: 0; bottom: 0; width: 100%; height: 36px; padding: 0 9px;
  background: var(--my-surface); color: var(--my-text); font-size: .72rem;
  border: 0; border-top: 1px solid var(--my-border); outline: none;
}
.pa-image-item .alt-input:focus { background: var(--my-brand-soft); }
.pa-image-item.is-dragging { opacity: .4; }

/* نوار اکشن چسبان */
.pa-actionbar {
  position: sticky; bottom: 16px; z-index: 20;
  display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 10px 12px;
  background: color-mix(in srgb, var(--my-surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--my-border); border-radius: var(--my-radius-lg); box-shadow: var(--my-shadow-lg);
}
.pa-saving-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--my-brand); opacity: 0; }
.pa-saving-dot.is-active { opacity: 1; animation: pa-pulse 1s infinite; }
@keyframes pa-pulse { 50% { opacity: .3; transform: scale(.7); } }

/* Toast */
.pa-toast-stack { position: fixed; inset-inline-start: 22px; bottom: 22px; z-index: 99999; display: flex; flex-direction: column; gap: 8px; }
.pa-toast {
  min-width: 220px; max-width: 380px; padding: 12px 16px;
  background: var(--my-text); color: var(--my-bg);
  border-radius: var(--my-radius); box-shadow: var(--my-shadow-lg);
  font-size: .84rem; font-weight: 600;
  opacity: 0; transform: translateY(8px); transition: opacity .22s, transform .22s;
}
.pa-toast.is-visible { opacity: 1; transform: none; }
.pa-toast.is-success { background: var(--my-success); color: var(--my-on-status); }
.pa-toast.is-error { background: var(--my-danger); color: var(--my-on-status); }

/* ---- ریسپانسیو ---- */
@media (max-width: 1050px) { .pa-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .pa-head h1, .pa-form-head h1 { font-size: 1.3rem; }
  .pa-head > .pa-btn { width: 100%; }
  .pa-toolbar > .select2-container, .pa-toolbar > .pa-select2-mini { flex: 1 1 100%; width: 100% !important; }
  .pa-chips { width: 100%; overflow-x: auto; }
  .pa-chip { flex: 1; white-space: nowrap; }
  .pa-row-2, .pa-row-3, .pa-slug-row { grid-template-columns: 1fr; }
  .pa-card { padding: 16px; }
  .pa-table { min-width: 820px; }
  .pa-actionbar { bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .pa *, .pa-toast { transition: none !important; animation: none !important; }
}


/* =========================================================================
   ۶) تقویم شمسی (.jdp) و تکمیل dropdownهای پنل payments
   -------------------------------------------------------------------------
   این بخش را عیناً به انتهای my-overrides.css اضافه کن (بعد از بخش ۵).
   فقط از توکن‌های --my-* همان فایل استفاده می‌کند، پس لایت/دارک و رنگ برند خودکار
   با بقیه‌ی پنل یکی است. چیزی از بخش‌های قبلی را تغییر نمی‌دهد.
   ========================================================================= */

/* ---------- فیلد تاریخ ---------- */
.jdp-field { position: relative; display: block; width: 100%; }
/* input نمایشی dir=ltr دارد (ارقام)، پس فاصله‌ها فیزیکی‌اند تا با جای آیکن (سمت چپ) هم‌خوان باشند */
.jdp-field > input { width: 100%; padding-left: 42px !important; text-align: right; }
.jdp-trigger {
  position: absolute; top: 50%; left: 6px; transform: translateY(-50%);
  width: 30px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: var(--my-radius-sm);
  color: var(--my-muted); cursor: pointer; transition: background .15s, color .15s;
}
.jdp-trigger:hover { background: var(--my-brand-soft); color: var(--my-brand); }
.jdp-trigger:disabled { opacity: .5; cursor: not-allowed; }
.jdp-field > input[aria-expanded="true"] { border-color: var(--my-brand) !important; box-shadow: var(--my-ring) !important; }

/* ---------- پنجره‌ی تقویم ---------- */
.jdp {
  position: fixed; z-index: 2000; width: 304px; padding: 12px;
  direction: rtl; text-align: start;
  background: var(--my-surface); color: var(--my-text);
  border: 1px solid var(--my-border); border-radius: var(--my-radius-lg);
  box-shadow: var(--my-shadow-lg);
  font-size: .85rem; line-height: 1.5;
  animation: jdp-in .14s ease-out;
}
.jdp[hidden] { display: none !important; }
.jdp *, .jdp *::before, .jdp *::after { box-sizing: border-box; }
@keyframes jdp-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.jdp button { font: inherit; }
.jdp-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 10px; }
.jdp-nav {
  width: 34px; height: 34px; padding: 0; flex: 0 0 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--my-surface); color: var(--my-muted);
  border: 1px solid var(--my-border); border-radius: var(--my-radius-sm);
  cursor: pointer; transition: all .15s;
}
.jdp-nav:hover { background: var(--my-brand-soft); border-color: var(--my-brand-soft-2); color: var(--my-brand); }
.jdp-title { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; }
.jdp-title-btn, .jdp-title-text {
  padding: 5px 9px; background: transparent; border: 0; border-radius: var(--my-radius-sm);
  color: var(--my-text); font-weight: 800; font-size: .92rem;
}
.jdp-title-btn { cursor: pointer; transition: background .15s, color .15s; }
.jdp-title-btn:hover { background: var(--my-brand-soft); color: var(--my-brand); }

.jdp-week, .jdp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.jdp-week { margin-bottom: 4px; }
.jdp-week span {
  padding: 4px 0; text-align: center;
  color: var(--my-faint); font-size: .74rem; font-weight: 700;
}
.jdp-week .is-friday { color: var(--my-danger); }
.jdp-pad { display: block; }

.jdp-day {
  height: 38px; padding: 0; background: transparent; color: var(--my-text);
  border: 1px solid transparent; border-radius: var(--my-radius-sm);
  font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.jdp-day:hover { background: var(--my-brand-soft); color: var(--my-brand); }
.jdp-day.is-friday { color: var(--my-danger); }
.jdp-day.is-today { border-color: var(--my-brand); }
.jdp-day.is-selected, .jdp-day.is-selected:hover {
  background: var(--my-brand); border-color: var(--my-brand);
  color: var(--my-on-brand); font-weight: 800;
}
.jdp-day:focus-visible, .jdp-cell:focus-visible, .jdp-nav:focus-visible,
.jdp-title-btn:focus-visible, .jdp-link:focus-visible, .jdp-ok:focus-visible {
  outline: 2px solid var(--my-brand); outline-offset: 1px;
}

/* ماه‌ها و سال‌ها */
.jdp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 0; }
.jdp-cell {
  height: 42px; padding: 0; background: transparent; color: var(--my-text);
  border: 1px solid transparent; border-radius: var(--my-radius-sm);
  font-weight: 600; cursor: pointer; transition: background .12s, color .12s;
}
.jdp-cell:hover:not(:disabled) { background: var(--my-brand-soft); color: var(--my-brand); }
.jdp-cell.is-today { border-color: var(--my-brand); }
.jdp-cell.is-selected { background: var(--my-brand); border-color: var(--my-brand); color: var(--my-on-brand); font-weight: 800; }
.jdp-cell:disabled { opacity: .35; cursor: not-allowed; }

/* ساعت */
.jdp-time {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 10px; padding: 8px 10px;
  background: var(--my-surface-2); border: 1px solid var(--my-border); border-radius: var(--my-radius);
}
.jdp-time-label { color: var(--my-muted); font-size: .8rem; font-weight: 700; }
.jdp-time-inputs { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--my-muted); }
.jdp-time-input {
  width: 46px; height: 36px; padding: 0; text-align: center;
  background: var(--my-surface); color: var(--my-text);
  border: 1px solid var(--my-border-strong); border-radius: var(--my-radius-sm);
  font: inherit; font-weight: 800; font-variant-numeric: tabular-nums;
}
.jdp-time-input:focus { outline: none; border-color: var(--my-brand); box-shadow: var(--my-ring); }

/* پایین پنجره */
.jdp-foot {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--my-border);
}
.jdp-link {
  padding: 6px 10px; background: transparent; border: 0; border-radius: var(--my-radius-sm);
  color: var(--my-brand); font-weight: 700; font-size: .82rem; cursor: pointer; transition: background .15s;
}
.jdp-link:hover { background: var(--my-brand-soft); }
.jdp-link.is-danger { color: var(--my-danger); }
.jdp-link.is-danger:hover { background: var(--my-danger-soft); }
.jdp-ok {
  margin-inline-start: auto; min-width: 72px; height: 34px; padding: 0 14px;
  background: var(--my-brand); color: var(--my-on-brand);
  border: 0; border-radius: var(--my-radius-sm); font-weight: 800; font-size: .82rem; cursor: pointer;
  transition: background .15s;
}
.jdp-ok:hover { background: var(--my-brand-hover); }

@media (max-width: 420px) { .jdp { width: calc(100vw - 16px); } }
@media (prefers-reduced-motion: reduce) { .jdp { animation: none; } .jdp * { transition: none !important; } }


/* ---------- dropdownها (تکمیل بخش ۴: Select2) ---------- */
/* انتخاب‌گرهای payments داخل کارت/مودال تمام‌عرض باشند و دقیقاً هم‌قد input ها */
.card-header .select2-container,
.modal-body .select2-container { width: 100% !important; }

/* پنجره‌ی لیست داخل مودال هم باید بالاتر از لایه‌ی مودال بیاید */
.modal .select2-container--open { z-index: 1065; }

/* گزینه‌ی انتخاب‌شده با نشان تیک (به‌جای فقط پس‌زمینه) */
.select2-container--default .select2-results__option--selected::after,
.select2-container--default .select2-results__option[aria-selected="true"]::after {
  content: "✓"; float: inline-end; font-weight: 800;
}

/* حالت خطا / غیرفعال برای select2 داخل فرم */
.is-invalid + .select2-container--default .select2-selection--single {
  border-color: var(--my-danger) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--my-danger) 16%, transparent) !important;
}
select:disabled + .select2-container--default .select2-selection--single {
  background-color: var(--my-surface-3) !important; opacity: .7; cursor: not-allowed;
}

/* پنجره‌ی انتخاب فایل/تاریخ native و لیست‌های بومی هم با تم تیره/روشن هماهنگ باشند */
select.form-select, .form-control { color-scheme: inherit; }
select.form-select option { background-color: var(--my-surface); color: var(--my-text); }


/* دستگیره‌ی drag (لیست ست‌ها + آیتم‌های ست) */
.pa .pa-drag-handle { cursor: grab; user-select: none; color: var(--bs-secondary-color, #888); text-align: center; letter-spacing: -2px; }
.pa .pa-drag-handle:active { cursor: grabbing; }
.pa .pa-table.is-locked .pa-drag-handle { opacity: .25; cursor: not-allowed; }
.pa .sortable-ghost { opacity: .45; }
 
.pa .pa-empty { text-align: center; padding: 28px 12px; color: var(--bs-secondary-color, #888); }
.pa .pa-chip-count { opacity: .65; margin-inline-start: 4px; font-size: .85em; }
 
/* لیست محصولات داخل فرم ست */
.pa .pa-set-items { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pa .pa-set-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--bs-border-color, #ddd); border-radius: 8px; background: var(--bs-body-bg, #fff); }
.pa .pa-set-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pa .pa-set-item-info .pa-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa .pa-set-empty { margin: 12px 0 0; color: var(--bs-secondary-color, #888); font-size: .9em; }
.pa .pa-set-warning { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; font-size: .9em; background: rgba(255, 171, 0, .12); color: #b37400; }
 
/* گالری */
.pa .pa-image-tile { position: relative; border: 1px solid var(--bs-border-color, #ddd); border-radius: 8px; overflow: hidden; cursor: grab; background: var(--bs-body-bg, #fff); }
.pa .pa-image-tile img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.pa .pa-image-badge { position: absolute; top: 6px; inset-inline-start: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: rgba(0, 0, 0, .65); color: #fff; }
.pa .pa-image-remove { position: absolute; top: 6px; inset-inline-end: 6px; background: rgba(255, 255, 255, .9); }
.pa .pa-image-alt { border-radius: 0; border-width: 1px 0 0; font-size: 12px; padding: 6px 8px; }
.pa .pa-dropzone.is-over { border-color: currentColor; }
.pa .pa-dropzone.is-busy { opacity: .6; pointer-events: none; }
 
/* picker (select2) */
.pa .pa-pick small { opacity: .7; }
 

/* =========================================================================
   ۷) پنل سئو (.seo-*) — صفحات / دسته‌بندی‌ها / تنظیمات سراسری
   -------------------------------------------------------------------------
   فقط از توکن‌های --my-* استفاده می‌کند؛ پس لایت/دارک خودکار است.
   (دیگر نیازی به seo-admin.css و تگ <link> آن در قالب‌ها نیست.)
   ========================================================================= */

/* offcanvas فرم (Bootstrap offcanvas در تم رنگ‌دهی نشده بود) */
.seo-offcanvas {
  --bs-offcanvas-width: min(720px, 100vw);
  width: min(720px, 100vw);
  max-width: 100vw;
  background-color: var(--my-surface) !important;
  color: var(--my-text);
  border-color: var(--my-border) !important;
  box-shadow: var(--my-shadow-lg);
}
.seo-offcanvas .offcanvas-header,
.seo-offcanvas > .border-top { border-color: var(--my-border) !important; }
.seo-offcanvas .offcanvas-body { overscroll-behavior: contain; }
.offcanvas-backdrop { --bs-backdrop-bg: #000; --bs-backdrop-opacity: .55; }

/* تب‌ها و pill های ناوبری سئو */
#seo-root .nav-tabs { border-color: var(--my-border); }
#seo-root .nav-tabs .nav-link,
.seo-offcanvas .nav-tabs .nav-link { color: var(--my-muted); border-color: transparent; }
#seo-root .nav-tabs .nav-link:hover,
.seo-offcanvas .nav-tabs .nav-link:hover { color: var(--my-text); }
#seo-root .nav-tabs .nav-link.active,
.seo-offcanvas .nav-tabs .nav-link.active {
  color: var(--my-brand) !important;
  background: transparent !important;
  border-color: transparent transparent var(--my-brand) !important;
  font-weight: 700;
}
#seo-root .nav-pills .nav-link {
  color: var(--my-muted);
  border-radius: var(--my-radius);
}
#seo-root .nav-pills .nav-link:hover { background: var(--my-brand-soft); color: var(--my-text); }
#seo-root .nav-pills .nav-link.active {
  background: var(--my-brand) !important;
  color: var(--my-on-brand) !important;
  box-shadow: none !important;
}

/* خطای فیلدهایی که invalid-feedback هم‌سطح input نیست (سوئیچ، انتخابگر تصویر) */
#seo-root [data-field].has-error .invalid-feedback,
.seo-offcanvas [data-field].has-error .invalid-feedback { display: block; color: var(--my-danger); }
.seo-offcanvas .form-control.is-invalid,
.seo-offcanvas .form-select.is-invalid,
#seo-root .form-control.is-invalid {
  border-color: var(--my-danger) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--my-danger) 16%, transparent) !important;
  background-image: none;
}

/* پیش‌نمایش نتایج گوگل */
.seo-serp { background: var(--my-surface-2); border-color: var(--my-border) !important; }
.seo-serp__url {
  font-size: .8rem; color: var(--my-muted); text-align: start;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.seo-serp__title {
  font-size: 1.1rem; line-height: 1.4; margin: 2px 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.seo-serp__desc {
  font-size: .85rem; line-height: 1.7; color: var(--my-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* جعبه‌ی پیش‌نمایش تصویر */
.seo-img-box {
  display: flex; align-items: center; justify-content: center;
  min-height: 96px; max-height: 180px; padding: .5rem; overflow: hidden;
  background: var(--my-surface-2);
  border: 1.5px dashed var(--my-border-strong);
  border-radius: var(--my-radius);
}
.seo-img-box img { max-width: 100%; max-height: 164px; object-fit: contain; }

/* JSON-LD */
.seo-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem; line-height: 1.6; tab-size: 2;
}
.offcanvas-body code, #seo-root code[dir="ltr"] {
  background: var(--my-surface-3); color: var(--my-text);
  padding: .1rem .4rem; border-radius: 6px; font-size: .78rem;
}
.seo-offcanvas .bg-lighter { background: var(--my-surface-3) !important; color: var(--my-text); }

/* جدول و آمار */
.seo-cell-title { max-width: 360px; }
.seo-cell-title .seo-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.seo-counter { font-variant-numeric: tabular-nums; }
#seo-tbody td { vertical-align: middle; }
#seo-state:empty { display: none; }
#seo-stats h4 { font-variant-numeric: tabular-nums; }

/* toast سئو روی offcanvas هم دیده شود */
#seo-toasts { z-index: 2000; }

@media (max-width: 575.98px) {
  .seo-offcanvas { width: 100vw; }
}


/* به انتهای my-overrides.css (همان فایلی که استایل‌های .pa در آن است) اضافه کنید.
   فقط از رنگ‌های خنثی/currentColor استفاده شده تا در تم لایت و دارک خودکار سازگار باشد. */

/* نوار همگام‌سازی حسابفا (بالای لیست محصولات) */
.pa .pa-hf-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; margin-bottom: 16px;
  border: 1px solid rgba(128, 128, 128, 0.3); border-radius: 12px;
}
.pa .pa-hf-bar[hidden] { display: none; }
.pa .pa-hf-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; }
.pa .pa-hf-info span { opacity: 0.75; font-size: 0.875rem; }
.pa .pa-hf-info span.is-error { opacity: 1; color: #ea5455; }
.pa .pa-hf-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pa .pa-hf-actions .pa-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* نشان‌ها در جدول */
.pa .pa-hf-badge {
  display: inline-block; margin-inline-start: 6px; padding: 0 8px; border-radius: 999px;
  font-size: 11px; line-height: 18px; white-space: nowrap;
  border: 1px solid rgba(128, 128, 128, 0.45); opacity: 0.9;
}
.pa .pa-hf-badge.is-discount { border-color: currentColor; }
.pa .pa-hf-badge.is-warn { color: #ea5455; border-color: currentColor; }

/* یادداشت اتصال در فرم محصول */
.pa .pa-hf-note {
  margin: 0 0 16px; padding: 12px 16px; border-radius: 12px;
  border: 1px solid rgba(128, 128, 128, 0.3); font-size: 0.875rem;
}
.pa .pa-hf-note[hidden] { display: none; }
.pa .pa-hf-note ul { margin: 8px 0 0; padding-inline-start: 18px; opacity: 0.85; }
.pa .pa-hf-note.is-warn { border-color: #ea5455; color: #ea5455; }

/* فیلدهای قفل‌شده (مقدار از حسابفا می‌آید) */
.pa input.is-locked { opacity: 0.7; cursor: not-allowed; }