/* ==========================================================================
   ui.css — بنیاد طراحی پاستا اَمور
   لایهٔ ظاهری مشترک: متغیرهای رنگ، شعاع، سایه، تایپوگرافی و جزئیات ریز.
   این فایل بعد از استایل هر صفحه بارگذاری می‌شود و فقط «جلوه» را بهتر می‌کند.
   ========================================================================== */

:root {
  /* رنگ اصلی: قرمز آلبالویی */
  --am-primary: #590E12;
  --am-primary-dark: #641417;
  --am-primary-soft: #FBEEEF;
  --am-primary-ring: rgba(126, 30, 34, .18);

  /* خنثی‌ها */
  --am-bg: #F4F4F6;
  --am-surface: #FFFFFF;
  --am-surface-2: #FAFAFB;
  --am-border: #E6E6EA;
  --am-border-strong: #D9D9DF;
  --am-text: #191A1C;
  --am-muted: #6E7076;
  --am-faint: #9A9CA2;

  /* وضعیت‌ها */
  --am-success: #1F7A3D;
  --am-success-soft: #EAF6EE;
  --am-warn: #B36B00;
  --am-warn-soft: #FFF4E2;
  --am-danger: #B3261E;
  --am-danger-soft: #FCECEA;
  --am-info: #1A5FB4;
  --am-info-soft: #EAF2FC;

  /* شکل و سایه */
  --am-radius: 14px;
  --am-radius-sm: 10px;
  --am-radius-xs: 8px;
  --am-shadow-1: 0 1px 2px rgba(16, 18, 22, .05), 0 1px 3px rgba(16, 18, 22, .04);
  --am-shadow-2: 0 4px 14px rgba(16, 18, 22, .07), 0 1px 3px rgba(16, 18, 22, .05);
  --am-shadow-3: 0 12px 34px rgba(16, 18, 22, .12);
  --am-ring: 0 0 0 3px var(--am-primary-ring);
}

/* ---------- پایه ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" on, "ss02" on;
  letter-spacing: -0.01em;
}

/* ---------- اسکرول‌بار ظریف ---------- */
* { scrollbar-width: thin; scrollbar-color: #C9C9D0 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #C9C9D0; border-radius: 999px; border: 3px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #B0B0B8; background-clip: content-box; }

/* ---------- فوکوس واضح و یکدست ---------- */
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--am-ring);
  border-radius: var(--am-radius-xs);
}

/* ---------- دکمه‌ها ---------- */
.btn, button.btn {
  transition: background-color .15s ease, border-color .15s ease, color .15s ease,
              box-shadow .15s ease, transform .06s ease;
}
.btn:active, button.btn:active { transform: translateY(1px); }
.btn:disabled, button.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- کارت‌ها ---------- */
.card {
  border: 1px solid var(--am-border);
  box-shadow: var(--am-shadow-1);
  transition: box-shadow .18s ease, border-color .18s ease;
}
.card:hover { box-shadow: var(--am-shadow-2); }

/* ---------- جدول‌ها ---------- */
.table-wrap { border-radius: var(--am-radius-sm); }
table th { letter-spacing: 0; font-weight: 700; }
table tbody tr { transition: background-color .12s ease; }
table tbody tr:hover { background: var(--am-surface-2); }
table td { vertical-align: middle; }

/* ---------- ورودی‌ها ---------- */
input[type="text"], input[type="number"], input[type="password"], select, textarea {
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
input[type="text"]:hover, select:hover, textarea:hover { border-color: var(--am-border-strong); }
input::placeholder, textarea::placeholder { color: var(--am-faint); }

/* ---------- برچسب و نشان ---------- */
.badge { letter-spacing: 0; font-weight: 700; }

/* ---------- آیکون‌های SVG ---------- */
.am-icon {
  width: 18px; height: 18px; flex: 0 0 auto;
  stroke: currentColor; fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: middle;
}
.am-icon.sm { width: 15px; height: 15px; stroke-width: 1.9; }
.am-icon.lg { width: 22px; height: 22px; stroke-width: 1.6; }
.am-icon.xl { width: 28px; height: 28px; stroke-width: 1.5; }

/* دکمه‌ای که فقط آیکون دارد */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--am-border); border-radius: var(--am-radius-xs);
  background: var(--am-surface); color: var(--am-text); cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.icon-btn:hover { background: var(--am-surface-2); border-color: var(--am-border-strong); }
