body, input, select, textarea, button, .btn, .form-control, .form-select { font-family: "primary-font", Tahoma, sans-serif; }
.ltr { direction: ltr; text-align: left; }

/* ---------- منو ---------- */
.pa-menu .menu-inner > .menu-item > .menu-link { margin: 3px 12px; padding: .62rem .9rem; border-radius: 12px; transition: all .2s ease; }
.pa-menu .menu-inner > .menu-item > .menu-link:hover { background: rgba(115,103,240,.10); transform: translateX(-2px); }
.pa-menu .menu-inner > .menu-item.active > .menu-link:not(.menu-toggle) { background: linear-gradient(72deg,#7367f0 20%,#9e95f5 100%) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(115,103,240,.45); }
.pa-menu .menu-inner > .menu-item.active > .menu-link:not(.menu-toggle) .menu-icon { color: #fff !important; }
/* منوی کشویی: گروهی که صفحهٔ فعلی داخلش است کمی رنگ می‌گیرد؛ زیرمنوی فعال پررنگ و بنفش */
.pa-menu .menu-inner > .menu-item.pa-has-active > .menu-link { background: rgba(115,103,240,.12); color: #7367f0; font-weight: 600; }
.pa-menu .menu-sub .menu-link { padding-top: .45rem; padding-bottom: .45rem; font-size: .93rem; }
.pa-menu .menu-sub > .menu-item.active > .menu-link:not(.menu-toggle) { color: #7367f0 !important; font-weight: 700; background: rgba(115,103,240,.08); border-radius: 8px; }
.pa-menu .menu-sub > .menu-item.pa-has-active > .menu-link.menu-toggle { color: #7367f0; font-weight: 600; }
.pa-menu .menu-sub .badge { margin-inline-start: auto; }

/* اسکرول‌بارها: منو سمت راست (لبهٔ بیرونی)، صفحه سمت چپ (لبهٔ بیرونی) تا کنار هم نباشند */
/* انتخابگر قوی‌تر از قانون RTL قالب ([dir=rtl] .menu .ps__rail-y) که ریل را به چپ می‌برد */
html[dir] .layout-menu .menu-inner > .ps__rail-y { right: 2px !important; left: auto !important; }
html[dir] .layout-menu .menu-inner > .ps__rail-y > .ps__thumb-y { right: 0 !important; left: auto !important; }
@media (min-width: 1200px) {
  /* کروم نوار اسکرول خود صفحه را همیشه سمت راست می‌گذارد؛ پس محتوا در یک قاب جدا اسکرول می‌شود که در حالت راست‌به‌چپ نوارش سمت چپ است */
  html, body { height: 100%; overflow: hidden; }
  .layout-wrapper, .layout-container { height: 100%; }
  .layout-page { height: 100vh; overflow-y: auto; overflow-x: hidden; }
  .layout-navbar-fixed .layout-content-navbar .layout-navbar { position: sticky !important; top: 0; right: auto !important; left: auto !important; }
  html.layout-navbar-fixed body .layout-wrapper .layout-container .layout-page { padding-top: 0 !important; }
}
.pa-menu .menu-item.soon .menu-link { opacity: .6; cursor: default; }
.pa-menu .menu-item.soon .menu-link:hover { background: transparent; transform: none; }
.pa-menu .menu-header { margin-top: 1rem; }
.pa-menu .menu-icon { font-size: 1.35rem; }
.ic-purple { color: #7367f0; } .ic-blue { color: #00bad1; } .ic-green { color: #28c76f; }
.ic-orange { color: #ff9f43; } .ic-red { color: #ea5455; } .ic-cyan { color: #00cfe8; }
.pa-brand-logo { max-height: 34px; max-width: 120px; object-fit: contain; }

/* ---------- نوار بالا ---------- */
.pa-avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#7367f0,#9e95f5); color: #fff; font-size: 1.4rem; box-shadow: 0 3px 8px rgba(115,103,240,.4); flex: 0 0 auto; }
.pa-date { background: rgba(115,103,240,.10); padding: .35rem .8rem; border-radius: 20px; font-size: .85rem; white-space: nowrap; }

/* ---------- کارت‌های آمار ---------- */
.stat-card { border: 0; border-radius: 1rem; color: #fff; overflow: hidden; position: relative; box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.15); transition: transform .2s, box-shadow .2s; }
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 .8rem 1.6rem rgba(0,0,0,.22); }
.stat-card .card-body { min-height: 120px; position: relative; z-index: 1; }
.stat-card .stat-label { opacity: .9; font-size: .95rem; }
.stat-card .stat-value { font-size: 2.1rem; font-weight: 700; line-height: 1.3; }
.stat-card .icon { position: absolute; left: 1rem; bottom: .4rem; font-size: 4.2rem; opacity: .22; z-index: 0; }
.g-purple { background: linear-gradient(135deg,#7367f0,#a49bf5); } .g-green { background: linear-gradient(135deg,#28c76f,#5fe09a); }
.g-orange { background: linear-gradient(135deg,#ff9f43,#ffc078); } .g-red { background: linear-gradient(135deg,#ea5455,#f48a8b); }
.g-blue { background: linear-gradient(135deg,#00bad1,#4fd8e8); }

/* ---------- فرم‌ها ---------- */
.pa-modal-head { background: linear-gradient(135deg,#7367f0,#9e95f5); border-radius: .5rem .5rem 0 0; }
.pa-section { background: rgba(255,159,67,.08); border: 1px dashed rgba(255,159,67,.5); border-radius: .75rem; padding: 1rem; }
.pa-logo-prev { width: 56px; height: 56px; object-fit: contain; border-radius: .5rem; border: 1px solid rgba(0,0,0,.1); background: #fff; }
.pa-logo-circle { display: inline-flex; width: 64px; height: 64px; border-radius: 50%; align-items: center; justify-content: center; font-size: 2rem; color: #fff;
  background: linear-gradient(135deg,#7367f0,#9e95f5); box-shadow: 0 6px 16px rgba(115,103,240,.45); }
.pa-auth-card { border-radius: 1rem; box-shadow: 0 .75rem 2rem rgba(0,0,0,.12); }
.table > :not(caption) > * > * { padding: .8rem 1rem; }
.pa-logo-sm { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid rgba(0,0,0,.08); }

/* ---------- SweetAlert در حالت تاریک ---------- */
.dark-style .swal2-popup { background: #2f3349; color: #cfd0e6; }
.dark-style .swal2-title, .dark-style .swal2-html-container { color: #cfd0e6; }
.swal2-popup { font-family: "primary-font", Tahoma, sans-serif; }

/* ---------- جدول‌ها: عنوان و مقدار هم‌تراز و وسط‌چین ---------- */
.table-center th, .table-center td { text-align: center; vertical-align: middle; white-space: nowrap; }
.table-center td.wrap { white-space: normal; }
.table-center .ltr { direction: ltr; text-align: center; unicode-bidi: plaintext; }
.table-center thead th { background: rgba(115,103,240,.08); font-weight: 700; }

/* ---------- نوار قدرت رمز ---------- */
.pw-meter { margin-top: .4rem; }
.pw-track { height: 6px; background: rgba(0,0,0,.08); border-radius: 6px; overflow: hidden; }
.dark-style .pw-track { background: rgba(255,255,255,.12); }
.pw-fill { height: 100%; width: 0; border-radius: 6px; transition: width .25s, background-color .25s; }

/* ---------- کپچا ---------- */
.pa-captcha { height: 48px; border-radius: .5rem; border: 1px solid rgba(0,0,0,.12); background: #f3f2fb; flex: 0 0 auto; }

/* ---------- تقویم شمسی ---------- */
.jdp { display: none; position: fixed; z-index: 2000; width: 292px; background: #fff; color: #444; border: 1px solid rgba(0,0,0,.12); border-radius: .75rem; box-shadow: 0 .75rem 2rem rgba(0,0,0,.22); padding: .6rem; direction: rtl; font-size: .9rem; user-select: none; }
.dark-style .jdp { background: #2f3349; color: #cfd0e6; border-color: rgba(255,255,255,.14); }
.jdp-head { display: flex; align-items: center; gap: .15rem; margin-bottom: .4rem; }
.jdp-head .t { flex: 1; text-align: center; font-weight: 700; }
.jdp-b { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.15rem; }
.jdp-b:hover { background: rgba(115,103,240,.18); }
.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.jdp-w { font-size: .75rem; opacity: .75; padding: .25rem 0; }
.jdp-d { padding: .42rem 0; border-radius: .5rem; cursor: pointer; }
.jdp-d:hover { background: rgba(115,103,240,.18); }
.jdp-d.today { box-shadow: inset 0 0 0 1px #7367f0; }
.jdp-d.sel { background: #7367f0; color: #fff !important; }
.fri { color: #ea5455; }
.jdp-foot { display: flex; justify-content: space-between; margin-top: .5rem; padding-top: .4rem; border-top: 1px solid rgba(0,0,0,.08); }
.jdp-link { cursor: pointer; font-size: .85rem; color: #7367f0; }
.jdp-link:hover { text-decoration: underline; }

/* ---------- چاپ ---------- */
/* در حالت عادی (روی صفحه) محل گزارش چاپی و نوار خطا مخفی است */
#printArea { display: none; }
#pa-err { position: fixed; bottom: 12px; left: 12px; right: 12px; z-index: 3000; background: #ea5455; color: #fff; border-radius: .6rem; padding: .6rem 1rem; box-shadow: 0 .5rem 1.2rem rgba(0,0,0,.3); direction: rtl; font-size: .85rem; }
@page { size: A4; margin: 12mm; }

/* همهٔ قواعد زیر فقط هنگام چاپ اعمال می‌شوند (قبلاً بخشی از آن‌ها بیرون از @media افتاده بود و روی صفحه هم اثر می‌گذاشت) */
@media print {
  /* چاپ معمولی صفحه (Ctrl+P): بدون منو، نوار بالا و دکمه‌ها */
  .layout-menu, .layout-navbar, .layout-overlay, .drag-target, .btn, .card-header, .modal, .modal-backdrop, .jdp, .swal2-container, #pa-err { display: none !important; }
  .layout-page { padding: 0 !important; }
  .content-wrapper, .container-xxl { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
  .table-responsive { overflow: visible !important; }
  .card { box-shadow: none !important; border: 0 !important; }
  .table-center th, .table-center td { white-space: normal; }

  /* چاپ گزارش (دکمهٔ «چاپ گزارش»): فقط گزارش */
  body.printing-report > *:not(#printArea) { display: none !important; }
  body.printing-report #printArea { display: block !important; direction: rtl; color: #000; background: #fff; font-size: 11px; }
  #printArea h2 { font-size: 17px; margin: 0 0 4px; }
  #printArea .meta { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 11px; }
  #printArea table { width: 100%; border-collapse: collapse; }
  #printArea th, #printArea td { border: 1px solid #333; padding: 4px 5px; text-align: center; vertical-align: middle; }
  #printArea th { background: #e8e8e8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #printArea thead { display: table-header-group; }
  #printArea tr { page-break-inside: avoid; }
  #printArea td.n { direction: ltr; unicode-bidi: plaintext; }
  #printArea .tot td { font-weight: 700; background: #f3f3f3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #printArea .sign { margin-top: 28px; display: flex; justify-content: space-around; font-size: 11px; }
}

/* ---------- پیش‌نمایش فایل (PDF و تصویر) ---------- */
.pa-prev-frame { width: 100%; height: 75vh; border: 0; border-radius: .5rem; background: #fff; }
.pa-prev-img { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; border-radius: .5rem; }
.pa-thumb { cursor: zoom-in; }
.pa-logo-wrap { position: relative; display: inline-block; }

/* ---------- دکمهٔ جمع‌شونده‌ی منو: وقتی منو بسته است آیکن برعکس می‌شود ---------- */
.layout-menu-toggle .bx-chevron-right { transition: transform .25s; }
.layout-menu-collapsed .layout-menu .layout-menu-toggle .bx-chevron-right { transform: rotate(180deg); }

/* ---------- فاز ۱۱: سرستون قابل مرتب‌سازی و نوار صفحه‌بندی پایین جدول‌ها ---------- */
th.pa-sort { cursor: pointer; user-select: none; white-space: nowrap; }
th.pa-sort:hover, th.pa-sort:focus { color: #7367f0; outline: none; }
th .pa-sort-ic { font-size: 1rem; vertical-align: middle; margin-inline-start: .2rem; opacity: .35; }
th.pa-sorted { color: #7367f0; }
th.pa-sorted .pa-sort-ic { opacity: 1; }
.pa-pagebar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.pa-pagebar .pa-pageinfo { margin-inline-end: auto; font-size: .8125rem; color: #a8aaae; }
.pa-pagebar .pa-pagesize { width: auto; }
.pa-pagebar .pa-pagego { width: 5rem; }
.pa-gridbar:not(:empty) { padding: .75rem 1.25rem; border-top: 1px solid rgba(0,0,0,.075); }
.dark-style .pa-gridbar:not(:empty) { border-top-color: rgba(255,255,255,.1); }
