﻿/* ═══════════════════════════════════════════════════════════════════
   داما سیستم — سیستم طراحی یکسان (RTL، Bootstrap 5، Tabulator، Tom Select)
   همه صفحه‌ها فقط از همین توکن‌ها و کلاس‌ها استفاده می‌کنند.
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --ty-primary: #0F2B5B;
  --ty-primary-600: #173a75;
  --ty-primary-50: #eef3fb;
  --ty-accent: #1E88E5;
  --ty-accent-50: #e8f2fd;
  --ty-bg: #F5F7FA;
  --ty-surface: #ffffff;
  --ty-border: #E5E7EB;
  --ty-border-strong: #d1d5db;
  --ty-text: #1f2937;
  --ty-muted: #6b7280;
  --ty-success: #15803d;
  --ty-success-50: #e9f7ef;
  --ty-warning: #b45309;
  --ty-warning-50: #fff7e6;
  --ty-danger: #c62828;
  --ty-danger-50: #fdecec;
  --ty-info: #0369a1;
  --ty-radius: 8px;
  --ty-control-h: 40px;
  --ty-sidebar-w: 264px;
  --ty-header-h: 60px;
  --ty-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .08);
  --ty-shadow-lg: 0 8px 24px rgba(16, 24, 40, .12);
  --ty-font: "Vazirmatn", "Tahoma", system-ui, sans-serif;
  --bs-body-font-family: var(--ty-font);
  --bs-body-bg: var(--ty-bg);
  --bs-body-color: var(--ty-text);
  --bs-border-color: var(--ty-border);
  --bs-border-radius: var(--ty-radius);
  --bs-primary: var(--ty-primary);
  --bs-primary-rgb: 15, 43, 91;
  --bs-link-color: var(--ty-accent);
  --bs-link-color-rgb: 30, 136, 229;
}

html, body { font-family: var(--ty-font); font-size: 14px; background: var(--ty-bg); color: var(--ty-text); }
body { font-feature-settings: "ss01"; -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { text-decoration: none; }
.ltr { direction: ltr; unicode-bidi: plaintext; }
.num { direction: ltr; unicode-bidi: plaintext; font-variant-numeric: tabular-nums; }
.text-muted, .form-text { color: var(--ty-muted) !important; }
:focus-visible { outline: 2px solid var(--ty-accent); outline-offset: 2px; }

/* ───── پوسته برنامه ───── */
.app-shell { min-height: 100vh; display: flex; }
.app-sidebar {
  width: var(--ty-sidebar-w); background: var(--ty-primary); color: #dbe5f5; position: fixed; inset: 0 0 0 auto;
  display: flex; flex-direction: column; z-index: 1040; transition: width .2s ease, transform .2s ease;
}
.app-brand { height: var(--ty-header-h); display: flex; align-items: center; gap: .6rem; padding: 0 1.1rem; color: #fff; font-weight: 800; font-size: 1.15rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.app-brand .logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #1E88E5, #36b37e); display: grid; place-items: center; color: #fff; font-size: 1.1rem; }
.app-brand small { display: block; font-size: .7rem; font-weight: 400; color: #9fb3d6; }
.app-nav { overflow-y: auto; flex: 1; padding: .6rem .5rem 1.5rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.app-nav .nav-group { margin-bottom: .15rem; }
.app-nav .nav-group-btn, .app-nav .nav-link {
  width: 100%; display: flex; align-items: center; gap: .65rem; color: #c9d6ee; padding: .55rem .8rem; border-radius: 7px; background: none; border: 0;
  font-size: .9rem; text-align: right; min-height: 40px;
}
.app-nav .nav-group-btn:hover, .app-nav .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.app-nav .nav-group-btn .bi-chevron-down { margin-inline-start: auto; font-size: .7rem; transition: transform .2s; }
.app-nav .nav-group-btn[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }
.app-nav .nav-sub { padding-inline-start: 1.65rem; }
.app-nav .nav-sub .nav-link { font-size: .85rem; padding: .42rem .7rem; min-height: 36px; }
.app-nav .nav-link.active { background: rgba(30,136,229,.22); color: #fff; font-weight: 600; box-shadow: inset -3px 0 0 #4aa3ff; }
.app-nav i.bi { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .95; }
.app-sidebar-foot { padding: .55rem .75rem; font-size: .72rem; color: #8ea4c9; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center;
  justify-content: space-between; gap: .5rem; flex-shrink: 0; }
/* دکمه «درباره داما سیستم» پایین منوی کناری */
.about-btn { display: inline-flex; align-items: center; gap: .45rem; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #dbe5f5;
  border-radius: 8px; padding: .4rem .7rem; font-size: .82rem; min-height: 36px; white-space: nowrap; }
.about-btn:hover, .about-btn:focus-visible { background: rgba(255,255,255,.14); color: #fff; }
.about-btn i { font-size: 1.05rem; }
.app-sidebar-foot .about-ver { white-space: nowrap; }

.app-main { flex: 1; margin-right: var(--ty-sidebar-w); min-width: 0; display: flex; flex-direction: column; transition: margin .2s; }
.app-header {
  height: var(--ty-header-h); background: var(--ty-surface); border-bottom: 1px solid var(--ty-border); display: flex; align-items: center; gap: .75rem;
  padding: 0 1.25rem; position: sticky; top: 0; z-index: 1030;
}
.app-header .tenant-chip { display: inline-flex; align-items: center; gap: .4rem; background: var(--ty-primary-50); color: var(--ty-primary); padding: .3rem .75rem; border-radius: 999px; font-weight: 600; font-size: .85rem; }
.app-header .tenant-chip.readonly { background: var(--ty-warning-50); color: var(--ty-warning); }
.app-header .btn-icon { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--ty-border); background: #fff; color: var(--ty-text); }
.app-header .user-btn { display: flex; align-items: center; gap: .5rem; border: 0; background: none; padding: .25rem .5rem; border-radius: 10px; }
.app-header .user-btn:hover { background: var(--ty-bg); }
.app-header .btn, .app-header .user-btn, .app-header .tenant-chip { white-space: nowrap; flex-shrink: 0; }
.app-header > .fw-bold { min-width: 0; }
.save-banner { border-radius: 12px; font-weight: 600; }
.validation-summary ul { padding-inline-start: 1.1rem; }
.validation-summary .err-link { color: inherit; text-decoration: none; border-bottom: 1px dashed currentColor; }
.validation-summary .err-link:hover { color: #7f1d1d; }
tr.row-invalid > td { background: #fff1f2 !important; }
tr.row-invalid > td:first-child { box-shadow: inset -3px 0 0 #dc3545; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ty-accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.app-content { padding: 1.25rem; flex: 1; }
.app-footer { padding: .6rem 1.25rem; color: var(--ty-muted); font-size: .75rem; }

body.sidebar-collapsed .app-sidebar { width: 72px; overflow-x: hidden; }
body.sidebar-collapsed .app-main { margin-right: 72px; }
body.sidebar-collapsed:not(.sidebar-peek) .app-brand span, body.sidebar-collapsed:not(.sidebar-peek) .app-nav .nav-group-btn span,
body.sidebar-collapsed:not(.sidebar-peek) .app-nav .nav-link > span:not(.nav-img),
body.sidebar-collapsed:not(.sidebar-peek) .app-nav .bi-chevron-down, body.sidebar-collapsed:not(.sidebar-peek) .app-nav .nav-sub,
body.sidebar-collapsed:not(.sidebar-peek) .app-sidebar-foot .about-ver, body.sidebar-collapsed:not(.sidebar-peek) .about-btn span { display: none !important; }
body.sidebar-collapsed:not(.sidebar-peek) .app-sidebar-foot { justify-content: center; padding-inline: 0; }
body.sidebar-collapsed:not(.sidebar-peek) .about-btn { padding: .4rem .6rem; }
body.sidebar-collapsed:not(.sidebar-peek) .app-nav .nav-group-btn, body.sidebar-collapsed:not(.sidebar-peek) .app-nav .nav-link { justify-content: center; padding-inline: 0; }
/* منوی جمع‌شده که با کلیک آیکون موقتاً روی صفحه باز شده (تا خروج نشانگر) */
body.sidebar-collapsed.sidebar-peek .app-sidebar { width: var(--ty-sidebar-w); box-shadow: -12px 0 32px rgba(15, 23, 42, .28); }
body.sidebar-collapsed .app-nav .nav-link > span, body.sidebar-collapsed .app-nav .nav-group-btn > span, body.sidebar-collapsed .app-brand > span { white-space: nowrap; }
/* راهنمای شناور عنوان آیکون‌های منوی جمع‌شده */
.nav-tip {
  position: fixed; z-index: 1080; transform: translateY(-50%) translateX(6px); pointer-events: none; opacity: 0; visibility: hidden;
  background: #0f2742; color: #fff; font-size: .82rem; font-weight: 600; padding: .38rem .7rem; border-radius: 8px; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .25); transition: opacity .12s ease, transform .12s ease, visibility .12s;
}
.nav-tip::after { content: ""; position: absolute; top: 50%; right: -5px; transform: translateY(-50%); border: 5px solid transparent; border-right: 0; border-left-color: #0f2742; }
.nav-tip.show { opacity: 1; visibility: visible; transform: translateY(-50%) translateX(0); }

@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(100%); box-shadow: var(--ty-shadow-lg); }
  body.sidebar-open .app-sidebar { transform: none; }
  .app-main, body.sidebar-collapsed .app-main { margin-right: 0; }
  .app-content { padding: .9rem; }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1035; }
  body.sidebar-open .sidebar-backdrop { display: block; }
}

/* ───── سرصفحه ───── */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.35rem; font-weight: 800; margin: 0; color: var(--ty-primary); }
.page-head .subtitle { color: var(--ty-muted); font-size: .85rem; margin-top: .15rem; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.breadcrumb { font-size: .8rem; margin-bottom: .2rem; --bs-breadcrumb-divider: "‹"; }

/* ───── کارت ───── */
.card { border: 1px solid var(--ty-border); border-radius: 12px; box-shadow: var(--ty-shadow); background: var(--ty-surface); }
.card + .card { margin-top: 1rem; }
.card-header { background: transparent; border-bottom: 1px solid var(--ty-border); padding: .85rem 1.1rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-header h2, .card-title { font-size: 1rem; font-weight: 700; margin: 0; color: var(--ty-primary); display: flex; align-items: center; gap: .45rem; }
.card-body { padding: 1.1rem; }
.form-section > .card-header { cursor: pointer; user-select: none; }
.form-section > .card-header .bi-chevron-down { transition: transform .2s; }
.form-section.collapsed > .card-header .bi-chevron-down { transform: rotate(90deg); }
.form-section.collapsed > .card-body { display: none; }

/* ───── کنترل‌های فرم یکسان ───── */
.dama-field { margin-bottom: .9rem; }
.form-label { font-weight: 600; font-size: .82rem; margin-bottom: .3rem; color: #374151; }
.form-label .req { color: var(--ty-danger); margin-inline-start: .2rem; }
.form-control, .form-select, .ts-wrapper.form-select .ts-control, .ts-wrapper .ts-control {
  min-height: var(--ty-control-h); border-radius: var(--ty-radius); border-color: var(--ty-border-strong); font-size: .9rem;
}
.form-control:focus, .form-select:focus, .ts-wrapper.focus .ts-control { border-color: var(--ty-accent); box-shadow: 0 0 0 .2rem rgba(30,136,229,.15); }
.form-control[readonly], .form-control:disabled, .form-select:disabled { background: #f3f4f6; }
.form-control::placeholder { color: #a0a8b5; opacity: 1; font-weight: 400; }
.form-control.is-invalid, .form-select.is-invalid, .is-invalid + .ts-wrapper .ts-control, .ts-wrapper.is-invalid .ts-control { border-color: var(--ty-danger); }
.invalid-feedback { font-size: .78rem; }
.input-group-text { background: #f8fafc; border-color: var(--ty-border-strong); color: var(--ty-muted); font-size: .8rem; }
.dama-num { text-align: left; font-variant-numeric: tabular-nums; }
.dama-date { text-align: left; }
.dama-check { display: flex; flex-direction: column; justify-content: flex-end; }
.dama-check .form-check { min-height: var(--ty-control-h); display: flex; align-items: center; gap: .55rem; padding: 0; margin: 0; }
.dama-check .form-check-input { width: 2.4em; height: 1.25em; margin: 0; float: none; }
.form-control-plaintext { min-height: var(--ty-control-h); padding: .45rem 0; font-weight: 500; }
.money-hint { font-size: .75rem; color: var(--ty-muted); margin-top: .2rem; }
.form-actions { position: sticky; bottom: 0; z-index: 5; background: rgba(245,247,250,.92); backdrop-filter: blur(4px); border-top: 1px solid var(--ty-border); margin: 1rem -1.25rem -1.25rem; padding: .8rem 1.25rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.form-actions .spacer { flex: 1; }
.audit-summary { font-size: .75rem; color: var(--ty-muted); display: flex; flex-wrap: wrap; gap: 1rem; }
.validation-summary { border-radius: 10px; }
.validation-summary ul { margin: 0; padding-inline-start: 1.2rem; }

/* Tom Select یکسان */
.ts-wrapper { min-height: var(--ty-control-h); }
.ts-wrapper.single .ts-control { padding: .45rem .75rem; display: flex; align-items: center; background-image: none; }
.ts-wrapper .ts-control input { font-size: .9rem; }
.ts-dropdown { border-radius: 10px; box-shadow: var(--ty-shadow-lg); font-size: .88rem; z-index: 1060; }
.ts-dropdown .option { padding: .45rem .75rem; }
.ts-dropdown .option .desc { display: block; font-size: .74rem; color: var(--ty-muted); }
/* مانده صندوق/حساب بانکی فقط در فهرست گزینه‌های کمبو (dama-select.js) */
.ts-dropdown .option .desc.ts-bal { font-weight: 600; }
.ts-dropdown .option .desc.ts-bal.pos { color: #15803d; }
.ts-dropdown .option .desc.ts-bal.neg { color: #b42318; }
.ts-dropdown .active { background: var(--ty-accent-50); color: var(--ty-text); }
.ts-wrapper.disabled .ts-control { background: #f3f4f6; opacity: 1; }
.ts-dropdown .no-results, .ts-dropdown .loading-more { padding: .5rem .75rem; color: var(--ty-muted); }
.ts-wrapper.single .ts-control::after { left: .75rem; right: auto; }
.ts-wrapper .clear-button { left: 1.8rem !important; right: auto !important; }

/* تاریخ */
jdp-container { z-index: 2000 !important; font-family: var(--ty-font) !important; border-radius: 12px !important; box-shadow: var(--ty-shadow-lg) !important; }

/* دکمه‌ها */
.btn { border-radius: var(--ty-radius); font-weight: 600; font-size: .86rem; min-height: var(--ty-control-h); display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding-inline: 1rem; }
.btn-sm { min-height: 32px; font-size: .8rem; padding-inline: .65rem; }
.btn-primary { --bs-btn-bg: var(--ty-primary); --bs-btn-border-color: var(--ty-primary); --bs-btn-hover-bg: var(--ty-primary-600); --bs-btn-hover-border-color: var(--ty-primary-600); --bs-btn-active-bg: #0b2148; }
.btn-accent { --bs-btn-color: #fff; --bs-btn-bg: var(--ty-accent); --bs-btn-border-color: var(--ty-accent); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #1976d2; --bs-btn-hover-border-color: #1976d2; }
.btn-outline-primary { --bs-btn-color: var(--ty-primary); --bs-btn-border-color: #b9c6dd; --bs-btn-hover-bg: var(--ty-primary); --bs-btn-hover-border-color: var(--ty-primary); }
.btn .spinner-border { width: 1rem; height: 1rem; border-width: .15em; }
@media (pointer: coarse) { .btn, .form-control, .form-select, .ts-wrapper .ts-control { min-height: 44px; } }

/* ───── گرید و صفحه‌بندی یکسان ───── */
.dama-grid-wrap { background: var(--ty-surface); border: 1px solid var(--ty-border); border-radius: 12px; overflow: hidden; }
.card .dama-grid-wrap { border: 0; border-radius: 0; }
.dama-grid-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; padding: .65rem .8rem; border-bottom: 1px solid var(--ty-border); background: #fbfcfe; }
.dama-grid-search { position: relative; flex: 1; max-width: 340px; min-width: 180px; }
.dama-grid-search i { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); color: var(--ty-muted); }
.dama-grid-search input { padding-right: 2rem; min-height: 36px; }
.dama-grid-tools { display: flex; gap: .4rem; }
.tabulator { border: 0; font-size: .86rem; background: transparent; direction: rtl; }
.tabulator .tabulator-header { border-bottom: 1px solid var(--ty-border); background: #f8fafc; color: #374151; font-weight: 700; }
.tabulator .tabulator-header .tabulator-col { background: #f8fafc; border-left: 1px solid #eef0f3; border-right: 0; }
.tabulator .tabulator-header .tabulator-col .tabulator-col-content { padding: .6rem .6rem; }
.tabulator .tabulator-tableholder .tabulator-table { background: #fff; }
.tabulator-row { border-bottom: 1px solid #f0f2f5; min-height: 40px; }
.tabulator-row.tabulator-row-even { background: #fcfdff; }
.tabulator-row.tabulator-selectable:hover { background: var(--ty-accent-50); cursor: pointer; }
/* رنگ ردیف از داده (GridBuilder.RowClass): اشتراک نزدیک پایان (زرد) و پایان‌یافته یا بدون اشتراک (قرمز) */
.tabulator-row.row-soon, .tabulator-row.row-soon.tabulator-row-even { background: #fff8e6; box-shadow: inset -4px 0 0 #f59e0b; }
.tabulator-row.row-expired, .tabulator-row.row-expired.tabulator-row-even { background: #fdf0f0; box-shadow: inset -4px 0 0 #dc2626; }
.tabulator-row.row-soon:hover { background: #fff1cc; }
/* کالای تازه رسیده از بنگاه دیگر (هنوز رسید آن باز نشده): سبز با نشان «جدید» */
.tabulator-row.row-new, .tabulator-row.row-new.tabulator-row-even { background: #ecfdf3; box-shadow: inset -4px 0 0 #16a34a; font-weight: 600; }
.tabulator-row.row-new:hover { background: #dcfce7; }
.tabulator-row.row-new .tabulator-cell:first-child::after { content: "جدید"; margin-inline-start: .35rem; padding: .05rem .4rem; border-radius: 999px;
    background: #16a34a; color: #fff; font-size: .68rem; font-weight: 700; vertical-align: middle; }
.tabulator-row.row-expired:hover { background: #fbe2e2; }
.legend-swatch { display: inline-block; width: .9rem; height: .9rem; border-radius: .2rem; vertical-align: -.15rem; margin-left: .25rem; }
.legend-soon { background: #fff8e6; border-right: 4px solid #f59e0b; }
.legend-expired { background: #fdf0f0; border-right: 4px solid #dc2626; }
/* فرم تمدید اشتراک: دکمه‌های مدت آماده */
.ext-spans { margin-bottom: .9rem; }
.ext-spans-row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-bottom: .35rem; }
.ext-spans-label { font-size: .85rem; color: var(--bs-secondary-color); min-width: 11rem; }
/* Tabulator ترازِ «راست» را با justify-content:flex-end می‌سازد که در راست‌به‌چپ یعنی چپ؛ متن فارسی از راست شروع شود */
.tabulator .tabulator-cell[style*="justify-content: flex-end"] { justify-content: flex-start !important; }
.tabulator-row .tabulator-cell { padding: .55rem .6rem; border-left: 1px solid #f5f6f8; border-right: 0; }
.tabulator .tabulator-footer { background: #f8fafc; border-top: 1px solid var(--ty-border); font-weight: 700; }
.tabulator .tabulator-col-sorter { right: auto; left: 4px; }
.tabulator-placeholder span { color: var(--ty-muted) !important; font-size: .9rem !important; font-weight: 500 !important; }
.tabulator .tabulator-frozen.tabulator-frozen-left { border-left: 1px solid var(--ty-border); }
.grid-actions { display: flex; gap: .25rem; justify-content: center; }
.grid-actions a, .grid-actions button { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 7px; border: 1px solid var(--ty-border); background: #fff; color: var(--ty-primary); padding: 0; }
/* hover ملایم: زمینه روشن هم‌رنگ دکمه به‌جای زمینه پررنگ */
.grid-actions a, .grid-actions button { transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease; }
.grid-actions a:hover, .grid-actions button:hover { background: var(--ty-primary-50); border-color: color-mix(in srgb, var(--ty-primary) 35%, #fff); color: var(--ty-primary); box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }
.grid-actions a.text-success:hover, .grid-actions button.text-success:hover { background: var(--ty-success-50); border-color: color-mix(in srgb, var(--ty-success) 35%, #fff); }
.grid-actions .danger { color: var(--ty-danger); }
.grid-actions .danger:hover { background: var(--ty-danger-50); border-color: color-mix(in srgb, var(--ty-danger) 35%, #fff); color: var(--ty-danger); }
.dama-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .8rem; border-top: 1px solid var(--ty-border); background: #fbfcfe; font-size: .82rem; color: var(--ty-muted); }
.dama-pager .pages { display: flex; gap: .25rem; align-items: center; }
.dama-pager .pages button { min-width: 34px; height: 34px; border: 1px solid var(--ty-border); background: #fff; border-radius: 8px; color: var(--ty-text); font-size: .8rem; }
.dama-pager .pages button.active { background: var(--ty-primary); color: #fff; border-color: var(--ty-primary); }
.dama-pager .pages button:disabled { opacity: .45; }
.dama-pager select { width: auto; min-height: 34px; padding-block: .2rem; font-size: .8rem; }
.grid-state { padding: 2rem; text-align: center; color: var(--ty-muted); }
.grid-state .bi { font-size: 1.8rem; display: block; margin-bottom: .4rem; }
.grid-error { color: var(--ty-danger); }

/* ───── فیلتر ───── */
.filter-panel { margin-bottom: 1rem; }
.filter-panel .card-body { padding-bottom: .2rem; }
.filter-panel .filter-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-bottom: .9rem; }
.filter-panel .filter-actions .btn { white-space: nowrap; }

/* ───── سطرهای سند ───── */
.lines-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.lines-table thead th { background: #f8fafc; font-size: .78rem; font-weight: 700; color: #374151; padding: .55rem .45rem; border-bottom: 1px solid var(--ty-border); white-space: nowrap; position: sticky; top: 0; z-index: 2; }
.lines-table tbody td { padding: .35rem .3rem; border-bottom: 1px solid #f0f2f5; vertical-align: top; }
.lines-table tbody td .dama-field { margin: 0; }
.lines-table tbody td .form-label { display: none; }
.lines-table .row-no { width: 34px; text-align: center; color: var(--ty-muted); padding-top: .7rem; }
.lines-table .row-del { width: 40px; }
.lines-table tfoot td { padding: .55rem .45rem; font-weight: 700; background: #f8fafc; }
.lines-wrap { overflow-x: auto; border: 1px solid var(--ty-border); border-radius: 10px; }
.lines-wrap .lines-table { min-width: 860px; }
/* جدول گزارشی (table[data-scroll]، dama-columns.js): در موبایل و تبلت هم جدول می‌ماند و اسکرول افقی می‌گیرد؛ ستون شناسه ثابت */
.lines-table[data-scroll] thead th { white-space: normal; text-overflow: clip; line-height: 1.3; vertical-align: bottom; }
.lines-table[data-scroll] tbody td { white-space: nowrap; }
.lines-table[data-scroll] tbody td.ta-r { white-space: normal; } /* متن (نام حساب، هشدار) می‌شکند؛ عدد و تاریخ یک‌خطی */
/* ردیف عنوان گروه (colspan) در اسکرول افقی: عنوان کنار لبه شروع کادر می‌ماند */
.lines-table[data-scroll] tr.cost-group .cg-title { position: sticky; inset-inline-start: .9rem; display: inline-block; }
.lines-table .sticky-col { position: sticky; z-index: 1; background-color: var(--ty-surface, #fff); }
.lines-wrap .lines-table thead th.sticky-col { z-index: 4; background-color: #f8fafc; } /* بالاتر از سرستون‌های چسبان دیگر (daily-wrap: z-index 2) */
.lines-table tbody tr.table-success > td { background-color: #e8f6ee; }
/* جدول بلند گزارش (تراز آزمایشی): ارتفاع محدود با سرستون چسبان */
.tall-wrap { max-height: 72vh; overflow: auto; }
html.print-mode .tall-wrap { max-height: none; overflow: visible; }
/* دکمه داخل جدول گزارشی در صفحه لمسی: ۳۴px (نه ۴۴px عمومی) تا ردیف‌ها بی‌دلیل بلند نشوند */
@media (pointer: coarse) { .lines-table[data-scroll] .btn-sm { min-height: 34px; padding-block: .2rem; } }
/* تراز آزمایشی: ردیف گروه و رنگ ملایم گروه ستون‌ها (ابتدا، گردش، پایان دوره) */
.lines-table tbody tr.tb-group > td { background-color: #f1f5f9; font-weight: 700; }
.tb-table thead th.tb-open { background-color: #f3f7fd; }
.tb-table thead th.tb-period { background-color: #f6f3fd; }
.tb-table thead th.tb-close { background-color: #eff8f2; }
.lines-table tbody tr.table-success > td.sticky-col { background-color: #e8f6ee; }
.lines-table tfoot .sticky-col { background-color: #f8fafc; }
.lines-table .sticky-edge { box-shadow: inset 1px 0 0 var(--ty-border), -6px 0 8px -6px rgba(15, 23, 42, .3); }
.lines-toolbar .scroll-hint { display: none; }
@media (max-width: 991.98px) {
    .lines-toolbar:has(.scroll-hint) .resize-hint { display: none; }
    .lines-toolbar .scroll-hint { display: inline; }
}
@media (max-width: 767.98px) {
    .lines-table[data-scroll] { font-size: .8rem; }
    .lines-table[data-scroll] thead th { padding: .45rem .35rem; font-size: .72rem; }
    .lines-table[data-scroll] tbody td { padding: .3rem .35rem; }
    .card-body:has(> .lines-wrap > .lines-table[data-scroll]) { padding: .6rem; }
}
/* برنامه بهداشتی گله (جدول Bootstrap): خانه‌ها یک‌خطی و اسکرول افقی؛ فقط عنوان کار می‌شکند */
@media (max-width: 991.98px) {
    .health-table th, .health-table td { white-space: nowrap; }
    .health-table td.task { white-space: normal; min-width: 230px; }
}
.btn-add-line { border-style: dashed !important; }

/* ───── وضعیت ───── */
.badge { font-weight: 600; border-radius: 6px; padding: .35em .6em; }
.st-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.st-draft { background: #eef2f7; color: #475569; }
.st-submitted { background: #fff4e5; color: #b45309; }
.st-approved { background: #e0f2fe; color: #0369a1; }
.st-posted { background: #e8f6ee; color: #15803d; }
.st-rejected, .st-cancelled { background: #fdecec; color: #b91c1c; }
.st-reversed { background: #f3e8ff; color: #7e22ce; }
.st-active { background: #e8f6ee; color: #15803d; }
.st-planned { background: #e0f2fe; color: #0369a1; }
.st-closed { background: #eef2f7; color: #475569; }
.st-warning { background: #fff4e5; color: #b45309; }

/* ───── داشبورد و KPI ───── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .85rem; margin-bottom: 1rem; }
.kpi { background: var(--ty-surface); border: 1px solid var(--ty-border); border-radius: 12px; padding: .9rem 1rem; box-shadow: var(--ty-shadow); display: flex; gap: .8rem; align-items: center; min-height: 86px; }
.kpi .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; background: var(--ty-primary-50); color: var(--ty-primary); }
.kpi .ico.green { background: var(--ty-success-50); color: var(--ty-success); }
.kpi .ico.orange { background: var(--ty-warning-50); color: var(--ty-warning); }
.kpi .ico.red { background: var(--ty-danger-50); color: var(--ty-danger); }
.kpi .ico.blue { background: var(--ty-accent-50); color: var(--ty-accent); }
.kpi .label { font-size: .78rem; color: var(--ty-muted); }
.kpi .value { font-size: 1.3rem; font-weight: 800; color: var(--ty-text); line-height: 1.3; direction: ltr; unicode-bidi: plaintext; text-align: right; }
.kpi .value small { font-size: .72rem; font-weight: 500; color: var(--ty-muted); }
.kpi .note { font-size: .7rem; color: var(--ty-muted); }
.kpi.estimate .value::after { content: "≈"; margin-inline-start: .25rem; color: var(--ty-warning); font-size: .9rem; }
.kpi-table td, .kpi-table th { padding: .45rem .6rem; font-size: .85rem; }
.alert-list .alert { display: flex; gap: .7rem; align-items: flex-start; border-radius: 10px; margin-bottom: .55rem; padding: .7rem .9rem; font-size: .85rem; }
.alert-list .alert i { font-size: 1.15rem; margin-top: .1rem; }
.flock-tile { border: 1px solid var(--ty-border); border-radius: 12px; padding: .8rem .9rem; background: #fff; height: 100%; display: flex; flex-direction: column; gap: .35rem; }
.flock-tile .title { font-weight: 700; color: var(--ty-primary); display: flex; justify-content: space-between; gap: .5rem; }
.flock-tile .meta { font-size: .78rem; color: var(--ty-muted); display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.flock-tile .meta b { color: var(--ty-text); }
.flock-tile.missing { border-color: #f59e0b; box-shadow: inset 0 3px 0 #f59e0b; }
.chart-box { position: relative; height: 260px; }

/* ───── گزارش ───── */
.report-table { width: 100%; font-size: .86rem; }
.report-table th { background: #f8fafc; font-weight: 700; color: #374151; position: sticky; top: 0; }
.report-table th, .report-table td { padding: .5rem .6rem; border-bottom: 1px solid #edf0f4; }
.report-table tr.total td { font-weight: 800; background: #f8fafc; border-top: 2px solid var(--ty-border-strong); }
.report-table tr.section td { background: var(--ty-primary-50); font-weight: 700; color: var(--ty-primary); }
.report-table td.amount, .report-table th.amount { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-head { display: none; }
.neg { color: var(--ty-danger); }
.pos { color: var(--ty-success); }

/* ───── احراز هویت ───── */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(1100px 600px at 100% 0, #dff1e6 0, transparent 60%), radial-gradient(900px 520px at 0 100%, #fbefd2 0, transparent 60%), var(--ty-bg); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .card-body { padding: 2rem; }
/* سوال امنیتی و فراموشی رمز */
.login-extra { margin-bottom: .4rem; }
.login-extra .dama-field { margin-bottom: 0; }
/* فرم کالا: بخش‌های مشترک قفل‌شده برای کاربر بنگاه (fieldset بدون اثر روی چیدمان ردیف) و عنوان بخش «ویژه بنگاه» */
fieldset.catalog-lock { display: contents; }
.company-only-title { font-size: .82rem; font-weight: 700; color: var(--ty-primary); border-top: 1px dashed var(--ty-border); padding-top: .5rem; margin-bottom: .5rem; }
/* «مرا به خاطر بسپار» و «فراموشی رمز» در همه عرض‌ها یک ردیف و هم‌راستا (وسط عمودی) */
.login-extra .dama-check { justify-content: center; min-width: 0; }
.login-extra .dama-check .form-check { min-height: 2rem; }
.login-extra .form-check-label, .login-extra > a { font-size: .85rem; line-height: 1.4; white-space: nowrap; }
.login-extra > a { display: inline-flex; align-items: center; gap: .3rem; }
@media (max-width: 359.98px) { .login-extra .form-check-label, .login-extra > a { font-size: .78rem; } }
.sq-head { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: 1rem; }
.sq-icon { flex: 0 0 auto; width: 2.6rem; height: 2.6rem; border-radius: .75rem; display: grid; place-items: center; font-size: 1.3rem;
  background: var(--ty-primary-50); color: var(--ty-primary); }
.sq-icon.ok { background: #e7f6ee; color: #15803d; }
.sq-status { display: flex; gap: .6rem; align-items: flex-start; border-radius: .6rem; padding: .65rem .8rem; margin-bottom: .9rem; font-size: .9rem; }
.sq-status > i { font-size: 1.1rem; line-height: 1.3; }
.sq-status.ok { background: #e7f6ee; color: #14532d; }
.sq-status.warn { background: #fff4e5; color: #92400e; }
.sq-privacy { display: flex; gap: .5rem; align-items: flex-start; font-size: .8rem; color: var(--bs-secondary-color); background: var(--ty-bg, #f5f7fa);
  border-radius: .5rem; padding: .55rem .7rem; }
.sq-privacy > i { font-size: 1rem; line-height: 1.3; }
.sq-steps { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1rem; counter-reset: sq; font-size: .82rem; }
.sq-steps li { flex: 1; display: flex; align-items: center; gap: .4rem; color: var(--bs-secondary-color); padding-bottom: .4rem; border-bottom: 3px solid #e5e8ee; }
.sq-steps li::before { counter-increment: sq; content: counter(sq, persian); width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center;
  background: #e5e8ee; font-weight: 700; font-size: .75rem; }
.sq-steps li.active { color: var(--ty-primary, #10294f); font-weight: 600; border-color: var(--ty-primary, #10294f); }
.sq-steps li.active::before { background: var(--ty-primary, #10294f); color: #fff; }
.sq-steps li.done { color: #15803d; border-color: #22c55e; }
.sq-steps li.done::before { content: "✓"; background: #22c55e; color: #fff; }
.auth-logo { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.5rem; }
.auth-logo .logo { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, #1E88E5, #36b37e); display: grid; place-items: center; color: #fff; font-size: 1.5rem; }
.auth-logo h1 { font-size: 1.3rem; margin: 0; font-weight: 800; color: var(--ty-primary); }
.auth-logo p { margin: 0; color: var(--ty-muted); font-size: .82rem; }

/* toast */
.toast-container { z-index: 2100; }
.toast { border-radius: 12px; box-shadow: var(--ty-shadow-lg); font-size: .88rem; }

/* ───── چاپ ───── */
/* ───────────── چاپ حرفه‌ای (پیش‌نمایش + چاپ) — dama-print.js ───────────── */
.print-header, .print-signatures { display: none; }
html.print-mode, html.print-mode * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
html.print-mode .app-shell .app-sidebar, html.print-mode .app-shell .app-header, html.print-mode .app-shell .app-footer, html.print-mode .sidebar-backdrop,
html.print-mode .app-shell .no-print, html.print-mode .app-shell .btn, html.print-mode .app-shell .dama-grid-toolbar, html.print-mode .app-shell .dama-pager,
html.print-mode .app-shell .filter-panel, html.print-mode .app-shell .form-actions, html.print-mode .app-shell .page-head .actions,
html.print-mode .app-shell .breadcrumb, html.print-mode .app-shell .save-banner, html.print-mode .toast-container, html.print-mode .visually-hidden-focusable { display: none !important; }
html.print-mode body { background: #dfe4ea; }
html.print-mode .app-main { margin: 0 !important; display: block; }
html.print-mode .app-content {
  width: var(--sheet-w); min-height: var(--sheet-h); margin: 76px auto 40px; padding: var(--sheet-m); background: #fff; position: relative;
  box-shadow: 0 6px 28px rgba(15, 23, 42, .22); flex: none; overflow: visible;
}
html.print-mode .print-zoom { zoom: var(--print-zoom, 1); color: #111827; font-size: 12.5px; }
/* سربرگ */
html.print-mode .print-header {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding-bottom: 8px; margin-bottom: 12px;
  border-bottom: 2.5px solid #1e3a5f; break-inside: avoid;
}
html.print-mode.print-no-header .print-header { display: none; }
.print-header .ph-org { display: flex; align-items: center; gap: 8px; }
.print-header .ph-logo { width: 34px; height: 34px; }
.print-header .ph-org strong { display: block; font-size: 14px; color: #1e3a5f; }
.print-header .ph-org span { display: block; font-size: 10px; color: #64748b; }
.print-header .ph-title { font-size: 17px; font-weight: 800; color: #0f172a; text-align: center; }
.print-header .ph-meta { font-size: 10px; color: #475569; text-align: left; line-height: 1.7; }
html.print-mode:not(.print-no-header) .page-head h1 { display: none; }
html.print-mode .page-head { margin-bottom: 8px; }
html.print-mode .page-head .subtitle { color: #334155; }
/* بخش‌ها و کارت‌ها */
html.print-mode .card { box-shadow: none !important; border: 1px solid #cbd5e1; border-radius: 6px; margin-bottom: 10px !important; break-inside: avoid; }
html.print-mode .card-header { background: #f1f5f9 !important; border-bottom: 1px solid #cbd5e1; padding: 5px 10px; }
html.print-mode .card-header h2, html.print-mode .card-header .h6 { font-size: 12.5px; font-weight: 700; color: #1e3a5f; }
html.print-mode .card-body { padding: 8px 10px; }
html.print-mode .form-section > .card-header > .bi-chevron-down { display: none; }
html.print-mode .dama-static { margin-bottom: 6px; }
html.print-mode .dama-static .form-label { color: #64748b; font-size: 10.5px; margin-bottom: 1px; }
html.print-mode .dama-static .form-control-plaintext { padding: 0 0 2px; font-weight: 600; border-bottom: 1px dotted #cbd5e1; min-height: 0; }
/* جدول‌ها */
html.print-mode .table-responsive, html.print-mode .lines-wrap { overflow: visible !important; max-height: none !important; }
html.print-mode .table { border-collapse: collapse; margin-bottom: 0; font-size: 11.5px; width: 100%; }
html.print-mode .table > :not(caption) > * > * { border: 1px solid #b6c1ce; padding: 3px 6px; box-shadow: none; }
html.print-mode .table thead th { background: #e2e8f0 !important; color: #0f172a; font-weight: 700; position: static !important; white-space: nowrap; }
html.print-mode .table tbody tr:nth-child(even) > * { background: #f8fafc; }
html.print-mode .table tfoot > tr > * { background: #eef2f7 !important; border-top: 2px solid #475569; font-weight: 700; }
html.print-mode .table tr { break-inside: avoid; }
html.print-mode .table thead { display: table-header-group; }
html.print-mode .table tfoot { display: table-footer-group; }
html.print-mode .table-warning > *, html.print-mode .table-danger > * { background: #fff7e6 !important; }
/* چاپ فهرست‌های گرید (dama-grid.js → T.gridPrint): جدول ساده به‌جای Tabulator، فقط هنگام چاپ */
.grid-print { display: none; }
html.print-mode .grid-print { display: block; }
html.print-mode .app-shell [data-grid].has-print { display: none !important; }
html.print-mode .grid-print .gp-filter { font-size: 11px; color: #334155; margin: 0 0 6px; padding: 4px 8px; border: 1px solid #cbd5e1; border-radius: 6px; background: #f8fafc !important; }
html.print-mode .grid-print .gp-table td { white-space: normal; vertical-align: middle; }
html.print-mode .grid-print .gp-table .gp-c { text-align: center; }
html.print-mode .grid-print .gp-table .gp-r { text-align: right; }
html.print-mode .grid-print .gp-table .gp-no { width: 34px; }
html.print-mode .grid-print .gp-table .gp-nw { white-space: nowrap; }
html.print-mode .grid-print .gp-table .grid-actions { display: none; }
/* ردیف‌های گزارش در چاپ یک‌خطی؛ مقیاس خودکار (dama-print.js) جدول را با اندازه و جهت کاغذ در عرض برگه جا می‌دهد.
   اگر یک‌خطی ماندن متن‌های بلند مقیاس را از حد خوانایی کمتر کند، فقط همان خانه‌های بلند (pc-long) می‌شکنند */
html.print-mode .print-zoom :is(.lines-table, .report-table, .table) :is(td, th):not(:is(.voucher, .invoice) *) { white-space: nowrap; }
html.print-mode.print-wrap-long .print-zoom :is(.lines-table, .report-table, .table) td.pc-long:not(:is(.voucher, .invoice) *),
html.print-mode.print-wrap-long .grid-print .gp-table td.pc-long { white-space: normal; min-width: 140px; }
.print-filter { display: none; }
html.print-mode .print-filter { display: block; font-size: 11px; color: #334155; margin: 0 0 6px; padding: 4px 8px; border: 1px solid #cbd5e1; border-radius: 6px; background: #f8fafc !important; }
html.print-mode .grid-print .gp-count { font-size: 10.5px; color: #64748b; margin-top: 4px; }
html.print-mode a { color: inherit !important; text-decoration: none !important; }
html.print-mode .badge, html.print-mode .st-badge { background: #fff !important; color: #111827 !important; border: 1px solid #94a3b8; }
html.print-mode .kpi { box-shadow: none; border: 1px solid #cbd5e1; break-inside: avoid; }
html.print-mode .chart-box { break-inside: avoid; }
/* جای امضا (اسناد) */
html.print-mode .print-signatures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; break-inside: avoid; }
html.print-mode.print-no-signs .print-signatures { display: none; }
.print-signatures .sig { text-align: center; }
.print-signatures .sig-title { font-weight: 700; font-size: 12px; color: #1e3a5f; margin-bottom: 42px; }
.print-signatures .sig-line { border-top: 1px solid #475569; padding-top: 3px; font-size: 10px; color: #64748b; }
/* ستون‌ها روی کاغذ مثل صفحه بمانند (عرض کاغذ کمتر از نقطه‌شکست md است) */
html.print-mode .col-md-1 { flex: 0 0 auto; width: 8.3333%; }
html.print-mode .col-md-2 { flex: 0 0 auto; width: 16.6667%; }
html.print-mode .col-md-3 { flex: 0 0 auto; width: 25.0000%; }
html.print-mode .col-md-4 { flex: 0 0 auto; width: 33.3333%; }
html.print-mode .col-md-5 { flex: 0 0 auto; width: 41.6667%; }
html.print-mode .col-md-6 { flex: 0 0 auto; width: 50.0000%; }
html.print-mode .col-md-7 { flex: 0 0 auto; width: 58.3333%; }
html.print-mode .col-md-8 { flex: 0 0 auto; width: 66.6667%; }
html.print-mode .col-md-9 { flex: 0 0 auto; width: 75.0000%; }
html.print-mode .col-md-10 { flex: 0 0 auto; width: 83.3333%; }
html.print-mode .col-md-11 { flex: 0 0 auto; width: 91.6667%; }
html.print-mode .col-md-12 { flex: 0 0 auto; width: 100.0000%; }
html.print-mode .col-lg-1 { flex: 0 0 auto; width: 8.3333%; }
html.print-mode .col-lg-2 { flex: 0 0 auto; width: 16.6667%; }
html.print-mode .col-lg-3 { flex: 0 0 auto; width: 25.0000%; }
html.print-mode .col-lg-4 { flex: 0 0 auto; width: 33.3333%; }
html.print-mode .col-lg-5 { flex: 0 0 auto; width: 41.6667%; }
html.print-mode .col-lg-6 { flex: 0 0 auto; width: 50.0000%; }
html.print-mode .col-lg-7 { flex: 0 0 auto; width: 58.3333%; }
html.print-mode .col-lg-8 { flex: 0 0 auto; width: 66.6667%; }
html.print-mode .col-lg-9 { flex: 0 0 auto; width: 75.0000%; }
html.print-mode .col-lg-10 { flex: 0 0 auto; width: 83.3333%; }
html.print-mode .col-lg-11 { flex: 0 0 auto; width: 91.6667%; }
html.print-mode .col-lg-12 { flex: 0 0 auto; width: 100.0000%; }
html.print-mode .col-xl-1 { flex: 0 0 auto; width: 8.3333%; }
html.print-mode .col-xl-2 { flex: 0 0 auto; width: 16.6667%; }
html.print-mode .col-xl-3 { flex: 0 0 auto; width: 25.0000%; }
html.print-mode .col-xl-4 { flex: 0 0 auto; width: 33.3333%; }
html.print-mode .col-xl-5 { flex: 0 0 auto; width: 41.6667%; }
html.print-mode .col-xl-6 { flex: 0 0 auto; width: 50.0000%; }
html.print-mode .col-xl-7 { flex: 0 0 auto; width: 58.3333%; }
html.print-mode .col-xl-8 { flex: 0 0 auto; width: 66.6667%; }
html.print-mode .col-xl-9 { flex: 0 0 auto; width: 75.0000%; }
html.print-mode .col-xl-10 { flex: 0 0 auto; width: 83.3333%; }
html.print-mode .col-xl-11 { flex: 0 0 auto; width: 91.6667%; }
html.print-mode .col-xl-12 { flex: 0 0 auto; width: 100.0000%; }
/* نوار پیش‌نمایش و خطوط پایان صفحه (فقط روی صفحه) */
.print-toolbar {
  position: fixed; inset: 0 0 auto 0; z-index: 3000; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 10px 16px; background: #1e293b; color: #e2e8f0; box-shadow: 0 2px 12px rgba(0, 0, 0, .3); font-size: 13px;
}
.print-toolbar .pt-title { font-weight: 800; color: #fff; display: flex; align-items: center; gap: 6px; }
.print-toolbar .pt-field { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.print-toolbar .pt-field .form-select { width: auto; min-width: 90px; }
.print-toolbar .pt-check { display: flex; align-items: center; gap: 5px; white-space: nowrap; cursor: pointer; }
.print-toolbar .pt-rot { display: inline-block; transform: rotate(90deg); }
.print-toolbar .btn-outline-light.active { background: #e2e8f0; color: #1e293b; }
.print-toolbar .pt-info { color: #94a3b8; font-size: 12px; }
.print-toolbar .pt-spacer { flex: 1; }
.print-guide {
  position: absolute; inset-inline: 0; height: 0; border-top: 2px dashed #f59e0b; z-index: 5; pointer-events: none;
}
.print-guide::after {
  content: attr(data-label); position: absolute; left: 6px; top: -10px; background: #f59e0b; color: #fff; font-size: 10px; padding: 0 6px; border-radius: 6px;
}

@media print {
  html.print-mode body { background: #fff; }
  html.print-mode .app-content { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
  .print-toolbar, .print-guide { display: none !important; }
  /* چاپ بدون اسکریپت (حالت پشتیبان) */
  .app-sidebar, .app-header, .app-footer, .no-print, .app-shell .btn { display: none !important; }
  .app-main { margin: 0 !important; }
}


/* سلول‌های سطرهای سند (حالت cell کنترل‌ها) */
.dama-cell { margin: 0; min-width: 0; }
.dama-cell .invalid-feedback:empty { display: none; }
.dama-cell.dama-check { padding-top: .55rem; }
.dama-cell.dama-check .form-check-label { font-size: .8rem; color: var(--ty-muted); }
.lines-table .btn-icon { width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; margin-top: .2rem; }
.lines-table td.calc { padding-top: .7rem; font-weight: 600; white-space: nowrap; text-align: center; direction: ltr; }
.lines-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .6rem; }
.doc-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; }
.doc-totals .t { background: #f8fafc; border: 1px solid var(--ty-border); border-radius: 8px; padding: .5rem .75rem; }
.doc-totals .t span { display: block; font-size: .75rem; color: var(--ty-muted); }
.doc-totals .t strong { font-size: 1.05rem; direction: ltr; display: inline-block; }
.doc-totals .t.grand { background: #eef5ff; border-color: #cfe2ff; }
/* آنالیز جیره (فرمول و تولید دان) */
.diet-panel .doc-totals { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); }
.diet-panel .doc-totals .t small { font-size: .7rem; color: var(--ty-muted); margin-inline-start: .25rem; }
.diet-panel .diet-missing { font-size: .82rem; }
.diet-panel .diet-missing ul { margin: .25rem 0 0; padding-inline-start: 1.1rem; }
.table-center th, .table-center td { text-align: center; vertical-align: middle; }
.diet-compare td.diff-up { color: #0f7a3e; }
.diet-compare td.diff-down { color: #b42318; }
.lines-table { table-layout: fixed; }
.lines-table thead th:first-child { width: 38px; }
.lines-table thead th:last-child { width: 48px; }
.lines-table .dama-cell .form-control, .lines-table .dama-cell .ts-wrapper { min-width: 0; }
.empty-state { text-align: center; padding: 2rem 1rem; color: var(--ty-muted); }
.empty-state > i { font-size: 2.2rem; display: block; margin-bottom: .4rem; opacity: .6; }
.sticky-head thead th { position: sticky; top: 0; background: #f8fafc; z-index: 1; white-space: nowrap; font-size: .78rem; }
.table td.num, .table th.num { direction: ltr; unicode-bidi: plaintext; }
.select-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.select-tiles a { display: block; border: 1px solid var(--ty-border); border-radius: 12px; padding: .9rem 1rem; background: var(--ty-surface); color: var(--ty-text); text-decoration: none; box-shadow: var(--ty-shadow); }
.select-tiles a:hover { border-color: var(--ty-accent); }
.select-tiles .t { font-weight: 700; }
.select-tiles .d { font-size: .8rem; color: var(--ty-muted); }
/* وضعیت گزارش روزانه هر سالن در یک تاریخ: کاشی‌های انتخاب سالن و نوار سالن‌های فرم (سبز قطعی، نارنجی پیش‌نویس، خاکستری ثبت نشده) */
.select-tiles .tiles-summary { grid-column: 1 / -1; font-size: .85rem; color: var(--ty-muted); }
.select-tiles a.hs-posted { border-inline-start: 4px solid #16a34a; }
.select-tiles a.hs-posted .t .bi { color: #16a34a; }
.select-tiles a.hs-draft { border-inline-start: 4px solid #f59e0b; background: #fffbeb; }
.select-tiles a.hs-draft .t .bi { color: #d97706; }
.select-tiles a.hs-empty { border-inline-start: 4px solid #cbd5e1; }
.house-strip { background: var(--ty-surface); border: 1px solid var(--ty-border); border-radius: 10px; padding: .5rem .6rem; margin-bottom: .75rem; }
.house-strip .hs-head { display: flex; justify-content: space-between; font-size: .8rem; color: var(--ty-muted); margin-bottom: .35rem; }
.house-strip .hs-items { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: 2px; }
.house-strip .hs-item { flex: 0 0 auto; display: flex; flex-direction: column; min-width: 120px; padding: .35rem .6rem; border: 1px solid var(--ty-border);
  border-radius: 8px; text-decoration: none; color: var(--ty-text); background: #fff; line-height: 1.35; }
.house-strip .hs-item .bi { font-size: .9rem; }
.house-strip .hs-item .hs-name { font-weight: 700; font-size: .85rem; }
.house-strip .hs-item small { color: var(--ty-muted); font-size: .72rem; }
.house-strip .hs-item.hs-posted { border-color: #86efac; } .house-strip .hs-item.hs-posted .bi { color: #16a34a; }
.house-strip .hs-item.hs-draft { border-color: #fcd34d; background: #fffbeb; } .house-strip .hs-item.hs-draft .bi { color: #d97706; }
.house-strip .hs-item.hs-empty .bi { color: #94a3b8; }
/* سالن فعلی: کادر داخل خود کارت (outline بیرونی در نوار اسکرول‌دار بریده می‌شد) */
.house-strip .hs-items { padding: 3px 2px 4px; }
.house-strip .hs-item.current { border: 2px solid var(--ty-accent); background: #e8f2fd; box-shadow: inset 0 -3px 0 var(--ty-accent); position: relative; }
.house-strip .hs-item.current .hs-name { color: #0d47a1; }
.house-strip .hs-item.current::before { content: "سالن فعلی"; position: absolute; top: -1px; inset-inline-end: 6px; transform: translateY(-50%);
  background: var(--ty-accent); color: #fff; font-size: .62rem; font-weight: 700; padding: 0 .4rem; border-radius: 6px; line-height: 1.5; }
.house-strip .hs-items:has(.current) { padding-top: 9px; }
/* جزئیات زیر عنوان گزارش روزانه (سن، موجودی، استاندارد وزن و دان) خواناتر */
.page-head .subtitle.daily-meta { font-size: 1rem; gap: .5rem !important; }
.page-head .subtitle.daily-meta .badge { font-size: .95rem; font-weight: 600; padding: .45em .75em; }
.page-head .subtitle.daily-meta .badge.fs-6 { font-size: 1rem !important; }
.select-tiles .ok { color: var(--ty-success); }
.quick-form .form-control { height: 48px; font-size: 1.1rem; }
.quick-form .card-header h2 { font-size: 1rem; }
.perm-group { border: 1px solid var(--ty-border); border-radius: 10px; padding: .6rem .8rem; background: var(--ty-surface); height: 100%; }
.perm-row { display: flex; align-items: center; gap: .6rem; padding: .15rem 0; border-bottom: 1px dashed #eef0f3; }
.perm-row:last-child { border-bottom: 0; }
.account-tree tr.lvl-1 td { background: #f8fafc; }

/* ───── ستون‌های جدول‌ها (dama-columns.js): نوار ابزار، تغییر عرض، ترازبندی، منوی ستون‌ها ───── */
.lines-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .45rem; }
.lines-table thead th { overflow: hidden; text-overflow: ellipsis; }
.lines-table thead th + th { border-inline-start: 1px solid #eef0f3; }
.lines-table th.ta-c, .lines-table td.ta-c { text-align: center; }
.lines-table th.ta-r, .lines-table td.ta-r { text-align: right; }
.lines-table td.ta-c .form-control { text-align: center; }
/* table[data-center]: همه ستون‌ها (حتی متن و کمبو) وسط‌چین، جز نمای کارتی موبایل */
.lines-table[data-center]:not(.cards) th.ta-r, .lines-table[data-center]:not(.cards) td.ta-r { text-align: center; }
.lines-table[data-center]:not(.cards) td .ts-wrapper .ts-control { justify-content: center; text-align: center; }
.lines-table[data-center]:not(.cards) td .ts-wrapper .ts-control > input { text-align: center; }
.lines-table tfoot td.diet { font-weight: 700; color: #1f3864; background: #f3f7fd; }
.lines-table .col-off { display: none !important; }
.col-resizer { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: 9px; cursor: col-resize; z-index: 3; touch-action: none; }
.col-resizer::after { content: ""; position: absolute; top: 20%; bottom: 20%; inset-inline-end: 0; width: 2px; border-radius: 2px; background: #d5dbe3; }
.col-resizer:hover::after, .lines-table.resizing .col-resizer::after { background: var(--ty-accent, #0d6efd); }
.lines-table.resizing, .lines-table.resizing * { user-select: none; cursor: col-resize !important; }
/* سلول محاسبه‌ای (مبلغ، درصد، …): کادر فقط‌خواندنی هم‌اندازه کنترل‌های ورودی */
.lines-table tbody td.calc { padding: .35rem .3rem; }
.lines-table .calc-box {
    min-height: 40px; display: flex; align-items: center; justify-content: center; padding: .3rem .6rem; line-height: 1.5; border: 1px solid var(--ty-border); border-radius: var(--bs-border-radius, .375rem);
    background: #f4f6f9; color: inherit; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: center; font-variant-numeric: tabular-nums;
}
.lines-table .calc-box:empty::before { content: "—"; color: #b6bdc7; font-weight: 400; }
/* سلولی که برای کالای انتخابی کاربرد ندارد (بچ/انقضای کالای بدون بچ) */
.lines-table td.na .dama-cell { pointer-events: none; position: relative; }
.lines-table td.na .form-control, .lines-table td.na .ts-control { background: #f1f3f5 !important; border-style: dashed; color: transparent; box-shadow: none; }
.lines-table td.na .form-control::placeholder, .lines-table td.na .ts-control input::placeholder { color: transparent; }
.lines-table td.na .ts-control .item { visibility: hidden; }
.lines-table td.na .dama-cell::after { content: "—"; position: absolute; inset: 0; display: grid; place-items: center; color: #adb5bd; pointer-events: none; }
/* منوی «ستون‌ها» (جدول سطرها و فهرست‌ها) */
.col-menu { min-width: 250px; max-height: min(60vh, 520px); overflow: auto; padding: .35rem 0; z-index: 1035; }
.col-menu-head { font-size: .75rem; color: var(--ty-muted); padding: .2rem 1rem .4rem; font-weight: 700; }
.col-menu-item { display: flex; align-items: center; gap: .55rem; cursor: pointer; font-size: .85rem; padding: .32rem 1rem; white-space: normal; }
.col-menu-item .form-check-input { margin: 0; flex: none; }
.col-menu-item small { margin-inline-start: auto; color: var(--ty-muted); font-size: .7rem; }
.col-menu-item.locked { cursor: default; opacity: .7; }
.col-menu-actions { display: flex; flex-direction: column; gap: .35rem; padding: .2rem .75rem .3rem; }
.dama-grid-tools .dropdown-toggle::after { margin-inline-start: .3rem; }
html.print-mode .col-resizer, html.print-mode .lines-toolbar { display: none !important; }
@media print { .col-resizer, .lines-toolbar { display: none !important; } }
/* کمبوهای داخل سلول: متن انتخاب‌شده در یک خط (در ستون باریک با … کوتاه می‌شود؛ متن کامل در راهنمای موس) */
.lines-table .ts-wrapper.single .ts-control { flex-wrap: nowrap; overflow: hidden; }
.lines-table .ts-wrapper.single .ts-control > .item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
/* مقدار بیش از موجودی انبار (dama-pages.js → markStock) */
.form-control.is-over-stock:not(.is-invalid) { border-color: #f59f00; box-shadow: 0 0 0 .15rem rgba(245, 159, 0, .18); }
/* ───── نمای کارتی سطرهای سند: موبایل (کمتر از ۷۶۸px) یا table[data-cards] — dama-columns.js کلاس cards را می‌گذارد ───── */
.lines-wrap:has(> .lines-table.cards) { border: 0; border-radius: 0; overflow: visible; }
.lines-toolbar:has(+ .lines-wrap > .lines-table.cards) > .small { display: none; }
.lines-table.cards { display: block; width: 100% !important; min-width: 0 !important; table-layout: auto; }
.lines-table.cards thead { display: none; }
.lines-table.cards tbody, .lines-table.cards tfoot { display: block; }
.lines-table.cards tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .6rem; position: relative; margin-bottom: .65rem;
    padding: .65rem .75rem .75rem; border: 1px solid var(--ty-border); border-radius: 12px; background: var(--ty-surface, #fff); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.lines-table.cards td { display: block; min-width: 0; width: auto !important; padding: 0 !important; border: 0 !important; }
.lines-table.cards td.ta-r:not(.half) { grid-column: 1 / -1; }
.lines-table.cards td[data-label]::before { content: attr(data-label); display: block; margin-bottom: .2rem; font-size: .74rem; font-weight: 600; color: var(--ty-muted); text-align: right; }
.lines-table.cards td.row-no { grid-column: 1 / -1; padding-inline-end: 2.8rem !important; font-weight: 700; color: var(--ty-text, #1f2937); text-align: right; }
.lines-table.cards td.row-no::before { content: "ردیف "; }
.lines-table.cards td.row-del { position: absolute; top: .45rem; inset-inline-end: .5rem; }
.lines-table.cards td.row-del .btn-icon { margin-top: 0; }
.lines-table.cards tr.row-invalid { border-color: #f1aeb5; background: #fff7f8; }
.lines-table.cards tr.row-invalid > td { background: transparent !important; box-shadow: none !important; }
.lines-table.cards tfoot tr { background: #f8fafc; }
.lines-table.cards tfoot td:empty { display: none; }
.lines-table.cards [data-stock] { margin-top: .2rem; text-align: right; }
/* ثبت سریع: انتخاب تاریخ گزارش */
.quick-date { display: flex; align-items: center; gap: .4rem; max-width: 340px; }
.quick-date .form-control { font-weight: 700; }
.quick-date .btn { flex: none; }
/* خطای طولانی سرور در خانه باریک جدول: متن کامل در کادر خطای بالای فرم (با پیوند به همین خانه) و راهنمای موس؛ اینجا فقط کادر قرمز */
.lines-table:not(.cards) .invalid-feedback[data-server="1"] { display: none !important; }
/* نوار دکمه‌های فرم در موبایل: فشرده (دو ستون) تا فضای فرم را نگیرد */
@media (max-width: 575.98px) {
    .form-actions { gap: .4rem; padding: .5rem .75rem; }
    .form-actions .btn { flex: 1 1 calc(50% - .4rem); padding: .42rem .5rem; font-size: .85rem; white-space: nowrap; }
    .form-actions .spacer, .form-actions > .small { display: none; }
}
/* ───── دریافت و پرداخت: زبانه‌های روش، جمع کل، مانده طرف حساب ───── */
.pay-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.pay-tabs .nav-link { white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--ty-muted); }
.pay-tabs .nav-link.active { color: var(--ty-accent, #1E88E5); }
.pay-tab-sum:empty { display: none; }
.pay-tab-sum { font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; background: #eef2f7; color: #475569; font-variant-numeric: tabular-nums; }
.pay-tab-sum.has { background: #e8f6ee; color: #15803d; }
.pay-panes { border: 1px solid var(--ty-border); border-top: 0; border-radius: 0 0 10px 10px; padding: .85rem; background: var(--ty-surface, #fff); }
.pay-panes .lines-wrap { border-radius: 8px; }
.pay-empty { display: none; padding: .9rem; text-align: center; color: var(--ty-muted); border: 1px dashed var(--ty-border); border-radius: 8px; }
.tab-pane.is-empty .pay-empty { display: block; }
.tab-pane.is-empty .lines-wrap, .tab-pane.is-empty .lines-toolbar { display: none; }
.pay-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .6rem; margin-top: .75rem; padding: .6rem .85rem; border-radius: 10px; background: #eef5ff; border: 1px solid #cfe2ff; }
.pay-total strong { font-size: 1.15rem; direction: ltr; font-variant-numeric: tabular-nums; }
.pay-total-parts { font-size: .8rem; color: var(--ty-muted); }
.party-balance { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: -.4rem; }
.party-balance:empty { display: none; }
.pb-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem; border-radius: 8px; font-size: .85rem; border: 1px solid transparent; }
.pb-chip b { font-size: .95rem; }
.pb-chip.debit { background: #fff4e5; color: #9a3412; border-color: #fed7aa; }
.pb-chip.credit { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.pb-chip.zero { background: #e8f6ee; color: #15803d; border-color: #bbf7d0; }
.pb-left { font-size: .8rem; color: var(--ty-muted); }
.pb-chip { flex-wrap: wrap; }
.pb-chip .pb-amount { white-space: nowrap; }
.pb-chip small { font-weight: 600; opacity: .85; }
/* ───────────── صورتحساب (Views/Shared/_Invoice.cshtml): نمای یکسان صفحه و چاپ به سبک فاکتور رسمی ─────────────
   جدول‌های خط‌دار با عنوان خاکستری کم‌رنگ (کم‌جوهر در چاپ)؛ اندازه‌ها نسبی (em) تا با مقیاس چاپ و اندازه کاغذ متناسب شوند. */
.invoice { --inv-ink: #111827; --inv-navy: #1e3a5f; --inv-line: #9aa5b4; --inv-soft: #f3f4f6; --inv-head: #e5e7eb;
    container-type: inline-size; container-name: invoice;
    background: #fff; color: var(--inv-ink); border: 1px solid #cbd5e1; border-radius: 10px; padding: 16px 18px; font-size: .86rem; line-height: 1.55; }
/* سربرگ: راست QR (و آرم)، وسط عنوان + نام بنگاه + انبار، چپ شماره/تاریخ/وضعیت بدون جدول و زمینه */
.inv-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding-bottom: 10px;
    margin-bottom: 10px; border-bottom: 2px solid var(--inv-navy); }
.inv-side { justify-self: start; display: flex; align-items: center; gap: 8px; }
.inv-logo { width: 62px; height: 62px; object-fit: contain; flex-shrink: 0; }
.inv-title { text-align: center; }
.inv-title h2 { font-size: 1.45em; font-weight: 900; margin: 0; color: var(--inv-ink); letter-spacing: -.2px; }
.inv-title .inv-issuer { font-size: 1.08em; font-weight: 800; color: var(--inv-navy); margin-top: .2em; }
.inv-title .inv-sub { font-size: .9em; color: #374151; margin-top: .1em; }
.inv-title .inv-brand-note { font-size: .72em; color: #9ca3af; margin-top: .1em; }
.inv-meta { justify-self: end; margin: 0; display: grid; gap: .15em; font-size: .95em; }
.inv-meta > div { display: flex; gap: .4em; justify-content: flex-end; }
.inv-meta dt { font-weight: 600; color: #4b5563; margin: 0; }
.inv-meta dd { font-weight: 800; margin: 0; min-width: 6.5em; text-align: left; }
.inv-qr { text-align: center; }
.inv-qr img { width: 82px; height: 82px; display: block; image-rendering: pixelated; }
.inv-qr span { font-size: .68em; color: #6b7280; }
/* جدول مشخصات (فروشنده، خریدار، تحویل) */
.inv-grid { width: 100%; border-collapse: collapse; table-layout: fixed; margin-bottom: 8px; font-size: .92em; break-inside: avoid; }
.inv-grid caption { caption-side: top; text-align: right; font-weight: 800; font-size: .95em; color: var(--inv-navy); padding: 0 .2em .2em; }
.inv-grid col.k { width: 12%; }
.inv-grid col.v { width: 21.33%; }
.inv-grid th, .inv-grid td { border: 1px solid var(--inv-line); padding: .22em .5em; vertical-align: middle; }
.inv-grid th { background: var(--inv-soft); font-weight: 600; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-grid td { font-weight: 600; overflow-wrap: anywhere; }
/* اقلام */
.inv-table-wrap { overflow-x: auto; }
.inv-table { width: 100%; border-collapse: collapse; font-size: .95em; }
.inv-table caption { caption-side: top; text-align: right; font-weight: 800; font-size: .95em; color: var(--inv-navy); padding: 0 .2em .2em; }
.inv-table th { background: var(--inv-head); color: #111827; font-weight: 700; font-size: .92em; padding: .35em .4em; border: 1px solid var(--inv-line); text-align: center; white-space: nowrap; }
.inv-table td { border: 1px solid var(--inv-line); padding: .3em .4em; vertical-align: middle; }
.inv-table td.n { text-align: center; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-table td.t { text-align: right; }
.inv-table .inv-no { width: 3em; text-align: center; color: #4b5563; }
.inv-table tbody tr:nth-child(even) td { background: #f9fafb; }
.inv-table tfoot th { text-align: left; background: var(--inv-soft); font-weight: 700; padding: .3em .7em; border: 1px solid var(--inv-line); }
.inv-table tfoot td.n { font-weight: 800; }
.inv-table tfoot tr.grand th, .inv-table tfoot tr.grand td { background: var(--inv-head); font-size: 1.05em; font-weight: 900; border: 1.5px solid #374151; }
.inv-table tfoot tr.words td { text-align: right; background: #fff; padding: .4em .6em; }
.inv-table tfoot tr.words span { color: #6b7280; font-weight: 600; }
.inv-notes { margin-top: 8px; border: 1px dashed var(--inv-line); border-radius: 6px; padding: .4em .6em; font-size: .92em; }
.inv-notes span { color: #6b7280; font-weight: 700; }
.inv-signs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; margin-top: 18px; padding-top: 6px; break-inside: avoid; }
/* چاپ: صورتحساب فقط به اندازه محتوا (برگه پر نمی‌شود)؛ جای امضا بلافاصله پس از جدول‌ها */
html.print-mode .invoice { display: block; }
.inv-signs .sig { border-top: 1.2px solid #6b7280; padding-top: .3em; text-align: center; font-size: .85em; color: #374151; min-height: 56px; }
.inv-verify { margin-top: 8px; font-size: .72em; color: #6b7280; text-align: center; }
/* اطلاعات داخلی سند (بهای تمام‌شده، گله، حساب) فقط روی صفحه */
.inv-internal { margin-top: 1rem; }
@media (max-width: 767.98px) { .invoice { padding: 10px; } .inv-grid { table-layout: auto; } }
/* چاپ صفحه دارای صورتحساب: سربرگ عمومی، عنوان، خلاصه‌ها و امضای عمومی حذف؛ خود صورتحساب کل برگه */
html.print-mode .print-zoom:has(.invoice) > .print-header,
html.print-mode .print-zoom:has(.invoice) .page-head,
html.print-mode .print-zoom:has(.invoice) .doc-totals,
html.print-mode .print-zoom:has(.invoice) .inv-internal,
html.print-mode .print-zoom:has(.invoice) [data-doc-print] { display: none !important; }
html.print-mode .print-zoom:has(.invoice) .card:has([data-doc-print]) { display: none !important; }
html.print-mode .invoice { border: 0; padding: 0; border-radius: 0; font-size: 11.5px; }
html.print-mode .inv-table th, html.print-mode .inv-table tfoot th, html.print-mode .inv-grid th, html.print-mode .inv-meta th,
html.print-mode .inv-table tfoot tr.grand td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
html.print-mode .inv-table-wrap { overflow: visible; }
/* هر اندازه و جهت کاغذ: چیدمان صورتحساب با عرض واقعی برگه (container query) */
@container invoice (max-width: 620px) {
    .inv-head { grid-template-columns: minmax(0, 1fr) auto; }
    .inv-head .inv-title { grid-column: 1 / -1; order: -1; }
    .inv-logo { width: 46px; height: 46px; }
    .inv-qr img { width: 66px; height: 66px; }
    .inv-grid col.k { width: 15%; }
    .inv-grid col.v { width: 18.33%; }
    .inv-table th, .inv-table td { padding: .25em .25em; }
    .inv-signs { grid-template-columns: repeat(3, 1fr); }
}
@container invoice (min-width: 1000px) {
    .inv-logo { width: 72px; height: 72px; }
    .inv-qr img { width: 92px; height: 92px; }
}
/* ───── نشان و آیکون‌های تصویری داما (wwwroot/img/brand) ───── */
/* نشان اصلی (سرمه‌ای روی زمینه شفاف): در منوی تیره روی کاشی سفید */
.app-brand .logo { background: #fff; width: 40px; height: 40px; border-radius: 10px; padding: 3px; overflow: hidden; }
.app-brand .logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.auth-logo img.logo { width: 72px; height: 72px; object-fit: contain; background: none; border-radius: 0; }
.dash-title { display: flex; align-items: center; gap: .75rem; }
.dash-logo { width: 54px; height: 54px; object-fit: contain; flex: none; }
/* آیکون تصویری منو روی کاشی سفید (آیکون‌ها خط سرمه‌ای دارند و روی منوی تیره خوانا نیستند) */
.nav-img { width: 22px; height: 22px; flex: none; display: inline-grid; place-items: center; border-radius: 6px; background: #fff; margin-inline-end: .1rem; }
.nav-img img { width: 18px; height: 18px; object-fit: contain; display: block; }
.print-header .ph-logo { border-radius: 8px; }
/* منوی جمع‌شده: نشان و آیکون تصویری گروه‌ها نمایش داده می‌شود */
body.sidebar-collapsed .app-brand span.logo, body.sidebar-collapsed .app-nav .nav-img { display: inline-grid !important; }

/* ───── تسویه فاکتورهای باز (دریافت/پرداخت) ───── */
.settle-table { font-size: .8rem; border: 1px solid var(--ty-border); border-radius: 8px; overflow: hidden; }
.settle-table > :not(caption) > * > * { padding: .38rem .5rem; text-align: center; vertical-align: middle; }
.settle-table thead th { background: #eef1f5; color: #334155; font-weight: 700; font-size: .76rem; white-space: nowrap; border-bottom: 1px solid var(--ty-border); }
.settle-table tbody tr:hover > * { background: #f8fafc; }
.settle-table td.num { direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.settle-table td.st-inv { font-weight: 600; white-space: nowrap; }
.settle-table td.st-rem { font-weight: 700; color: #15305a; }
.settle-table .st-tag { display: block; margin-top: .1rem; font-size: .68rem; color: #9a3412; direction: rtl; }
.settle-table .form-control { text-align: center; font-size: .8rem; }
.settle-table tfoot td { background: #f3f5f8; font-weight: 700; border-top: 1.5px solid #94a3b8; }
.settle-table .settle-empty { color: var(--ty-muted); padding: .9rem; }
.settle-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .6rem; }
.settle-note { font-size: .78rem; color: var(--ty-muted); }

/* ───────────── نمای یکسان صفحه‌های جزئیات سند (حواله و رسید انبار، سند هزینه، دریافت/پرداخت، روزانه، درمان، جوجه‌ریزی، تولید دان، چک، …) ─────────────
   یک کد برای همه: مشخصات سند در شبکه خانه‌های کادردار «عنوان / مقدار» و جدول‌ها با ستون و ردیف تفکیک‌شده و وسط‌چین؛ همان نما در چاپ. */
.print-zoom:has([data-doc-print], [data-doc-view]) { --dv-line: #cfd6df; --dv-head: #eef1f5; --dv-foot: #f3f5f8; }
.print-zoom:has([data-doc-print], [data-doc-view]) .card-body.row:has(> .dama-static) {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0; margin: 0; padding: 0; overflow: hidden; }
.print-zoom:has([data-doc-print], [data-doc-view]) .card:has(> .card-body.row > .dama-static) { overflow: hidden; }
.print-zoom:has([data-doc-print], [data-doc-view]) .card-body.row:has(> .dama-static) > * {
    width: auto; max-width: none; margin: 0 -1px -1px 0; padding: .5rem .75rem; border-inline-end: 1px solid var(--dv-line); border-bottom: 1px solid var(--dv-line);
    background: #fff; min-width: 0; }
.print-zoom:has([data-doc-print], [data-doc-view]) .card-body.row:has(> .dama-static) > .col-12 { grid-column: 1 / -1; }
.print-zoom:has([data-doc-print], [data-doc-view]) .card-body.row:has(> .dama-static) > .col-md-6, .print-zoom:has([data-doc-print], [data-doc-view]) .card-body.row:has(> .dama-static) > .col-lg-6 { grid-column: span 2; }
.print-zoom:has([data-doc-print], [data-doc-view]) .dama-static .form-label { display: block; font-size: .72rem; font-weight: 600; color: #64748b; margin-bottom: .15rem; }
.print-zoom:has([data-doc-print], [data-doc-view]) .dama-static .form-control-plaintext { padding: 0; min-height: 0; font-weight: 700; color: #0f172a; border: 0 !important; overflow-wrap: anywhere; }
.print-zoom:has([data-doc-print], [data-doc-view]) .table { font-size: .84rem; margin-bottom: 0; }
.print-zoom:has([data-doc-print], [data-doc-view]) .card .table { border-style: hidden; }
.print-zoom:has([data-doc-print], [data-doc-view]) .table > :not(caption) > * > * { border: 1px solid var(--dv-line); padding: .42rem .55rem; vertical-align: middle; text-align: center !important; }
.print-zoom:has([data-doc-print], [data-doc-view]) .table thead th { background: var(--dv-head) !important; color: #1e293b; font-weight: 700; font-size: .78rem; white-space: nowrap; }
.print-zoom:has([data-doc-print], [data-doc-view]) .table tbody tr:nth-child(even) > * { background: #fafbfc; }
.print-zoom:has([data-doc-print], [data-doc-view]) .table tbody tr:hover > * { background: #f1f5f9; }
.print-zoom:has([data-doc-print], [data-doc-view]) .table tfoot > tr > * { background: var(--dv-foot) !important; font-weight: 700; border-top: 2px solid #94a3b8; }
.print-zoom:has([data-doc-print], [data-doc-view]) .table td.num, .print-zoom:has([data-doc-print], [data-doc-view]) .table th.num { direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.print-zoom:has([data-doc-print], [data-doc-view]) .card-header h2, .print-zoom:has([data-doc-print], [data-doc-view]) .card-header .h6 { font-size: .9rem; font-weight: 800; color: #15305a; }
html.print-mode .print-zoom:has([data-doc-print], [data-doc-view]) .card-body.row:has(> .dama-static) > * { padding: .3rem .55rem; }
html.print-mode .print-zoom:has([data-doc-print], [data-doc-view]) .table > :not(caption) > * > * { padding: .28rem .4rem; }
/* چاپ واقعی: بدون ارتفاع تمام‌صفحه و بدون عناصر پنهانِ بعد از محتوا (علت چاپ برگه سفید دوم) */
@media print {
    html, body { height: auto !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; background: #fff !important; }
    html.print-mode .app-shell { min-height: 0 !important; display: block !important; }
    html.print-mode .app-main { display: block !important; }
    html.print-mode .app-content { flex: none !important; }
    html.print-mode body > :not(.app-shell) { display: none !important; }
    html.print-mode .print-zoom > :last-child, html.print-mode .print-area > :last-child { margin-bottom: 0 !important; }
}

/* ───── واکنش‌گرایی سراسری (موبایل، تبلت، لپ‌تاپ، رایانه) ───── */
/* کارت شاخص: عدد هرگز از کادر بیرون نمی‌زند؛ اندازه قلم با عرض خود کارت (container query) کوچک می‌شود */
.kpi-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.kpi-grid.kpi-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1199.98px) { .kpi-grid.kpi-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479.98px) { .kpi-grid.kpi-4 { grid-template-columns: minmax(0, 1fr); } }
.kpi { min-width: 0; }
.kpi > div:last-child { min-width: 0; flex: 1 1 auto; container-type: inline-size; }
.kpi .label { line-height: 1.5; }
.kpi .value { font-size: 1.3rem; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; }
/* عددی که با کوچک‌ترین قلم هم جا نشود: واحد به سطر بعد می‌رود (dama-app.js fitKpi) */
.kpi .value.kpi-wrap { white-space: normal; overflow-wrap: anywhere; }
.kpi .value small { font-size: .55em; }
.kpi .value.text-danger { color: var(--ty-danger) !important; }
@media (max-width: 575.98px) { .kpi { padding: .7rem .8rem; min-height: 72px; gap: .6rem; } .kpi .ico { width: 38px; height: 38px; font-size: 1.1rem; } }

/* سرصفحه: در موبایل دکمه‌ها زیر عنوان و هم‌عرض */
@media (max-width: 575.98px) {
    .page-head h1 { font-size: 1.15rem; }
    .page-head .actions { width: 100%; }
    .page-head .actions > .btn, .page-head .actions > a.btn { flex: 1 1 auto; }
    .card-header { padding: .7rem .8rem; flex-wrap: wrap; }
    .card-body { padding: .8rem; }
}

/* پنل فیلتر: کلیدها هم‌تراز کمبوها؛ دکمه‌ها در انتهای ردیف (رایانه) یا تمام‌عرض (موبایل) */
.filter-panel > .card-header { padding-block: .6rem; }
.filter-panel > .card-header h2 { font-size: .92rem; }
.filter-panel .dama-check { align-self: end; padding-bottom: .55rem; margin-bottom: .9rem; }
.filter-panel .dama-check .form-text { display: none; }
.filter-panel .filter-actions { justify-content: flex-end; }
@media (max-width: 575.98px) { .filter-panel .filter-actions .btn { flex: 1 1 0; } }

/* جدول فشرده نمایشی (فهرست‌های داخل صفحه) با ستون‌های قابل تغییر اندازه و وسط‌چین (dama-columns.js) */
.lines-table.lines-compact { font-size: .8rem; }
.lines-table.lines-compact thead th { font-size: .74rem; padding: .5rem .4rem; white-space: normal; line-height: 1.35; vertical-align: middle; overflow: visible; }
.lines-table.lines-compact tbody td, .lines-table.lines-compact tfoot td { padding: .45rem .4rem; vertical-align: middle; }
.lines-table.lines-compact td.num { direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lines-table.lines-compact tbody tr:nth-child(even) > td { background: #fafbfc; }
.lines-table.lines-compact tbody tr:hover > td { background: #f1f5f9; }
.lines-table.lines-compact .row-no { padding-top: .45rem; }
.lines-table.lines-compact tr.row-inactive > td { color: var(--ty-muted); }
.lines-wrap:has(> .lines-compact) .lines-table { min-width: 0; }
/* سالن‌های دوره و توزیع جوجه‌ریزی: هر سالن یک سطر (موبایل/تبلت با اسکرول افقی و ستون ثابت سالن) */
.cycle-houses tbody td, .placement-lines tbody td { vertical-align: middle; }
.placement-lines td.house-name, .cycle-houses tbody td.fw-semibold { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cycle-houses .dama-cell.dama-check { padding-top: 0; display: flex; justify-content: center; }
.cycle-houses .dama-cell.dama-check .form-check { margin: 0; min-height: 0; }
.placement-lines .row-no { padding-top: .35rem; vertical-align: middle; }
.lines-table.cards td.row-actions { grid-column: 1 / -1; }
.partner-actions { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; }
.lines-table.cards .partner-actions { justify-content: flex-start; padding-top: .3rem; border-top: 1px dashed var(--ty-border); }
.partner-actions .btn { white-space: nowrap; padding: .2rem .5rem; font-size: .76rem; }
/* منوی کشویی عملیات: واضح، با عنوان، روی همه لایه‌ها */
.partner-menu { z-index: 1080; min-width: 230px; font-size: .85rem; border-radius: 10px; padding: .35rem; border: 1px solid var(--ty-border); }
.partner-menu .dropdown-header { font-weight: 700; color: var(--ty-primary); font-size: .8rem; }
.partner-menu .dropdown-item { display: flex; align-items: center; gap: .5rem; border-radius: 8px; padding: .5rem .65rem; white-space: normal; }
.partner-menu .dropdown-item:hover, .partner-menu .dropdown-item:focus { background: var(--ty-accent-50); color: var(--ty-text); }
.partner-menu .dropdown-item .bi { font-size: 1rem; width: 1.1rem; text-align: center; }

/* فرم تقسیم سود: کارت‌های جمع‌وجور و جدول سهم‌ها */
.dist-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
@media (max-width: 1199.98px) { .dist-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .dist-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dist-summary .s { border: 1px solid var(--ty-border); border-radius: 10px; padding: .55rem .7rem; background: var(--ty-surface); min-width: 0; container-type: inline-size; }
.dist-summary .s span { display: block; font-size: .72rem; color: var(--ty-muted); line-height: 1.4; }
.dist-summary .s strong { display: block; font-size: clamp(.82rem, 9cqi, 1.05rem); direction: ltr; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.dist-summary .s.main { background: #eef6ff; border-color: #cfe2ff; }
.dist-summary .s.main.loss { background: #fff4f4; border-color: #f5c2c7; }
.dist-summary .s a { font-size: .7rem; }
.dist-entry { display: flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: center; font-size: .8rem; padding: .55rem .75rem; border-radius: 10px; background: #f8fafc; border: 1px solid var(--ty-border); }
.dist-entry .num { font-weight: 700; direction: ltr; }
.share-input .form-control { text-align: center; max-width: 110px; margin-inline: auto; }
.lines-table.cards .share-input .form-control { max-width: none; margin: 0; }

/* بخش‌های فرم و دکمه‌ها در تبلت/موبایل */
@media (max-width: 767.98px) {
    .doc-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .table-responsive > .table { font-size: .82rem; }
}
/* در جدول، دکمه «بیشتر» فقط آیکون؛ در نمای کارتی موبایل با متن */
.lines-table:not(.cards) .partner-actions .more-text { display: none; }
.partner-actions .dropdown-toggle::after { margin-inline-start: .2rem; vertical-align: .15em; }
.lines-table.cards.lines-compact tbody tr > td, .lines-table.cards.lines-compact tbody tr:hover > td { background: transparent; }
.lines-table.lines-compact tbody td.num, .lines-table.lines-compact tfoot td.num { overflow: hidden; text-overflow: ellipsis; }

/* ───── حقوق و دستمزد ───── */
.payroll-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .6rem; }
.payroll-links .pl { display: grid; grid-template-columns: auto 1fr; column-gap: .6rem; align-items: center; padding: .65rem .8rem; border: 1px solid var(--ty-border);
    border-radius: 10px; background: var(--ty-surface, #fff); color: inherit; text-decoration: none; min-width: 0; }
.payroll-links .pl:hover { border-color: #9ec5fe; background: #f5f9ff; }
.payroll-links .pl i { grid-row: span 2; font-size: 1.4rem; color: var(--bs-primary); }
.payroll-links .pl span { font-weight: 600; font-size: .9rem; }
.payroll-links .pl small { color: var(--ty-muted); font-size: .74rem; line-height: 1.4; overflow-wrap: anywhere; }
.payroll-sheet tr.row-warn > td { background: #fff8e6; }
.pay-breakdown { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .75rem; }
.pay-breakdown .pb { border: 1px solid var(--ty-border); border-radius: 10px; padding: .6rem .75rem; min-width: 0; scroll-margin-top: 80px; }
.pay-breakdown .pb:target { border-color: var(--bs-primary); box-shadow: 0 0 0 .15rem rgba(13, 110, 253, .15); }
.pay-breakdown h3 { font-size: .88rem; font-weight: 700; margin: 0 0 .4rem; }
.pay-breakdown .pb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.pay-breakdown .pb-title { font-size: .74rem; color: var(--ty-muted); font-weight: 600; margin-bottom: .2rem; }
.pb-row { display: flex; justify-content: space-between; gap: .5rem; font-size: .8rem; padding: .12rem 0; border-bottom: 1px dashed #edf0f4; }
.pb-row span { min-width: 0; overflow-wrap: anywhere; }
.pb-row b { font-weight: 600; white-space: nowrap; }
.pb-row.total { border-bottom: 0; border-top: 1px solid var(--ty-border); font-weight: 700; margin-top: .15rem; }
.pay-breakdown .pb-foot { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-top: .45rem; font-size: .76rem; color: var(--ty-muted); }
.pay-breakdown .pb-foot b { color: var(--ty-text, #1f2937); }
.pay-breakdown .pb-foot .net { margin-inline-start: auto; color: var(--bs-success); font-weight: 700; }
@media (max-width: 575.98px) { .pay-breakdown { grid-template-columns: 1fr; } .pay-breakdown .pb-cols { grid-template-columns: 1fr; } }

/* فیش حقوق (صفحه و چاپ) */
.payslips { display: grid; gap: 1rem; }
.payslip { background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; padding: .9rem 1rem; max-width: 860px; margin-inline: auto; width: 100%; font-size: .82rem; }
.ps-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; border-bottom: 2px solid #0f2b5b; padding-bottom: .5rem; margin-bottom: .55rem; }
.ps-brand { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.ps-brand img { width: 38px; height: 38px; }
.ps-brand strong { display: block; font-size: .9rem; }
.ps-brand span { font-size: .7rem; color: #64748b; }
.ps-title { text-align: center; }
.ps-title h2 { font-size: 1rem; font-weight: 800; margin: 0; color: #0f2b5b; }
.ps-no { text-align: left; font-size: .78rem; color: #475569; }
.ps-info { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem .75rem; margin: 0 0 .5rem; }
.ps-info > div { display: flex; gap: .35rem; min-width: 0; }
.ps-info .wide { grid-column: span 2; }
.ps-info dt { font-weight: 500; color: #64748b; white-space: nowrap; }
.ps-info dt::after { content: ":"; }
.ps-info dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.ps-attend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; background: #f1f5f9; border-radius: 6px; padding: .3rem .6rem; margin-bottom: .5rem; }
.ps-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ps-table th, .ps-table td { border: 1px solid #cbd5e1; padding: .25rem .45rem; vertical-align: top; }
.ps-table th { background: #0f2b5b; color: #fff; font-weight: 600; text-align: center; }
.ps-table .amt { text-align: left; direction: ltr; width: 22%; white-space: nowrap; }
.ps-table tfoot td { background: #f8fafc; font-weight: 700; }
.ps-net { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; margin: .5rem 0; padding: .45rem .7rem;
    border: 2px solid #198754; border-radius: 8px; background: #f0fdf4; }
.ps-net span { font-weight: 600; margin-inline-end: .5rem; }
.ps-net b { font-size: 1.1rem; color: #146c43; }
.ps-net small { color: #475569; }
.ps-foot { display: flex; flex-wrap: wrap; gap: .25rem 1rem; color: #475569; font-size: .76rem; }
.ps-foot b { color: #0f172a; }
.ps-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.4rem; text-align: center; font-size: .76rem; color: #64748b; }
.ps-sign span { border-top: 1px dotted #94a3b8; padding-top: .3rem; }
@media (max-width: 767.98px) {
    .ps-head { grid-template-columns: 1fr; text-align: center; }
    .ps-brand { justify-content: center; }
    .ps-no { text-align: center; }
    .ps-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ps-table .amt { width: 30%; }
}
@media print {
    .payslips { display: block; }
    .payslip { border-color: #94a3b8; break-inside: avoid; page-break-after: always; margin-bottom: 0; box-shadow: none; }
    .payslip:last-child { page-break-after: auto; }
    .ps-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* فیلتر یک‌ردیفه (فرم‌های تهیه لیست): کنترل‌ها و دکمه در یک ردیف و هم‌تراز پایین؛ دکمه کنار آخرین کنترل */
.filter-panel .filter-inline { align-items: flex-end; }
.filter-panel .filter-inline > .filter-actions { justify-content: flex-start; margin-bottom: calc(.9rem + 2px); }
.filter-panel .filter-inline > .filter-actions .btn { height: 40px; display: inline-flex; align-items: center; gap: .35rem; }
/* مرتب‌سازی ستون (table[data-sort]) */
.lines-table thead th.sortable { cursor: pointer; user-select: none; }
.lines-table thead th.sortable:hover { background: #eef2f7; }
.lines-table thead th.sortable::after { content: "\2195"; opacity: .25; font-size: .7em; margin-inline-start: .25rem; }
.lines-table thead th.sortable[data-dir="asc"]::after { content: "\25B2"; opacity: .8; }
.lines-table thead th.sortable[data-dir="desc"]::after { content: "\25BC"; opacity: .8; }

/* فروش و خروج مرغ: انتخاب نوع خروج (فروش / هدیه / سهمیه) و نوار خلاصه */
.sale-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.sale-kind { display: grid; grid-template-columns: auto 1fr; column-gap: .5rem; align-items: center; margin: 0; padding: .6rem .75rem; cursor: pointer;
    border: 1.5px solid var(--ty-border); border-radius: 10px; background: var(--ty-surface, #fff); min-width: 0; user-select: none; }
.sale-kind i { grid-row: span 2; font-size: 1.35rem; color: #64748b; }
.sale-kind span { font-weight: 700; font-size: .9rem; }
.sale-kind small { color: var(--ty-muted); font-size: .72rem; overflow-wrap: anywhere; }
.btn-check:checked + .sale-kind { border-color: var(--bs-primary); background: #eef5ff; box-shadow: 0 0 0 .15rem rgba(13, 110, 253, .12); }
.btn-check:checked + .sale-kind i { color: var(--bs-primary); }
.btn-check:focus-visible + .sale-kind { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.btn-check:disabled + .sale-kind { opacity: .45; cursor: not-allowed; }
.sale-summary { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; justify-content: center; margin: .5rem 0 .75rem;
    padding: .5rem .8rem; border: 1px solid var(--ty-border); border-radius: 10px; background: #f8fafc; font-size: .85rem; }
.sale-summary b { font-weight: 700; direction: ltr; display: inline-block; }
@media (max-width: 575.98px) {
    .sale-kinds { gap: .35rem; }
    .sale-kind { grid-template-columns: 1fr; justify-items: center; text-align: center; row-gap: .15rem; padding: .45rem .3rem; }
    .sale-kind i { grid-row: auto; font-size: 1.2rem; }
    .sale-kind span { font-size: .8rem; }
    .sale-kind small { display: none; }
    .sale-summary { font-size: .8rem; }
}

/* چاپ جدول‌های نمایشی (lines-table): عرض متناسب با کاغذ انتخابی، شکست سطر متن، بدون عرض ثابت ستون و بدون نمای کارتی موبایل؛
   مقیاس خودکار (dama-print.js) فقط وقتی کوچک می‌کند که حداقل عرض واقعی جدول از عرض کاغذ بیشتر باشد */
html.print-mode .lines-table { width: 100% !important; min-width: 0 !important; table-layout: auto !important; border-collapse: collapse !important; font-size: 10.5px; }
html.print-mode .lines-table th, html.print-mode .lines-table td {
    width: auto !important; min-width: 0 !important; max-width: none !important; white-space: normal !important; overflow: visible !important;
    text-overflow: clip !important; overflow-wrap: break-word; padding: 3px 4px !important; border: 1px solid #b6c1ce !important; position: static !important; }
/* ردیف‌های داده یک‌خطی (سرستون می‌تواند بشکند)؛ متن بلند فقط در حالت print-wrap-long (مقیاس کمتر از حد خوانایی) می‌شکند */
html.print-mode .lines-table td:not(:is(.voucher, .invoice) *) { white-space: nowrap !important; overflow-wrap: normal; }
html.print-mode.print-wrap-long .lines-table td.pc-long:not(:is(.voucher, .invoice) *) { white-space: normal !important; overflow-wrap: break-word; min-width: 120px !important; }
html.print-mode .lines-table thead th { background: #e2e8f0 !important; color: #0f172a; font-weight: 700; }
html.print-mode .lines-table td.num, html.print-mode .lines-table .num { white-space: nowrap !important; overflow-wrap: normal; }
html.print-mode .lines-table tr { break-inside: avoid; }
html.print-mode .lines-table thead { display: table-header-group !important; }
html.print-mode .lines-table tfoot { display: table-footer-group !important; }
html.print-mode .lines-table.cards { display: table !important; }
html.print-mode .lines-table.cards tbody { display: table-row-group !important; }
html.print-mode .lines-table.cards tr { display: table-row !important; box-shadow: none; border: 0; padding: 0; margin: 0; }
html.print-mode .lines-table.cards td { display: table-cell !important; }
html.print-mode .lines-table.cards td[data-label]::before, html.print-mode .lines-table.cards td.row-no::before { content: none !important; }
html.print-mode .lines-table .col-off { display: none !important; }
html.print-mode .lines-toolbar, html.print-mode .col-resizer { display: none !important; }
html.print-mode .dist-summary { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important; }
html.print-mode .grid-print .gp-table { table-layout: auto; width: 100%; font-size: 10.5px; }
/* متن بلند (شرح) فقط بین کلمه‌ها می‌شکند و حداقل عرض خوانا دارد تا ستون‌های عددی آن را تک‌حرفی نکنند؛ اگر جا نشد مقیاس خودکار کوچک می‌کند */
html.print-mode .grid-print .gp-table td, html.print-mode .grid-print .gp-table th { overflow-wrap: break-word; }
html.print-mode .grid-print .gp-table td.gp-r:not(.gp-nw) { min-width: 11em; }

/* ───── شاخص‌های مهندسی گله/دوره (_Insights) ───── */
.ins-head { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: .75rem; margin-bottom: 1rem; }
.ins-tile { position: relative; background: var(--ty-surface); border: 1px solid var(--ty-border); border-radius: 12px; padding: .75rem .9rem .7rem; box-shadow: var(--ty-shadow);
    min-width: 0; overflow: hidden; }
.ins-tile::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: #cbd5e1; }
.ins-tile.lvl-good::before { background: var(--ty-success); }
.ins-tile.lvl-warn::before { background: var(--ty-warning); }
.ins-tile.lvl-bad::before { background: var(--ty-danger); }
.ins-tile.lvl-info::before { background: var(--ty-accent); }
.ins-label { font-size: .76rem; color: var(--ty-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ins-value { font-size: 1.35rem; font-weight: 800; color: var(--ty-text); line-height: 1.35; white-space: nowrap; }
.ins-value small { font-size: .72rem; font-weight: 500; color: var(--ty-muted); }
.ins-tile.lvl-bad .ins-value { color: var(--ty-danger); }
.ins-sub { font-size: .72rem; color: var(--ty-muted); display: flex; gap: .4rem; flex-wrap: wrap; min-height: 1.1em; }
.ins-dev { direction: ltr; unicode-bidi: isolate; font-weight: 700; }
.ins-est { color: var(--ty-warning); font-weight: 700; margin-inline-start: .2rem; cursor: help; }
.ins-role { display: inline-block; font-size: .68rem; font-weight: 600; color: var(--ty-primary); background: var(--ty-primary-50); border-radius: 999px; padding: .1rem .5rem; white-space: nowrap; }
.ins-list { list-style: none; margin: 0; padding: .35rem .5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: .4rem .75rem; }
.ins-list li { display: flex; gap: .65rem; align-items: flex-start; padding: .55rem .7rem; border-radius: 10px; background: #f8fafc; border: 1px solid #eef0f3; }
.ins-list li > i { font-size: 1.15rem; line-height: 1.3; color: var(--ty-muted); flex: none; }
.ins-list li.lvl-bad { background: var(--ty-danger-50); border-color: #f5c2c7; }
.ins-list li.lvl-bad > i { color: var(--ty-danger); }
.ins-list li.lvl-warn { background: var(--ty-warning-50); border-color: #ffe1a6; }
.ins-list li.lvl-warn > i { color: var(--ty-warning); }
.ins-list li.lvl-good { background: var(--ty-success-50); border-color: #badbcc; }
.ins-list li.lvl-good > i { color: var(--ty-success); }
.ins-list li.lvl-info > i { color: var(--ty-accent); }
.ins-a-title { font-weight: 700; font-size: .86rem; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.ins-a-text { font-size: .8rem; color: #374151; line-height: 1.7; }
/* گروه شاخص‌ها: فهرست کرکره‌ای تک‌ستونه (فقط نوار عنوان‌ها؛ هر بار یک گروه باز) */
.ins-groups { display: flex; flex-direction: column; gap: .5rem; }
.ins-group .card-header { padding-block: .55rem; }
.ins-group .collapse.show, .ins-group .collapsing { border-top: 1px solid var(--ty-border); }
.ins-group:has(.collapse:not(.show)) .ins-toggle { border-radius: inherit; }
.ins-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.ins-table th { font-size: .72rem; font-weight: 600; color: var(--ty-muted); background: #f8fafc; padding: .4rem .5rem; text-align: center; border-bottom: 1px solid var(--ty-border); }
.ins-table th:first-child { text-align: right; padding-inline-start: .9rem; }
.ins-table td { padding: .42rem .5rem; border-bottom: 1px solid #f1f3f5; vertical-align: middle; text-align: center; }
.ins-table tr:last-child td { border-bottom: 0; }
.ins-table td.ins-t { text-align: right; padding-inline-start: .9rem; }
.ins-table td.ins-t small { display: block; font-size: .68rem; color: var(--ty-muted); line-height: 1.4; }
.ins-table td.ins-v { font-weight: 700; white-space: nowrap; }
.ins-table td.ins-v small { font-weight: 500; color: var(--ty-muted); font-size: .7rem; }
.ins-table td.ins-s { white-space: nowrap; color: #4b5563; }
.ins-table td.ins-s .ins-dev { font-size: .7rem; color: var(--ty-muted); margin-inline-start: .2rem; }
.ins-table .ins-dot-col { width: 26px; padding-inline: .25rem; }
.ins-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #e5e7eb; }
.ins-table tr.lvl-good .ins-dot { background: var(--ty-success); }
.ins-table tr.lvl-warn .ins-dot { background: var(--ty-warning); }
.ins-table tr.lvl-bad .ins-dot { background: var(--ty-danger); }
.ins-table tr.lvl-info .ins-dot { background: var(--ty-accent); }
.ins-table tr.lvl-bad td.ins-v { color: var(--ty-danger); }
.ins-table tr.lvl-warn td.ins-v { color: #b45309; }
/* سلول جدول‌های مقایسه (سالن‌ها، روزشمار) با رنگ وضعیت */
.lines-table td.lvl-good { color: var(--ty-success); }
.lines-table td.lvl-warn { color: #b45309; background: #fff8eb; }
.lines-table td.lvl-bad { color: var(--ty-danger); background: #fdf1f2; font-weight: 700; }
.lines-table tr.row-missing td { background: #fffbea; }
.daily-wrap { max-height: 560px; overflow: auto; }
.daily-wrap .sticky-head thead th { z-index: 2; }
/* بهای تمام‌شده و سود (زیان) */
.cost-table tr.cost-group td { background: #f1f5f9; font-weight: 700; color: #1f3864; text-align: right !important; padding-inline-start: .9rem; }
.cost-table tr.cost-group.income td { background: #ecfdf3; color: #166534; }
.cost-table tr.cost-sub td { font-weight: 700; background: #fafbfc; border-top: 1px dashed #d5dbe3; }
.lines-table tr.cost-total td { font-weight: 800; background: #eef5ff; }
.cost-table tr.cost-total.loss td.num { color: var(--ty-danger); }
.cost-table tr.cost-total.gain td.num { color: var(--ty-success); }
.share-bar { position: relative; height: 20px; border-radius: 6px; background: #f1f3f5; overflow: hidden; min-width: 80px; }
.share-bar > span { position: absolute; inset-block: 0; inset-inline-start: 0; background: linear-gradient(90deg, #93c5fd, #60a5fa); border-radius: 6px; }
.share-bar > b { position: relative; font-size: .74rem; line-height: 20px; display: block; text-align: center; color: #1e293b; }
html.print-mode .ins-tile, html.print-mode .ins-group, html.print-mode .ins-list li { box-shadow: none; break-inside: avoid; }
html.print-mode .daily-wrap { max-height: none; overflow: visible; }
html.print-mode .ins-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.print-mode .ins-group .collapse { display: block !important; }
@media (max-width: 575.98px) {
    .ins-head { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
    .ins-value { font-size: 1.1rem; }
    .ins-table td.ins-t { padding-inline-start: .6rem; }
}

/* ───── فرم وزن‌کشی (dama-weighing.js) ───── */
.weigh-ctx { display: flex; gap: 1rem; align-items: center; padding: .7rem .9rem; border-radius: 12px; border: 1px solid var(--ty-border); background: #f8fafc; }
.weigh-ctx.ok { background: var(--ty-success-50); border-color: #badbcc; }
.weigh-ctx.bad { background: var(--ty-danger-50); border-color: #f5c2c7; color: #842029; }
.weigh-ctx .wc-age { display: flex; flex-direction: column; align-items: center; min-width: 96px; padding-inline-end: 1rem; border-inline-end: 1px solid rgba(0,0,0,.08); text-align: center; }
.weigh-ctx .wc-age span { font-size: .72rem; color: var(--ty-muted); }
.weigh-ctx .wc-age strong { font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--ty-success); }
.weigh-ctx .wc-age small { font-size: .75rem; color: var(--ty-muted); }
.weigh-ctx.bad .wc-age i { font-size: 2rem; color: var(--ty-danger); }
.weigh-ctx .wc-items { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .82rem; }
.weigh-ctx .wc-items i { color: var(--ty-muted); margin-inline-end: .2rem; }
.weigh-quick .form-control { font-size: 1.5rem; font-weight: 700; letter-spacing: .02em; }
.weigh-tools { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.weigh-scale { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .6rem .75rem; border: 1px dashed #cbd5e1; border-radius: 10px; background: #fafbfc; }
.weigh-chips { display: flex; flex-wrap: wrap; gap: .35rem; max-height: 260px; overflow: auto; padding: .4rem; border: 1px solid var(--ty-border); border-radius: 10px; background: #fff; }
.w-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .25rem .2rem .55rem; border-radius: 999px; background: #eef5ff; border: 1px solid #cfe2ff; font-size: .82rem; }
.w-chip small { color: var(--ty-muted); font-size: .65rem; }
.w-chip b { direction: ltr; }
.w-chip button { border: 0; background: transparent; color: #64748b; font-size: 1rem; line-height: 1; padding: 0 .3rem; border-radius: 50%; }
.w-chip button:hover { background: #fee2e2; color: var(--ty-danger); }
.w-chip.low { background: #fff7e6; border-color: #ffe1a6; }
.w-chip.high { background: #ecfdf3; border-color: #badbcc; }
.w-chip.out { background: #fdecec; border-color: #f5c2c7; color: #842029; font-weight: 700; }
.weigh-result-sticky { position: sticky; top: 80px; }
@media (max-width: 1199.98px) { .weigh-result-sticky { position: static; } }
.weigh-big { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-bottom: .75rem; }
.weigh-big > div { background: #f8fafc; border: 1px solid var(--ty-border); border-radius: 10px; padding: .55rem .6rem; text-align: center; min-width: 0; }
.weigh-big > div:first-child { background: #eef5ff; border-color: #cfe2ff; }
.weigh-big span { display: block; font-size: .72rem; color: var(--ty-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weigh-big strong { display: block; font-size: 1.45rem; font-weight: 800; direction: ltr; unicode-bidi: plaintext; }
.weigh-big small { font-size: .7rem; color: var(--ty-muted); }
.weigh-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; font-size: .84rem; }
.weigh-stats > div { display: flex; justify-content: space-between; gap: .5rem; padding: .32rem 0; border-bottom: 1px dashed #eef0f3; }
.weigh-stats span { color: var(--ty-muted); }
.weigh-stats b { white-space: nowrap; }
.weigh-stats > div.wide { grid-column: 1 / -1; }
.weigh-sample .progress { height: 8px; margin-top: .25rem; }
.hist-row { display: grid; grid-template-columns: 96px 1fr 76px; gap: .5rem; align-items: center; font-size: .8rem; margin-bottom: .3rem; }
.hist-l { color: var(--ty-muted); white-space: nowrap; }
.hist-bar { height: 16px; background: #f1f3f5; border-radius: 5px; overflow: hidden; position: relative; }
.hist-bar > span { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 5px; background: #cbd5e1; }
.hist-bar > span.ok { background: #34a853; }
.hist-bar > span.mid { background: #f6b93b; }
.hist-bar > span.far { background: #e57373; }
.hist-v { text-align: left; white-space: nowrap; }
.hist-v small { color: var(--ty-muted); }
.weigh-advice { grid-template-columns: 1fr; }
@media (max-width: 575.98px) {
    .weigh-ctx { flex-direction: column; align-items: stretch; }
    .weigh-ctx .wc-age { border-inline-end: 0; border-bottom: 1px solid rgba(0,0,0,.08); padding: 0 0 .5rem; }
    .weigh-big strong { font-size: 1.15rem; }
    .weigh-stats { grid-template-columns: minmax(0, 1fr); }
}

/* عدد شاخص جدا از متن راست‌به‌چپ (علامت منفی و درصد جابه‌جا نشود) */
bdi.num { unicode-bidi: isolate; direction: ltr; }

/* کادر کرکره‌ای هشدارها */
.ins-toggle { border: 0; text-align: start; cursor: pointer; color: inherit; }
.ins-toggle:hover { background: #f1f5f9; }
.ins-toggle:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: -2px; }
.ins-toggle .ins-chev { transition: transform .2s; font-size: .9rem; color: var(--ty-muted); }
.ins-toggle.collapsed .ins-chev, .ins-toggle[aria-expanded="false"] .ins-chev { transform: rotate(90deg); }
.ins-advice:has(.collapse:not(.show)) .ins-toggle { border-radius: inherit; }
html.print-mode .ins-advice .collapse { display: block !important; }
html.print-mode .ins-chev, html.print-mode .ins-count { display: none; }

/* ───── فرم استاندارد نژاد (dama-breeds.js) ───── */
.std-tabs { gap: .35rem; flex-wrap: wrap; }
.std-tabs .nav-link { border: 1px solid var(--ty-border); font-size: .85rem; padding: .4rem .8rem; color: inherit; }
.std-tabs .nav-link.active { color: #fff; }
.std-tabs .nav-link i { margin-inline-end: .25rem; }
.std-lib-card { padding: .6rem .8rem; border: 1px solid #cfe2ff; background: #f5f9ff; border-radius: 10px; line-height: 1.8; }
.std-map { border: 1px dashed #93c5fd; border-radius: 12px; padding: .75rem; background: #fafcff; }
.std-preview { max-height: 320px; overflow: auto; }
.std-preview th { min-width: 120px; vertical-align: top; }
.std-preview th .form-select { font-size: .78rem; }
.std-rows { max-height: 560px; overflow: auto; }
.std-tools { display: flex; flex-wrap: wrap; gap: .35rem; }
.std-summary { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.std-chip { display: inline-flex; flex-direction: column; padding: .3rem .7rem; border: 1px solid var(--ty-border); border-radius: 10px; background: #f8fafc; }
.std-chip small { font-size: .68rem; color: var(--ty-muted); }
.std-chip b { font-size: .9rem; }

/* نمای کارتی موبایل: خانه‌های data-mobile-hide (مثلاً انرژی و پروتئین سطرهای تولید دان) پنهان؛ رایانه و تبلت دست‌نخورده */
.lines-table.cards [data-mobile-hide="1"] { display: none !important; }

/* جدول «داده‌های به‌کاررفته» پیش‌بینی فروش: منبع‌های طولانی می‌شکنند تا صفحه موبایل پهن نشود */
.ins-table.ins-wrap td.ins-s { white-space: normal; min-width: 7rem; }

/* ═════════ پیام داخلی ═════════ */
/* زنگوله سرآیند: عدد زرد بالا-چپ و تکان تا وقتی پیام خوانده‌نشده هست */
.msg-bell { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--ty-primary);
  background: var(--ty-primary-50); flex-shrink: 0; text-decoration: none; }
.msg-bell:hover { background: #dfe8f7; color: var(--ty-primary); }
.msg-bell i { font-size: 1.15rem; line-height: 1; transform-origin: 50% 2px; }
.msg-bell.ringing i { animation: msg-ring 2.4s ease-in-out infinite; color: #b7791f; }
.msg-bell-count { position: absolute; top: -4px; left: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: #facc15; color: #1f2937;
  font-size: .72rem; font-weight: 800; line-height: 19px; text-align: center; box-shadow: 0 0 0 2px #fff; }
@keyframes msg-ring {
  0%, 55%, 100% { transform: rotate(0); }
  5%, 15%, 25% { transform: rotate(16deg); }
  10%, 20%, 30% { transform: rotate(-14deg); }
  35% { transform: rotate(6deg); }
  40% { transform: rotate(-4deg); }
}
@media (prefers-reduced-motion: reduce) { .msg-bell.ringing i { animation: none; } }

/* زبانه‌ها: موبایل نوار لغزان */
.msg-tabs { display: flex; align-items: center; gap: .35rem; overflow-x: auto; scrollbar-width: none; margin-bottom: .9rem; padding-bottom: 2px; }
.msg-tabs::-webkit-scrollbar { display: none; }
.msg-tab { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .85rem; border-radius: 999px; color: var(--ty-text); background: var(--ty-surface);
  border: 1px solid var(--ty-border); white-space: nowrap; text-decoration: none; font-weight: 600; font-size: .88rem; }
.msg-tab:hover { border-color: var(--ty-accent); color: var(--ty-accent); }
.msg-tab.active { background: var(--ty-primary); border-color: var(--ty-primary); color: #fff; }
.msg-tab-new { margin-inline-start: auto; border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem; }
.msg-count { background: #facc15; color: #1f2937; border-radius: 999px; padding: 0 .45rem; font-size: .75rem; font-weight: 800; }

.msg-search { position: relative; display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; max-width: 560px; }
.msg-search > i { position: absolute; inset-inline-start: .8rem; color: var(--ty-muted); pointer-events: none; }
.msg-search .form-control { padding-inline-start: 2.2rem; border-radius: 999px; }

/* فهرست گفتگوها */
.msg-list { background: var(--ty-surface); border: 1px solid var(--ty-border); border-radius: 12px; overflow: hidden; box-shadow: var(--ty-shadow); }
.msg-item { display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; color: var(--ty-text); text-decoration: none; border-bottom: 1px solid #f1f3f5; }
.msg-item:last-child { border-bottom: 0; }
.msg-item:hover { background: #f8fafc; color: var(--ty-text); }
.msg-item.unread { background: #f3f8ff; }
.msg-item.unread .msg-who, .msg-item.unread .msg-subject { font-weight: 800; }
.msg-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.msg-top { display: flex; align-items: baseline; gap: .5rem; }
.msg-who { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.msg-when { flex-shrink: 0; font-size: .75rem; color: var(--ty-muted); }
.msg-subject { font-size: .9rem; }
.msg-n { color: var(--ty-muted); font-weight: 400; font-size: .8rem; }
.msg-snippet { font-size: .8rem; color: var(--ty-muted); }
.msg-dot { flex-shrink: 0; min-width: 22px; height: 22px; border-radius: 999px; background: var(--ty-accent); color: #fff; font-size: .72rem; font-weight: 800;
  display: grid; place-items: center; padding: 0 6px; }
.msg-av { flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.05rem; }
.msg-av.sm { width: 32px; height: 32px; font-size: .85rem; }
.msg-av.tone0 { background: #1E88E5; }
.msg-av.tone1 { background: #2e7d32; }
.msg-av.tone2 { background: #8e24aa; }
.msg-av.tone3 { background: #ef6c00; }
.msg-av.tone4 { background: #00897b; }
.msg-av.tone5 { background: #c62828; }
.msg-av.tone6 { background: #5d4037; }
.msg-av.tone7 { background: #3949ab; }
.msg-empty { text-align: center; padding: 2.5rem 1rem; background: var(--ty-surface); border: 1px dashed var(--ty-border-strong); border-radius: 12px; color: var(--ty-text); }
.msg-empty > i { font-size: 2.4rem; color: var(--ty-accent); display: block; margin-bottom: .5rem; }
.msg-pager { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: .9rem; }
.msg-fab { position: fixed; inset-inline-start: 1rem; bottom: 1.1rem; width: 56px; height: 56px; border-radius: 50%; background: var(--ty-accent); color: #fff;
  display: grid; place-items: center; font-size: 1.35rem; box-shadow: var(--ty-shadow-lg); z-index: 1030; }
.msg-fab:hover { color: #fff; background: #1976d2; }

/* نوشتن پیام */
.msg-compose { max-width: 860px; }
.msg-mode { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.msg-mode .btn { border-radius: 999px; }
.msg-body { resize: vertical; min-height: 44px; line-height: 1.8; }
.msg-compose-foot { display: flex; justify-content: flex-end; gap: .5rem; background: var(--ty-surface); }
.msg-compose-foot .btn { min-width: 110px; }
.msg-attach { margin-top: .5rem; }
.msg-attach-btns { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.msg-attach-btns .btn { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; }
.msg-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.msg-chip { display: inline-flex; align-items: center; gap: .4rem; max-width: 100%; padding: .3rem .5rem; border: 1px solid var(--ty-border); border-radius: 10px;
  background: #f8fafc; font-size: .8rem; }
.msg-chip img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.msg-chip .text-truncate { max-width: 160px; }
.msg-chip small { color: var(--ty-muted); }
.msg-chip .btn-close { font-size: .6rem; }

/* گفتگو */
.msg-thread-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; background: var(--ty-surface); border: 1px solid var(--ty-border);
  border-radius: 12px; padding: .6rem .75rem; box-shadow: var(--ty-shadow); position: sticky; top: calc(var(--ty-header-h) + .25rem); z-index: 5; }
.msg-thread-title { font-size: 1.05rem; font-weight: 800; color: var(--ty-primary); margin: 0; }
.msg-thread-people { font-size: .78rem; color: var(--ty-muted); }
.min-w-0 { min-width: 0; }
.msg-thread { display: flex; flex-direction: column; gap: .75rem; padding-bottom: 1rem; }
.msg-bubble { display: flex; align-items: flex-end; gap: .5rem; max-width: min(720px, 92%); }
.msg-bubble.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble-body { background: var(--ty-surface); border: 1px solid var(--ty-border); border-radius: 14px; border-start-start-radius: 4px; padding: .55rem .8rem;
  box-shadow: var(--ty-shadow); min-width: 0; }
.msg-bubble.mine .msg-bubble-body { background: #e8f5e9; border-color: #c8e6c9; border-start-start-radius: 14px; border-start-end-radius: 4px; }
.msg-bubble-meta { display: flex; gap: .6rem; justify-content: space-between; font-size: .75rem; color: var(--ty-muted); margin-bottom: .2rem; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; }
.msg-files { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .45rem; }
.msg-img img { display: block; max-width: 220px; max-height: 220px; width: auto; height: auto; border-radius: 10px; border: 1px solid var(--ty-border); object-fit: cover; }
.msg-file { display: inline-flex; align-items: center; gap: .4rem; max-width: 100%; padding: .4rem .6rem; border-radius: 10px; background: #f1f5f9; color: var(--ty-text);
  text-decoration: none; font-size: .82rem; }
.msg-file .text-truncate { max-width: 200px; }
.msg-file small { color: var(--ty-muted); }
.msg-bubble-to { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font-size: .72rem; color: var(--ty-muted); margin-top: .3rem; }
.msg-read.all { color: var(--ty-success); font-weight: 700; }
/* پاسخ: پایین صفحه چسبان (به‌ویژه موبایل) */
.msg-reply { position: sticky; bottom: 0; background: var(--ty-surface); border: 1px solid var(--ty-border); border-radius: 14px; padding: .6rem; box-shadow: var(--ty-shadow-lg);
  margin-top: .5rem; z-index: 6; }
.msg-reply-row { display: flex; align-items: flex-end; gap: .5rem; }
.msg-reply .msg-body { resize: none; border-radius: 12px; }
.msg-send { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; padding: 0; flex-shrink: 0; }
.msg-reply .msg-attach-hint { display: none; }

/* گروه‌ها */
.msg-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: .75rem; }
.msg-members { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.msg-member { background: var(--ty-primary-50); color: var(--ty-primary); border-radius: 999px; padding: .15rem .6rem; font-size: .78rem; }

@media (max-width: 575.98px) {
  .msg-tab-new span { display: none; }
  .msg-item { padding: .7rem .65rem; gap: .6rem; }
  .msg-av { width: 38px; height: 38px; }
  .msg-bubble { max-width: 100%; }
  .msg-img img { max-width: 160px; max-height: 160px; }
  .msg-compose-foot .btn { flex: 1 1 0; }
}

/* پیام صوتی: نوار ضبط (نقطه قرمز تپنده، زمان، پیشرفت تا سقف ۳۰۰ کیلوبایت) و پخش‌کننده در گفتگو */
.msg-recorder { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; padding: .45rem .65rem; border-radius: 999px;
  background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; font-size: .85rem; }
.msg-recorder[hidden] { display: none; }
.msg-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #e11d48; animation: msg-rec 1s ease-in-out infinite; flex-shrink: 0; }
@keyframes msg-rec { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
.msg-rec-time { font-weight: 800; min-width: 2.6rem; }
.msg-rec-meter { flex: 1 1 80px; height: 6px; border-radius: 999px; background: #fecdd3; overflow: hidden; min-width: 60px; }
.msg-rec-meter > span { display: block; height: 100%; width: 0; background: #e11d48; transition: width .4s; }
.msg-recorder .btn { border-radius: 999px; display: inline-flex; align-items: center; gap: .3rem; }
.msg-chip.voice audio { height: 32px; max-width: 210px; }
.msg-voice { display: flex; align-items: center; gap: .4rem; background: #f1f5f9; border-radius: 999px; padding: .2rem .5rem .2rem .3rem; max-width: 100%; }
.msg-voice > i { color: #e11d48; }
.msg-voice audio { height: 36px; width: 240px; max-width: 100%; }
.msg-voice-dl { color: var(--ty-muted); }
@media (max-width: 575.98px) {
  .msg-voice audio { width: 190px; }
  .msg-chip.voice audio { max-width: 170px; }
}
@media (prefers-reduced-motion: reduce) { .msg-rec-dot { animation: none; } }

/* ───── نوار اطلاعات خلاصه (کارت دامدار، محموله، سهمیه) ───── */
.info-strip { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; padding: .65rem .85rem; background: var(--ty-primary-50); border: 1px solid var(--ty-border); border-radius: .6rem; }
.info-strip > div { display: flex; flex-direction: column; min-width: 90px; }
.info-strip span { font-size: .75rem; color: #6b7280; }
.info-strip strong { font-size: .92rem; }
.quota-table td.ok { color: #15803d; font-weight: 700; }
.quota-table td.over { color: #b91c1c; font-weight: 700; }
.heads-table input, .heads-table select { min-width: 90px; }
.recipient-tabs .btn { flex: 1 1 0; }
.matrix-table th, .matrix-table td { text-align: center; vertical-align: middle; }
.matrix-table td:first-child, .matrix-table th:first-child { text-align: right; }
@media (max-width: 575.98px) { .info-strip > div { min-width: 40%; } }

/* ───── خطوط جداسازی جدول‌ها و گریدها (انتخاب کاربر: افقی، عمودی یا هر دو؛ پیش‌فرض هر دو) ───── */
:root { --grid-h: #dfe3ea; --grid-v: #e6e9ef; --grid-head: #cfd5de; }
body.gl-h { --grid-v: transparent; }
body.gl-v { --grid-h: transparent; }
.tabulator { border: 1px solid var(--grid-head); border-radius: .5rem; overflow: hidden; }
.tabulator .tabulator-header { border-bottom: 2px solid var(--grid-head); }
.tabulator .tabulator-header .tabulator-col { border-left: 1px solid var(--grid-head); }
.tabulator-row { border-bottom: 1px solid var(--grid-h); }
.tabulator-row .tabulator-cell { border-left: 1px solid var(--grid-v); }
.tabulator-row .tabulator-cell:last-child, .tabulator .tabulator-header .tabulator-col:last-child { border-left: 0; }
.table > :not(caption) > * > * { border-bottom-color: var(--grid-h); }
.table > :not(caption) > tr > *:not(:last-child), .table > :not(caption) > * > tr > *:not(:last-child) { border-left: 1px solid var(--grid-v); }
.table > thead > tr > th { border-bottom: 2px solid var(--grid-head); background: #f8fafc; }
.table-bordered > :not(caption) > * > * { border-color: var(--grid-h) var(--grid-v); }
.lines-table thead th { border-bottom: 2px solid var(--grid-head); border-left: 1px solid var(--grid-head); }
.lines-table tbody td { border-bottom: 1px solid var(--grid-h); border-left: 1px solid var(--grid-v); }
.lines-table thead th:last-child, .lines-table tbody td:last-child { border-left: 0; }
.lines-wrap { border: 1px solid var(--grid-head); border-radius: .5rem; }
.report-table th, .report-table td { border-left: 1px solid var(--grid-v); border-bottom: 1px solid var(--grid-h); }
.grid-lines-pick .btn.active { background: var(--ty-primary); color: #fff; }

/* ───── سازگاری کامل با همه اندازه‌ها (موبایل، تبلت، لپ‌تاپ، نمایشگر عریض) ───── */
.table-responsive, .lines-wrap { -webkit-overflow-scrolling: touch; max-width: 100%; }
.quick-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.recipient-tabs { flex-wrap: wrap; }
.pay-quick { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.info-strip strong { word-break: break-word; }
/* محتوای صفحه در هر عرضی (پنجره ماکسیمایز، نمایشگر عریض) تمام عرض ناحیه اصلی را می‌گیرد؛ حاشیه خودکار در ستون flex عرض را به اندازه محتوا جمع می‌کرد */
.app-content { width: 100%; min-width: 0; }
@media (max-width: 991.98px) {
  .page-head { flex-wrap: wrap; gap: .5rem; }
  .page-head .actions { width: 100%; display: flex; flex-wrap: wrap; gap: .4rem; }
}
@media (max-width: 575.98px) {
  .quick-actions .btn { flex: 1 1 calc(50% - .5rem); font-size: .82rem; }
  .recipient-tabs .btn { flex: 1 1 100%; border-radius: .4rem !important; margin-bottom: .25rem; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .doc-totals { grid-template-columns: 1fr 1fr; }
  .tabulator { font-size: .8rem; }
  .tabulator-row .tabulator-cell { padding: .45rem .4rem; }
  .modal-body .table { font-size: .8rem; }
  .info-strip > div { min-width: 45%; }
  .form-actions { flex-wrap: wrap; gap: .35rem; }
  .form-actions .btn { flex: 1 1 calc(50% - .35rem); padding: .35rem .4rem; font-size: .82rem; min-height: 38px; }
  .form-actions .spacer, .form-actions .small { display: none; }
}
@media print { body.gl-h, body.gl-v { --grid-h: #999; --grid-v: #999; } }

/* فیلتر فهرست‌ها در موبایل: بسته با دکمه «فیلترها» (dama-app.js) */
/* بخش جست‌وجو و فیلتر همه فهرست‌ها: کرکره‌ای، در حالت اولیه بسته (dama-app.js) */
.filter-toggle { display: none; }
.filter-panel[data-collapsible] .filter-toggle { display: flex; width: 100%; align-items: center; gap: .4rem; background: none; border: 0; padding: .6rem .9rem; font-weight: 700; color: var(--ty-primary); }
.filter-panel[data-collapsible] .filter-toggle .bi-chevron-down { transition: transform .2s; }
.filter-panel[data-collapsible]:not(.is-collapsed) .filter-toggle .bi-chevron-down { transform: rotate(180deg); }
.filter-panel[data-collapsible].is-collapsed > .card-body { display: none; }
.filter-toggle .filter-badge { font-size: .72rem; }

/* ───── کارت انتخاب سیاست فروش ───── */
.policy-card { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; text-align: right; padding: .8rem 1rem; border: 1px solid var(--grid-head); border-radius: .6rem; background: #fff; }
.policy-card i { font-size: 1.4rem; color: var(--ty-primary); }
.policy-card span { font-size: .8rem; color: #6b7280; }
.policy-card.active { border: 2px solid var(--ty-primary); background: var(--ty-primary-50); }
.policy-card:not(:disabled):hover { border-color: var(--ty-primary); }

/* رسید خرید: ستون‌های محموله خود/فروشنده بر اساس منشأ */
form[data-source="2"] .col-own-lot, form:not([data-source="2"]) .col-seller-lot { display: none; }
.inv-qr { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.inv-qr img { width: 92px; height: 92px; image-rendering: pixelated; }
.inv-qr span { font-size: .7rem; color: #6b7280; }
.verify-card { max-width: 560px; margin: 2rem auto; }
.verify-card .ok { color: #15803d; } .verify-card .bad { color: #b91c1c; }

/* دسترسی سریع شخصی (داشبورد و نوار بالا) */
.quick-menu { min-width: 260px; max-width: 340px; max-height: 70vh; overflow-y: auto; }
.quick-pins { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; }
.quick-pin { position: relative; border: 1px solid var(--ty-border); border-radius: 12px; background: var(--ty-surface); }
.quick-pin:hover { border-color: var(--ty-accent); }
.quick-pin-link { display: flex; align-items: center; gap: .5rem; padding: .7rem .8rem; color: var(--ty-text); text-decoration: none; font-weight: 600; font-size: .9rem; }
.quick-pin-link i { color: var(--ty-primary); font-size: 1.15rem; }
.quick-pin-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-pin-tools { position: absolute; top: 2px; left: 4px; display: flex; gap: .15rem; opacity: 0; transition: opacity .15s; }
.quick-pin:hover .quick-pin-tools, .quick-pin:focus-within .quick-pin-tools { opacity: 1; }
.quick-pin-tools form { margin: 0; }
@media (hover: none) { .quick-pin-tools { opacity: 1; } }

/* دکمه بازگشت نوار بالا (مانند Back مرورگر) */
.app-header .back-top { display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }

/* موبایل و تبلت: نوار بالا و نوار دکمه‌های فرم هرگز از عرض صفحه بیرون نزنند */
@media (max-width: 991.98px) {
  .form-actions { margin-inline: -.9rem; padding-inline: .9rem; }
  .app-header > .ms-auto { min-width: 0; }
  .app-header .tenant-chip { flex-shrink: 1; min-width: 0; }
  .app-header .tenant-chip .text-truncate { max-width: 160px !important; }
}
@media (max-width: 575.98px) {
  .app-header { gap: .35rem; padding-inline: .5rem; }
  .app-header > .ms-auto { gap: .35rem !important; }
  .app-header .tenant-chip { padding: .25rem .5rem; }
  .app-header .tenant-chip .text-truncate { max-width: 72px !important; }
  .app-header .user-btn .bi-chevron-down { display: none; }
}
@media (max-width: 359.98px) {
  .app-header .tenant-chip .text-truncate { display: none; }
}

/* پیش‌نمایش آرم بنگاه */
.company-logo-preview { width: 140px; height: 140px; object-fit: contain; border: 1px dashed var(--ty-border); border-radius: 12px; background: #fff; padding: 8px; }
.company-logo-preview.empty { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; color: var(--ty-muted); font-size: .8rem; }
.company-logo-preview.empty i { font-size: 2rem; }

/* صفحه عمومی استعلام اصالت حواله (QR) */
.check-sheet { position: relative; overflow: hidden; }
.check-watermark { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-around; align-items: center; pointer-events: none; z-index: 0; }
.check-watermark span { transform: rotate(-24deg); font-size: 1.35rem; font-weight: 900; color: rgba(21, 128, 61, .07); white-space: nowrap; }
.check-sheet > *:not(.check-watermark) { position: relative; z-index: 1; }
.check-seal { width: 64px; height: 64px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 2.1rem; color: #fff; }
.check-seal.ok { background: #15803d; box-shadow: 0 0 0 6px rgba(21, 128, 61, .15); }
.check-seal.warn { background: #b45309; box-shadow: 0 0 0 6px rgba(180, 83, 9, .15); }
.check-seal.bad { background: #b91c1c; box-shadow: 0 0 0 6px rgba(185, 28, 28, .15); }
.check-table { background: rgba(255, 255, 255, .85); }
.check-table th { background: #f1f5f9; width: 34%; }

/* ───── صفحه ورود با تصویر کارکرد سامانه ───── */
.auth-shell { width: 100%; display: grid; place-items: center; }
.auth-shell.with-hero { max-width: 1080px; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 0; align-items: stretch;
    background: var(--ty-surface); border-radius: 22px; box-shadow: 0 18px 50px rgba(15, 43, 91, .12); overflow: hidden; }
.auth-shell.with-hero .auth-card { max-width: none; align-self: center; padding: 1.25rem; }
.auth-shell.with-hero .auth-card > .card { border: 0; box-shadow: none; }
.auth-hero { position: relative; background: #e3f3e8; display: flex; flex-direction: column; min-height: 520px; }
.auth-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center bottom; position: absolute; inset: 0; }
.auth-hero-text { position: relative; margin: 1.5rem; padding: 1rem 1.2rem; background: rgba(255, 255, 255, .86); border-radius: 14px; backdrop-filter: blur(3px); max-width: 380px; }
.auth-hero-text h2 { font-size: 1.15rem; font-weight: 900; color: #1b4d33; margin: 0 0 .5rem; }
.auth-hero-text ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .86rem; color: #334155; }
.auth-hero-text i { color: #2f8f5b; margin-inline-end: .35rem; }
@media (max-width: 991.98px) {
  .auth-shell.with-hero { grid-template-columns: 1fr; max-width: 480px; }
  .auth-hero { min-height: 170px; order: -1; }
  .auth-hero-text { display: none; }
}
/* بنر خوشامد داشبورد */
.dash-hero { position: relative; overflow: hidden; border-radius: 16px; background: linear-gradient(90deg, #f6fbf7 0, #e3f3e8 100%); border: 1px solid var(--ty-border);
    min-height: 120px; display: flex; align-items: center; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.dash-hero img { position: absolute; inset-inline-end: 0; top: 0; height: 100%; width: 46%; object-fit: cover; object-position: center 70%;
    -webkit-mask-image: linear-gradient(to left, #000 60%, transparent); mask-image: linear-gradient(to left, #000 60%, transparent); }
.dash-hero .dash-title { position: relative; z-index: 1; }
@media (max-width: 767.98px) { .dash-hero img { width: 100%; opacity: .22; -webkit-mask-image: none; mask-image: none; } }

/* صفحه‌بندی محلی جدول نتیجه (گزارش‌ساز)؛ در چاپ همه ردیف‌ها */
tr.lp-hidden { display: none; }
html.print-mode tr.lp-hidden { display: table-row; }

/* ───────────── حواله تحویل کالا (Views/SalesInvoices/_Sheet.cshtml) به قالب سامانه قدیم ─────────────
   جدول‌های خط‌دار سیاه‌وسفید و کم‌جوهر؛ اندازه‌ها نسبی (em) تا با مقیاس چاپ در A4 و A5 (عمودی/افقی) در یک برگه جا شود. */
.voucher { position: relative; --v-line: #4b5563; --v-soft: #f3f4f6; font-size: .9rem; line-height: 1.6; color: #111827; overflow: hidden; }
.voucher .v-watermark { position: absolute; inset: 35% 0 auto; text-align: center; transform: rotate(-18deg); font-size: 2.2em; font-weight: 900;
    color: rgba(185, 28, 28, .14); pointer-events: none; z-index: 0; }
.voucher .v-brand { position: absolute; left: -4px; bottom: 30%; writing-mode: vertical-rl; transform: rotate(180deg); font-size: .62em; letter-spacing: .1em;
    color: #9ca3af; border: 1px solid #d1d5db; padding: .3em .1em; }
.v-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 10px; margin-bottom: .6em; }
.v-qr { justify-self: start; display: flex; gap: 8px; align-items: flex-start; text-align: center; }
.v-qr img { width: 92px; height: 92px; image-rendering: pixelated; display: block; margin-inline: auto; }
.v-qr .v-logo { width: 70px; height: 70px; object-fit: contain; image-rendering: auto; }
.v-qr small { display: block; font-size: .66em; color: #374151; margin-top: .2em; }
.v-title { text-align: center; padding-top: .2em; }
.v-title h1 { font-size: 1.9em; font-weight: 900; margin: 0 0 .25em; color: #111827; }
.v-title div { font-size: 1.05em; }
.v-meta { justify-self: end; margin: 0; display: grid; gap: .1em; font-size: .95em; }
.v-meta > div { display: flex; gap: .35em; }
.v-meta dt { font-weight: 700; margin: 0; }
.v-meta dd { margin: 0; font-weight: 600; }
.v-intro { margin: .4em 0 .3em; font-size: .95em; }
.v-sub { font-size: 1em; font-weight: 800; margin: 0 0 .25em; }
.v-party, .v-items { width: 100%; border-collapse: collapse; margin-bottom: .7em; font-size: .92em; position: relative; z-index: 1; background: #fff; }
.v-party { table-layout: fixed; }
.v-party col.k { width: 13%; }
.v-party col.v { width: 20.33%; }
.v-party th, .v-party td, .v-items th, .v-items td { border: 1px solid var(--v-line); padding: .35em .5em; vertical-align: middle; }
.v-party th { font-weight: 700; text-align: right; }
.v-party td { overflow-wrap: anywhere; }
.v-items thead th { background: var(--v-soft); font-weight: 800; text-align: center; font-size: .95em; }
.v-items th.v-no { width: 2.8em; }
.v-items th.v-unit { width: 5.5em; }
.v-items th.v-num { width: 5.5em; }
.v-items th.v-money { width: 7.5em; }
.v-items td { text-align: center; }
.v-items td.t { text-align: right; }
.v-items td.num { direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.v-items .v-summary th { text-align: right; font-weight: 800; }
.v-items .v-summary tr.total th, .v-items .v-summary tr.total td, .v-items .v-summary tr.payable th, .v-items .v-summary tr.payable td { background: var(--v-soft); font-weight: 800; }
.v-items .v-summary tr.words td { text-align: right; padding: .45em .6em; }
.v-items .v-summary tr.words span { display: inline-block; margin-inline-end: 2.5em; }
.v-note { font-size: .9em; margin: .2em 0 .4em; }
.v-foot { position: relative; z-index: 1; break-inside: avoid; }
.v-receipt { margin: 2.2em 0 .6em; font-size: .95em; }
.v-signs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8em; }
.v-sign { border: 1px solid var(--v-line); border-radius: 8px; min-height: 6.2em; padding: .5em .7em; }
.v-sign b { display: block; font-size: .95em; }
.v-sign small { display: block; font-size: .78em; color: #374151; }
.v-valid { font-weight: 800; margin: .8em 0 .4em; font-size: .92em; }
.v-issue { display: flex; justify-content: space-between; gap: 1em; font-size: .78em; color: #374151; border-top: 1px solid #d1d5db; padding-top: .3em; }
/* چاپ: پانویس (رسید، امضاها، اعتبار) پایین برگه */
html.print-mode .voucher { font-size: 11.5px; }
html.print-mode .voucher .v-foot { margin-top: 0; }
html.print-mode .voucher .v-items thead th, html.print-mode .voucher .v-summary tr.total th, html.print-mode .voucher .v-summary tr.payable th,
html.print-mode .voucher .v-summary tr.total td, html.print-mode .voucher .v-summary tr.payable td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* کاغذ کوچک (A5) یا صفحه باریک: QR و فاصله‌ها کوچک‌تر */
@container invoice (max-width: 620px) {
    .v-qr img { width: 72px; height: 72px; }
    .v-qr .v-logo { width: 52px; height: 52px; }
    .v-title h1 { font-size: 1.55em; }
    .v-party col.k { width: 15%; }
    .v-party col.v { width: 18.33%; }
    .v-party th, .v-party td, .v-items th, .v-items td { padding: .25em .3em; }
    .v-receipt { margin-top: 1.2em; }
}
@media (max-width: 575.98px) {
    .v-head { grid-template-columns: 1fr auto; }
    .v-head .v-title { grid-column: 1 / -1; order: -1; }
    .v-party { table-layout: auto; }
    .v-items { display: block; overflow-x: auto; }
    .v-signs { grid-template-columns: 1fr; }
}

/* جدول عنوان/مقدار افقی (مشخصات محموله، وضعیت فعلی نرخ): عنوان‌ها خاکستری، مقدارها پررنگ؛ در صفحه باریک اسکرول افقی */
.kv-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.kv-table th, .kv-table td { border: 1px solid var(--ty-border); padding: .45rem .6rem; text-align: center; white-space: nowrap; }
.kv-table th { background: var(--ty-primary-50, #eef2f7); color: var(--ty-muted); font-weight: 600; font-size: .78rem; }
.kv-table td { font-weight: 700; color: var(--ty-text); }
/* سهمیه محموله: ردیف دارای سهمیه اختصاصی/عمومی */
tr.quota-custom > td { background: #ecfdf3 !important; }
tr.quota-general > td:nth-child(4) { color: var(--ty-primary); font-weight: 700; }

/* سوابق حواله‌های دامدار: ردیف‌های یک حواله هم‌رنگ؛ جمع هر نهاده به شکل برچسب */
.voucher-history tr.band > td { background: #f5f8fc; }
.total-chip { display: inline-flex; align-items: baseline; gap: .35rem; border: 1px solid var(--ty-border); border-radius: 999px; padding: .3rem .8rem; background: var(--ty-surface); font-size: .85rem; }
.total-chip > span { color: var(--ty-muted); }
.total-chip strong { color: var(--ty-primary); font-size: 1rem; }
details.farmer-history > summary { cursor: pointer; list-style: none; }
details.farmer-history > summary::-webkit-details-marker { display: none; }
details.farmer-history > summary::before { content: "\F282"; font-family: bootstrap-icons; transition: transform .15s; }
details.farmer-history[open] > summary::before { transform: rotate(180deg); }
/* جدول سوابق دریافت دامدار (ساخته‌شده با اسکریپت): در همه عرض‌ها جدول می‌ماند؛ در تبلت و تلفن اسکرول افقی داخل کادر */
details.farmer-history .fh-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-height: 320px; overflow-y: auto; }
details.farmer-history .fh-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: .82rem; }
details.farmer-history .fh-table th, details.farmer-history .fh-table td { border: 1px solid var(--ty-border); padding: .3rem .45rem; text-align: center; vertical-align: middle; white-space: nowrap; }
details.farmer-history .fh-table thead th { background: var(--ty-primary-50, #eef2f7); color: var(--ty-muted); font-weight: 700; font-size: .76rem; position: sticky; top: 0; z-index: 1; }
details.farmer-history .fh-table td.fh-text { white-space: normal; min-width: 120px; }
details.farmer-history .fh-table td.num { font-variant-numeric: tabular-nums; }
details.farmer-history .fh-table tbody tr:nth-child(even) > td { background: #fafbfc; }
details.farmer-history .fh-table .btn { min-height: 0 !important; height: auto; padding: .05rem .3rem; line-height: 1.4; }
@media (max-width: 767.98px) {
    details.farmer-history > summary { font-size: .85rem; }
    details.farmer-history > summary > a { margin-inline-start: 0 !important; width: 100%; }
}
/* سهمیه پیشنهادی دامدار در حواله: همه ستون‌ها وسط‌چین و عنوان‌ها کوچک‌تر */
.quota-table th, .quota-table td { text-align: center !important; vertical-align: middle; }
.quota-table thead th { font-size: .76rem; font-weight: 700; color: var(--ty-muted); background: var(--ty-primary-50, #eef2f7); white-space: nowrap; }
.quota-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* جدول سهمیه محموله: روی همه دستگاه‌ها یک‌ردیفه؛ در تلفن ستون‌ها فشرده تا بدون اسکرول افقی جا شوند */
@media (max-width: 767.98px) {
  .lot-quota-table { font-size: .78rem; }
  .lot-quota-table th, .lot-quota-table td { padding: .3rem .25rem !important; white-space: normal; word-break: break-word; }
  .lot-quota-table input.form-control { min-height: 32px; height: 32px; padding: .2rem .3rem; font-size: .8rem; }
}

/* بخشی که فقط در پیش‌نمایش و چاپ دیده می‌شود (مثلاً رسید فشرده دریافت/پرداخت) */
.print-only { display: none !important; }
html.print-mode .print-only { display: block !important; }
@media print { .print-only { display: block !important; } }

/* ───── رسید دریافت / پرداخت وجه (Views/Shared/_TreasurySheet.cshtml) ───── */
.tr-sheet { position: relative; overflow: hidden; }
.tr-sheet .tr-watermark { position: absolute; inset: 40% 0 auto; text-align: center; transform: rotate(-16deg); font-size: 3em; font-weight: 900;
    color: rgba(185, 28, 28, .13); pointer-events: none; }
.tr-sheet .tr-text { margin: .3em 0 .6em; line-height: 2; font-size: .98em; }
.tr-sheet .tr-settle { margin-top: 8px; }
.tr-sheet .inv-signs { margin-top: 14px; }
.tr-sheet .inv-signs .sig { min-height: 48px; }
.tr-sheet .tr-issue { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4em 1em; margin-top: 8px; padding-top: .3em;
    border-top: 1px solid #d1d5db; font-size: .76em; color: #4b5563; }
.lines-table tr.trace-child > td { background: #f8fafc; }

/* گزارش نظارت و پایش: نوار درصد داخل خانه جدول؛ در چاپ همه زبانه‌ها پشت سر هم */
.pct-bar { position: relative; min-width: 84px; height: 1.35rem; border-radius: 6px; background: #eef2f7; overflow: hidden; }
.pct-bar::before { content: ""; position: absolute; inset: 0 0 0 auto; width: var(--p, 0%); background: linear-gradient(90deg, #86efac, #22c55e); }
.pct-bar > span { position: relative; display: block; text-align: center; font-size: .8rem; font-weight: 700; line-height: 1.35rem; color: #14532d; }
html.print-mode .tab-content > .tab-pane { display: block !important; opacity: 1 !important; margin-bottom: 10px; }

/* سربرگ داشبورد (بدون تصویر زمینه) و نشان وزارت جهاد کشاورزی بالای فرم ورود */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: .25rem 0; }
.dash-head .dash-logo { width: 58px; height: 58px; }
.auth-ministry { display: flex; flex-direction: column; align-items: center; gap: .3rem; margin-bottom: 1rem; padding-bottom: .9rem; border-bottom: 1px solid var(--ty-border); }
.auth-ministry img { height: 76px; width: auto; max-width: 160px; object-fit: contain; }
.auth-ministry span { font-size: .82rem; font-weight: 700; color: #1b4d33; }

/* کمبوی جستجوپذیر جدول مرجع ارزش غذایی در فرم کالا */
.nutrient-ref-pick { flex: 1 1 340px; min-width: min(100%, 300px); max-width: 480px; }

/* ───── برگ تولید خوراک (Views/Shared/_FeedProductionSheet.cshtml) ───── */
.fp-sheet .fp-draft { color: rgba(30, 64, 175, .1); }
.fp-figs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin: 2px 0 10px; break-inside: avoid; }
.fp-figs > div { border: 1px solid var(--inv-line); border-radius: 6px; padding: .3em .45em; text-align: center; background: #fff; }
.fp-figs > div.hi { background: var(--inv-head); border-color: #9ca3af; }
.fp-figs span { display: block; font-size: .74em; color: #4b5563; font-weight: 600; }
.fp-figs b { display: block; font-size: 1.02em; font-weight: 900; direction: ltr; font-variant-numeric: tabular-nums; }
.fp-figs small { display: block; font-size: .68em; color: #6b7280; }
.fp-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 10px; align-items: start; break-inside: avoid; }
.fp-two > :only-child { grid-column: 1 / -1; }
.fp-cost th { text-align: right; background: var(--inv-soft); font-weight: 600; border: 1px solid var(--inv-line); padding: .3em .5em; white-space: normal; }
.fp-cost td.n { font-weight: 700; width: 38%; }
.fp-cost tr.grand-row th, .fp-cost tr.grand-row td { background: var(--inv-head); font-weight: 900; }
.fp-diet td { padding: .22em .4em; }
@container invoice (max-width: 560px) { .fp-figs { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fp-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 575.98px) { .fp-figs { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fp-two { grid-template-columns: minmax(0, 1fr); } }

/* مراحل گردش (درخواست خرید و…): انجام‌شده سبز، جاری آبی، ردشده/لغو قرمز */
.flow-steps { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; counter-reset: fs; }
.flow-steps li { flex: 1 1 140px; display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; border: 1px solid var(--ty-border); border-radius: .6rem; background: var(--ty-surface); font-size: .82rem; color: var(--ty-muted); }
.flow-steps li i { font-size: 1.05rem; }
.flow-steps li small { display: block; font-size: .72rem; }
.flow-steps li.done { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.flow-steps li.current { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; font-weight: 700; }
.flow-steps li.failed { border-color: #fecaca; background: #fef2f2; color: #b91c1c; font-weight: 700; }
.lines-table tr.row-warn > td, table tr.row-warn > td { background: #fff8e6; }
/* سند تمام‌برگشتی در فهرست: کم‌رنگ با خط کنار قرمز */
.tabulator-row.row-returned, .tabulator-row.row-returned.tabulator-row-even { background: #fff5f5; color: #9ca3af; box-shadow: inset -4px 0 0 #f87171; }

/* دکمه کنار کنترل (تأمین‌کننده/مشتری/دامدار جدید): هم‌ردیف و هم‌ارتفاع کمبو در همه عرض‌ها */
.input-group.field-action { flex-wrap: nowrap; }
.input-group > .ts-wrapper { flex: 1 1 auto; width: 1%; min-width: 0; }
.input-group.field-action > .ts-wrapper .ts-control { border-start-end-radius: 0; border-end-end-radius: 0; }
.input-group.field-action > .btn { white-space: nowrap; min-height: var(--ty-control-h); padding-inline: .75rem; z-index: 1; }

/* جمع سند به شکل کادرهای فقط‌خواندنی با عنوان بالای کادر، هم‌ردیف و هم‌اندازه با «تخفیف کل» */
.totals-fields { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; align-items: start; }
.totals-fields .dama-field { margin-bottom: 0; }
.totals-fields .form-label { display: block; }
.totals-fields .tf output { display: flex; align-items: center; justify-content: flex-end; min-height: var(--ty-control-h); padding: .45rem .75rem;
  border: 1px solid var(--ty-border); border-radius: var(--ty-radius); background: #f8fafc; font-weight: 700; direction: ltr; font-variant-numeric: tabular-nums; }
.totals-fields .tf.grand output { background: #eef5ff; border-color: #cfe2ff; color: #0d47a1; font-size: 1.02rem; }
@media (max-width: 991.98px) { .totals-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .totals-fields .tf.grand { grid-column: 1 / -1; } }
/* مقدار تعیین‌شده توسط طرف دیگر (مثلاً نرخ فروشنده در خرید مستقیم): فقط‌خواندنی و متمایز */
.form-control.is-locked, .form-control.is-locked:focus { background: #f1f5f9; color: #334155; cursor: not-allowed; }

/* واترمارک حواله باطل/تمام‌برگشتی (صفحه و چاپ) */
.voucher .v-watermark small { display: block; font-size: .42em; font-weight: 800; margin-top: .2em; }
.voucher .v-void { color: #b91c1c; font-weight: 800; }
.check-watermark.void span { color: rgba(185, 28, 28, .10); }

/* چاپ ردیابی محموله: جدول ۸ ستونی با خانه‌های چندخطی و عرض درصدی؛ در هر کاغذ و جهت بدون کوچک شدن متن خوانا می‌ماند */
.trace-print { font-size: 9pt; color: #0f172a; }
.trace-print .tp-head { text-align: center; border-bottom: 2px solid #0f2b5b; padding-bottom: .3rem; margin-bottom: .45rem; }
.trace-print .tp-head h2 { font-size: 12.5pt; font-weight: 800; color: #0f2b5b; margin: 0; }
.trace-print .tp-head div { font-size: 9.5pt; color: #334155; }
.trace-print .tp-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin: 0 0 .5rem; border: 1px solid #cbd5e1; }
.trace-print .tp-info > div { padding: .2rem .45rem; border: 1px solid #e2e8f0; min-width: 0; }
.trace-print .tp-info dt { font-size: 7.5pt; font-weight: 600; color: #64748b; }
.trace-print .tp-info dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.trace-print .tp-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.trace-print .tp-table th, .trace-print .tp-table td { border: 1px solid #cbd5e1; padding: .2rem .3rem; vertical-align: middle; text-align: center; overflow-wrap: anywhere; word-break: break-word; }
.trace-print .tp-table th { background: #0f2b5b; color: #fff; font-weight: 700; font-size: 8pt; text-align: center; }
.trace-print .tp-table td small { display: block; color: #475569; font-size: 7.5pt; }
.trace-print .tp-table td.num { text-align: center; direction: ltr; font-variant-numeric: tabular-nums; }
.trace-print .tp-table tr.tp-child > td { background: #f8fafc; }
.trace-print .tp-table tfoot td { background: #eef2f7; font-weight: 800; }
.trace-print .tp-table thead { display: table-header-group; }
.trace-print .tp-table tr { break-inside: avoid; }
.voucher .v-watermark { z-index: 5; color: rgba(185, 28, 28, .22); text-shadow: 0 0 1px rgba(255, 255, 255, .6); }
.trace-print .tp-table td.num { white-space: nowrap; overflow-wrap: normal; word-break: normal; font-size: 8pt; }
.trace-print .tp-table th { overflow-wrap: normal; word-break: normal; }
.trace-print .tp-table td, .trace-print .tp-table th { padding: .2rem .2rem; }
.trace-print .tp-table td.num { font-size: 7.5pt; }

/* رسید دریافت/پرداخت: ردیف چک برگشتی/عودت/باطل */
.invoice .inv-table tr.tr-void td { text-decoration: line-through; color: #b91c1c; }
.invoice .inv-table tr.tr-void td small { text-decoration: none; }

/* حواله: جدول مشخصات فشرده (ارتفاع کم)، ستون نام و نشانی پهن‌تر و یک‌خطی؛ اعداد جدول کمی کوچک‌تر */
.v-party col.k1 { width: 14%; } .v-party col.v1 { width: 27%; }
.v-party col.k2 { width: 10%; } .v-party col.v2 { width: 16%; }
.v-party col.k3 { width: 10%; } .v-party col.v3 { width: 23%; }
/* عنوان و مقدار هر خانه داخل همان خانه (قلم با data-fit کوچک می‌شود؛ هرگز روی خانه کناری نمی‌افتد) */
.v-party th, .v-party td.v-fit { overflow: hidden; text-overflow: clip; }
.v-party th { line-height: 1.25; }
/* اقلام: چیدمان ثابت تا نام نهاده عرض باقی‌مانده را بگیرد و یک‌خطی بماند (قلم با data-fit کوچک می‌شود) */
.v-items { table-layout: fixed; }
.v-items th.v-words { width: 34%; }
/* ستون مبلغ به اندازه مبلغ‌های میلیاردی پررنگ (جمع کل) تا عدد بریده نشود */
.v-items th.v-money { width: 8.8em; }
.v-items th.v-unit { width: 4.8em; }
.v-items th.v-num { width: 5em; }
.v-items.v-many th.v-money { width: 7.6em; }
.v-items.v-many th.v-unit, .v-items.v-many th.v-num { width: 4.4em; }
.v-items.v-many td.num { font-size: .84em; }
.v-items td.v-fit { white-space: nowrap; overflow: hidden; text-overflow: clip; }
.v-party th, .v-party td { padding: .18em .4em; line-height: 1.35; }
.v-party th { font-size: .92em; white-space: nowrap; }
.v-party td.v-fit { white-space: nowrap; overflow: hidden; }
.v-items td.num { font-size: .9em; }
.v-items .v-summary td.num { font-size: .92em; }
/* چاپ: حواله تمام برگه را می‌گیرد و پانویس (رسید، امضاها، مدت اعتبار، صادرکننده) به پایین برگه می‌چسبد؛ سربرگ عمومی چاپ تکرار نمی‌شود */
html.print-mode .voucher { display: flex; flex-direction: column; }
html.print-mode .voucher .v-foot { margin-top: auto; }
html.print-mode .print-area:has(.voucher) ~ .print-header, html.print-mode body:has(.print-zoom .voucher) .print-header { display: none !important; }

/* نمودار با نام همه اقلام زیر محور (چندسطری) */
.chart-box.chart-tall { height: 320px; }
/* گزارش جامع خرید/فروش: چاپ خوانا (جدول تمام‌عرض، سرستون تکرارشونده) */
.trade-table .report-table td, .trade-table .report-table th { white-space: nowrap; }
html.print-mode .trade-table .report-table { font-size: 9px; }
html.print-mode .trade-table .report-table th { white-space: normal; padding: .2rem .25rem; }
html.print-mode .trade-table .report-table td { white-space: nowrap; padding: .2rem .25rem; }
html.print-mode.print-wrap-long .trade-table .report-table td.pc-long { white-space: normal; }
html.print-mode .trade-table .report-table thead { display: table-header-group; }
html.print-mode .trade-chart { break-inside: avoid; }

/* گرید فشرده (گزارش جامع خرید/فروش): قلم سطرها و عنوان‌ها کمی کوچک‌تر */
.grid-compact .tabulator .tabulator-row .tabulator-cell { font-size: .8rem; padding-top: 5px; padding-bottom: 5px; }
.grid-compact .tabulator .tabulator-header .tabulator-col .tabulator-col-title { font-size: .78rem; }
.trade-chart > .card-header h2 { font-size: .95rem; }

/* حواله/رسید: نشانی بلند به‌جای ریز شدن دوخطی می‌شود؛ کادر «وضعیت برگشت» صفحه در چاپ نمی‌آید (برگشت‌ها جدول مرتب داخل خود برگه است) */
.v-party td.v-addr { line-height: 1.3; }
html.print-mode .print-zoom:has(.voucher) .return-status { display: none !important; }
/* خط بیرونی جدول‌ها (border-collapse نیمی بیرون جدول است) با overflow حواله بریده نشود */
html.print-mode .voucher { padding: 0 2px; }
.v-items.v-returns { font-size: .84em; margin-bottom: .5em; }
.v-items.v-returns caption { caption-side: top; text-align: right; font-weight: 800; font-size: 1.1em; color: #111827; padding: 0 0 .2em; }
.v-items.v-returns th.v-desc { width: 38%; }
/* رسید خرید و ورود کالا (Views/Purchases/_Sheet.cshtml): فروشنده و خریدار هر کدام یک ردیف */
.v-title .v-src { font-size: .9em; color: #374151; }
.v-party.v-parties col.p0 { width: 9%; } .v-party.v-parties col.p1 { width: 31%; } .v-party.v-parties col.p2 { width: 12%; }
.v-party.v-parties col.p3 { width: 13%; } .v-party.v-parties col.p4 { width: 12%; } .v-party.v-parties col.p5 { width: 23%; }
.v-party.v-parties thead th { white-space: nowrap; overflow: hidden; }
.v-party.v-parties thead th { background: var(--v-soft); text-align: center; font-weight: 800; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.v-party.v-parties tbody th { text-align: center; }
.v-party.v-parties td { text-align: center; }
.v-party.v-parties td.v-addr { text-align: right; }
.v-items th.v-lot { width: 7em; }
.v-transport { display: flex; flex-wrap: wrap; gap: .2em 1.6em; }
@media (max-width: 575.98px) { .v-party.v-parties { table-layout: auto; display: block; overflow-x: auto; } }

/* برگه چاپی اسناد انبار (Views/InventoryDocs/_Sheet.cshtml): ستون تاریخ انقضا */
.v-items th.v-date { width: 6.2em; }

/* پنجره «درباره داما سیستم» */
.about-modal .about-logo { width: 28px; height: 28px; vertical-align: -7px; margin-inline-end: .35rem; }
.about-modal .about-lead { line-height: 1.9; }
.about-modal .about-list { padding-inline-start: 1.2rem; margin-bottom: 1rem; line-height: 1.9; font-size: .92rem; }
.about-modal .about-author { border: 1px solid var(--ty-border); border-radius: 10px; background: #f8fafc; padding: .75rem 1rem; display: grid; gap: .35rem; }
.about-modal .about-author span { color: var(--ty-muted); }
.about-modal .about-ver { margin-top: .75rem; font-size: .8rem; color: var(--ty-muted); text-align: center; }
.v-party.v-pairs2 col.k { width: 17%; }
.v-party.v-pairs2 col.v { width: 33%; }