.icon-btn.danger { color: var(--am-danger); }
.icon-btn.danger:hover { background: var(--am-danger-soft); border-color: transparent; }

/* ---------- انیمیشن ورود کارت‌ها ---------- */
@keyframes am-fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.card { animation: am-fade-up .22s ease both; }

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

/* ---------- چاپ: حذف افکت‌های غیرضروری ---------- */
@media print {
  .card { box-shadow: none !important; border: none !important; animation: none !important; }
}

/* ==========================================================================
   ۱۴۰۵/۰۹/۰۱ — اصلاح تایپوگرافی فارسی/انگلیسی در پنل
   ========================================================================== */

/* فونت: ترتیب اولویت، با بازگشت مطمئن به فونت‌های نصب‌شدهٔ ویندوز */
html, body, .sb-panel, .sb-item, .sb-sub, button, input, select, textarea, table {
  font-family: "Vazirmatn", "Vazir", "IRANSansX", "IRANSans", "Sahel", "Shabnam",
               "Segoe UI", "Tahoma", "Arial", sans-serif !important;
}

/* حذف فشردگی حروف که در فارسی باعث چسبیدن کلمات می‌شد */
body { letter-spacing: normal !important; word-spacing: normal; }

/* ---------- پنل: جلوگیری از درهم‌رفتن فارسی و لاتین ---------- */
.sb-panel { direction: rtl; }
.sb-item {
  direction: rtl;
  unicode-bidi: isolate;
  text-align: right;
  line-height: 1.75;
  min-height: 36px;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}
.sb-item > span:not(.sb-ico):not(.arw) {
  flex: 1 1 auto;
  min-width: 0;
  unicode-bidi: plaintext;
  text-align: right;
}
.sb-item .arw { flex: 0 0 auto; }

/* فاصلهٔ امن بین آیکون و متن */
.sb-ico { margin-left: 2px; }

/* زیرمنوها کمی جمع‌تر و خوانا */
.sb-sub .sb-item { line-height: 1.7; min-height: 32px; }

/* ردیف کاربر در پایین پنل */
.sb-user { direction: rtl; text-align: right; }
.sb-uname { unicode-bidi: plaintext; min-width: 0; overflow-wrap: break-word; }

/* سنجاق نوار کناری (دکمهٔ منو) هم فارسی‌ساز */
.sb-handle { direction: rtl; }

/* اعداد و نسخه‌ها: جهت مستقل تا با متن فارسی قاطی نشوند */
.sb-ver { unicode-bidi: plaintext; }
/* ---------- فونت محلی (اگر فایل‌ها در پوشهٔ fonts باشند) ---------- */
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/Vazirmatn-Regular.woff2") format("woff2"); }
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/Vazirmatn-Medium.woff2") format("woff2"); }
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/Vazirmatn-Bold.woff2") format("woff2"); }
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/Vazirmatn-ExtraBold.woff2") format("woff2"); }
/* ==========================================================================
   بازبینی ظاهری — تراکم بیشتر، سایهٔ نرم‌تر، خوانایی بهتر
   ========================================================================== */

/* فونت: ویندوز اول فارسی‌خوان‌ترها */
html, body, button, input, select, textarea, table, .sb-panel {
  font-family: "Vazirmatn", "IRANSansX", "IRANSans", "Segoe UI", "Tahoma", sans-serif !important;
  font-size: 13px;
  line-height: 1.75;
}

/* ---------- کارت‌ها: جمع‌وجور و تخت ---------- */
.card {
  padding: 12px 14px !important;
  border-radius: 12px !important;
  border: 1px solid #ECECF0 !important;
  box-shadow: 0 1px 2px rgba(17, 19, 24, .045) !important;
  margin-bottom: 12px !important;
}
.card:hover { box-shadow: 0 2px 6px rgba(17, 19, 24, .06) !important; }

.card-head {
  margin-bottom: 10px !important;
  padding-bottom: 8px;
  border-bottom: 1px solid #F2F2F5;
  gap: 8px;
}
.card-head h2 { font-size: 13px !important; font-weight: 800 !important; }

/* ---------- جدول‌ها: فشرده و تمیز ---------- */
table { font-size: 12px; }
table th {
  padding: 7px 9px !important;
  font-size: 10.5px !important;
  font-weight: 700;
  background: #F7F7F9 !important;
  border-bottom: 1px solid #EDEDF1;
}
table td { padding: 7px 9px !important; border-top: 1px solid #F3F3F6 !important; }
table tbody tr:hover { background: #FAFAFC !important; }

/* ---------- دکمه‌ها: کوچک‌تر و نرم‌تر ---------- */
.btn {
  padding: 8px 12px !important;
  border-radius: 9px !important;
  font-size: 11.5px !important;
  font-weight: 700;
  box-shadow: none !important;
}
.btn-sm { padding: 5px 9px !important; font-size: 10.5px !important; }
.btn-primary { box-shadow: 0 1px 2px rgba(126, 30, 34, .18) !important; }
.btn-primary:hover { background: var(--am-primary-dark) !important; }

/* ---------- برچسب‌های ریز ---------- */
.badge { padding: 2px 7px !important; font-size: 9.8px !important; }

/* ---------- ورودی‌ها ---------- */
input[type="text"], input[type="number"], input[type="password"], select, textarea {
  padding: 8px 10px !important;
  font-size: 12.5px !important;
  border-radius: 9px !important;
}

/* ---------- پنل کناری: فشرده‌تر ---------- */
.sb-item { padding: 7px 9px !important; font-size: 11.5px !important; min-height: 32px !important; }
.sb-sub .sb-item { padding: 6px 9px !important; font-size: 11px !important; min-height: 28px !important; }
.sb-body { padding: 6px 6px 10px !important; }

/* ---------- عنوان‌های درشت صفحه‌ها کمی کوچک‌تر ---------- */
h1 { font-size: 17px !important; }
h3 { font-size: 13.5px !important; }
/* ==========================================================================
   صندوق — کارت فیش فشرده، مرزهای مشخص، فیلدهای باریک‌تر
   ========================================================================== */

:root {
  --am-primary: #590E12;
  --am-primary-dark: #43090C;
  --am-border: #D8D8DF;
  --am-border-strong: #C6C6D0;
}

/* کارت صورت‌حساب: کوچک‌تر، با مرز روشن و جداکنندهٔ سرصفحه */
.grid .card {
  border: 1px solid #D6D6DF !important;
  border-radius: 11px !important;
  box-shadow: 0 1px 2px rgba(17, 19, 24, .06) !important;
  overflow: hidden;
}
.grid .card:hover { border-color: #BEBECB !important; box-shadow: 0 2px 6px rgba(17, 19, 24, .09) !important; }
.grid.list-view .card { border-radius: 10px !important; }

.chk-head { padding: 8px 12px !important; border-bottom: 1px solid #E4E4EA !important; }
.cc-body { padding: 3px 10px 8px 10px !important; }
.cc-no { font-size: 13px !important; }
.cc-nm { font-size: 11px !important; }
.cc-tt { font-size: 12px !important; font-weight: 800 !important; }
.cc-mt { font-size: 9px !important; }
.grid.list-view .cc-body { padding: 2px 10px 6px 10px !important; }

/* خط جداکنندهٔ واضح بین ناحیه‌ها در صندوق */
.chk-body { border-top: 1px solid #EDEDF2 !important; }
.cart { border-top: 1px solid #EDEDF2 !important; }

/* فیلدها: باریک‌تر، مرز واضح‌تر */
.fgr input, .fgr select, .fgr textarea {
  padding: 6px 9px !important;
  border: 1px solid #D6D6DE !important;
  border-radius: 7px !important;
  background: #FFFFFF !important;
  font-size: 11.5px !important;
}
.fgr input:hover, .fgr select:hover { border-color: #C2C2CE !important; }
.fgr input:focus, .fgr select:focus, .fgr textarea:focus {
  border-color: var(--am-primary) !important;
  box-shadow: 0 0 0 2px rgba(107, 20, 24, .14) !important;
}
.fgr label { font-size: 10.5px !important; font-weight: 600 !important; color: #63636B !important; }

/* آیتم‌های سبد: جمع‌تر و با مرز تمیز */
.ci {
  padding: 6px 9px !important;
  border: 1px solid #E0E0E8 !important;
  border-radius: 9px !important;
  background: #FFFFFF !important;
}
.ci-h { margin-bottom: 2px !important; }
.ci-n { font-size: 11.5px !important; }

/* محصولات: کارت‌های تازه‌تر */
.pcard { border: 1px solid #DEDEE6 !important; border-radius: 11px !important; }
.pcard:hover { border-color: #C3C3D0 !important; }
/* ==========================================================================
   ظریف‌سازی کلی — مواد، محصولات، گزارش‌ها
   ========================================================================== */
html, body { font-size: 12.5px; }

/* تیترها و برند */
h1, .brand-name { font-size: 14.5px !important; }
h2 { font-size: 12.5px !important; }
h3 { font-size: 12px !important; }
.brand-logo, .logo { width: 34px !important; height: 34px !important; font-size: 15px !important; border-radius: 10px !important; }
.card-head h2 { font-size: 12.5px !important; }

/* جدول‌ها ظریف‌تر */
table { font-size: 11.5px !important; }
table th { font-size: 10px !important; padding: 6px 8px !important; }
table td { padding: 6px 8px !important; }

/* دکمه‌ها و برچسب‌ها */
.btn { padding: 6px 10px !important; font-size: 11px !important; border-radius: 8px !important; }
.btn-sm { padding: 4px 8px !important; font-size: 10px !important; }
.badge { font-size: 9.5px !important; padding: 1px 6px !important; }

/* آیکون‌های جایگزین‌شده */
.am-icoreplace { display: inline-flex; align-items: center; vertical-align: -2px; }
.am-icoreplace .am-icon { width: 14px; height: 14px; stroke-width: 1.8; }

/* گزارش‌ها: ظریف‌تر */
.kpi { padding: 10px 8px !important; border-radius: 10px !important; }
.kpi .l { font-size: 9.5px !important; }
.kpi b { font-size: 13px !important; }
.row-line { font-size: 11.5px !important; padding: 6px 2px !important; }
.chart { padding: 6px !important; border-radius: 10px !important; }
.legend { font-size: 9.5px !important; }

/* فرم‌ها و ورودی‌ها */
input, select, textarea { font-size: 11.5px !important; padding: 6px 9px !important; }
label { font-size: 10.5px !important; }
/* ==========================================================================
   صحنهٔ صندوق — کادرهای ظریف با مرز روشن
   ========================================================================== */
:root {
  --am-primary: #590E12;
  --am-primary-dark: #43090C;
  --am-primary-soft: #F9EFF0;
}

/* نوار بالا: کشش کمتر، مرز مشخص */
.top { padding: 7px 9px !important; }
.top .r { margin-bottom: 5px !important; gap: 5px !important; }
.cust { padding: 7px 10px 7px 58px !important; font-size: 11.5px !important; border-radius: 8px !important; }
.cust-edit { left: 8px !important; }
.otbtn { padding: 6px 5px !important; font-size: 10.5px !important; border-radius: 7px !important; }
.otypes { gap: 3px !important; }

/* ستون دسته‌بندی: مرز تیزتر */
.cat { border-left: 1px solid #DDDDE4 !important; padding: 6px 5px !important; }
.catbtn { padding: 8px !important; font-size: 11.5px !important; border-radius: 8px !important; margin-bottom: 2px !important; }
.catbtn.on, .catbtn.active { background: var(--am-primary) !important; color: #fff !important; }

/* کارت محصول: باریک‌تر و با مرز واضح */
.pcard { border: 1px solid #D9D9E1 !important; border-radius: 9px !important; height: 58px !important; padding: 4px 6px !important; gap: 6px !important; }
.pcard:hover { border-color: var(--am-primary) !important; box-shadow: 0 2px 8px rgba(89, 14, 18, .16) !important; }
.pc-nm { font-size: 11px !important; }
.pc-pr { font-size: 10.5px !important; }

/* سبد خرید */
.cart { padding: 5px 6px !important; }
.ci { margin-bottom: 5px !important; }
.ci-n { font-size: 11px !important; }
.ci-v { font-size: 10.5px !important; }
.itm-body, .ci-f { font-size: 10.5px !important; }

/* ناحیهٔ پرداخت و جمع‌بندی */
.pay { border-right: 1px solid #DDDDE4 !important; }
.tbx { border-radius: 7px !important; }
.payline, .paylines { gap: 5px !important; }
.pl { font-size: 11px !important; }
.pay .mf, .pay .foot { border-top: 1px solid #E6E6EC !important; }

/* دکمه‌های عملیات سبد */
.itm-plus, .itm-rm { width: 24px !important; height: 24px !important; font-size: 12px !important; border-radius: 7px !important; }
/* ==========================================================================
   پنل ریلی + جمع‌شدن محتوا
   ========================================================================== */
body {
  padding-right: var(--sb-w, 56px) !important;
  transition: padding-right .2s ease;
  box-sizing: border-box;
}
@media (max-width: 820px) {
  body { padding-right: 56px !important; }
}

/* صفحهٔ فیش باز: از ریل فاصله بگیرد */
#posScreen { right: calc(var(--sb-w, 56px) + 8px) !important; }

/* ==========================================================================
   کارت فیش: مستطیل کوتاه (نه مربع)
   ========================================================================== */

/* ==========================================================================
   کاهش ارتفاع (عرض عمودی) — همه‌چیز کوتاه‌تر از بالا به پایین
   ========================================================================== */

/* کارت فیش */
.grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important; gap: 5px !important; }
.grid .card { min-height: 0 !important; }
.grid .card .cc-no { font-size: 12px !important; line-height: 1.1 !important; margin-bottom: 0 !important; }
.grid .card .cc-nm { font-size: 10px !important; line-height: 1.3 !important; }
.grid .card .cc-mt { font-size: 8px !important; line-height: 1.3 !important; margin: 0 !important; }
.grid .card .cc-tt { font-size: 11px !important; line-height: 1.2 !important; }
.cc-body { padding: 2px 8px 4px 8px !important; }
.chk-head { padding: 6px 10px !important; }

/* نوار بالا و کادر مشتری */
.top { padding: 5px 8px !important; }
.top .r { margin-bottom: 4px !important; }
.cust { padding: 4px 8px 4px 52px !important; font-size: 11px !important; line-height: 1.4 !important; }
.otbtn { padding: 4px 4px !important; font-size: 10px !important; }

/* کادرهای ورودی (آدرس، جایگاه، تخفیف، …) */
.fgr input, .fgr select, .fgr textarea { padding: 4px 8px !important; font-size: 11px !important; line-height: 1.4 !important; }
.fgr label { font-size: 9.5px !important; margin-bottom: 1px !important; }
input, select, textarea { padding: 4px 8px !important; font-size: 11px !important; }

/* دکمه‌ها */
.btn { padding: 5px 9px !important; font-size: 10.5px !important; line-height: 1.3 !important; }
.btn-sm { padding: 3px 7px !important; font-size: 9.5px !important; }
.swrow { padding: 4px 8px !important; }

/* کارت محصول */
.pcard { height: 46px !important; padding: 2px 6px !important; gap: 5px !important; border-radius: 8px !important; }
.pc-nm { font-size: 10.5px !important; line-height: 1.25 !important; }
.pc-pr { font-size: 10px !important; line-height: 1.2 !important; }
.pc-img { width: 30px !important; height: 30px !important; border-radius: 7px !important; }
.catbtn { padding: 5px 8px !important; font-size: 11px !important; margin-bottom: 1px !important; }
.cat { padding: 4px 4px !important; }

/* سبد و اقلام */
.cart { padding: 4px 5px !important; }
.ci { padding: 4px 7px !important; margin-bottom: 4px !important; border-radius: 8px !important; }
.ci-n { font-size: 10.5px !important; line-height: 1.3 !important; }
.ci-h { margin-bottom: 1px !important; }
.itm-plus, .itm-rm { width: 19px !important; height: 19px !important; font-size: 11px !important; }

/* جدول‌ها */
table th { padding: 4px 7px !important; }
table td { padding: 4px 7px !important; }

/* کارت‌های عمومی */
.card { padding: 9px 11px !important; }
.card-head { margin-bottom: 7px !important; padding-bottom: 6px !important; }
.kpi { padding: 7px 6px !important; }
/* ==========================================================================
   نوار تب صورتحساب‌ها در صندوق
   ========================================================================== */
#posScreen .postabs {
  display: flex; align-items: center; gap: 4px; flex: 0 0 auto;
  padding: 5px 8px; background: #fff; border-bottom: 1px solid #E2E2E8;
  overflow-x: auto; overflow-y: hidden;
}
#posScreen .postabs::-webkit-scrollbar { height: 5px; }
.ptab {
  display: flex; align-items: center; gap: 4px; padding: 3px 8px;
  border: 1px solid #D9D9E2; border-radius: 7px; background: #FAFAFC;
  font-size: 10.5px; font-weight: 600; cursor: pointer; white-space: nowrap; color: #1A1A1A;
}
.ptab:hover { background: #F2F2F6; }
.ptab.on { background: var(--am-primary, #590E12); color: #fff; border-color: var(--am-primary, #590E12); }
.ptx { border: none; background: transparent; color: inherit; font-size: 12px; cursor: pointer; padding: 0 1px; opacity: .8; line-height: 1; }
.ptx:hover { opacity: 1; }
.ptadd {
  border: 1px dashed #C7C7D2; background: #fff; border-radius: 7px;
  width: 24px; height: 24px; cursor: pointer; font-size: 14px; color: #590E12; flex: 0 0 auto; line-height: 1;
}
.ptadd:hover { background: #F6F6F9; }
.ptc { font-size: 9px; background: rgba(0,0,0,.10); border-radius: 5px; padding: 0 3px; }
.ptab.on .ptc { background: rgba(255,255,255,.22); }
/* ==========================================================================
   چاپ — رفع بریدگی لبه و واضح‌سازی خطوط
   ========================================================================== */
@media print {
  html, body {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    background: #fff !important;
  }
  body > *:not(#printArea) { display: none !important; }
  #printArea {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    overflow: visible !important;
  }
  .sb-panel, .sb-rail-tab, #toast, .modal-bg { display: none !important; }
  .rcpt, .kot { width: 100% !important; max-width: 100% !important; margin: 0 !important; }
}

/* ---------- واضح‌تر کردن فیش‌ها ---------- */
.rcpt, .kot { color: #000; }
.rcpt { font-size: 11px; }
.rcpt .itm-n, .rcpt .tbx { font-size: 11px; font-weight: 700; }
.rcpt .itm { border-bottom: 0.35mm dashed #000; }
.rcpt .tbx { border: 0.4mm solid #000; }
.rcpt .itm-v { color: #000; font-weight: 600; }
.rcpt .f { font-weight: 900; font-size: 12px; }
.kot { font-size: 11px; }
.kot .kitem { border-bottom: 0.35mm dashed #000; }
.kot .knm { font-weight: 800; }
.kot .kq { font-weight: 900; }
.kot .kt { font-weight: 900; font-size: 12px; border-top: 0.4mm solid #000; border-bottom: 0.4mm solid #000; }
.kot .ksub { font-weight: 700; color: #000; }
.kot .kc { font-weight: 800; }
.wt .wtn, .wt .wtplace, .wt .wtno { font-weight: 900; }
.lbl .lbl-no { font-size: 24px; }
/* ==========================================================================
   اصلاح منوی کارت‌ها (بریدگی) و نمای لیستی
   ========================================================================== */
/* منو نباید توسط کارت بریده شود */
.grid .card { overflow: visible !important; position: relative; }
.grid .card .cc-body { border-radius: 0 0 11px 11px; }
.cc-drop, .dd { z-index: 90 !important; }
.grid .card:has(.dd.on) { z-index: 95; }
.chk-body { overflow-y: auto; }

/* نمای لیستی: هر فیش یک ردیف استاندارد */
.grid.list-view { grid-template-columns: 1fr !important; gap: 4px !important; }
.grid.list-view .card {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 4px 8px !important;
  min-height: 0 !important;
  border-radius: 9px !important;
}
.grid.list-view .toolbar { order: 3; padding: 0 !important; flex: 0 0 auto; }
.grid.list-view .toolbar button { width: 24px; height: 24px; font-size: 11px; }
.grid.list-view .cc-ac { order: 2; }
.grid.list-view .cc-body {
  padding: 0 !important;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 0 !important;
}
.grid.list-view .cc-no { font-size: 12px !important; min-width: 44px; margin: 0 !important; }
.grid.list-view .cc-nm { font-size: 11.5px !important; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid.list-view .cc-mt { font-size: 9px !important; margin: 0 !important; flex: 0 0 auto; }
.grid.list-view .cc-tt { font-size: 12px !important; margin: 0 !important; white-space: nowrap; }
.grid.list-view .cc-tm { display: none; }
.grid.list-view .cc-ac { border-top: none; padding: 0 !important; flex: 0 0 auto; }
.grid.list-view .cc-ac .btn { padding: 3px 7px !important; font-size: 9.5px !important; }
/* ---------- چاپ: هیچ محتوایی از عرض کاغذ بیرون نزند ---------- */
@media print {
  #printArea, #printArea * { box-sizing: border-box !important; }
  #printArea .lbl, #printArea .wt, #printArea .rcpt, #printArea .kot {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow: hidden;
  }
  #printArea .lbl { padding: 2mm !important; }
  #printArea .wt { padding: 0 !important; }
  #printArea .lbl-top, #printArea .wth { max-width: 100%; }
  #printArea .lbl-items, #printArea .wtitem { overflow-wrap: anywhere; }
}

/* ---------- منوی کارت‌ها: متن کامل ---------- */
.dd { min-width: 250px !important; }
.dd button { white-space: normal !important; line-height: 1.6 !important; }
.grid.list-view .dd { min-width: 250px !important; }
/* ---------- نمای لیستی: چیدمان قطعی ---------- */
.grid.list-view .card {
  display: grid !important;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 5px 9px !important;
}
.grid.list-view .cc-body {
  display: flex !important;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  padding: 0 !important;
}
.grid.list-view .cc-no { margin: 0 !important; min-width: 42px; font-size: 12px !important; }
.grid.list-view .cc-nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px !important; }
.grid.list-view .cc-mt { flex: 0 0 auto; margin: 0 !important; font-size: 9px !important; white-space: nowrap; }
.grid.list-view .cc-tt { flex: 0 0 auto; margin: 0 !important; font-size: 12px !important; white-space: nowrap; }
.grid.list-view .cc-tm { display: none !important; }
.grid.list-view .cc-ac { display: flex; gap: 4px; border: none !important; padding: 0 !important; flex-wrap: nowrap; }
.grid.list-view .toolbar { position: relative; padding: 0 !important; gap: 3px; }
.grid.list-view .toolbar button { width: 24px; height: 24px; font-size: 11px; }
.grid.list-view .dd { top: 26px; right: 0; left: auto; }
/* ---------- چاپ: جلوگیری از شکستن وسط اقلام ---------- */
@media print {
  #printArea, #printArea .rcpt, #printArea .kot, #printArea .lbl, #printArea .wt {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  #printArea .itm, #printArea .kitem, #printArea .tbx, #printArea .wtitem, #printArea .lbl-items {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  #printArea { overflow: visible !important; }
}
/* ---------- چاپ: پرکردن کامل عرض کاغذ (بدون حاشیهٔ اضافه) ---------- */
@media print {
  html, body {
    width: var(--paper-w, 58mm) !important;
    max-width: var(--paper-w, 58mm) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }
  #printArea {
    width: var(--paper-w, 58mm) !important;
    max-width: var(--paper-w, 58mm) !important;
    margin: 0 !important;
    padding: 0 1.5mm !important;
    box-sizing: border-box !important;
    float: none !important;
    position: static !important;
  }
  #printArea .rcpt, #printArea .kot, #printArea .lbl, #printArea .wt {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
}
/* ---------- چاپ: عرض و تراز دقیق ---------- */
@media print {
  html, body {
    width: var(--paper-w, 48mm) !important;
    max-width: var(--paper-w, 48mm) !important;
    margin: 0 auto !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  #printArea {
    width: var(--paper-w, 48mm) !important;
    max-width: var(--paper-w, 48mm) !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    position: static !important;
    float: none !important;
  }
  #printArea .rcpt, #printArea .kot, #printArea .lbl, #printArea .wt {
    width: 100% !important; max-width: 100% !important; margin: 0 !important;
  }
}
/* ---------- منوی ⋯ : متن خوانا و مرتب ---------- */
.dd, .ccdrop { min-width: 210px !important; max-width: 300px !important; direction: rtl; }
.dd button {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: right !important;
  white-space: normal !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  letter-spacing: 0 !important;
  line-height: 1.85 !important;
  padding: 7px 12px !important;
  font-size: 11px !important;
}
.dd button > span { flex: 1 1 auto; }
.grid.list-view .dd { min-width: 210px !important; }
/* ---------- منوی ⋯ : بدون شکستن کلمات ---------- */
.dd, .ccdrop {
  width: max-content !important;
  min-width: 200px !important;
  max-width: 340px !important;
  direction: rtl;
}
.dd button {
  display: block !important;
  width: 100% !important;
  text-align: right !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
  line-height: 1.9 !important;
  letter-spacing: 0 !important;
  padding: 7px 12px !important;
  font-size: 11px !important;
}