/* ───────── ایران حساب — پوسته (RTL، تاریک پیش‌فرض) ───────── */
/* فونت برند (مثل نمونه: یکان بخ). فونت تجاری است و باید از fontiran.com مجوز خرید:
   فایل‌ها را با نام regular/semibold/bold در public/fonts/brand/ بگذارید، یا فونت نصب‌شده روی ویندوز استفاده می‌شود. */
@font-face { font-family: "Sakou"; src: url("../fonts/sakou/sakou-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Sakou"; src: url("../fonts/sakou/sakou-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Sakou"; src: url("../fonts/sakou/sakou-700.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "BrandFont"; src: local("Yekan Bakh FaNum"), local("YekanBakhFaNum-Regular"), url("../fonts/brand/regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "BrandFont"; src: local("Yekan Bakh FaNum SemiBold"), local("YekanBakhFaNum-SemiBold"), url("../fonts/brand/semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "BrandFont"; src: local("Yekan Bakh FaNum Bold"), local("YekanBakhFaNum-Bold"), url("../fonts/brand/bold.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  /* ─── ابعاد و متغیرهای کنترلهای پایه (Global Control Design Tokens) ─── */
  --ctrl-h: 34px;                  /* ارتفاع استاندارد اینپوتها، سلکتها و دکمهها */
  --ctrl-h-sm: 30px;               /* ارتفاع فشرده برای داخل جداول و تولبارها */
  --ctrl-font-size: 12.5px;        /* سایز فونت پایه فرمها و کنترلها */
  --ctrl-line-height: 1.4;         /* line-height کنترلها */
  --ctrl-radius: 6px;              /* border-radius یکدست */
  --ctrl-pad-x: 10px;              /* پدینگ افقی یکدست */
  --ctrl-border-color: #cbd5e1;    /* رنگ حاشیه پیشفرض */
  --btn-icon-size: 34px;           /* ابعاد دکمههای آیکونی مربعی */
  --btn-icon-sm: 30px;             /* دکمههای آیکونی فشرده و داخل گرید */
}

:root, html[data-theme="dark"] {
  --bg: #0b1220; --rail: #0d1526; --side: #111a2c; --panel: #131d31; --panel2: #172238; --panel3: #1b2740;
  --line: #24324d; --line2: #2c3b5a; --text: #e5eaf3; --muted: #8e9bb6; --muted2: #64728f;
  --primary: #3b82f6; --primary-2: #2563eb; --primary-soft: #1a2c4f; --head: #1f3358; --head-text: #dbe6ff;
  --ok: #22c55e; --ok-soft: #12301f; --warn: #f59e0b; --warn-soft: #33260c; --danger: #ef4444; --danger-soft: #3a1717;
  --credit: #f87171; --orange: #f97316; --row-alt: #141f34; --row-hover: #1c2a46; --sel: #24427a;
  --grp-income: #3a1d24; --grp-memo: #13321f;
  --radius: 6px; --shadow: 0 6px 24px rgba(0,0,0,.35);
  --ctrl-border-color: var(--line);
}
html[data-theme="light"] {
  --bg: #eef2f8; --rail: #0f172a; --side: #ffffff; --panel: #ffffff; --panel2: #f6f8fc; --panel3: #eef2f8;
  --line: #dfe5ef; --line2: #cfd8e6; --text: #1d2939; --muted: #667085; --muted2: #98a2b3;
  --primary-soft: #e6eeff; --head: #e3ebfa; --head-text: #23395f; --row-alt: #fafbfe; --row-hover: #eef4ff; --sel: #cfe0ff;
  --ok-soft: #e7f7ed; --warn-soft: #fff4e5; --danger-soft: #fdecec; --credit: #dc2626; --grp-income: #fdeeee; --grp-memo: #e9f8ef;
  --shadow: 0 6px 24px rgba(16,24,40,.12);
  --ctrl-border-color: var(--line);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Sakou, "Segoe UI", BrandFont, Vazirmatn, Tahoma, sans-serif; font-size: 13.5px; background: var(--bg); color: var(--text); direction: rtl; overflow: hidden; }
a { color: var(--primary); text-decoration: none; }
button { font: inherit; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: plaintext; text-align: left; white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 11.5px; } .bold { font-weight: 700; }
.ok { color: var(--ok); } .danger { color: var(--danger); } .warn { color: var(--warn); } .credit { color: var(--credit); }
.hidden { display: none !important; }
.ico { flex: none; }

/* ── چیدمان: ریل | زیرمنو | محتوا ── */
.app { display: grid; grid-template-columns: 62px 232px 1fr; grid-template-rows: 40px 1fr 26px; height: 100vh; }
.rail { grid-row: 1 / 4; background: var(--rail); border-left: 1px solid var(--line); display: flex; flex-direction: column; align-items: stretch; padding: 8px 5px; gap: 2px; }
.rail .logo { height: 50px; display: grid; place-items: center; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.rail a { color: #aab6cc; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border-radius: 9px; font-size: 10.5px; position: relative; }
.rail a.active, .rail a:hover { background: #1a2742; color: #fff; }
.rail a.active::before { content: ""; position: absolute; right: -5px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--primary); }
.rail .spacer { flex: 1; }
.side { background: var(--side); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side .search { margin: 10px; position: relative; }
.side .search input { padding-right: 32px; border-radius: 10px; background: var(--panel2); }
.side .search .ico { position: absolute; right: 9px; top: 8px; color: var(--muted); }
.side nav { flex: 1; overflow-y: auto; }
.side .item { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 6px; border-bottom: 1px solid var(--line); min-height: 40px; }
.side .item > a.lnk { flex: 1; display: flex; align-items: center; gap: 9px; color: var(--text); padding: 9px 4px; min-width: 0; }
.side .item > a.lnk span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .item .ico { color: var(--muted); }
.side .item.active { background: var(--primary-soft); box-shadow: inset -3px 0 0 var(--primary); }
.side .item.active > a.lnk { color: var(--link); font-weight: 700; }
.side .item.soon > a.lnk { color: var(--muted); }
.side .q-add { width: 26px; height: 26px; border-radius: 7px; background: #22c55e; color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; flex: none; }
.side .q-add:hover { background: #16a34a; }
.side .q-gear { color: var(--orange); background: none; border: 0; cursor: pointer; padding: 2px; display: grid; place-items: center; }
.side .ctx { border-top: 1px solid var(--line); padding: 8px 10px; display: flex; justify-content: space-between; gap: 6px; background: var(--panel2); margin: 8px; border-radius: 8px; font-size: 12px; }
.side .ctx select { background: transparent; border: 0; padding: 0; color: var(--text); width: auto; font-size: 12px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tabsbar { display: flex; align-items: center; gap: 6px; padding: 6px 10px 0; background: var(--rail); border-bottom: 1px solid var(--line); min-height: 44px; min-width: 0; } /* بدون این، تب‌های زیاد نوار و کل برنامه را از صفحه بیرون می‌برند؛ ردیف تب‌ها خودش اسکرول می‌خورد */
.tabsbar .tabs { display: flex; gap: 4px; overflow-x: auto; min-width: 0; flex: 0 1 auto; scrollbar-width: none; align-self: flex-end; }
.tabsbar .tab { display: flex; align-items: center; gap: 6px; height: 34px; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; padding: 0 10px; color: var(--muted); white-space: nowrap; max-width: 170px; font-size: 12.5px; }
.tabsbar .tab .ico { flex: none; opacity: .8; }
.tabsbar .tab span { overflow: hidden; text-overflow: ellipsis; }
.tabsbar .tab:hover { color: var(--text); }
.tabsbar .tab.active { background: var(--primary-2); color: #fff; border-color: var(--primary-2); }
.tabsbar .tab b { display: none; place-items: center; width: 16px; height: 16px; border-radius: 4px; cursor: pointer; font-weight: 400; }
.tabsbar .tab b:hover { background: rgba(255,255,255,.15); }
.tabsbar .tab.active b, .tabsbar .tab:hover b.x, .tabsbar .tab.pinned b.pin { display: grid; }
.tabsbar .tab .x { font-size: 15px; line-height: 1; }
.tabsbar .tab .pin .ico { width: 12px; height: 12px; }
.tabsbar .tab.pinned:not(.active) .pin { color: var(--orange); }
.tabsbar .tb-plus { width: 28px; height: 28px; border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; border-radius: 6px; flex: none; }
.tabsbar .tb-plus:hover { background: var(--panel); color: var(--text); }
.tabsbar .grow { flex: 1; }
.tabsbar .ctl { display: flex; gap: 2px; align-items: center; }
.tabsbar .ctl button, .tabsbar .fs { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.tabsbar .ctl button:hover, .tabsbar .fs:hover { background: var(--panel); color: var(--text); }
.tabsbar .ctl button.red { color: #f87171; }
.tabsbar > *:not(.tabs) { margin-bottom: 6px; }
.tabsbar .ctl button[hidden] { display: none; }
.tabsbar .ctl button.spin .ico { animation: tb-spin .8s linear infinite; } @keyframes tb-spin { to { transform: rotate(360deg); } }
/* میان‌بر بخش‌ها (مثل کاریا): نوار بالا / کنار صفحه / پایین صفحه */
.mini-dock { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 2px 3px; background: var(--panel); }
.mini-dock .md-cmd { width: 16px; height: 26px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; border-radius: 6px; padding: 0; }
.mini-dock .md-cmd:hover { color: var(--text); background: var(--panel2); }
.mini-dock .md-ico { position: relative; width: 28px; height: 26px; display: grid; place-items: center; border-radius: 7px; color: var(--muted) !important; }
.mini-dock .md-ico:hover { background: var(--panel2); color: var(--text) !important; }
.mini-dock .md-ico.on { background: var(--primary-soft, rgba(37,99,235,.12)); color: var(--primary) !important; }
.mini-dock .md-badge { position: absolute; top: -4px; inset-inline-start: -4px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: #64748b; color: #fff; font-size: 9.5px; line-height: 15px; text-align: center; font-weight: 700; }
.mini-dock .md-ico.alert .md-badge { background: #dc2626; }
.mini-dock .md-badge[hidden] { display: none; }
.mini-dock.side, .mini-dock.bottom { position: fixed; z-index: 90; box-shadow: 0 8px 24px rgba(0,0,0,.18); touch-action: none; cursor: grab; }
.mini-dock.side { flex-direction: column; left: 8px; top: 40%; padding: 3px 2px; }
.mini-dock.bottom { bottom: 34px; left: 40%; }
.mini-dock.side .md-cmd { width: 26px; height: 16px; transform: rotate(90deg); }
.mini-dock.bottom .md-cmd { transform: rotate(180deg); }
.sub-badge { height: 30px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 8px; border: 1px solid transparent; font-size: 12px; font-weight: 700; white-space: nowrap; }
.sub-badge.trial { background: #f97316; color: #fff !important; }
.sub-badge.ok { background: rgba(22,163,74,.12); border-color: rgba(22,163,74,.45); color: #16a34a !important; }
.sub-badge.due { background: #dc2626; color: #fff !important; }
.frame-chip { height: 30px; display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); flex: none; }
.frame-chip .fs { width: 22px !important; height: 22px !important; }
.net { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); flex: none; }
.net.off { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.25); }
#menu-search.flash { box-shadow: 0 0 0 2px var(--primary); }
.notes-pop { position: fixed; z-index: 60; width: 300px; background: var(--panel); border: 1px solid var(--line2, var(--line)); border-radius: 10px; box-shadow: var(--shadow); padding: 8px; }
.np-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; } .np-h button { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.np-add input { width: 100%; }
.np-list { max-height: 300px; overflow: auto; margin-top: 6px; }
.np-item { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 6px; cursor: pointer; }
.np-item:hover { background: var(--primary-soft); } .np-item span { flex: 1; } .np-item.done span { text-decoration: line-through; color: var(--muted); }
.np-item button { border: 0; background: none; color: var(--muted); cursor: pointer; } .np-item button:hover { color: #f87171; }
.np-clear { margin-top: 6px; border: 0; background: none; color: var(--link); cursor: pointer; font: inherit; font-size: 12px; }
.notice-row { display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); } .notice-row .t { flex: 1; }
html.compact table.g td, html.compact table.g th { padding-top: 3px !important; padding-bottom: 3px !important; }
html.compact table.g { font-size: 12.5px; }
.crumbs { padding: 8px 16px; color: var(--muted); font-size: 12px; }
.crumbs b { color: var(--link); }
.content { flex: 1; overflow: auto; padding: 0 12px 12px; }
.statusbar { grid-column: 2 / 4; background: var(--rail); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 18px; padding: 0 12px; font-size: 11.5px; color: var(--muted); }
.statusbar .st { cursor: pointer; display: flex; gap: 4px; }
.statusbar .sp { flex: 1; }

/* ── پنل/کارت صفحه ── */
.page { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.page + .page { margin-top: 10px; }
.page-h { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--panel); }
.page-h h2 { margin: 0; font-size: 14px; }
.page-h .meta { color: var(--muted); font-size: 12px; }
.page-h .end { margin-right: auto; display: flex; gap: 6px; align-items: center; }
.page-b { padding: 12px; }
.seg { display: inline-flex; background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.seg a, .seg button { padding: 5px 14px; border-radius: 7px; color: var(--muted); border: 0; background: none; cursor: pointer; font-size: 12.5px; }
.seg .on { background: var(--panel); color: var(--link); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.toolbar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.tb { width: var(--btn-icon-size); height: var(--btn-icon-size); border-radius: var(--ctrl-radius); border: 1px solid var(--line); background: var(--panel2); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; box-sizing: border-box; padding: 0; font-family: inherit; }
.tb:hover { color: var(--text); border-color: var(--line2); }
.tb.primary { background: var(--primary-2); border-color: var(--primary-2); color: #fff; }
.tb.danger:hover { color: var(--danger); }
.tb[disabled] { opacity: .4; pointer-events: none; }
.tsearch { position: relative; display: inline-flex; align-items: center; }
.tsearch input { width: 260px; height: var(--ctrl-h); padding-right: 30px; padding-left: var(--ctrl-pad-x); border-radius: var(--ctrl-radius); font-size: var(--ctrl-font-size); font-family: inherit; }
.tsearch .ico { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pagesize { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--ctrl-radius); padding: 0 8px; background: var(--panel2); font-size: var(--ctrl-font-size); color: var(--muted); height: var(--ctrl-h); box-sizing: border-box; font-family: inherit; }
.pagesize select { width: auto; height: 100%; padding: 0 4px; background: transparent; color: var(--link); border: 0; font-weight: 700; cursor: pointer; font-size: var(--ctrl-font-size); font-family: inherit; }
.pagesize select:focus { outline: none; }
.chips { display: flex; gap: 6px; padding: 8px 10px; background: #2a1d10; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
html[data-theme="light"] .chips { background: #fff6ea; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 8px 8px 0 0; border: 1px solid #5a3a1a; color: #f3c58a; background: transparent; cursor: pointer; font-size: 12.5px; }
html[data-theme="light"] .chip { border-color: #f1c58f; color: #9a5b12; }
.chip .n { background: rgba(249,115,22,.25); border-radius: 6px; padding: 0 6px; font-size: 11px; }
.chip.on { background: var(--panel); color: var(--text); border-color: var(--line2); }
.hints { display: flex; gap: 8px; padding: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.hint { border: 1px solid var(--line2); border-radius: 999px; padding: 4px 12px; font-size: 11.5px; color: var(--muted); }
.hint.blue { border-color: #2f5bb0; color: var(--link); }

/* ── گرید داده ── */
.grid-wrap { overflow: auto; max-height: calc(100vh - 290px); }
table.g, table.k-table, table.lines, table.t, table.ta-tbl, table.rp-t, table.mowsem-table, table.sx-grid { width: 100%; border-collapse: collapse; font-size: 12px; }
table.g thead th, table.k-table thead th, table.lines thead th, table.t thead th, table.ta-tbl thead th, table.rp-t thead th, table.mowsem-table thead th, table.sx-grid thead th { background: var(--head); color: var(--head-text); font-weight: 700; font-size: 11.5px; padding: 2px 6px; height: var(--ctrl-h-sm); position: sticky; top: 0; z-index: 2; border: 1px solid var(--line, #cbd5e1); text-align: center; white-space: nowrap; user-select: none; line-height: var(--ctrl-line-height); vertical-align: middle; }
table.g thead th.sortable { cursor: pointer; }
table.g thead th .fic { float: left; opacity: .5; font-size: 10px; }
table.g thead tr.frow th { background: var(--panel); top: var(--ctrl-h-sm); padding: 2px 3px; height: var(--ctrl-h-sm); vertical-align: middle; }
table.g thead tr.frow input, table.g thead tr.frow select { height: calc(var(--ctrl-h-sm) - 4px); padding: 0 6px; font-size: 11px; border-radius: var(--ctrl-radius); background: var(--panel2); border: 1px solid var(--line2); width: 100%; box-sizing: border-box; font-family: inherit; }
table.g tr, table.k-table tr, table.lines tr, table.t tr, table.ta-tbl tr, table.rp-t tr, table.mowsem-table tr, table.sx-grid tr { height: 28px; }
table.g td, table.k-table td, table.lines td, table.t td, table.ta-tbl td, table.rp-t td, table.mowsem-table td, table.sx-grid td { padding: 2px 6px; height: 28px; border: 1px solid var(--line, #cbd5e1); text-align: center; vertical-align: middle; font-size: 12px; line-height: var(--ctrl-line-height); }
table.g tbody td:has(input), table.g tbody td:has(select), table.k-table tbody td:has(input), table.k-table tbody td:has(select) { padding: 0 !important; }
table.g tbody td input:not([type=checkbox]):not([type=radio]), table.g tbody td select, table.k-table tbody td input:not([type=checkbox]):not([type=radio]), table.k-table tbody td select { border: none !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; width: 100% !important; height: 28px !important; line-height: 28px !important; padding: 0 6px !important; margin: 0 !important; font-size: 12px !important; font-family: inherit !important; box-sizing: border-box !important; vertical-align: middle !important; }
table.g tbody td input:focus, table.g tbody td select:focus, table.k-table tbody td input:focus, table.k-table tbody td select:focus { box-shadow: inset 0 0 0 1.5px #6366f1 !important; background: #fff !important; outline: none !important; }
table.g tbody tr:nth-child(even) td, table.k-table tbody tr:nth-child(even) td { background: var(--row-alt); }
table.g tbody tr:hover td, table.k-table tbody tr:hover td { background: var(--row-hover); }
table.g td.t { text-align: right; }
table.g td.sel { background: var(--sel) !important; }
table.g td.rn { color: var(--muted); width: 44px; }
table.g td.ck, table.g th.ck { width: 34px; }
table.g td.ops { white-space: nowrap; width: 1%; }
table.g tfoot td { background: var(--panel2); font-weight: 700; position: sticky; bottom: 0; height: var(--ctrl-h-sm); }
table.g tr.grp-income td { background: var(--grp-income) !important; }
table.g tr.grp-memo td { background: var(--grp-memo) !important; }
.ib { width: var(--btn-icon-sm); height: var(--btn-icon-sm); border-radius: var(--ctrl-radius); border: 1px solid var(--line2); background: var(--panel2); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; vertical-align: middle; box-sizing: border-box; padding: 0; flex: none; font-family: inherit; }
.ib.add { background: #22c55e; border-color: #22c55e; color: #fff; }
.ib.edit { color: var(--link); } .ib.del { color: var(--danger); }
.grid-foot { padding: 6px; text-align: center; color: var(--muted); font-size: 11.5px; border-top: 1px solid var(--line); }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--primary); vertical-align: middle; }

/* ── فرم ── */
label { display: block; font-size: var(--ctrl-font-size); color: var(--muted); margin-bottom: 4px; line-height: var(--ctrl-line-height); }
label .req { color: var(--danger); }
label .hlp { color: var(--muted2); font-size: 11px; margin-right: 6px; }
input:not([type=checkbox]):not([type=radio]),
select,
textarea {
  font-family: inherit;
  font-size: var(--ctrl-font-size);
  line-height: var(--ctrl-line-height);
  color: var(--text);
  background: var(--panel2);
  border: 1px solid var(--ctrl-border-color);
  border-radius: var(--ctrl-radius);
  height: var(--ctrl-h);
  padding: 0 var(--ctrl-pad-x);
  width: 100%;
  box-sizing: border-box;
  vertical-align: middle;
}
textarea { height: auto; min-height: 64px; padding: 6px var(--ctrl-pad-x); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(59,130,246,.2); }
input[readonly] { opacity: .85; }
.fgrid { display: grid; gap: 8px 12px; align-items: flex-end; }
.c2 { grid-template-columns: repeat(2, 1fr); } .c3 { grid-template-columns: repeat(3, 1fr); } .c4 { grid-template-columns: repeat(4, 1fr); } .c6 { grid-template-columns: repeat(6, 1fr); } .c8 { grid-template-columns: repeat(8, 1fr); }
.s2 { grid-column: span 2; } .s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .sall { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-size: var(--ctrl-font-size); height: var(--ctrl-h); margin: 0; cursor: pointer; box-sizing: border-box; }
.check small { color: var(--muted); }
.fsec { border: 1px solid var(--line); border-radius: var(--ctrl-radius); padding: 10px 12px; margin-bottom: 10px; }
.fsec h4 { margin: -2px 0 10px; font-size: 13px; color: var(--link); }
.radio-card { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--ctrl-radius); padding: 8px 10px; cursor: pointer; }
.radio-card input { width: auto; margin-top: 3px; height: auto; }
.radio-card b { display: block; font-size: 13px; }
.radio-card small { color: var(--muted); }
.yn { display: inline-flex; border: 1px solid var(--line); border-radius: var(--ctrl-radius); overflow: hidden; height: var(--ctrl-h); box-sizing: border-box; align-items: center; }
.yn label { margin: 0; padding: 0 12px; cursor: pointer; color: var(--muted); height: 100%; display: inline-flex; align-items: center; }
.yn input { display: none; }
.yn input:checked + span { color: #fff; }
.yn label:has(input:checked) { background: var(--primary-2); color: #fff; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--ctrl-h);
  padding: 0 14px;
  border-radius: var(--ctrl-radius);
  border: 1px solid var(--line2);
  background: var(--panel2);
  color: var(--text);
  font-family: inherit;
  font-size: var(--ctrl-font-size);
  line-height: var(--ctrl-line-height);
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  vertical-align: middle;
}
.btn:hover { border-color: var(--primary); }
.btn.primary { background: var(--primary-2); border-color: var(--primary-2); color: #fff; }
.btn.success { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn.danger { color: var(--danger); }
.btn.sm { height: var(--ctrl-h-sm); padding: 0 9px; font-size: 11.5px; }
.badge { display: inline-flex; align-items: center; padding: 0 8px; height: 22px; border-radius: 999px; font-size: 11px; border: 1px solid var(--line2); color: var(--muted); line-height: 1; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.blue { background: var(--primary-soft); color: var(--link); border-color: transparent; }
.badge.red { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.alert { padding: 8px 12px; border-radius: var(--ctrl-radius); margin: 8px 0; font-size: 12px; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.err { background: var(--danger-soft); color: #fca5a5; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert ul { margin: 0; padding-right: 18px; }
.filters { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: flex-end; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel2); }
.filters > div { min-width: 120px; }

/* ── مودال ── */
dialog.modal { border: 1px solid var(--line2); border-radius: 12px; padding: 0; background: var(--panel); color: var(--text); width: min(760px, 94vw); max-height: 90vh; box-shadow: var(--shadow); }
dialog.modal.wide { width: min(1100px, 96vw); }
dialog.modal::backdrop { background: rgba(3,7,18,.6); }
.m-h { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.m-h .kicker { color: var(--muted); font-size: 11.5px; }
.m-h h3 { margin: 0; font-size: 14.5px; }
.m-h .x { margin-right: auto; background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; }
.m-b { padding: 14px; overflow: auto; max-height: calc(90vh - 120px); }
.m-f { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--panel2); }
.m-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -14px -14px 12px; padding: 8px 14px 0; }
.m-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 12px; color: var(--muted); cursor: pointer; }
.m-tabs button.on { color: var(--link); border-bottom-color: var(--primary); }

/* ── ستونی (Miller) ── */
.miller { display: grid; grid-template-columns: repeat(4, 1fr); min-height: 420px; }
.miller .col { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.miller .col-h { display: flex; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--panel2); font-size: 12px; color: var(--muted); }
.miller .col-h .end { margin-right: auto; }
.miller .row { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-bottom: 1px solid var(--line); cursor: pointer; }
.miller .row:hover { background: var(--row-hover); }
.miller .row.on { background: var(--sel); }
.miller .row .code { color: var(--muted); font-size: 11.5px; margin-right: auto; }
.miller .empty { padding: 30px 10px; text-align: center; color: var(--muted); }
.tree ul { list-style: none; margin: 0; padding-right: 22px; }
.tree > ul { padding-right: 6px; }
.tree li { padding: 3px 0; }
.tree .node { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 6px; cursor: pointer; }
.tree .node:hover { background: var(--row-hover); }
.tree .tg { width: 16px; color: var(--muted); }

/* ── ورود ── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; overflow: auto; }
.auth .box { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px; box-shadow: var(--shadow); }
.auth h1 { margin: 0 0 6px; font-size: 22px; text-align: center; }
.auth h1.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; font-weight: 800; }
.auth-ways { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 12px; }
.auth-ways a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 12px; }
.auth-ways a.on { border-color: var(--primary); color: var(--link); background: var(--primary-soft); }

/* ── کارت‌های هاب گزارش ── */
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; padding: 12px; }
.hub a { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 14px; color: var(--text); background: var(--panel2); }
.hub a:hover { border-color: var(--primary); }
.hub b { color: var(--link); font-size: 14px; } .hub p { color: var(--muted); margin: 6px 0 0; line-height: 1.8; }
.hub .tagl { float: left; font-size: 11px; color: var(--ok); border: 1px solid var(--ok); border-radius: 999px; padding: 0 8px; }

/* ── گام‌ها ── */
.steps { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px; border-bottom: 1px solid var(--line); }
.steps a { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.steps a.on { background: var(--primary-2); color: #fff; border-color: var(--primary-2); }
.steps a.done { border-color: var(--ok); color: var(--ok); }

/* ── صورت‌های مالی ── */
.fin-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.fin-row.sub { padding-right: 18px; color: var(--muted); font-size: 12px; }
.fin-row.total { font-weight: 800; border-bottom: 2px solid var(--line2); }

@media print {
  body { overflow: visible; background: #fff; color: #000; }
  .rail, .side, .tabsbar, .statusbar, .toolbar, .filters, .no-print, .crumbs { display: none !important; }
  .app { display: block; } .content { overflow: visible; padding: 0; } .grid-wrap { max-height: none; overflow: visible; }
  table.g thead th { background: #eee; color: #000; } table.g td { border-color: #bbb; } table.g tbody tr td { background: #fff !important; }
}

/* ───────── دکمه‌های آموزش و تنظیمات سربرگ صفحه (مثل نمونه) ───────── */
.pt { width: 30px; height: 30px; padding: 0; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.pt:hover { background: var(--hover, rgba(255,255,255,.05)); color: var(--text); }
.pt.help { color: #e5484d; border-color: rgba(229,72,77,.35); }
.pt.set { color: var(--orange); border-color: rgba(245,138,7,.4); background: rgba(245,138,7,.08); }
.pt.set:hover { background: rgba(245,138,7,.16); color: var(--orange); }
dialog.modal:has(.help-modal) { width: min(880px, 94vw); max-width: 94vw; }
.help-modal { width: 100%; }
.help-body { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 14px; max-height: 70vh; }
.help-nav { display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); padding-left: 10px; overflow: auto; }
.help-nav a { padding: 6px 8px; border-radius: 6px; color: var(--muted); font-size: 12px; }
.help-nav a.on, .help-nav a:hover { background: var(--primary-soft); color: var(--text); }
.help-text { overflow: auto; line-height: 2; }
.help-text ol { margin: 0; padding-right: 18px; }
.help-media { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #000; }
.help-media video, .help-media img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.help-media iframe { display: block; width: 100%; height: 420px; border: 0; background: #fff; }
.pt-grp { margin-right: auto; display: flex; gap: 6px; align-items: center; }

/* ───────── مرور حساب — سربرگ و فیلتر فشرده (مثل نمونه) ───────── */
.rv-head { display: grid; grid-template-columns: 1fr auto 1fr; }
.rv-head .rv-start { display: flex; gap: 6px; align-items: center; }
.rv-head .end { justify-content: flex-end; }
.tb.plain { border-color: transparent; background: transparent; color: var(--link); }
.tb.plain:hover { background: var(--primary-soft); }
.tb.ok { color: var(--ok, #22c55e) !important; }
#rf-toggle.on { border-color: var(--primary); color: var(--link); background: var(--primary-soft); }
.rf { display: flex; gap: 14px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.rf[hidden] { display: none; }
.rf-grid { display: grid; grid-auto-flow: column; grid-template-rows: 30px 30px; grid-auto-columns: 118px; gap: 8px 6px; }
.rf-span { grid-row: 1 / span 2; display: flex; align-items: center; }
.rf-span .pill { width: 118px; }
.rf.less .more { display: none; }
.rf-side { display: flex; gap: 8px; align-items: flex-end; margin-right: auto; padding-bottom: 2px; }
.rf-f { display: flex; flex-direction: column; gap: 4px; }
.rf-f > span { font-size: 11.5px; color: var(--muted); padding-right: 4px; }
.pill { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border: 1px solid var(--line2, var(--line)); border-radius: 7px; background: var(--panel2); color: var(--text); font-size: 12px; min-width: 0; cursor: text; }
.pill:focus-within { border-color: var(--primary); }
.pill input:not([type=checkbox]), .pill select { border: 0 !important; background: transparent !important; padding: 0 !important; height: 28px; min-width: 0; flex: 1; color: inherit; font: inherit; outline: none; box-shadow: none !important; }
.pill input::placeholder { color: var(--muted); }
.pill .ico { color: var(--muted); flex: none; }
.pill.sel { cursor: pointer; }
.pill.sel > span { color: var(--text); font-weight: 600; white-space: nowrap; }
.pill.sel select { text-align: left; direction: rtl; font-weight: 700; flex: 1 1 0; width: 0; min-width: 0; cursor: pointer; }
.pill.chk { cursor: pointer; user-select: none; }
.pill.chk input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.pill.chk > span { flex: 1; white-space: nowrap; font-weight: 600; }
.pill.chk > b { color: var(--link); font-weight: 700; }
.pill.chk.on { border-color: var(--primary); background: var(--primary-soft); }
.pill.chk.on > span { color: var(--muted); }
.pill.dashed { border-style: dashed; justify-content: center; color: var(--link); cursor: pointer; font-family: inherit; }
.pill.run { cursor: pointer; justify-content: center; min-width: 104px; color: var(--link); font-family: inherit; }
.pill.run:hover { border-color: var(--primary); background: var(--primary-soft); }
.rf-side .pill.sel { min-width: 104px; }
.lvl-tabs { display: flex; gap: 6px; }
.lvl-tabs a { min-width: 70px; height: 32px; padding: 0 12px; display: grid; place-items: center; border: 1px solid var(--line2, var(--line)); border-radius: 8px 8px 0 0; border-bottom-width: 2px; color: var(--text); font-weight: 600; background: var(--panel2); }
.lvl-tabs a:hover { border-color: var(--primary); }
.lvl-tabs a.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.rv-bar { align-items: flex-end; padding-bottom: 0; }
.rv-bar .psz { margin-bottom: 6px; }
.rv-bar .tb { margin-bottom: 6px; }
.pill.psz select { flex: none; width: 64px; }

/* دکمه‌ی حذف فیلترها */
.clear-f { display: inline-grid; place-items: center; width: 40px; height: 28px; border: 1px solid var(--line2, var(--line)); border-radius: 999px; color: #f87171; }
.clear-f:hover { border-color: #f87171; background: rgba(248,113,113,.1); }
/* ───────── تقویم شمسی ───────── */
.jdp { position: fixed; z-index: 1000; width: 252px; background: var(--panel); border: 1px solid var(--line2, var(--line)); border-radius: 10px; box-shadow: var(--shadow); padding: 8px; user-select: none; font-size: 12.5px; }
.jdp-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.jdp-h b { font-weight: 700; cursor: pointer; padding: 3px 8px; border-radius: 6px; }
.jdp-h b:hover, .jdp-h button:hover { background: var(--primary-soft); }
.jdp-h button { width: 28px; height: 28px; border: 0; background: transparent; color: var(--text); border-radius: 6px; cursor: pointer; font-size: 15px; }
.jdp-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.jdp-g span { color: var(--muted); font-size: 11px; padding: 4px 0; }
.jdp-g button { height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; font: inherit; }
.jdp-g button:hover { background: var(--primary-soft); }
.jdp-g button.fri { color: #f87171; }
.jdp-g button.today { box-shadow: inset 0 0 0 1px var(--primary); }
.jdp-g button.on { background: var(--primary); color: #fff; }
.jdp-g.months { grid-template-columns: repeat(3, 1fr); } .jdp-g.months button { height: 38px; }
.jdp-f { display: flex; justify-content: space-between; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
.jdp-f button { border: 0; background: transparent; color: var(--link); cursor: pointer; font: inherit; padding: 4px 8px; border-radius: 6px; }
.jdp-f button:hover { background: var(--primary-soft); }
.pill.date { cursor: pointer; } .pill.date .ico { cursor: pointer; }

/* مرور حساب: ستون کنترل‌های سمت چپ — هم‌اندازه و هم‌تراز (مثل نمونه) */
.rf-side { align-items: flex-end; gap: 10px; }
.rf-side .pill, .rf-side .run { height: 36px; box-sizing: border-box; margin: 0; }
.rf-side .pill.sel { min-width: 118px; }
.rf-side .pill.zero { padding: 0 12px; background: transparent; }
.rf-side .pill.zero > span { font-weight: 500; }
.rf-side .run { min-width: 128px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; font-weight: 700; transition: opacity .15s; }
.rf-side .run.busy { opacity: .45; pointer-events: none; }
.pill.msel { position: relative; cursor: pointer; min-width: 104px; justify-content: space-between; }
.pill.msel > b { font-weight: 700; }
.pill.msel .msel-pop { display: none; position: absolute; top: calc(100% + 4px); right: 0; min-width: 100%; z-index: 30; background: var(--panel); border: 1px solid var(--line2, var(--line)); border-radius: 8px; padding: 6px; box-shadow: var(--shadow); flex-direction: column; gap: 2px; }
.pill.msel.open { border-color: var(--primary); }
.pill.msel.open .msel-pop { display: flex; }
.msel-pop .check { padding: 6px 8px; border-radius: 6px; white-space: nowrap; }
.msel-pop .check:hover { background: var(--primary-soft); }
/* نوار پیشرفت باریک بالای جدول هنگام اجرای گزارش */
#rv-out { position: relative; transition: opacity .15s; }
.rv-progress { position: absolute; top: 0; left: 0; right: 0; height: 3px; overflow: hidden; z-index: 5; pointer-events: none; opacity: 0; }
.rv-progress::before { content: ""; position: absolute; inset: 0 0 0 auto; width: 35%; background: var(--primary); border-radius: 3px; animation: rvbar 1s ease-in-out infinite; }
#rv-out.loading .rv-progress { opacity: 1; }
#rv-out.loading > :not(.rv-progress) { opacity: .55; }
@keyframes rvbar { 0% { transform: translateX(100%); } 100% { transform: translateX(-300%); } }
.pill.msel > .ico { transform: rotate(-90deg); color: var(--text); } .pill.msel.open > .ico { transform: rotate(90deg); }

/* ستون تیک، ردیف‌های انتخاب‌شده و نوار برچسب‌ها (مثل نمونه) */
table.g th.ckc, table.g td.ckc { width: 34px; text-align: center; padding: 0 6px; }
table.g td.ckc input, table.g th.ckc input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
table.g tr.picked td { background: rgba(34,197,94,.10) !important; }
table.g tr.picked td:first-child { box-shadow: inset -3px 0 0 #22c55e; }
.pick-bar { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--panel); }
.pick-bar[hidden] { display: none; }
.pb-clear { flex: none; width: 30px; height: 28px; display: grid; place-items: center; border: 0; background: transparent; color: #f87171; cursor: pointer; border-radius: 6px; }
.pb-clear:hover { background: rgba(248,113,113,.12); }
.pb-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 74px; overflow: auto; }
.pb-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line2, var(--line)); border-radius: 999px; font-size: 12px; white-space: nowrap; }
.pb-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0; line-height: 1; }
.pb-chip button:hover { color: #f87171; }
.pill.sort-reset { height: 34px; padding: 0 14px; cursor: pointer; font: inherit; font-size: 13px; color: var(--text); background: transparent; }
.pill.sort-reset[hidden] { display: none; }
.pill.sort-reset:hover { border-color: var(--primary); }
.rv-bar .sort-reset { margin-bottom: 6px; }
@media print {
  body.print-picked table.g tbody tr:not(.picked) { display: none !important; }
  table.g th.ckc, table.g td.ckc, .pick-bar { display: none !important; }
  table.g tr.picked td { background: none !important; box-shadow: none !important; }
}

.tb:disabled, .tb[disabled] { opacity: .35; cursor: default; pointer-events: none; }
.tb.danger:not(:disabled) { color: #f87171; }
.ib.del { color: #f87171; }
.ib.del.off { opacity: .3; cursor: not-allowed; }

/* اسناد: پنجره‌ی فیلتر (مثل نمونه) */
.dfilters { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); background: var(--panel); }
.dfilters.hidden { display: none; }
.df-grid { display: grid; grid-template-columns: repeat(6, minmax(140px, 170px)); gap: 6px 10px; }
.df label { display: block; font-size: 12px; color: var(--muted); margin: 0 4px 4px 0; }
.df-in { height: 34px; width: 100%; box-sizing: border-box; border: 1px solid var(--line2, var(--line)); border-radius: 8px; background: var(--panel2); color: var(--text); font: inherit; padding: 0 10px; }
.df-in:focus-within, select.df-in:focus { border-color: var(--primary); outline: none; }
.df-in.date { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.df-in.date input { border: 0 !important; background: transparent !important; padding: 0 !important; height: 32px; flex: 1; min-width: 0; color: inherit; box-shadow: none !important; outline: none; }
.df-in.date .ico { color: var(--muted); flex: none; }
.df-act { display: flex; gap: 14px; margin-top: 8px; }
.df-act .lnk { border: 0; background: none; padding: 0; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.df-act .lnk:hover { color: var(--link); }
/* ستون زیر سیستم */
td.sub { text-align: center; }
.sub-b { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 7px; border: 1px solid rgba(248,113,113,.55); background: rgba(248,113,113,.08); color: #fca5a5 !important; font-size: 12px; }
.sub-b b { font-weight: 700; }
.sub-b:hover { background: rgba(248,113,113,.18); }
.sub-b.sales, .sub-b.invoice, .sub-b.proforma, .sub-b.return { border-color: rgba(96,165,250,.55); background: rgba(96,165,250,.08); color: #93c5fd !important; }
.sub-b.off { opacity: .55; cursor: default; }
.tb.blue:not(:disabled) { color: #60a5fa; }

.tb-count { white-space: nowrap; font-size: 13px; color: var(--text); padding: 0 6px; margin-right: 4px; }
.tb-count [data-gcount] { font-weight: 700; }

/* ═════════ طرح‌ها (skin) × حالت (روشن/تیره) × جوهر × گوشه‌ها — مثل نمونه ═════════ */
html[data-skin="aftab"][data-theme="dark"] {
  --page:#070b11; --surface:#0e141d; --frame:#0f1620; --frame-ink:#cfe0f7; --frame-active:#22303f;
  --ink-src:#f4f8fd; --muted-src:#93a3b8; --line-src:#35455a; --far:#ffffff;
  --bg:#070b11; --rail:#0f1620; --side:#0a1017; --panel:#0e141d; --panel2:#141c26; --panel3:#19222e;
  --text:var(--ink-src); --muted:var(--muted-src); --line:var(--line-src); --line2:color-mix(in srgb, var(--line-src) 80%, var(--far));
  --muted2:color-mix(in srgb, var(--muted-src) 60%, var(--surface));
  --primary:#7bb6ff; --primary-2:#5d9bf0; --on-brand:#04101f; --primary-soft:#1f2b3a;
  --link:color-mix(in srgb, #7bb6ff 75%, #ffffff);
  --head:#7bb6ff; --head-text:#04101f;
  --row-alt:color-mix(in srgb, #7bb6ff 6%, #0e141d); --row-hover:#1f2b3a; --sel:color-mix(in srgb, #7bb6ff 30%, #0e141d);
  --danger:#b81f38; --ok:#14803f; --warn:#b35c00;
  --rail-ink:#cfe0f7; --rail-hover:#22303f;
}
html[data-skin="aftab"][data-theme="light"] {
  --page:#ffffff; --surface:#ffffff; --frame:#dbe6f5; --frame-ink:#0a2d63; --frame-active:#b0c8e6;
  --ink-src:#05080d; --muted-src:#3c4a5a; --line-src:#93a9c4; --far:#000000;
  --bg:color-mix(in srgb, #f2f6fc 55%, #ffffff); --rail:#dbe6f5; --side:#f2f6fc; --panel:#ffffff; --panel2:#eef2f7; --panel3:#e8eef6;
  --text:var(--ink-src); --muted:var(--muted-src); --line:var(--line-src); --line2:color-mix(in srgb, var(--line-src) 80%, var(--far));
  --muted2:color-mix(in srgb, var(--muted-src) 60%, var(--surface));
  --primary:#0d4fa3; --primary-2:#093c7e; --on-brand:#ffffff; --primary-soft:#dbe7f7;
  --link:#0d4fa3;
  --head:#0d4fa3; --head-text:#ffffff;
  --row-alt:color-mix(in srgb, #0d4fa3 5%, #ffffff); --row-hover:#dbe7f7; --sel:color-mix(in srgb, #0d4fa3 30%, #ffffff);
  --danger:#b81f38; --ok:#14803f; --warn:#b35c00;
  --rail-ink:#0a2d63; --rail-hover:#b0c8e6;
}
html[data-skin="arghavan"][data-theme="dark"] {
  --page:#0f0d1c; --surface:#171429; --frame:#1a1630; --frame-ink:#c3b4ff; --frame-active:#2e2755;
  --ink-src:#ece9fb; --muted-src:#948db5; --line-src:#322c52; --far:#ffffff;
  --bg:#0f0d1c; --rail:#1a1630; --side:#131024; --panel:#171429; --panel2:#1d1932; --panel3:#221d3a;
  --text:var(--ink-src); --muted:var(--muted-src); --line:var(--line-src); --line2:color-mix(in srgb, var(--line-src) 80%, var(--far));
  --muted2:color-mix(in srgb, var(--muted-src) 60%, var(--surface));
  --primary:#9b86f5; --primary-2:#7e66e8; --on-brand:#120c2a; --primary-soft:#2a2445;
  --link:color-mix(in srgb, #9b86f5 75%, #ffffff);
  --head:#9b86f5; --head-text:#120c2a;
  --row-alt:color-mix(in srgb, #9b86f5 6%, #171429); --row-hover:#2a2445; --sel:color-mix(in srgb, #9b86f5 30%, #171429);
  --danger:#e0435a; --ok:#45c65a; --warn:#f0872b;
  --rail-ink:#c3b4ff; --rail-hover:#2e2755;
}
html[data-skin="arghavan"][data-theme="light"] {
  --page:#ffffff; --surface:#ffffff; --frame:#e2ddfa; --frame-ink:#43318f; --frame-active:#c3b9f1;
  --ink-src:#14102a; --muted-src:#5d5679; --line-src:#cec6e8; --far:#000000;
  --bg:color-mix(in srgb, #f5f3fe 55%, #ffffff); --rail:#e2ddfa; --side:#f5f3fe; --panel:#ffffff; --panel2:#f1f4f8; --panel3:#f5f8fb;
  --text:var(--ink-src); --muted:var(--muted-src); --line:var(--line-src); --line2:color-mix(in srgb, var(--line-src) 80%, var(--far));
  --muted2:color-mix(in srgb, var(--muted-src) 60%, var(--surface));
  --primary:#6247c9; --primary-2:#4d36a8; --on-brand:#ffffff; --primary-soft:#eae5fc;
  --link:#6247c9;
  --head:#6247c9; --head-text:#ffffff;
  --row-alt:color-mix(in srgb, #6247c9 5%, #ffffff); --row-hover:#eae5fc; --sel:color-mix(in srgb, #6247c9 30%, #ffffff);
  --danger:#e0435a; --ok:#45c65a; --warn:#f0872b;
  --rail-ink:#43318f; --rail-hover:#c3b9f1;
}
html:not([data-skin]), html[data-skin="iran"][data-theme="dark"] {
  --page:#0b1220; --surface:#131d31; --frame:#0d1526; --frame-ink:#aab6cc; --frame-active:#1a2742;
  --ink-src:#e5eaf3; --muted-src:#8e9bb6; --line-src:#24324d; --far:#ffffff;
  --bg:#0b1220; --rail:#0d1526; --side:#111a2c; --panel:#131d31; --panel2:#172238; --panel3:#1b2740;
  --text:var(--ink-src); --muted:var(--muted-src); --line:var(--line-src); --line2:color-mix(in srgb, var(--line-src) 80%, var(--far));
  --muted2:color-mix(in srgb, var(--muted-src) 60%, var(--surface));
  --primary:#4aa3ee; --primary-2:#2b87e3; --on-brand:#ffffff; --primary-soft:#1c2a46;
  --link:color-mix(in srgb, #4aa3ee 75%, #ffffff);
  --head:#4aa3ee; --head-text:#ffffff;
  --row-alt:color-mix(in srgb, #4aa3ee 6%, #131d31); --row-hover:#1c2a46; --sel:color-mix(in srgb, #4aa3ee 30%, #131d31);
  --danger:#ef4444; --ok:#22c55e; --warn:#f59e0b;
  --rail-ink:#aab6cc; --rail-hover:#1a2742;
}
html[data-skin="iran"][data-theme="light"] {
  --page:#ffffff; --surface:#ffffff; --frame:#d9e8ff; --frame-ink:#124497; --frame-active:#b3d0ff;
  --ink-src:#0f1a26; --muted-src:#5c6b7c; --line-src:#d3dce7; --far:#000000;
  --bg:color-mix(in srgb, #f3f7fe 55%, #ffffff); --rail:#d9e8ff; --side:#f3f7fe; --panel:#ffffff; --panel2:#f1f4f8; --panel3:#f5f8fb;
  --text:var(--ink-src); --muted:var(--muted-src); --line:var(--line-src); --line2:color-mix(in srgb, var(--line-src) 80%, var(--far));
  --muted2:color-mix(in srgb, var(--muted-src) 60%, var(--surface));
  --primary:#2b87e3; --primary-2:#1f70ca; --on-brand:#ffffff; --primary-soft:#e7f0fd;
  --link:#2b87e3;
  --head:#2b87e3; --head-text:#ffffff;
  --row-alt:color-mix(in srgb, #2b87e3 5%, #ffffff); --row-hover:#e7f0fd; --sel:color-mix(in srgb, #2b87e3 30%, #ffffff);
  --danger:#e0435a; --ok:#45c65a; --warn:#f0872b;
  --rail-ink:#124497; --rail-hover:#b3d0ff;
}
html[data-skin="khak"][data-theme="dark"] {
  --page:#14110c; --surface:#1b1710; --frame:#201b14; --frame-ink:#e2c79a; --frame-active:#392f22;
  --ink-src:#f4ece0; --muted-src:#a3937c; --line-src:#3b3327; --far:#ffffff;
  --bg:#14110c; --rail:#201b14; --side:#17130d; --panel:#1b1710; --panel2:#221d15; --panel3:#272118;
  --text:var(--ink-src); --muted:var(--muted-src); --line:var(--line-src); --line2:color-mix(in srgb, var(--line-src) 80%, var(--far));
  --muted2:color-mix(in srgb, var(--muted-src) 60%, var(--surface));
  --primary:#d0a15e; --primary-2:#b3874a; --on-brand:#1d1509; --primary-soft:#2f281d;
  --link:color-mix(in srgb, #d0a15e 75%, #ffffff);
  --head:#d0a15e; --head-text:#1d1509;
  --row-alt:color-mix(in srgb, #d0a15e 6%, #1b1710); --row-hover:#2f281d; --sel:color-mix(in srgb, #d0a15e 30%, #1b1710);
  --danger:#e0435a; --ok:#45c65a; --warn:#f0872b;
  --rail-ink:#e2c79a; --rail-hover:#392f22;
}
html[data-skin="khak"][data-theme="light"] {
  --page:#fbf8f3; --surface:#fffdfa; --frame:#ece3d5; --frame-ink:#6b4a24; --frame-active:#d6c7ae;
  --ink-src:#211a11; --muted-src:#6b5b48; --line-src:#d3c6b1; --far:#000000;
  --bg:color-mix(in srgb, #f7f2e9 55%, #ffffff); --rail:#ece3d5; --side:#f7f2e9; --panel:#fffdfa; --panel2:#f4efe6; --panel3:#f7f2ea;
  --text:var(--ink-src); --muted:var(--muted-src); --line:var(--line-src); --line2:color-mix(in srgb, var(--line-src) 80%, var(--far));
  --muted2:color-mix(in srgb, var(--muted-src) 60%, var(--surface));
  --primary:#9a6b2f; --primary-2:#7d5624; --on-brand:#fffaf3; --primary-soft:#eee5d6;
  --link:#9a6b2f;
  --head:#9a6b2f; --head-text:#fffaf3;
  --row-alt:color-mix(in srgb, #9a6b2f 5%, #fffdfa); --row-hover:#eee5d6; --sel:color-mix(in srgb, #9a6b2f 30%, #fffdfa);
  --danger:#e0435a; --ok:#45c65a; --warn:#f0872b;
  --rail-ink:#6b4a24; --rail-hover:#d6c7ae;
}
html[data-skin="mohr"][data-theme="dark"] {
  --page:#0c1614; --surface:#111d1a; --frame:#10201d; --frame-ink:#7fd8c4; --frame-active:#1e3f38;
  --ink-src:#e8f5f1; --muted-src:#8fada6; --line-src:#2b423b; --far:#ffffff;
  --bg:#0c1614; --rail:#10201d; --side:#0f1c19; --panel:#111d1a; --panel2:#16251f; --panel3:#1a2b25;
  --text:var(--ink-src); --muted:var(--muted-src); --line:var(--line-src); --line2:color-mix(in srgb, var(--line-src) 80%, var(--far));
  --muted2:color-mix(in srgb, var(--muted-src) 60%, var(--surface));
  --primary:#2fb99b; --primary-2:#23997f; --on-brand:#05201a; --primary-soft:#1f342c;
  --link:color-mix(in srgb, #2fb99b 75%, #ffffff);
  --head:#2fb99b; --head-text:#05201a;
  --row-alt:color-mix(in srgb, #2fb99b 6%, #111d1a); --row-hover:#1f342c; --sel:color-mix(in srgb, #2fb99b 30%, #111d1a);
  --danger:#e0435a; --ok:#45c65a; --warn:#f0872b;
  --rail-ink:#7fd8c4; --rail-hover:#1e3f38;
}
html[data-skin="mohr"][data-theme="light"] {
  --page:#ffffff; --surface:#ffffff; --frame:#cfe9e2; --frame-ink:#0b5c4e; --frame-active:#9fd2c5;
  --ink-src:#08131a; --muted-src:#46586a; --line-src:#a9c4bd; --far:#000000;
  --bg:color-mix(in srgb, #f0f8f6 55%, #ffffff); --rail:#cfe9e2; --side:#f0f8f6; --panel:#ffffff; --panel2:#f1f4f8; --panel3:#f5f8fb;
  --text:var(--ink-src); --muted:var(--muted-src); --line:var(--line-src); --line2:color-mix(in srgb, var(--line-src) 80%, var(--far));
  --muted2:color-mix(in srgb, var(--muted-src) 60%, var(--surface));
  --primary:#0f7f6c; --primary-2:#0a6355; --on-brand:#ffffff; --primary-soft:#ddf1ec;
  --link:#0f7f6c;
  --head:#0f7f6c; --head-text:#ffffff;
  --row-alt:color-mix(in srgb, #0f7f6c 5%, #ffffff); --row-hover:#ddf1ec; --sel:color-mix(in srgb, #0f7f6c 30%, #ffffff);
  --danger:#e0435a; --ok:#45c65a; --warn:#f0872b;
  --rail-ink:#0b5c4e; --rail-hover:#9fd2c5;
}
html[data-skin="shab"][data-theme="dark"] {
  --page:#0d1420; --surface:#141d2c; --frame:#121b2b; --frame-ink:#9dc0ee; --frame-active:#223349;
  --ink-src:#e6edf6; --muted-src:#8b9bb0; --line-src:#2a3852; --far:#ffffff;
  --bg:#0d1420; --rail:#121b2b; --side:#101825; --panel:#141d2c; --panel2:#1a2434; --panel3:#1f2a3c;
  --text:var(--ink-src); --muted:var(--muted-src); --line:var(--line-src); --line2:color-mix(in srgb, var(--line-src) 80%, var(--far));
  --muted2:color-mix(in srgb, var(--muted-src) 60%, var(--surface));
  --primary:#5b9cf0; --primary-2:#4682d6; --on-brand:#08111f; --primary-soft:#253248;
  --link:color-mix(in srgb, #5b9cf0 75%, #ffffff);
  --head:#5b9cf0; --head-text:#08111f;
  --row-alt:color-mix(in srgb, #5b9cf0 6%, #141d2c); --row-hover:#253248; --sel:color-mix(in srgb, #5b9cf0 30%, #141d2c);
  --danger:#f2687d; --ok:#3fbe70; --warn:#f5a63f;
  --rail-ink:#9dc0ee; --rail-hover:#223349;
}
html[data-skin="shab"][data-theme="light"] {
  --page:#0d1420; --surface:#141d2c; --frame:#121b2b; --frame-ink:#9dc0ee; --frame-active:#223349;
  --ink-src:#e6edf6; --muted-src:#8b9bb0; --line-src:#2a3852; --far:#000000;
  --bg:color-mix(in srgb, #101825 55%, #ffffff); --rail:#121b2b; --side:#101825; --panel:#141d2c; --panel2:#1a2434; --panel3:#1f2a3c;
  --text:var(--ink-src); --muted:var(--muted-src); --line:var(--line-src); --line2:color-mix(in srgb, var(--line-src) 80%, var(--far));
  --muted2:color-mix(in srgb, var(--muted-src) 60%, var(--surface));
  --primary:#5b9cf0; --primary-2:#4682d6; --on-brand:#08111f; --primary-soft:#253248;
  --link:#5b9cf0;
  --head:#5b9cf0; --head-text:#08111f;
  --row-alt:color-mix(in srgb, #5b9cf0 5%, #141d2c); --row-hover:#253248; --sel:color-mix(in srgb, #5b9cf0 30%, #141d2c);
  --danger:#f2687d; --ok:#3fbe70; --warn:#f5a63f;
  --rail-ink:#9dc0ee; --rail-hover:#223349;
}
html[data-skin="bolour"][data-theme="dark"] {
  --page:transparent; --surface:rgba(255,255,255,0.06); --frame:rgba(255,255,255,0.08); --frame-ink:#93c5fd; --frame-active:rgba(37,99,235,0.25);
  --ink-src:rgba(255,255,255,0.95); --muted-src:rgba(203,213,225,0.72); --line-src:rgba(255,255,255,0.16); --far:#ffffff;
  --bg:#06080f; --rail:transparent; --side:transparent; --panel:transparent; --panel2:rgba(255,255,255,0.06); --panel3:rgba(255,255,255,0.12);
  --text:var(--ink-src); --muted:var(--muted-src); --line:var(--line-src); --line2:rgba(255,255,255,0.24);
  --muted2:rgba(148,163,184,0.5);
  --primary:#2563eb; --primary-2:#1d4ed8; --on-brand:#ffffff; --primary-soft:rgba(37,99,235,0.25);
  --link:#60a5fa;
  --head:rgba(37,99,235,0.24); --head-text:#ffffff;
  --row-alt:transparent; --row-hover:rgba(255,255,255,0.07); --sel:rgba(37,99,235,0.35);
  --danger:#f87171; --ok:#34d399; --warn:#fbbf24;
  --rail-ink:#bfdbfe; --rail-hover:rgba(37,99,235,0.2);
  --shadow:0 10px 35px rgba(0,0,0,0.45);
}
html[data-skin="bolour"][data-theme="light"] {
  --page:transparent; --surface:rgba(255,255,255,0.65); --frame:rgba(255,255,255,0.8); --frame-ink:#1e40af; --frame-active:rgba(37,99,235,0.15);
  --ink-src:#0f172a; --muted-src:#475569; --line-src:rgba(203,213,225,0.65); --far:#000000;
  --bg:#eef2f9; --rail:transparent; --side:transparent; --panel:transparent; --panel2:rgba(255,255,255,0.6); --panel3:rgba(255,255,255,0.85);
  --text:var(--ink-src); --muted:var(--muted-src); --line:var(--line-src); --line2:rgba(255,255,255,0.9);
  --muted2:#64748b;
  --primary:#2563eb; --primary-2:#1d4ed8; --on-brand:#ffffff; --primary-soft:rgba(37,99,235,0.12);
  --link:#2563eb;
  --head:rgba(37,99,235,0.14); --head-text:#0f172a;
  --row-alt:transparent; --row-hover:rgba(37,99,235,0.08); --sel:rgba(37,99,235,0.2);
  --danger:#dc2626; --ok:#16a34a; --warn:#d97706;
  --rail-ink:#1e3a8a; --rail-hover:rgba(37,99,235,0.1);
  --shadow:0 10px 35px rgba(15,23,42,0.08);
}
/* جوهر ۱ تا ۱۰ مثل نمونه (۵ = رنگ‌های خودِ طرح): ۱–۴ به سمت زمینه کم‌رنگ، ۶–۱۰ به سمت --far پررنگ؛ لبه‌ها (--line2) هم.
   [data-theme] لازم است: قاعده‌ی طرح‌ها (html[data-skin][data-theme]) هم‌وزن است و بدون آن جوهر هیچ اثری نداشت. */
html[data-theme][data-ink="1"] { --text: color-mix(in srgb, var(--ink-src) 52%, var(--surface)); --muted: color-mix(in srgb, var(--muted-src) 46%, var(--surface)); --line: color-mix(in srgb, var(--line-src) 42%, var(--surface)); --line2: color-mix(in srgb, color-mix(in srgb, var(--line-src) 80%, var(--far)) 38%, var(--surface)); }
html[data-theme][data-ink="2"] { --text: color-mix(in srgb, var(--ink-src) 64%, var(--surface)); --muted: color-mix(in srgb, var(--muted-src) 58%, var(--surface)); --line: color-mix(in srgb, var(--line-src) 55%, var(--surface)); --line2: color-mix(in srgb, color-mix(in srgb, var(--line-src) 80%, var(--far)) 51%, var(--surface)); }
html[data-theme][data-ink="3"] { --text: color-mix(in srgb, var(--ink-src) 76%, var(--surface)); --muted: color-mix(in srgb, var(--muted-src) 71%, var(--surface)); --line: color-mix(in srgb, var(--line-src) 68%, var(--surface)); --line2: color-mix(in srgb, color-mix(in srgb, var(--line-src) 80%, var(--far)) 64%, var(--surface)); }
html[data-theme][data-ink="4"] { --text: color-mix(in srgb, var(--ink-src) 88%, var(--surface)); --muted: color-mix(in srgb, var(--muted-src) 85%, var(--surface)); --line: color-mix(in srgb, var(--line-src) 84%, var(--surface)); --line2: color-mix(in srgb, color-mix(in srgb, var(--line-src) 80%, var(--far)) 82%, var(--surface)); }
html[data-theme][data-ink="6"] { --text: color-mix(in srgb, var(--ink-src) 94%, var(--far)); --muted: color-mix(in srgb, var(--muted-src) 88%, var(--far)); --line: color-mix(in srgb, var(--line-src) 82%, var(--far)); --line2: color-mix(in srgb, color-mix(in srgb, var(--line-src) 80%, var(--far)) 80%, var(--far)); }
html[data-theme][data-ink="7"] { --text: color-mix(in srgb, var(--ink-src) 88%, var(--far)); --muted: color-mix(in srgb, var(--muted-src) 78%, var(--far)); --line: color-mix(in srgb, var(--line-src) 68%, var(--far)); --line2: color-mix(in srgb, color-mix(in srgb, var(--line-src) 80%, var(--far)) 64%, var(--far)); }
html[data-theme][data-ink="8"] { --text: color-mix(in srgb, var(--ink-src) 82%, var(--far)); --muted: color-mix(in srgb, var(--muted-src) 68%, var(--far)); --line: color-mix(in srgb, var(--line-src) 55%, var(--far)); --line2: color-mix(in srgb, color-mix(in srgb, var(--line-src) 80%, var(--far)) 50%, var(--far)); }
html[data-theme][data-ink="9"] { --text: color-mix(in srgb, var(--ink-src) 76%, var(--far)); --muted: color-mix(in srgb, var(--muted-src) 58%, var(--far)); --line: color-mix(in srgb, var(--line-src) 43%, var(--far)); --line2: color-mix(in srgb, color-mix(in srgb, var(--line-src) 80%, var(--far)) 37%, var(--far)); }
html[data-theme][data-ink="10"] { --text: color-mix(in srgb, var(--ink-src) 70%, var(--far)); --muted: color-mix(in srgb, var(--muted-src) 48%, var(--far)); --line: color-mix(in srgb, var(--line-src) 30%, var(--far)); --line2: color-mix(in srgb, color-mix(in srgb, var(--line-src) 80%, var(--far)) 24%, var(--far)); }

/* گوشه‌ها */
html[data-corner="sharp"] { --r: 4px; --r-lg: 6px; }
html:not([data-corner]), html[data-corner="soft"] { --r: var(--ctrl-radius, 6px); --r-lg: 10px; }
html[data-corner="round"] { --r: 8px; --r-lg: 14px; }
.page, .grid-wrap, dialog.modal, .notes-pop, .jdp, .msel-pop, .help-media, .side .ctx { border-radius: var(--r-lg) !important; }
.tb, .ib, .btn, .pill, .df-in, input:not([type=checkbox]):not([type=radio]), select, textarea, .seg, .seg a, .lvl-tabs a, .tabsbar .tab, .sub-badge, .side .q-add, .pagesize, .tsearch, .clear-f, .sub-b, .rail a { border-radius: var(--r) !important; }
.side a.q-add { width: 24px; height: 24px; border-radius: 6px !important; } .side a.q-add svg { width: 14px; height: 14px; stroke-width: 3.2; }
.tabsbar .tab, .lvl-tabs a { border-bottom-left-radius: 0 !important; border-bottom-right-radius: 0 !important; }

/* رنگ‌های وابسته به طرح */
.rail a { color: color-mix(in srgb, var(--rail-ink) 78%, transparent) !important; }
.rail a.active, .rail a:hover { background: var(--rail-hover) !important; color: var(--rail-ink) !important; }
.tabsbar .tab.active, .tb.primary, .btn.primary, .yn label:has(input:checked), .lvl-tabs a.on, .jdp-g button.on { background: var(--primary) !important; border-color: var(--primary) !important; color: var(--on-brand) !important; }
.side .item.active > a.lnk, .tb.plain, .pagesize select, .df-act .lnk:hover, .pill.chk > b, .pill.dashed, .pill.run, .jdp-f button { color: var(--link) !important; }
a { color: var(--link); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent) !important; }

/* ═════════ جدول‌ها — مثل نمونه ═════════ */
.grid-wrap { border: 1px solid color-mix(in srgb, var(--primary) 55%, var(--line)); margin: 8px 10px; }
table.g { font-size: 12px; }
table.g thead tr:first-child th { background: var(--head); color: var(--head-text); font-weight: 700; padding: 2px 6px; height: var(--ctrl-h-sm, 30px); border-left: 1px solid color-mix(in srgb, var(--head-text) 22%, transparent); line-height: var(--ctrl-line-height, 1.4); vertical-align: middle; }
table.g thead tr:first-child th:last-child { border-left: 0; }
table.g thead th .fic { float: none; opacity: .85; font-size: 10px; margin-right: 2px; }
table.g thead th .ffun { float: left; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-top: 1px; opacity: .85; cursor: pointer; border-radius: 3px; }
table.g thead th .ffun:hover { opacity: 1; background: color-mix(in srgb, var(--head-text) 18%, transparent); }
table.g thead th .ffun.on { opacity: 1; color: #fde68a; }
table.g thead tr.frow th { background: var(--panel); top: var(--ctrl-h-sm, 30px); padding: 2px 3px; height: var(--ctrl-h-sm, 30px); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); vertical-align: middle; }
table.g thead tr.frow input, table.g thead tr.frow select { height: calc(var(--ctrl-h-sm, 30px) - 4px); padding: 0 6px; font-size: 11px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--ctrl-radius, 6px); line-height: var(--ctrl-line-height, 1.4); }
table.g td { padding: 2px 6px; height: var(--ctrl-h-sm, 30px); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); font-size: 12px; line-height: var(--ctrl-line-height, 1.4); vertical-align: middle; }
table.g td:last-child { border-left: 0; }
table.g tbody tr:nth-child(odd) td { background: var(--panel); }
table.g tbody tr:nth-child(even) td { background: var(--row-alt); }
table.g tbody tr:hover td { background: var(--row-hover); }
table.g tfoot td { background: var(--head); color: var(--head-text); border-left-color: color-mix(in srgb, var(--head-text) 22%, transparent); }
table.g td.rn { color: var(--muted); }
.ib { width: 22px; height: 22px; background: transparent; }
.ib.edit { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 55%, transparent); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.ib.del { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, transparent); background: color-mix(in srgb, var(--danger) 8%, transparent); }
html.compact table.g td { height: 20px; }

/* ═════════ پنل «طرح و حالت نمایش» ═════════ */
.look-pop { position: fixed; z-index: 70; width: 268px; max-height: calc(100vh - 20px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.look-pop h5 { margin: 0; padding: 10px 12px 6px; font-size: 12px; color: var(--muted); font-weight: 600; border-top: 1px solid var(--line); }
.look-pop h5:first-child { border-top: 0; }
.look-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 12px 10px; border: 1px solid var(--line2); border-radius: var(--r); overflow: hidden; }
.look-seg button { height: 34px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; }
.look-seg button + button { border-right: 1px solid var(--line2); }
.look-seg button.on { background: var(--primary); color: var(--on-brand); font-weight: 700; }
.look-ink { display: flex; align-items: center; gap: 10px; padding: 0 12px 12px; font-size: 12.5px; }
.look-ink input[type=range] { flex: 1; min-width: 0; height: 18px; cursor: pointer; accent-color: var(--primary); padding: 0; border: 0; background: none; box-shadow: none !important; }
.look-ink b { width: 18px; text-align: center; }
.look-skins { overflow-y: auto; padding: 0 8px 8px; }
.look-skin { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; background: transparent; border-radius: var(--r); cursor: pointer; text-align: right; font: inherit; color: var(--text); }
.look-skin:hover { background: var(--panel2); }
.look-skin.on { background: var(--primary-soft); }
.look-skin i { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.look-skin span { flex: 1; display: flex; flex-direction: column; } .look-skin span b { font-size: 13px; } .look-skin span small { color: var(--muted); font-size: 11.5px; }
.look-skin .ck { color: var(--primary); font-weight: 700; visibility: hidden; } .look-skin.on .ck { visibility: visible; }


/* ═════════ نوار پایین (مثل نمونه) ═════════ */
.statusbar { height: 26px; gap: 0; padding: 0 14px; }
.statusbar .st-grp { display: flex; gap: 22px; direction: rtl; }
.statusbar .st { align-items: center; gap: 5px; color: var(--link); }
.statusbar .st i { font-style: normal; font-size: 12px; }
.statusbar .st b { color: var(--text); font-weight: 600; }
.side .ctx { margin: 8px; padding: 7px 12px; border: 1px solid var(--line); background: var(--panel2); align-items: center; }
.side .ctx select { font-weight: 600; cursor: pointer; }
.side .ctx select + select { text-align: left; direction: rtl; color: var(--muted); }
/* آواتار در ستون ماژول‌ها */
.rail .rail-prof .rail-av, .rail .rail-prof .rail-av-i { width: 26px; height: 26px; border-radius: 50% !important; display: grid; place-items: center; object-fit: cover; }
.rail .rail-prof .rail-av-i { background: var(--primary); color: var(--on-brand); }

/* ═════════ پنجره‌ی «اطلاعات کاربر» ═════════ */

.prof-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; position: sticky; top: 0; background: var(--panel); z-index: 2; }
.prof-h h3 { margin: 0; font-size: 15px; color: var(--link); }
.prof-hc { display: flex; align-items: center; gap: 8px; }
.prof-sel { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 999px !important; background: var(--panel2); font-weight: 700; font-size: 12.5px; }
.prof-sel select { border: 0 !important; background: transparent !important; padding: 0 !important; width: auto; font-weight: 700; color: var(--text); opacity: 1; box-shadow: none !important; }
.prof-sel .flag { width: 18px; height: 12px; border-radius: 2px; background: linear-gradient(#239f40 0 33%, #fff 33% 66%, #da0000 66%); }
.prof-auto { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--primary-soft); color: var(--link); font-weight: 700; font-size: 12.5px; cursor: pointer; }
.prof-auto input, .prof-sw input { display: none; }
.prof-auto i, .prof-sw i { width: 30px; height: 17px; border-radius: 999px; background: var(--line2); position: relative; transition: .15s; flex: none; }
.prof-auto i::after, .prof-sw i::after { content: ""; position: absolute; top: 2px; right: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: .15s; }
.prof-auto input:checked + i, .prof-sw input:checked + i { background: var(--primary); }
.prof-auto input:checked + i::after, .prof-sw input:checked + i::after { right: 15px; }
.prof-out { display: flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px; border: 0; border-radius: 999px !important; background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); font: inherit; font-weight: 700; font-size: 12.5px; cursor: pointer; }
.prof-x { width: 32px; height: 32px; border: 0; border-radius: 50% !important; background: var(--panel2); color: var(--text); font-size: 18px; cursor: pointer; }
.prof-b { max-height: calc(90vh - 60px); overflow-y: auto; }
.prof-me { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 16px 16px; border-bottom: 1px solid var(--line); }
.prof-av { position: relative; width: 96px; height: 96px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, #fff)); color: #fff; display: grid; place-items: center; }
.prof-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.prof-av-ed { position: absolute; bottom: 2px; left: 2px; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-2); color: #fff; display: grid; place-items: center; cursor: pointer; border: 2px solid var(--panel); }
.prof-name { display: flex; align-items: center; gap: 6px; } .prof-name b { font-size: 16px; color: var(--link); }
.prof-name button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; }
.prof-role { padding: 3px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--link); font-size: 12px; font-weight: 700; }
.prof-on { font-size: 12px; color: var(--muted); } .prof-on.off { color: var(--danger); }
.prof-sec { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.prof-sec h4, .prof-two h4 { margin: 0 0 10px; font-size: 12.5px; }
.prof-quick { display: flex; flex-wrap: wrap; gap: 6px; min-height: 18px; }
.prof-chip { display: inline-block; padding: 2px 10px; border-radius: 6px; background: var(--primary-soft); color: var(--link); font-size: 12px; font-style: normal; font-weight: 600; margin-left: 4px; }
.prof-info { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.prof-info .pi { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); min-height: 22px; }
.prof-info .pi:nth-child(odd) { border-left: 1px solid var(--line); }
.prof-info .pi:nth-last-child(-n+2) { border-bottom: 0; }
.prof-info .pi span { width: 110px; color: var(--muted); font-size: 12.5px; flex: none; }
.prof-info .pi b { flex: 1; font-weight: 600; }
.prof-info .pi button { border: 0; background: none; color: var(--muted); cursor: pointer; } .prof-info .pi button.done { color: var(--ok); }
.prof-use { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.prof-use div { background: var(--panel2); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.prof-use span { font-size: 12px; color: var(--muted); } .prof-use b { font-size: 13px; }
.prof-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.prof-two .phint { color: var(--muted); font-size: 12px; margin: 6px 0; }
.prof-two .msg { font-size: 12px; margin: 4px 0 0; } .prof-two .msg.ok { color: var(--ok); } .prof-two .msg.err { color: var(--danger); }
.prof-user { display: flex; align-items: center; gap: 8px; background: var(--panel2); border-radius: var(--r); padding: 0 12px; height: 46px; }
.prof-user span { color: var(--muted); } .prof-user input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; font-weight: 700; color: var(--link); text-align: right; }
.prof-pass { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.prof-pass input { height: 44px; background: var(--panel2); border-color: transparent; }
.prof-pass .btn:disabled { opacity: .45; }
.prof-sw { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; margin-bottom: 10px; }
.prof-sw span { display: flex; flex-direction: column; } .prof-sw small { color: var(--muted); font-size: 12px; }
.prof-vol { display: flex; align-items: center; gap: 10px; margin: 0 0 12px 0; font-size: 12px; color: var(--muted); }
.prof-vol input { flex: 1; accent-color: var(--primary); padding: 0; border: 0; background: none; box-shadow: none !important; }
.prof-vol.off { opacity: .5; }
.prof-mode { margin: 0; background: var(--primary-soft); padding: 3px; gap: 3px; border: 0; }
.prof-mode button { border: 0 !important; border-radius: calc(var(--r) - 2px); }
.prof-mode button.on { background: var(--panel); color: var(--link); }
.prof-dev { margin: 12px 16px 16px; background: var(--panel2); border-radius: var(--r); }
.prof-dev summary { padding: 12px 14px; cursor: pointer; font-weight: 700; color: var(--link); }
.dev-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); } .dev-row .t { flex: 1; }

/* گوشه‌های گرد جدول‌ها و پنجره‌ها (مثل نمونه) */
.grid-wrap { overflow: auto; }
.grid-wrap table.g thead tr:first-child th:first-child { border-top-right-radius: calc(var(--r-lg) - 1px); }
.grid-wrap table.g thead tr:first-child th:last-child { border-top-left-radius: calc(var(--r-lg) - 1px); }
.page, .df-in, .dfilters, .toolbar .tsearch, .prof-use div, .prof-dev, .prof-user, .prof-pass input, .look-pop, .notes-pop { border-radius: var(--r-lg); }
.alert { border-radius: var(--r) !important; }

/* اسکرول‌بار ضخیم و آبی-بنفش مطابع سایت اصلی */
* { scrollbar-width: thick; scrollbar-color: color-mix(in srgb, var(--primary) 60%, transparent) transparent; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--primary) 55%, transparent); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--primary) 75%, transparent); }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }

/* پنجره‌ی اطلاعات کاربر: بزرگ، ثابت از بالا و پایین، یک اسکرول داخلی */
dialog.modal:has(.prof) { width: min(900px, 94vw); max-width: none; height: calc(100vh - 64px); max-height: none; margin: 38px auto 26px; padding: 0; border-radius: 14px !important; }
dialog.modal:has(.prof) #modal-body { height: 100%; }
.prof { display: flex; flex-direction: column; height: 100%; }
.prof-h { position: static; flex: none; }
.prof-b { flex: 1; min-height: 0; max-height: none; overflow-y: auto; }
.prof-sel .flag.f-en { background: linear-gradient(90deg, #b22234 0 100%); background: repeating-linear-gradient(#b22234 0 1.7px, #fff 1.7px 3.4px); }
.prof-sel .flag.f-ar { background: linear-gradient(#007a3d 0 33%, #fff 33% 66%, #000 66%); }
.prof-sel select { cursor: pointer; }
.copied { color: var(--ok) !important; }
.toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 9999; background: var(--text); color: var(--panel); padding: 8px 16px; border-radius: 999px; font-size: 12.5px; box-shadow: var(--shadow); pointer-events: none; }
/* انگلیسی: چیدمان چپ‌به‌راست */
html[dir="ltr"] body { direction: ltr; }
html[dir="ltr"] table.g td.t { text-align: left; }

.copy-tip { position: fixed; z-index: 10000; padding: 7px 14px; border-radius: 8px; background: var(--panel); color: #16a34a; border: 1px solid var(--line2); box-shadow: var(--shadow); font-size: 12.5px; font-weight: 600; pointer-events: none; white-space: nowrap; opacity: 0; transform: translateY(4px) scale(.96); transition: opacity .2s, transform .2s; }
.copy-tip.on { opacity: 1; transform: none; }
.copy-tip.err { color: var(--danger); }

/* نوار تب‌ها بالای منو و محتوا (مثل نمونه) */
.app > .tabsbar { grid-column: 2 / 4; grid-row: 1; min-width: 0; min-height: 0; height: 40px; padding: 0 10px; align-items: flex-end; box-sizing: border-box; }
.app > .side { grid-row: 2; } .app > .main { grid-row: 2; } .app > .statusbar { grid-row: 3; }
.app > .tabsbar > *:not(.tabs) { margin-bottom: 5px; }
.tabsbar .tabs { gap: 3px; padding-top: 6px; }
.tabsbar .tab { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 10px 10px 0 0 !important; border: 1px solid var(--line); border-bottom: 0; background: color-mix(in srgb, var(--panel) 75%, transparent); }
.tabsbar .tab:hover { background: var(--panel); }
.tabsbar .tab.active { box-shadow: 0 -2px 8px color-mix(in srgb, var(--primary) 25%, transparent); }
.side .search { margin-top: 10px; }

/* ── گزارش دفاتر قانونی (مثل نمونه): دو کارت + پنجره */
.bk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 330px)); gap: 14px; padding: 16px; }
.bk-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; min-height: 118px;
  background: var(--panel); border: 1px solid var(--line2); border-radius: calc(var(--r) + 4px); transition: border-color .15s, box-shadow .15s, transform .15s; }
.bk-card:hover { border-color: var(--primary); box-shadow: 0 6px 18px rgba(0,0,0,.12); transform: translateY(-1px); }
.bk-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.bk-t { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bk-t b { color: var(--link); font-size: 14.5px; }
.bk-chip { font-size: 11px; font-weight: 700; color: #15803d; background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.45); padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.bk-card p { margin: 0; color: var(--text); font-size: 12.5px; line-height: 1.9; }
.bk .m-b { display: flex; flex-direction: column; gap: 10px; }
.bk-seg { align-self: flex-start; }
.bk-d { margin: 0; font-size: 12.5px; color: var(--text); }
.bk-d:empty { display: none; }
.bk-box { display: flex; gap: 10px; flex-wrap: wrap; background: var(--panel2); border-radius: calc(var(--r) + 4px); padding: 12px 14px 16px; }
.bk-box > div { width: 150px; } .bk-box label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.bk-warn { border: 1px solid #f0c36d; background: rgba(250,204,21,.08); border-radius: calc(var(--r) + 4px); padding: 10px 14px; color: #a16207; }
.bk-warn b { display: block; margin-bottom: 4px; } .bk-warn p { margin: 0; font-size: 12.5px; line-height: 2; color: var(--text); } .bk-warn a { color: var(--link); }
.bk-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bk-out { display: inline-flex; gap: 8px; } .bk-out[hidden] { display: none; }
.bk-res { margin: 0; font-size: 12.5px; color: var(--muted); } .bk-res b { color: var(--text); }
a.btn.off, .btn[disabled] { opacity: .5; pointer-events: none; }

/* ── فرم‌های ابزار (اصلاحی تجمیعی) و پایان سال — مثل نمونه */
.xcard { border: 1px solid var(--line2); border-radius: calc(var(--r) + 4px); background: var(--panel); padding: 12px 14px 14px; }
.xcard > h4 { margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text); font-weight: 700; }
.xcard > h4 small { display: inline; color: var(--muted); font-weight: 400; font-size: 11.5px; margin: 0 6px 0 0; }
.xcard label, .xcard .xl { display: block; font-size: 12.5px; font-weight: 600; margin: 0 0 2px; color: var(--text); }
.xcard small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.xcard .xl { margin-top: 14px; }
.xgrid { display: grid; gap: 12px; } .xgrid.c6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } .xgrid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .xgrid.c6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .xgrid.c3 { grid-template-columns: 1fr; } }
.xf .page-h { border: 0; padding-bottom: 0; } .xf-lead { margin: 0; font-size: 12.5px; color: var(--text); }
.xf-body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.xseg { display: flex; width: 100%; padding: 4px; } .xseg button { flex: 0 0 auto; min-width: 72px; }
.xcard .xseg + .xf-new { margin-top: 8px; }
.xf-foot { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line2); padding-top: 14px; margin-top: 4px; }
.btn.xbig { font-size: 15px; padding: 8px 18px; }
.xf-msg { font-size: 12px; color: var(--muted); } .xf-msg.ok { color: var(--ok); } .xf-msg.warn { color: var(--warn); } .xf-msg.err { color: var(--danger); }
.ye-head { padding: 14px 16px 6px; }
.ye-head h2 { margin: 0 0 6px; font-size: 16px; } .ye-head > p { margin: 0 0 12px; font-size: 12.5px; color: var(--text); }
.ye-mode { margin-bottom: 12px; } .ye-mode a { padding: 6px 18px; }
.ye-steps { display: flex; flex-wrap: wrap; gap: 8px; }
.ye-steps a { display: inline-flex; align-items: center; gap: 8px; padding: 5px 8px 5px 14px; border: 1px solid var(--line2); border-radius: 999px !important; color: var(--muted); font-size: 12.5px; background: var(--panel); }
.ye-steps a i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line2); font-size: 11.5px; }
.ye-steps a:hover { border-color: var(--primary); color: var(--text); }
.ye-steps a.on { background: var(--primary-2); border-color: var(--primary-2); color: #fff; font-weight: 700; } .ye-steps a.on i { border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.15); }
.ye-steps a.done { border-color: var(--ok); color: var(--text); background: var(--ok-soft); } .ye-steps a.done i { background: var(--ok); border-color: var(--ok); color: #fff; }
.ye-card { margin: 12px 16px 0; padding: 16px 18px; } .ye-card > h4 { font-size: 14px; }
.ye-lead { font-size: 13px; margin: 0 0 8px; } .ye-why { font-size: 12px; color: var(--muted); margin: 0 0 14px; } .ye-why b { color: var(--link); margin-left: 6px; }
.ye-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; max-width: 1040px; }
.ye-box { border: 1px solid var(--line2); border-radius: calc(var(--r) + 4px); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.ye-box small { font-size: 11.5px; color: var(--muted); } .ye-box b { font-size: 17px; color: var(--link); } .ye-box span { font-size: 11.5px; color: var(--muted); }
.ye-box span.warn { color: var(--warn); } .ye-box span.ok { color: var(--ok); }
.ye-no, .ye-done, .ye-note { font-size: 12px; margin: 0 0 10px; } .ye-no b { color: var(--link); } .ye-done { color: var(--ok); } .ye-note { color: var(--text); line-height: 2; } .ye-note b { color: var(--link); }
.ye-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; } .ye-act .ye-no { margin: 0 8px; }
.ye-checks { display: grid; gap: 6px; margin-bottom: 12px; max-width: 640px; }
.ye-checks > div { display: flex; justify-content: space-between; padding: 8px 12px; border: 1px solid var(--line2); border-radius: var(--r); font-size: 12.5px; }
.ye-checks .ok b { color: var(--ok); } .ye-checks .bad { border-color: var(--danger); } .ye-checks .bad b { color: var(--danger); }
.ye-foot { margin: 12px 16px 14px; font-size: 12px; color: var(--muted); }
.ye-head.page-h { display: block; position: relative; border-bottom: 0; background: transparent; padding: 14px 16px 6px; }
.ye-head.page-h > .end { position: absolute; left: 16px; top: 14px; margin: 0; }
.xf .page-h { position: relative; padding-left: 56px; } .xf .page-h > .end { position: absolute; left: 12px; top: 8px; }
.ye-steps { gap: 6px; } .ye-steps a { padding: 4px 6px 4px 11px; font-size: 12px; gap: 6px; } .ye-steps a i { width: 20px; height: 20px; }
/* دفاتر قانونی — فیلدهای تاریخ با آیکن تقویم، بازه‌های دفتر */
.bk-box [hidden], .bk [data-show][hidden] { display: none !important; }
.bk-box label { color: var(--link); }
.bk input[data-jdate] { padding-left: 30px; background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4M7 14h2M11 14h2M15 14h2M7 17h2M11 17h2'/%3E%3C/svg%3E") no-repeat left 9px center; font-weight: 700; }
.bk-ranges { flex-direction: column; flex-wrap: nowrap; }
.bk-rh { display: flex; align-items: center; justify-content: space-between; }
.bk-rh b { font-size: 12.5px; color: var(--text); }
.bk-add { background: #16a34a; border-color: #16a34a; color: #fff; font-weight: 700; }
.bk-rl { display: flex; flex-direction: column; gap: 8px; }
.bk-r { display: flex; align-items: flex-end; gap: 10px; border: 1px solid var(--line2); border-radius: calc(var(--r) + 4px); padding: 10px 12px; background: var(--panel); }
.bk-r > div { width: 150px; } .bk-r label { display: block; font-size: 12px; font-weight: 700; color: var(--link); margin-bottom: 4px; }
.bk-rn { align-self: center; min-width: 14px; font-size: 12px; color: var(--muted); }
.bk-r .ib.del { margin-bottom: 4px; }
.bk-ranges > div { width: auto !important; } .bk-r input[data-jdate] { width: 100%; }

/* ── خزانه (فاز ۴) */
.kind-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.kind-bar a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 1px solid var(--line2); border-radius: 999px !important; font-size: 12.5px; color: var(--muted); background: var(--panel); }
.kind-bar a b { font-size: 11.5px; color: var(--text); font-weight: 700; } .kind-bar a small { font-size: 10.5px; color: var(--muted); }
.kind-bar a:hover { border-color: var(--primary); color: var(--text); }
.kind-bar a.on { background: var(--primary-2); border-color: var(--primary-2); color: #fff; } .kind-bar a.on b, .kind-bar a.on small { color: #fff; }
.kb-sep { width: 1px; height: 20px; background: var(--line2); margin: 0 4px; }
.kb-hint { margin-right: auto; font-size: 11.5px; color: var(--muted); }
.badge.kind-cash, .badge.kind-receipt { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.kind-bank, .badge.kind-transfer { background: rgba(59,130,246,.12); color: #2563eb; border-color: transparent; }
.badge.kind-petty { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.kind-pos, .badge.kind-payment { background: rgba(168,85,247,.12); color: #9333ea; border-color: transparent; }
.cp { cursor: copy; border-bottom: 1px dashed var(--line2); } .cp:hover { color: var(--link); border-color: var(--link); }
.way { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; margin: 1px 2px; background: var(--panel2); border: 1px solid var(--line2); color: var(--text); }
.way-cash { color: #15803d; border-color: rgba(34,197,94,.4); } .way-bank { color: #2563eb; border-color: rgba(59,130,246,.4); } .way-pos { color: #9333ea; border-color: rgba(168,85,247,.4); }
.way-cheque { color: #b45309; border-color: rgba(245,158,11,.5); } .way-discount, .way-other { color: var(--muted); }
.trs-lines td { vertical-align: middle; } .trs-lines select, .trs-lines input { width: 100%; }
.trs-lines .acc-cell .oth[hidden], .trs-lines [hidden] { display: none !important; }
.trs-lines .na { display: block; padding: 4px 2px; }
.trs-lines tr.chq-row td { padding-top: 0; background: var(--panel2); }
.chq-box { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 6px 0; }
.chq-box label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 0; }
.chq-box input { width: 150px !important; }
.lines tr.err td { background: var(--danger-soft) !important; }
.th-h { display: block; font-weight: 400; font-size: 10.5px; opacity: .8; }
.btn.add-line { margin-right: 10px; padding: 2px 10px; font-size: 12px; background: #16a34a; border-color: #16a34a; color: #fff; }
.black-warn { margin-top: 4px; font-size: 11.5px; color: var(--danger); font-weight: 700; }
.ta-kind { margin-bottom: 2px; }
.ta-sec { border: 1px solid var(--line2); border-radius: calc(var(--r) + 2px); padding: 6px 12px 12px; margin: 12px 0 0; } .ta-sec legend { font-size: 12px; font-weight: 700; color: var(--link); padding: 0 6px; }
.ta-sec[hidden] { display: none; }
.cq-ops { white-space: nowrap; }
.cq-act { border: 1px solid var(--line2); background: var(--panel); color: var(--text); font: inherit; font-size: 11px; padding: 2px 8px; border-radius: 999px !important; cursor: pointer; margin: 0 1px; }
.cq-act:hover { border-color: var(--primary); color: var(--link); }
.cq-act.a-bounce, .cq-act.a-cancel { color: var(--danger); } .cq-act.a-clear, .cq-act.a-pay { color: var(--ok); }
.cq-st { display: inline-block; font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line2); white-space: nowrap; }
.st-inhand, .st-issued { color: #2563eb; border-color: rgba(59,130,246,.45); } .st-deposited { color: #b45309; border-color: rgba(245,158,11,.5); }
.st-cleared, .st-paid { color: #15803d; border-color: rgba(34,197,94,.5); background: var(--ok-soft); } .st-bounced { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.st-returned, .st-spent, .st-cancelled { color: var(--muted); }
.kind-bar a.st-bounced:not(.on) b { color: var(--danger); }
.cq-card { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 10px 12px; border: 1px solid var(--line2); border-radius: calc(var(--r) + 4px); background: var(--panel2); font-size: 12.5px; }
.cq-card b { color: var(--link); } .cq-flow { margin-right: auto; }
.cq-tl { list-style: none; margin: 14px 0 0; padding: 0 14px 0 0; border-right: 2px solid var(--line2); }
.cq-tl li { position: relative; padding: 4px 12px 12px 0; font-size: 12.5px; } .cq-tl li::before { content: ''; position: absolute; right: -21px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.cq-tl li .cq-st { margin-left: 6px; }
.rep-group { margin: 14px 16px 0; font-size: 13px; color: var(--muted); }
.rep-bar { gap: 8px; } .rep-t { font-size: 14px; margin: 0 4px; }
.rep-f { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); } .rep-f input { width: 110px; } select.rep-f { max-width: 280px; }
.rep-hint { margin: 8px 12px; font-size: 12px; color: var(--muted); }
.rep-res { margin: 10px 12px; padding: 10px 14px; border: 1px solid var(--primary); border-radius: calc(var(--r) + 4px); background: var(--panel2); font-size: 13px; } .rep-res b { color: var(--link); font-size: 15px; }
.rep-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 12px 10px; } .rep-chips span { font-size: 11.5px; padding: 3px 10px; border: 1px solid var(--line2); border-radius: 999px; }
tr.carry td { background: var(--panel2); font-weight: 700; }
.cq-menu { display: inline-block; position: relative; } .cq-menu > summary { list-style: none; display: inline-block; } .cq-menu > summary::-webkit-details-marker { display: none; }
.cq-menu > div { position: absolute; z-index: 30; top: calc(100% + 4px); right: 0; display: flex; flex-direction: column; gap: 4px; padding: 6px; min-width: 170px;
  background: var(--panel); border: 1px solid var(--line2); border-radius: calc(var(--r) + 4px); box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.cq-menu > div .cq-act { text-align: right; border-radius: var(--r) !important; padding: 5px 10px; font-size: 12px; }
.grid-wrap:has(.cq-menu[open]) { overflow: visible; }
/* تنظیمات حسابداری دریافت و پرداخت — مثل نمونه */
.ts-page .page-h h2 { font-size: 13px; font-weight: 600; }
.ts-page .tb-count b { color: var(--link); }
.ts-lead { margin: 12px 14px 4px; font-size: 12px; color: var(--muted); }
.ts-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 18px 16px; padding: 14px; }
@media (max-width: 1500px) { .ts-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .ts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ts-key label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.ts-key small { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); line-height: 1.8; }
.ts-key small b.saved { color: var(--text); } .ts-key small b.dflt { color: var(--warn); }
.ts-sec { margin: 8px 0 0; padding: 10px 14px; font-size: 12.5px; font-weight: 600; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel2); position: relative; padding-right: 22px; }
.ts-sec::before { content: ''; position: absolute; right: 12px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: #f97316; }
.ts-table { margin: 0; border-radius: 0 !important; } .ts-table table.g { border-radius: 0; }
.ts-doc { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; padding: 16px 14px 6px; }
.ts-doc > div { width: 150px; } .ts-doc > div label, .ts-desc label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.ts-auto { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 150px; padding: 12px; border: 1px solid var(--line2); border-radius: calc(var(--r) + 4px); text-align: center; cursor: pointer; }
.ts-auto input { width: 18px; height: 18px; accent-color: var(--primary); } .ts-auto span { font-size: 11.5px; color: var(--text); line-height: 1.8; } .ts-auto small { font-size: 10px; color: var(--muted); line-height: 1.7; }
.ts-desc { display: flex; gap: 14px; align-items: flex-start; padding: 10px 14px 18px; }
.ts-desc > div:first-child { width: 150px; } .ts-desc-t { flex: 1; max-width: 520px; } .ts-desc-t textarea { width: 100%; resize: vertical; } .ts-desc-t small { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
/* تنظیمات چاپ چک — مثل نمونه */
.cp-page { background: transparent !important; border: 0 !important; box-shadow: none !important; display: flex; flex-direction: column; gap: 14px; }
.cp-page > .toolbar { background: var(--panel); border: 1px solid var(--line); border-radius: calc(var(--r) + 4px); }
.cp-card { background: var(--panel); border: 1px solid var(--line); border-radius: calc(var(--r) + 4px); overflow: hidden; }
.cp-opts { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 10px; padding: 14px 14px 6px; }
@media (max-width: 1500px) { .cp-opts { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.cp-opts label, .cp-desc label { display: block; font-size: 11.5px; font-weight: 600; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-desc { padding: 6px 14px 16px; } .cp-desc input { width: 100%; }
.cp-sec { margin: 0; padding: 12px 14px; font-size: 12.5px; font-weight: 600; position: relative; padding-right: 24px; border-bottom: 1px solid var(--line); }
.cp-sec::before { content: ''; position: absolute; right: 12px; top: 11px; bottom: 11px; width: 3px; border-radius: 3px; background: #f97316; }
.cp-sec small { font-weight: 400; color: var(--muted); font-size: 11px; margin-right: 10px; }
.cp-fields .grid-wrap { margin: 0; border-radius: 0 !important; max-height: none; } .cp-fields td { padding-top: 10px; padding-bottom: 10px; }
.cp-fields input.cp-n { border: 0; background: transparent; text-align: center; width: 100%; box-shadow: none; }
.cp-fields input.cp-n:focus { background: var(--panel2); outline: 1px solid var(--primary); }
.cp-fields input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
.cp-stage { padding: 8px; overflow: auto; }
.cp-sheet { position: relative; border: 1px dashed var(--line2); background: var(--panel); color: var(--text); font-family: inherit; }
.cp-f { position: absolute; white-space: nowrap; overflow: hidden; line-height: 1.2; } .cp-f[hidden] { display: none; }
/* فهرست‌های خزانه — مثل نمونه */
.doc-st { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 1px 10px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); white-space: nowrap; }
.doc-st i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; } .doc-st.registered { background: var(--ok-soft); color: #15803d; }
.doc-st.final { background: rgba(59,130,246,.12); color: #2563eb; } .doc-st.draft, .doc-st.none { background: var(--warn-soft); color: var(--warn); }
select.tb-grp { height: 32px; min-width: 130px; padding: 0 10px; font-size: 12px; }
.col-off { display: none !important; }
.cols-pop { position: fixed; z-index: 90; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; min-width: 200px; max-height: 60vh; overflow: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: calc(var(--r) + 4px); box-shadow: 0 12px 30px rgba(0,0,0,.18); font-size: 12.5px; }
.cols-pop b { margin-bottom: 4px; } .cols-pop label { display: flex; gap: 8px; align-items: center; margin: 0; cursor: pointer; }
table.g tbody tr.grp td { background: var(--panel2); font-size: 12px; padding: 6px 12px; text-align: right; } tr.grp span { color: var(--muted); margin-right: 6px; }
.tb-count b { color: var(--link); }
.empty-st { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 50px 20px 60px; text-align: center; }
.empty-st .ico { color: var(--muted2); opacity: .7; } .empty-st b { font-size: 13px; } .empty-st p { margin: 0; font-size: 12px; color: var(--muted); }
.rep-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 330px)); gap: 12px; padding: 14px; }
@media (max-width: 1300px) { .rep-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rep-cards .bk-card.off { opacity: .6; cursor: not-allowed; } .bk-chip.soon { color: #a16207; border-color: #f0c36d; background: rgba(250,204,21,.1); }
.rep-color { width: 30px !important; height: 26px; padding: 0 2px; border-radius: 6px; cursor: pointer; }
.toolbar select.tb-grp { width: auto !important; flex: 0 0 140px; }
.toolbar .tb[hidden] { display: none !important; }
.rep-bar select.rep-f, .rep-bar .rep-f input { width: auto !important; flex: 0 0 auto; }
/* گزارش‌های خزانه در پنجره — مثل نمونه */
.rpm .rpm-f { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 14px 16px; background: var(--panel2); border-bottom: 1px solid var(--line); }
.rpm .rpm-f > div { width: 128px; } .rpm .rpm-f > div.w2 { width: 230px; } .rpm .rpm-f label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.rpm .rpm-f .btn { height: 38px; padding: 0 16px; } .rpm .rpm-f .btn.primary { font-weight: 700; }
.rpm-b { max-height: calc(100vh - 260px); overflow: auto; }
.rp { padding: 8px 18px 18px; color: var(--text); }
.rp-h { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 10px 0 18px; } .rp-h b { font-size: 14px; } .rp-h span { font-size: 13px; } .rp-h small { color: var(--muted); font-size: 11.5px; }
.rp-t { width: 100%; border-collapse: collapse; font-size: 12px; }
.rp-t th { text-align: right; font-weight: 700; padding: 10px 8px; border-bottom: 1.5px solid var(--text); }
.rp-t td { padding: 9px 8px; vertical-align: top; } .rp-t td.n, .rp-t th:nth-last-child(-n+3) { text-align: left; direction: ltr; } .rp-t td.n { font-variant-numeric: tabular-nums; }
.rp-t tr.rp-g td { padding-top: 16px; } .rp-t tr.rp-sum td { padding-top: 18px; font-weight: 600; }
.rp-box { display: inline-block; min-width: 150px; padding: 8px 12px; border: 1px solid var(--line2); text-align: center; }
.rp-res { margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--primary); border-radius: 10px; font-size: 13px; } .rp-res b { color: var(--link); }
@media print { .rp-t th { border-color: #000; } .rp-box { border-color: #000; } }
/* گزارش تحلیلی خزانه — داشبورد ویجت‌ها مثل نمونه */
.ta-page { background: transparent !important; border: 0 !important; box-shadow: none !important; display: flex; flex-direction: column; gap: 12px; }
.ta-page > .toolbar { background: var(--panel); border: 1px solid var(--line); border-radius: calc(var(--r) + 4px); }
.ta-reset { border-radius: 999px !important; background: rgba(59,130,246,.1); color: var(--link); border-color: transparent; font-weight: 700; font-size: 12px; }
.ta-add-w { position: relative; } .ta-menu { position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; display: flex; flex-direction: column; min-width: 240px; padding: 6px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 12px 28px rgba(0,0,0,.18); }
.ta-menu button { text-align: right; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; } .ta-menu button:hover { background: var(--panel2); }
.ta-card { background: var(--panel); border: 1px solid var(--line2); border-radius: calc(var(--r) + 4px); }
.ta-filters { display: flex; gap: 12px; padding: 14px 16px 18px; align-items: flex-end; } .ta-filters > div { width: 160px; } .ta-filters label, .ta-rep > label { display: block; font-size: 11.5px; font-weight: 600; margin-bottom: 6px; }
.ta-ms { position: relative; } .ta-ms-b { width: 100%; height: 38px; display: flex; justify-content: space-between; align-items: center; padding: 0 12px; border: 1px solid var(--primary); border-radius: var(--r); background: var(--panel); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.ta-ms-p { position: absolute; z-index: 30; top: calc(100% + 4px); right: 0; left: 0; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 8px 20px rgba(0,0,0,.15); } .ta-ms-p label { display: flex; gap: 8px; font-size: 12.5px; margin: 4px 0; cursor: pointer; font-weight: 400; }
.ta-rep-row { display: flex; gap: 8px; align-items: center; } .ta-rep-row select { width: 240px; } .ta-rep-row .btn { font-weight: 700; color: var(--link); } .ta-rep-row .btn.danger-l { color: var(--danger); } .ta-rep-row .btn:disabled { opacity: .45; }
.ta-banner { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-radius: calc(var(--r) + 4px); background: linear-gradient(90deg, #163f86, #0f2b5b); color: #fff; }
.ta-banner > div:first-child { display: flex; flex-direction: column; gap: 6px; } .ta-banner b { font-size: 15px; } .ta-banner span { font-size: 12px; opacity: .9; }
.ta-meta { display: flex; gap: 26px; } .ta-meta div { display: flex; flex-direction: column; gap: 6px; } .ta-meta small { font-size: 10.5px; opacity: .75; } .ta-meta b { font-size: 12.5px; }
.ta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .ta-w.full { grid-column: 1 / -1; } .ta-w { padding: 12px 16px 16px; min-width: 0; }
.ta-wh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; } .ta-wh h4 { margin: 0; font-size: 13px; color: var(--link); } .ta-wh h4 small { color: var(--muted); font-weight: 400; margin-right: 8px; font-size: 11px; }
.ta-wt { display: flex; gap: 4px; opacity: .45; transition: opacity .15s; } .ta-w:hover .ta-wt { opacity: 1; }
.ta-wt button { border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 2px 6px; border-radius: 6px; } .ta-wt button:hover { background: var(--panel2); color: var(--text); } .ta-wt button.x:hover { color: var(--danger); } .ta-wt button:disabled { opacity: .3; cursor: default; }
.ta-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ta-kpi { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--line2); border-radius: 12px; border-right: 4px solid #0f2b5b; } .ta-kpi small { font-size: 11.5px; color: var(--muted); }
.ta-kpi b { font-size: 18px; color: var(--link); direction: ltr; text-align: right; } .ta-kpi span { font-size: 11px; color: var(--muted); }
.ta-unit { margin: 0 0 6px; font-size: 11px; color: var(--muted); } .ta-svg { width: 100%; color: var(--muted); }
.ta-leg { display: flex; gap: 18px; font-size: 12px; } .ta-leg.c { justify-content: center; } .ta-leg i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-left: 6px; vertical-align: middle; }
.ta-pie { display: flex; align-items: center; gap: 30px; } .ta-pie svg { width: 160px; flex: 0 0 160px; } .ta-pls { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.ta-pl { display: grid; grid-template-columns: 1fr 70px 70px; gap: 8px; align-items: center; font-size: 12px; } .ta-pl i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; } .ta-pl b { color: var(--link); text-align: left; } .ta-pl small { color: var(--muted); text-align: left; font-size: 10.5px; }
.ta-hb { display: flex; flex-direction: column; gap: 10px; } .ta-hb > div { display: grid; grid-template-columns: 210px 1fr 70px 70px; gap: 10px; align-items: center; font-size: 12px; }
.ta-hb .bar { height: 10px; background: var(--panel2); border-radius: 999px; overflow: hidden; display: flex; justify-content: flex-end; } .ta-hb .bar i { display: block; height: 100%; background: #0f2b5b; border-radius: 999px; min-width: 6px; }
.ta-hb b { color: var(--link); text-align: left; } .ta-hb small { color: var(--muted); font-size: 10.5px; text-align: left; } .ta-hb .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ta-tbl { width: 100%; border-collapse: collapse; font-size: 12px; } .ta-tbl th { text-align: right; padding: 10px; font-weight: 400; color: var(--muted); border-bottom: 3px solid #3b7dd8; background: var(--panel2); }
.ta-tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); } .ta-tbl td:nth-child(n+3), .ta-tbl th:nth-child(n+3) { text-align: left; direction: ltr; } .ta-tbl tfoot td { font-weight: 700; color: var(--link); border-top: 2px solid var(--line2); background: var(--panel2); }
.ta-empty { text-align: center; color: var(--muted); padding: 30px; font-size: 12.5px; }
@media print { .ta-page > .toolbar, .ta-filters, .ta-rep, .ta-wt, .side, .rail, .tabsbar, .topbar, .statusbar, .crumbs { display: none !important; } .ta-banner { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .ta-w { break-inside: avoid; } }
.ta-menu[hidden], .ta-ms-p[hidden] { display: none !important; }
/* ── فرم‌ها مثل نمونه: گوشه‌ی گردتر و پس‌زمینه‌ی شفاف (بدون رنگ زمینه) */
html:not([data-corner]), html[data-corner="soft"] { --r: 11px; --r-lg: 16px; }
html[data-corner="round"] { --r: 16px; --r-lg: 24px; }
input:not([type=checkbox]):not([type=radio]):not([type=color]), select:not(.pagesize select), textarea, .df-in, .tsearch {
  background-color: transparent !important; border: 1px solid var(--line2) !important; }
input:not([type=checkbox]):not([type=radio]):not([type=color]), select { min-height: 36px; }
input[readonly] { background-color: var(--panel2) !important; }
input:hover:not([readonly]):not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: color-mix(in srgb, var(--primary) 45%, var(--line2)) !important; }
input:focus, select:focus, textarea:focus { border-color: var(--primary) !important; }
select option { background: var(--panel); color: var(--text); }
.btn:not(.primary):not(.add-line):not(.bk-add) { background: transparent; border-color: var(--line2); }
.pill input:not([type=checkbox]), .pill select, .tsearch input, .df-in input, .df-in select, .combo-wrap input { border: 0 !important; min-height: 0; }
.bk input[data-jdate] { background-color: transparent !important; }
.ctx select { border: 0 !important; min-height: 0; background-color: transparent !important; }
/* پنجره‌ی «تنظیم نمودار» */
.tc-ov { position: fixed; inset: 0; z-index: 200; background: rgba(15,23,42,.45); display: grid; place-items: center; padding: 20px; } .tc-ov[hidden] { display: none; }
.tc-box { width: min(1100px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--panel); border-radius: 16px; box-shadow: 0 30px 60px rgba(0,0,0,.3); overflow: hidden; }
.tc-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: var(--panel2); border-bottom: 1px solid var(--line); } .tc-h b { font-size: 14px; } .tc-h .x { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.tc-b { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 16px 18px; overflow: auto; }
.tc-form { display: flex; flex-direction: column; } .tc-l { display: block; font-size: 12px; font-weight: 700; margin: 12px 0 6px; } .tc-form > .tc-l:first-child { margin-top: 0; }
.tc-types { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tc-types button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border: 1px solid var(--line2); border-radius: 12px; background: transparent; color: var(--muted); font: inherit; font-size: 11.5px; cursor: pointer; }
.tc-types button svg { color: var(--text); opacity: .75; } .tc-types button:hover { border-color: var(--primary); }
.tc-types button.on { border: 2px solid var(--primary); color: var(--link); background: color-mix(in srgb, var(--primary) 8%, transparent); } .tc-types button.on svg { color: var(--link); opacity: 1; }
.tc-lim[hidden] { display: none; } .tc-lim input { max-width: 140px; }
.tc-metrics { display: flex; flex-wrap: wrap; gap: 8px; } .tc-metrics label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line2); border-radius: 999px; font-size: 12px; cursor: pointer; margin: 0; }
.tc-metrics label.on { border-color: var(--primary); color: var(--link); background: color-mix(in srgb, var(--primary) 8%, transparent); font-weight: 700; }
.tc-filter { display: flex; gap: 8px; } .tc-filter select[hidden] { display: none; }
.tc-opts { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; font-size: 12px; } .tc-opts label { display: inline-flex; gap: 6px; align-items: center; margin: 0; cursor: pointer; }
.tc-pals { display: flex; flex-wrap: wrap; gap: 8px; } .tc-pals button { display: flex; gap: 0; padding: 4px; border: 1px solid var(--line2); border-radius: 10px; background: transparent; cursor: pointer; }
.tc-pals button i { width: 15px; height: 16px; } .tc-pals button i:first-child { border-radius: 0 5px 5px 0; } .tc-pals button i:last-child { border-radius: 5px 0 0 5px; } .tc-pals button.on { border: 2px solid var(--primary); }
.tc-custom { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; } .tc-custom input { width: 38px !important; height: 30px; padding: 2px; min-height: 0; }
.tc-prev { position: sticky; top: 0; align-self: start; } .tc-pv { padding: 14px; } .tc-pv.half { max-width: 100%; }
.tc-f { display: flex; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); } .tc-f .btn { height: 40px; padding: 0 20px; } .tc-f .btn.primary { font-weight: 700; }
@media (max-width: 900px) { .tc-b { grid-template-columns: 1fr; } }
/* زمینه‌ی خانه‌ها: سفیدِ متمایل به خاکستری */
input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea, .df-in, .tsearch { background-color: color-mix(in srgb, var(--panel) 72%, var(--panel2)) !important; }
input:focus, select:focus, textarea:focus { background-color: var(--panel) !important; }
.pill input:not([type=checkbox]), .pill select, .tsearch input, .df-in input, .df-in select, .ctx select { background-color: transparent !important; }
.tc-f { justify-content: flex-end; }
/* دفتر چک — مثل نمونه */
.cq-page .page-h { gap: 14px; } .cq-page .page-h h2 { font-size: 13px; font-weight: 600; } .cq-page .page-h h2 span { font-weight: 400; margin-right: 4px; }
.cq-dir a { padding: 5px 16px; font-weight: 700; }
select.tb-st { height: 34px; min-width: 150px; width: auto !important; flex: 0 0 auto; font-size: 12px; border: 1.5px solid var(--primary) !important; }
.cq-help { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--link); color: var(--link); font-size: 11px; font-weight: 700; cursor: help; }
.cq-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding: 2px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.cq-chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cq-chip.st-inhand { color: #a16207; background: #fef6dc; border-color: #f5d27a; } .cq-chip.st-issued { color: #1d4ed8; background: #e8f0fe; border-color: #b9cff8; }
.cq-chip.st-deposited { color: #c2410c; background: #fff1e6; border-color: #fbc59c; } .cq-chip.st-cleared, .cq-chip.st-paid { color: #15803d; background: #e8f7ee; border-color: #a7dfbd; }
.cq-chip.st-bounced { color: #b91c1c; background: #fdecec; border-color: #f4b4b4; } .cq-chip.st-returned, .cq-chip.st-spent, .cq-chip.st-cancelled { color: #4b5563; background: #f1f2f4; border-color: #d4d7dd; }
html[data-mode="dark"] .cq-chip { background: transparent; }
.ib.cq-h { color: var(--text); }
.qb { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; } .qb[hidden] { display: none; }
.qb-row, .qb-g { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } .qb-row b, .qb-g b { font-size: 12px; } .qb-row select, .qb-g > select { width: 150px !important; }
.qb-g { border: 1px solid var(--line2); border-radius: calc(var(--r) + 4px); padding: 12px 14px; }
.qb-c { display: inline-flex; gap: 6px; align-items: center; padding: 4px; border: 1px dashed var(--line2); border-radius: var(--r); } .qb-c select { width: 130px !important; } .qb-c input { width: 140px !important; }
.qb-c button { border: 0; background: none; color: var(--danger); cursor: pointer; font-size: 15px; }
.qb-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .qb-act input { width: 160px !important; } .qb-act select { width: 170px !important; }
.qb-g .btn, .qb-act .btn { color: var(--link); font-weight: 600; } .qb-act .btn.primary { color: #fff; }
[data-qb-toggle].on { color: var(--link); border-color: var(--primary); }
.cq-mf { flex-wrap: wrap; } .cq-act-b { font-weight: 700; color: var(--link); } .cq-act-b.a-bounce, .cq-act-b.a-cancel { color: var(--danger); } .cq-act-b.a-clear, .cq-act-b.a-pay { color: var(--ok); }
/* مودال گزارش‌های خزانه — مطابق نمونه */
.rpm .rpm-f > div.sg { width: auto; } .rpm-seg { height: 38px; align-items: center; } .rpm-seg button { padding: 6px 16px; font-size: 12px; }
.rpm .rpm-f input[type=number] { width: 100%; }
.rp-t.own th { text-align: right; } .rp-t.own th.n { text-align: left; } .rp-t td.n.r { text-align: right; }
.rp-t td.rp-empty { text-align: center; color: var(--muted); padding: 22px; }
.rp-t tr.neg td { background: color-mix(in srgb, var(--danger) 9%, transparent); }
.rp-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: -6px 0 18px; }
.rp-chips span { padding: 8px 12px; border: 1px solid var(--line2); border-radius: 9px; font-size: 11.5px; color: var(--muted); }
.rp-chips b { color: var(--text); font-size: 13px; margin-inline-start: 6px; direction: ltr; display: inline-block; font-variant-numeric: tabular-nums; }
.rp-none { text-align: center; color: var(--muted); font-size: 12.5px; margin: 18px 0 6px; }
.ag-pick { margin: 6px 18px 14px; width: calc(100% - 36px); } .ag-pick td.cb, .ag-pick th.cb { width: 34px; }
.ag-again { padding: 0 18px 16px; }
@media print { .rp-chips span { border-color: #000; } .rp-t tr.neg td { background: #fbe9e9 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.rp-chips b.tx { direction: rtl; }
/* مغایرت بانکی — مطابق نمونه */
.rc-f { display: flex; flex-wrap: wrap; gap: 14px; padding: 16px 18px 20px; margin: 12px 0; }
.rc-f .df { width: 150px; } .rc-f .df:first-child { width: 190px; } .rc-f .df label { display: block; font-size: 12px; margin-bottom: 6px; } .rc-f .req { color: var(--danger); font-style: normal; }
.rc-hint { font-size: 12px; color: var(--muted); margin: 4px 2px; }
.rc-msg { margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--primary); border-radius: 10px; font-size: 12.5px; } .rc-msg.err { border-color: var(--danger); color: var(--danger); }
.rc-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 14px; }
.rc-chips span { padding: 9px 14px; border: 1px solid var(--line2); border-radius: 10px; font-size: 12px; color: var(--muted); background: var(--panel); }
.rc-chips b { color: var(--text); margin-inline-start: 8px; direction: ltr; display: inline-block; font-variant-numeric: tabular-nums; }
.rc-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; } @media (max-width: 1100px) { .rc-sides { grid-template-columns: 1fr; } }
.rc-side { overflow: hidden; padding-bottom: 8px; } .rc-side .grid-wrap { max-height: calc(100vh - 360px); overflow: auto; }
.rc-st { display: flex; align-items: center; gap: 14px; padding: 10px 14px; } .rc-st b { font-size: 13px; padding-inline-start: 8px; border-inline-start: 3px solid var(--warn, #f97316); } .rc-st small { color: var(--muted); font-size: 11.5px; }
.rc-g td.t { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .rc-g tr[data-row] { cursor: pointer; }
.rc-g tr.rc-empty td { color: var(--muted); font-size: 12px; padding: 10px 12px; text-align: right; }
.rc-ps { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; } .rc-ps.no { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); } .rc-ps.ok { color: var(--ok, #16a34a); background: color-mix(in srgb, var(--ok, #16a34a) 14%, transparent); }
/* ورودی تاریخ داخل قاب df-in: بدون قاب و پس‌زمینه‌ی دوم */
.df-in.date input:not([type=checkbox]):not([type=radio]):not([type=color]) { border: 0 !important; background: transparent !important; min-height: 0; box-shadow: none !important; }
.tsearch input:not([type=checkbox]) { background: transparent !important; }
/* صورت‌حساب بانکی */
.st-go { display: flex; align-items: flex-end; } .st-go .btn { height: 38px; padding: 0 18px; }
.st-paste { width: 100%; font-size: 12px; direction: ltr; text-align: left; white-space: pre; }
.st-help { font-size: 11.5px; color: var(--muted); margin: 8px 0 10px; line-height: 1.9; }
.g td.empty-row { text-align: center; color: var(--muted); padding: 24px; font-size: 12.5px; }
/* عملیات بانکی چک / تسویه کارتخوان */
.bo-f { align-items: flex-end; } .bo-f .df.w2 { width: 230px; } .bo-f .df.w3 { width: 300px; } .bo-f .df input.df-in { width: 100%; }
.bo-h { flex-basis: 100%; margin: 2px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.8; }
.bo-sub { font-size: 13px; margin: 18px 4px 8px; }
.pos-g td input, .pos-g td select { width: 100%; min-width: 110px; } .pos-g td { vertical-align: middle; }
/* فرم «افزودن حساب خزانه» مطابق نمونه */
.ta2 .ta2-h { background: linear-gradient(90deg, var(--primary-2, #5b3fd0), var(--primary, #6d4fe0)); color: #fff; border-bottom: 0; }
.ta2 .ta2-h h3 { color: #fff; } .ta2 .ta2-h .x { color: #fff; background: rgba(255,255,255,.18); border-radius: 50% !important; width: 30px; height: 30px; }
.ta2 .fgrid > [hidden] { display: none !important; } .ta2 label .hlp { font-weight: 400; color: var(--muted); font-size: 11px; margin-inline-start: 6px; }
.ta2-box { display: flex !important; gap: 8px; align-items: flex-start; border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-weight: 400 !important; }
.ta2-box b { display: block; font-size: 12.5px; margin-bottom: 3px; } .ta2-box small { color: var(--muted); font-size: 11px; line-height: 1.7; } .ta2-box input { margin-top: 3px; }
.ta2-note { grid-column: span 1; font-size: 11px; color: var(--muted); line-height: 1.8; margin: 4px 0 0; }
.ta2 .m-f { justify-content: flex-start; }
/* فیلد جستجو با «تعریف تازه» */
.lk { position: relative; } .lk .lk-in { width: 100%; cursor: pointer; } .lk .lk-in.open { border-color: var(--primary) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent) !important; }
.lk-box { position: fixed; z-index: 1200; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; max-width: 420px; }
.lk-box .lk-q { width: 100%; border: 0 !important; border-bottom: 1px solid var(--line2) !important; border-radius: 0 !important; padding: 12px 14px; background: transparent !important; min-height: 0; }
.lk-box .lk-new { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line2); background: none; color: var(--link); font-weight: 700; font-size: 12.5px; cursor: pointer; text-align: right; }
.lk-box .lk-new i { width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: #fff; font-style: normal; display: inline-grid; place-items: center; font-size: 13px; line-height: 1; }
.lk-box .lk-list { max-height: 260px; overflow: auto; } .lk-box .lk-it { padding: 11px 16px; cursor: pointer; font-size: 12.5px; } .lk-box .lk-it:hover, .lk-box .lk-it.on { background: var(--sel); }
.lk-box .lk-empty { padding: 12px 16px; font-size: 12px; line-height: 1.9; color: var(--text); }
/* مثل نمونه: کد پررنگ کنار نام، مداد ویرایش با hover، دکمه‌ی تازه‌سازی کنار جستجو */
.lk-box { position: fixed; } .lk-box .lk-ref { position: absolute; top: 6px; left: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.lk-box .lk-ref:hover { background: var(--sel); color: var(--text); } .lk-box .lk-ref:disabled { opacity: .4; }
.lk-box .lk-it { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); } .lk-box .lk-code { color: var(--primary); font-weight: 800; min-width: 38px; }
.lk-box .lk-it span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-box .lk-ed { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 6px; opacity: 0; } .lk-box .lk-it:hover .lk-ed { opacity: 1; } .lk-box .lk-ed:hover { background: var(--panel2); color: var(--text); }
/* تسویه کارتخوان */
.ps-f { display: flex; flex-wrap: wrap; gap: 12px; padding: 16px 18px 20px; margin: 12px 0; align-items: flex-end; }
.ps-f .df { width: 160px; } .ps-f .df:nth-child(-n+2) { width: 180px; } .ps-f .df.grow { flex: 1; min-width: 260px; } .ps-f .df label { display: block; font-size: 12px; margin-bottom: 6px; } .ps-f .req { color: var(--danger); font-style: normal; }
.ps-f input.df-in { width: 100%; }
.ps-q { display: inline-grid; place-items: center; width: 15px; height: 15px; border: 1.4px solid currentColor; border-radius: 50%; font-size: 10px; font-weight: 700; cursor: help; margin-inline-start: 4px; color: var(--muted); }
.ps-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1px solid var(--line2); border-radius: 8px; font-size: 12px; color: var(--link); background: var(--panel); }
.ps-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); } .ps-chip i.new { background: var(--primary); }
.ps-items { padding-bottom: 6px; } .ps-g tr[data-row] { cursor: pointer; } .ps-g thead .frow th:first-child { text-align: center; color: var(--muted); }
.ps-hint { font-size: 11.5px; color: var(--text); margin: 8px 12px 4px; }

/* صورت‌حساب بانکی (برگه) */
.st-f { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; } .st-f .df { width: auto !important; min-width: 0; } .st-f .df.grow { grid-column: span 2; } .st-pane[hidden] { display: none; } .st-f .df-in.ro { background: var(--panel2, #ece9fb); color: var(--text); cursor: default; width: 100%; }
.st-att { align-self: flex-end; } .st-chk { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #f0b66b; background: #fff6e8; border-radius: 8px; font-size: 12.5px; cursor: pointer; }
.st-pane { margin: 8px 12px; display: grid; gap: 8px; } .st-pane textarea { width: 100%; border: 1px solid var(--line2); border-radius: 8px; padding: 8px; font-size: 12px; }
.st-pane div { display: flex; gap: 8px; align-items: center; }
.st-g td { padding: 2px 4px; } .st-g td input { width: 100%; border: 1px solid transparent; background: transparent; padding: 6px 6px; font: inherit; border-radius: 6px; } .st-g td input:focus { border-color: var(--primary); background: var(--panel); outline: 0; }
.st-g td.ck { text-align: center; width: 44px; } .st-del { width: 26px; height: 26px; border: 1px solid var(--line2); border-radius: 6px; background: var(--panel); cursor: pointer; color: var(--danger); }
.st-g tr.st-lock td input { color: var(--muted); } .st-g tfoot td { background: var(--primary); color: #fff; font-weight: 600; padding: 8px 10px; } .st-g tr.hidden { display: none; }

/* عملیات بانکی چک (برگه) */
.bo-tabs { display: flex; align-items: stretch; gap: 6px; padding: 10px 12px; margin: 0 0 8px; flex-wrap: wrap; } .bo-tabs b { font-size: 13px; padding: 8px 10px; } .bo-tabs b small { color: var(--muted); margin-inline-start: 4px; }
.bo-tabs a { padding: 8px 16px; border-radius: 8px; font-size: 12.5px; color: var(--text); text-align: center; background: var(--panel2, #ece9fb); } .bo-tabs a.on { background: var(--panel); box-shadow: 0 1px 4px rgba(0,0,0,.12); font-weight: 700; color: var(--link); }
.bo-hd { align-items: flex-end; } .bo-hd .df { width: 170px; }

/* مغایرت بانکی استقراری */
.ro-f .df { width: 190px; } .ro-f .df.grow { flex: 1; min-width: 260px; }
.ro-chips { display: flex; gap: 10px; margin: 0 0 10px; } .ro-chips span { border: 1px solid var(--line2); border-radius: 10px; padding: 8px 14px; font-size: 12.5px; background: var(--panel); } .ro-chips b { margin-inline-start: 8px; color: var(--link); }
.ro-g td { padding: 2px 4px; } .ro-g td input, .ro-g td select { width: 100%; border: 1px solid transparent; background: transparent; padding: 6px 6px; font: inherit; border-radius: 6px; } .ro-g td input:focus, .ro-g td select:focus { border-color: var(--primary); background: var(--panel); outline: 0; }
.ro-g td.ck { text-align: center; width: 44px; } .ro-g tr.hidden { display: none; }

/* ── گزارش مرور دریافت و پرداخت (rv-*) ── */
.rv-chips { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 0; }
.rv-chip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: var(--panel); font-size: 13px; }
.rv-chip b { margin-inline-start: 6px; }
.rv-tabs { display: flex; gap: 4px; background: var(--rail); border: 1px solid var(--line); border-radius: 12px; padding: 4px; width: fit-content; margin-bottom: 10px; }
.rv-tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); font: inherit; }
.rv-tabs button.on { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.rv-tabs.sub { flex-wrap: wrap; }
.rv-pane { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 10px 12px; }
.rv-pane[hidden], .rv-mtm[hidden] { display: none; }
.rv-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.rv-cap { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; color: var(--muted); }
.rv-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 10px; }
.rv-form label, .rv-mt { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.rv-form select, .rv-form input[type=text], .rv-form .jd, .rv-mtb { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--bg, #fff); font: inherit; min-width: 140px; }
.rv-cb { display: flex; align-items: center; gap: 6px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; }
.rv-ck > span:first-child { color: var(--muted); }
.rv-mt { position: relative; }
.rv-mtb { text-align: start; cursor: pointer; }
.rv-mtm { position: absolute; top: 56px; inset-inline-start: 0; z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.18); min-width: 200px; }
.rv-help { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.rv-hint { color: var(--muted); font-size: 12.5px; padding: 8px 2px; margin: 0; }
.rv-hint.err { color: #dc2626; }
.rv-scroll { overflow-x: auto; }
.rv-kpis { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 12px; }
.rv-k { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 150px; background: var(--rail); }
.rv-k.dash { border-style: dashed; background: transparent; }
.rv-k span { font-size: 12px; color: var(--muted); }
.rv-foot td { font-weight: 700; background: var(--primary-2); color: #fff; }
@media print { body.rv-printing .rv-pane:not(.rv-print-me), body.rv-printing .rv-chips, body.rv-printing .rv-tabs, body.rv-printing .rv-form, body.rv-printing .rv-bar { display: none !important; } }

/* ───── حقوق (فاز ۵) ───── */
.pr-ws { width: fit-content; display: flex; align-items: center; gap: 8px; margin: 0 14px 6px; font-size: 12px; color: var(--muted); }
.pr-ws span { white-space: nowrap; }
.pr-ws select { width: auto; flex: none; min-width: 160px; padding: 4px 8px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; }
.pr-ws a { color: var(--muted); display: inline-flex; }
.pr-filter { display: inline-flex; gap: 6px; margin: 0; }
.pr-filter select { padding: 4px 8px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; font-size: 12px; }
.pr-set { padding: 0 4px; }
.pr-rules { max-width: 980px; margin: 10px 0; }
.pr-rule { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 4px; }
.pr-rule label { font-weight: 600; font-size: 12.5px; }
.pr-rule small { color: var(--muted); font-size: 11.5px; }
.pr-in { display: flex; align-items: center; gap: 6px; }
.pr-in input { flex: 1; min-width: 0; text-align: left; }
.pr-in span { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.pr-photo { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.pr-photo label { margin: 0; } .pr-photo img { border-radius: 8px; }
.pr-card { display: flex; gap: 16px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; margin: 10px 0; }
.pr-ph { width: 92px; height: 92px; border-radius: 14px; object-fit: cover; flex: none; }
.pr-ph.ph { display: grid; place-items: center; background: var(--rail); color: var(--muted); }
.pr-info h3 { margin: 0 0 8px; font-size: 15px; } .pr-info h3 small { color: var(--muted); font-weight: 400; margin: 0 6px; }
.pr-kv { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 6px 14px; font-size: 12.5px; }
.pr-kv span { color: var(--muted); }
.pr-cur { margin: 4px 6px 12px; font-size: 13px; }
tr.hl td { background: var(--primary-soft); }
.tb.txt { width: auto; padding: 0 12px; white-space: nowrap; gap: 6px; display: inline-flex; align-items: center; }

/* ── قوانین و تنظیمات حقوق (۸ تب مثل سایت مرجع) */
.pr-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 12px; }
.pr-tabs button { border: 0; background: transparent; padding: 11px 16px; cursor: pointer; color: var(--muted); font: inherit; display: inline-flex; align-items: center; gap: 6px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pr-tabs button.on { color: var(--link); border-bottom-color: var(--link); font-weight: 600; }
.pr-two { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .pr-two { grid-template-columns: 1fr; } }
.pr-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.pr-bh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 14px; }
.pr-rules2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 700px) { .pr-rules2 { grid-template-columns: 1fr; } }
.pr-rules2 .pr-rule { background: var(--rail); }
.pr-in { direction: ltr; }
.pr-in span { min-width: 54px; text-align: center; padding: 6px 8px; background: var(--rail); border: 1px solid var(--line2); border-radius: 8px; color: var(--muted); }
.pr-in input { direction: ltr; }
.pr-fm { display: grid; gap: 3px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.pr-fm span { color: var(--muted); font-size: 12px; } .pr-fm b { font-size: 14px; } .pr-fm em { font-style: normal; color: var(--danger); font-size: 11.5px; }
.pr-note { margin-top: 12px; padding: 11px 13px; border-radius: 10px; background: var(--warn-soft); border-inline-start: 3px solid var(--warn); font-size: 12px; line-height: 1.9; }
.pr-note b { display: block; margin-bottom: 4px; } .pr-note p { margin: 0; color: var(--muted); }
.pr-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 320px); gap: 14px; align-items: center; padding: 12px 14px; background: var(--rail); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.pr-row .pr-lab label { display: block; font-weight: 600; font-size: 13px; } .pr-row .pr-lab small { color: var(--muted); font-size: 11.5px; }
.pr-two2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .pr-two2 .pr-row { grid-template-columns: 1fr; }
@media (max-width: 800px) { .pr-two2 { grid-template-columns: 1fr; } }
.pr-sample { padding: 10px 14px; border-radius: 10px; background: var(--primary-soft); border: 1px solid var(--line); color: var(--link); font-size: 12.5px; margin: 8px 0 14px; }
.pr-chk { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--rail); margin: 8px 0; cursor: pointer; }
.pr-chk input { margin-top: 3px; } .pr-chk b { display: block; font-size: 13px; } .pr-chk small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.pr-banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid var(--line2); border-radius: 12px; background: var(--primary-soft); font-size: 12.5px; margin-bottom: 14px; }
.pr-banner .i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--link); color: #fff; font-size: 12px; flex: none; }
.pr-banner.big .i { width: 38px; height: 38px; border-radius: 10px; }
.s2c { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fgrid > [hidden] { display: none !important; } .fgrid .sall { grid-column: 1 / -1; }
.hlp2 { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.pr-std { display: inline-block; font-size: 10.5px; padding: 0 7px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); margin-inline-start: 6px; }
.pr-basis small { display: block; color: var(--muted); font-size: 11px; }
.pr-sel { padding: 5px 9px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; font-size: 12px; }
.pr-es { display: grid; justify-items: center; gap: 6px; padding: 50px 0; color: var(--muted); } .pr-es b { color: var(--text); }
.pr-foot { padding: 8px 4px; } .pr-foot .pill { display: inline-block; padding: 4px 12px; border: 1px solid var(--line2); border-radius: 999px; font-size: 12px; color: var(--muted); }
.pr-lk { display: flex; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--rail); }
.pr-lk span { color: var(--muted); }
.pr-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 14px; margin: 16px 0 6px; }
@media (max-width: 900px) { .pr-slots { grid-template-columns: 1fr; } }
.pr-slot > label { display: block; font-weight: 700; font-size: 12.5px; margin-bottom: 5px; }
.pr-slot small { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); line-height: 1.8; }
.pr-taf { margin-top: 6px; padding-inline-start: 8px; border-inline-start: 2px solid var(--line2); } .pr-taf label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 3px; }
.toolbar .pr-sel, .pr-sel { width: auto; flex: none; }
.pr-c4 { grid-template-columns: 1fr 2fr 1fr 1fr; }

/* ── دوره‌های کارکرد و حقوق ── */
.pr-chip{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border:1px solid var(--line);border-radius:8px;background:var(--panel2);font-size:12px;color:var(--text);white-space:nowrap}
.pr-months{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.pr-month{display:flex;flex-direction:column;align-items:center;gap:4px;padding:14px 6px;border:1px solid var(--line);border-radius:10px;background:var(--panel2);color:var(--text);cursor:pointer;font:inherit}
.pr-month:hover:not(:disabled){border-color:var(--primary-2);background:var(--panel)}
.pr-month small{color:var(--muted);font-size:11px}.pr-month.has{opacity:.5;cursor:not-allowed}
.pr-in{width:100%;min-width:74px;text-align:center;padding:4px 6px;border:1px solid var(--line);border-radius:6px;background:var(--panel2);color:var(--text);font:inherit}
.pr-in:disabled{background:transparent;border-color:transparent;color:var(--muted)}
.g th small{display:block;font-weight:400;color:var(--muted);font-size:10px}
.pr-gt{display:inline-flex;gap:6px}.pr-gt button{padding:4px 10px;border:1px solid var(--line);border-radius:8px;background:var(--panel2);color:var(--muted);cursor:pointer;font:inherit;font-size:12px}
.pr-gt button.on{background:var(--primary-2);border-color:var(--primary-2);color:#fff}
.pr-sheet .gw:not(.sm),.pr-sheet .ge:not(.sm),.pr-sheet .gd:not(.sm),.pr-sheet .gp:not(.sm){display:none}
.pr-sheet.o-w .gw,.pr-sheet.o-e .ge,.pr-sheet.o-d .gd,.pr-sheet.o-p .gp{display:table-cell}
.pr-sheet{overflow:auto}
.pr-sheet.stuck .stk{position:sticky;background:var(--panel);z-index:2}
.pr-sheet.stuck .s1{right:0;min-width:44px}.pr-sheet.stuck .s2{right:44px;min-width:36px}.pr-sheet.stuck .s3{right:80px;min-width:60px}.pr-sheet.stuck .s4{right:140px;min-width:150px}
/* گزارش‌ها و خروجی حقوق */
.rp-body{padding:16px;overflow:auto}.rp-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;margin-bottom:14px}
.rp-stat{background:#fff;border:1px solid var(--border,#dde);border-radius:8px;padding:10px 14px;display:flex;flex-direction:column;gap:4px}.rp-stat span{color:#667;font-size:12px}.rp-stat b{font-size:17px}
.rp-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px}.rp-card{background:#fff;border:1px solid var(--border,#dde);border-radius:8px;padding:14px;display:flex;flex-direction:column;gap:8px}
.rp-card h4{margin:0}.rp-card p{margin:0;color:#667;font-size:12.5px;flex:1}.rp-card.off{opacity:.55}.rp-card .btn{align-self:flex-start;display:inline-flex;gap:6px;align-items:center}
.rp-an{margin-bottom:14px;text-decoration:none;color:inherit;max-width:520px}.rp-an:hover{border-color:#174f9f}
/* تردد */
.tm-months{display:flex;gap:4px;flex-wrap:wrap;padding:8px 12px}.tm-months a{padding:5px 11px;border:1px solid var(--line2,#dde);border-radius:7px;font-size:12.5px;text-decoration:none;color:inherit}.tm-months a.on{background:var(--primary,#174f9f);color:#fff;border-color:transparent}
.tm-day{display:grid;grid-template-columns:110px 1fr}.tm-chip{display:inline-flex;gap:4px;align-items:center;border:1px solid var(--line2,#dde);border-radius:6px;padding:1px 6px;margin:1px;font-size:12px}.tm-chip form{display:inline}.tm-chip button{border:0;background:none;cursor:pointer;color:#c2394b;padding:0 2px}
.tm-off td{opacity:.6}.tm-abs td:first-child{box-shadow:inset -3px 0 #c2394b}.tm-inc td:first-child{box-shadow:inset -3px 0 #d4a514}
.tm-dl{max-height:56vh;overflow:auto}.tm-add{display:flex;gap:6px;align-items:end;flex-wrap:wrap;margin-bottom:10px}.tm-add>div{display:flex;flex-direction:column;gap:2px}
.tm-wd{display:flex;gap:8px;flex-wrap:wrap}.tm-wd label{display:flex;gap:3px;align-items:center}

/* تسویه‌حساب: محاسبه‌ی زنده */
.st-prev{margin-top:12px;border:1px solid var(--line,#d8dce6);border-radius:10px;padding:10px 12px;background:var(--bg2,#f7f8fb)}.st-ph{display:flex;justify-content:space-between;margin-bottom:8px}.st-ph span{color:#667}
.st-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:6px 18px}.st-grid>div{display:flex;justify-content:space-between;padding:3px 0;border-bottom:1px dashed #ccd}.st-grid .sum{font-weight:700}.st-grid .minus b{color:#b3261e}.st-grid .net{grid-column:1/-1;font-size:1.1em;font-weight:800;border-bottom:0}.st-grid em{font-style:normal;color:#b26a00}

/* ── دکمه‌های ویرایش/حذف ردیف — مثل سایت اصلی؛ آیکن دقیقاً وسط کادر (آیکن ۲۴×۲۴ با خط ۱٫۸) */
.ib.copy, .ib.edit, .ib.del { position: relative; width: 18px; height: 18px; padding: 0; display: inline-block; vertical-align: middle; border-radius: 5px !important; border-width: 1px; line-height: 0; overflow: hidden; transition: background .12s, border-color .12s; }
.ib.copy .ico, .ib.edit .ico, .ib.del .ico { position: absolute; left: 50%; top: 50%; width: 17px; height: 17px; margin: 0; transform: translate(-50%, -50%); stroke-width: 1.8; shape-rendering: geometricPrecision; pointer-events: none; }
.ib.del .ico { transform: translate(-50%, -52%); }
.ib.edit, .ib.copy { color: #6247c9; background: #eef6ff; border-color: #80afe8; }
.ib.del { color: #d9485f; background: #fff0f2; border-color: #f0aab6; }
.ib.edit:hover, .ib.copy:hover { background: #dcebff; border-color: #5f95e0; }
.ib.del:hover { background: #ffe0e5; border-color: #e5788a; }
.ib.copy:focus-visible, .ib.edit:focus-visible, .ib.del:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.ib.del.off, .ib.del:disabled { color: #b9c3cf; background: #f4f6f9; border-color: #dfe6ee; opacity: 1; cursor: not-allowed; }
td.ops { white-space: nowrap; }
td.ops > .ib, td.ops > form { margin-inline: 1px; }

/* ── فرم‌های تعریفی مثل سایت اصلی (کدینگ‌ها، انبار، کسری/اضافات) ── */
.c1 { grid-template-columns: 1fr; }
.check-cards { display: flex; gap: 12px; margin: 16px 0 6px; }
.check-card { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 150px; min-height: 120px; padding: 12px 10px; border: 1px solid var(--line2); border-radius: var(--r); cursor: pointer; text-align: right; font-weight: 400; background: var(--panel); }
.check-card input { width: 16px; height: 16px; }
.check-card span { display: block; width: 100%; } .check-card b { display: block; font-size: 11.5px; color: var(--text); margin-bottom: 3px; } .check-card small { display: block; font-size: 11px; color: var(--muted); line-height: 1.8; }
.check-card.wide { flex-direction: row; align-items: flex-start; width: auto; min-height: 0; }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; margin-top: 14px; }
.slots .slot > label { display: block; font-weight: 700; font-size: 12px; margin-bottom: 5px; }
.slots .slot > small { display: block; margin-top: 4px; font-size: 10.5px; line-height: 1.8; color: var(--muted); }
.fgrid label .sub { font-weight: 400; color: var(--muted); font-size: 10.5px; margin-inline-start: 6px; }
.group-box { margin-top: 14px; border: 1px solid var(--line2); border-radius: var(--r); } .group-box > h4 { margin: 0; padding: 9px 12px; font-size: 12px; border-bottom: 1px solid var(--line2); } .group-box > .gb { padding: 10px 12px; } .group-box .hint { margin: 0 0 8px; font-size: 11px; color: var(--muted); }
@media (max-width: 800px) { .slots { grid-template-columns: 1fr; } .check-cards { flex-wrap: wrap; } }
dialog.modal:has(.tc-form), dialog.modal:has(.wide-form) { width: min(880px, 94vw); max-width: 94vw; }
dialog.modal:has(.k-modal-wrapper), dialog.modal:has(.it-form) {
    position: fixed !important; inset: 0 !important; margin: auto !important;
    width: min(640px, 92vw) !important; max-width: 640px !important; max-height: 92vh !important;
    background: transparent !important; border: none !important; box-shadow: none !important; padding: 0 !important; overflow: visible !important;
}
dialog.modal:has(.k-modal-wrapper)::backdrop, dialog.modal:has(.it-form)::backdrop {
    background: rgba(7, 31, 67, 0.4) !important; backdrop-filter: blur(2px) !important; -webkit-backdrop-filter: blur(2px) !important;
}
dialog.modal:has(.k-modal-wrapper) #modal-body, dialog.modal:has(.it-form) #modal-body {
    padding: 0 !important; margin: 0 !important; background: transparent !important;
}
dialog.modal:has(.upl) { width: min(560px, 94vw); }
.upl-tabs { display: flex; gap: 6px; padding: 8px 14px 0; background: var(--panel2); border-bottom: 1px solid var(--line2); }
.upl-tabs button { border: 1px solid var(--line2); border-bottom: 0; border-radius: 8px 8px 0 0; padding: 6px 14px; background: transparent; font: inherit; font-size: 12px; cursor: pointer; color: var(--muted); }
.upl-tabs button.on { background: var(--primary-2); border-color: var(--primary-2); color: #fff; }
.upl-hint { font-size: 11.5px; line-height: 1.9; color: var(--muted); margin: 0 0 12px; }
.upl-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 14px; border: 1.5px dashed var(--line2); border-radius: 10px; text-align: center; }
.upl-drop.over, .upl-drop.has { border-color: var(--primary-2); background: color-mix(in srgb, var(--primary-2) 6%, transparent); }
.upl-drop small { color: var(--muted); font-size: 11.5px; }
.upl-sum { font-size: 13px; margin-bottom: 10px; } .upl-sum .bad { color: var(--danger); }
.upl .m-f { flex-wrap: wrap; }

/* ───── ظاهر مودال‌های فرم — مثل سایت اصلی (پس‌زمینه، سربرگ گرادیان، اسکرول، کارت‌ها) ───── */
dialog.modal { --mb: color-mix(in srgb, var(--primary-2) 5%, var(--panel)); --mc: color-mix(in srgb, var(--primary-2) 7%, var(--panel)); --mline: color-mix(in srgb, var(--primary-2) 22%, var(--line2));
    border: 0; border-radius: 10px; background: var(--mb); box-shadow: 0 25px 70px rgba(6,31,69,.28); overflow: hidden; }
dialog.modal::backdrop { background: rgba(7,31,67,.38); }
dialog.modal .m-h { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 14px; row-gap: 0; padding: 11px 14px; border-bottom: 0;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary-2) 72%, #0b0630), color-mix(in srgb, var(--primary-2) 88%, #fff)); color: #fff; }
dialog.modal .m-h .kicker { grid-column: 1; grid-row: 1; color: rgba(255,255,255,.85); font-size: 11px; }
dialog.modal .m-h h3 { grid-column: 1; grid-row: 2; color: #fff; font-size: 14.5px; margin: 2px 0 0; font-weight: 600; }
dialog.modal .m-h .x { grid-column: 2; grid-row: 1 / span 2; margin: 0; width: 26px; height: 26px; border-radius: 50% !important; background: rgba(255,255,255,.16); color: #fff; font-size: 18px; line-height: 1; display: grid; place-items: center; }
dialog.modal .m-h .x:hover { background: rgba(255,255,255,.28); }
dialog.modal .m-b { padding: 12px 14px; scrollbar-width: thin; scrollbar-color: var(--primary-2) color-mix(in srgb, var(--primary-2) 12%, var(--panel)); }
dialog.modal .m-b::-webkit-scrollbar { width: 8px; } dialog.modal .m-b::-webkit-scrollbar-track { background: color-mix(in srgb, var(--primary-2) 12%, var(--panel)); } dialog.modal .m-b::-webkit-scrollbar-thumb { background: var(--primary-2); border-radius: 8px; }
dialog.modal form:not(.ta2) .m-f { flex-direction: row-reverse; justify-content: flex-start; background: var(--panel); border-top: 1px solid var(--mline); padding: 9px 14px; }
dialog.modal .m-f .btn { padding: 6px 20px; border-radius: 6px !important; }
dialog.modal .m-f .btn:not(.primary) { background: var(--panel); color: var(--primary-2); border-color: var(--mline); }
dialog.modal .m-b input:not([type=checkbox]):not([type=radio]), dialog.modal .m-b select, dialog.modal .m-b textarea { background: var(--mc); border-color: var(--mline); border-radius: 6px !important; }
dialog.modal .m-b label { font-weight: 600; font-size: 12px; } dialog.modal .m-b label .hlp, dialog.modal .m-b label small { font-weight: 400; font-size: 10.5px; color: var(--muted); }
dialog.modal .fsec { background: var(--mc); border-color: var(--mline); border-radius: 8px; padding: 10px 12px; }
dialog.modal .fsec h4 { color: color-mix(in srgb, var(--primary-2) 70%, #000); font-size: 12.5px; font-weight: 600; margin: 0 0 8px; }
dialog.modal .check:has(small) { background: var(--mc); border: 1px solid var(--mline); border-radius: 6px; padding: 8px 10px; }
dialog.modal .radio-card { background: var(--panel); border-color: var(--mline); padding: 10px 12px; } dialog.modal .radio-card:has(input:checked) { background: color-mix(in srgb, var(--primary-2) 11%, var(--panel)); border-color: var(--primary-2); }
/* نقش شخص */
.role-field { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; } .role-field .rf-l { min-width: 90px; font-size: 12px; font-weight: 700; } .role-field .rf-l small { display: block; font-weight: 400; font-size: 10.5px; color: var(--muted); }
.role-picks { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .role-split { width: 1px; height: 22px; background: var(--mline, var(--line2)); margin: 0 4px; }
.role-pick { display: inline-flex !important; align-items: center; gap: 6px; height: 29px; padding: 0 12px; border: 1px solid var(--mline, var(--line2)); border-radius: 999px !important; font-size: 12px !important; font-weight: 700 !important; cursor: pointer; color: var(--muted); background: var(--panel); user-select: none; }
.role-pick input { width: 14px !important; height: 14px; margin: 0; flex: none; } .role-pick:has(input:checked) { background: color-mix(in srgb, var(--primary-2) 14%, var(--panel)); border-color: var(--primary-2); color: var(--primary-2); }
.sid-box { position: relative; display: block; } .sid-box input { padding-left: 34px !important; }
.sid-box button { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border: 0; background: none; color: var(--muted2); display: grid; place-items: center; cursor: not-allowed; opacity: .7; padding: 0; }

/* دکمه‌ی «+» ردیف — مربع هم‌اندازه‌ی ویرایش/حذف، علامت دقیقاً وسط */
.ib.add { position: relative; width: 18px; height: 18px; padding: 0; display: inline-block; vertical-align: middle; border-radius: 5px !important; line-height: 0; overflow: hidden; background: #22c55e; border: 1px solid #22c55e; color: #fff; font-size: 0; }
.ib.add:hover { background: #16a34a; border-color: #16a34a; }
.ib.add .ico { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: 0; transform: translate(-50%, -50%); stroke-width: 3; pointer-events: none; }
.ib.copy .ico, .ib.edit .ico, .ib.del .ico { width: 14px; height: 14px; }
/* ───── فرم شخص / تفصیل (هم‌شکل سایت اصلی) ───── */
dialog.modal:has(.pf-form) { width: min(880px, 96vw); max-width: 96vw; }
.pf-form [hidden] { display: none !important; }
.pf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; align-items: start; }
.pf-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; font-weight: 600; }
.pf-f > span:first-child { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; line-height: 1.5; }
.pf-f > span small, .pf-f small { font-weight: 400; font-size: 10.5px; color: var(--muted); }
.pf-f .req { color: #dc2626; font-style: normal; }
.pf-f.wide { grid-column: span 2; } .pf-f.full { grid-column: 1 / -1; }
.pf-f input:not([type=checkbox]), .pf-f select { width: 100%; height: 32px; box-sizing: border-box; }
.pf-f input[readonly] { background: var(--panel2) !important; color: var(--muted); }
.pf-check { grid-column: 1 / -1; display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--mline); border-radius: 6px; background: var(--mc); }
.pf-check input { margin-top: 3px; } .pf-check span { display: flex; flex-direction: column; gap: 1px; } .pf-check small { font-weight: 400; color: var(--muted); font-size: 10.5px; }
.pf-card { margin-top: 12px; padding: 10px 12px; background: var(--mc); border: 1px solid var(--mline); border-radius: 8px; }
.pf-card > h3 { margin: 0 0 8px; font-size: 12.5px; font-weight: 700; color: color-mix(in srgb, var(--primary-2) 70%, #000); }
.pf-sub { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--mline); } .pf-sub h4 { margin: 0 0 8px; font-size: 12px; font-weight: 700; }
.pf-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pf-modes label { display: flex; gap: 8px; align-items: flex-start; padding: 9px 10px; background: var(--panel); border: 1px solid var(--mline); border-radius: 8px; cursor: pointer; }
.pf-modes label.on { border-color: var(--primary-2); background: color-mix(in srgb, var(--primary-2) 10%, var(--panel)); }
.pf-modes input { margin-top: 3px; } .pf-modes span { display: flex; flex-direction: column; gap: 2px; } .pf-modes b { font-size: 12.5px; } .pf-modes small { font-weight: 400; font-size: 10.5px; color: var(--muted); line-height: 1.6; }
.pf-picker { margin-top: 8px; border: 1px solid var(--mline); border-radius: 8px; background: var(--panel); overflow: hidden; }
.pf-pk-head { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-bottom: 1px solid var(--mline); }
.pf-pk-head input { flex: 1; height: 30px; box-sizing: border-box; } .pf-pk-head span { font-size: 11px; color: var(--primary-2); font-weight: 700; white-space: nowrap; }
.pf-pk-list { max-height: 190px; overflow: auto; } .pf-pk-list > label { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 12px; font-weight: 500; }
.pf-pk-list > label:last-of-type { border-bottom: 0; } .pf-pk-list > label:hover { background: var(--panel2); } .pf-pk-list > label.on { background: color-mix(in srgb, var(--primary-2) 10%, var(--panel)); }
.pf-pk-list > label b { min-width: 44px; color: var(--primary-2); font-variant-numeric: tabular-nums; } .pf-pk-list > label input { margin: 0; flex: none; }
.pf-hint { margin: 0; padding: 12px; font-size: 11.5px; color: var(--muted); text-align: center; }
.pf-role .role-picks { min-height: 32px; } .pf-note { color: #b45309 !important; line-height: 1.6; }
.iban-box { display: flex; direction: ltr; border: 1px solid var(--mline); border-radius: 6px; overflow: hidden; background: var(--mc); }
.iban-box b { display: grid; place-items: center; padding: 0 9px; background: var(--panel2); color: var(--muted); font-size: 12px; border-right: 1px solid var(--mline); }
.iban-box input { flex: 1; border: 0 !important; border-radius: 0 !important; outline: 0; }
.sid-box button svg { display: block; } .sid-box button:not(:disabled) { cursor: pointer; opacity: 1; color: var(--primary-2); }
.pf-alert { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 8px 10px; border-radius: 6px; font-size: 11.5px; line-height: 1.8; border: 1px solid; }
.pf-alert > b { flex: none; width: 17px; height: 17px; border-radius: 50% !important; display: grid; place-items: center; font-size: 11px; color: #fff; margin-top: 3px; }
.pf-alert.warn { background: #fffbeb; border-color: #fcd34d; color: #92400e; } .pf-alert.warn > b { background: #f59e0b; }
.pf-alert.err { background: #fef2f2; border-color: #fca5a5; color: #991b1b; } .pf-alert.err > b { background: #dc2626; }
@media (max-width: 760px) { .pf-grid, .pf-modes { grid-template-columns: 1fr; } .pf-f.wide { grid-column: auto; } }
.pf-form input[type=radio], .pf-form input[type=checkbox] { width: 15px !important; height: 15px !important; padding: 0; flex: none; accent-color: var(--primary-2); }
.pf-pk-list > label span { flex: 1; min-width: 0; }
/* ───── فرم کالا و خدمت (هم‌شکل سایت اصلی) ───── */
dialog.modal:has(.it-form) { width: min(880px, 96vw); max-width: 96vw; }
.it-form [hidden] { display: none !important; }
.it-form .m-tabs { display: flex; gap: 6px; margin: -12px -14px 12px; padding: 7px 10px 0; background: #fff8f3; border-bottom: 2px solid #ff6b3d; }
.it-form .m-tabs button { padding: 5px 16px; font-size: 10.5px; font-weight: 700; color: #b4521f; background: #ffece2; border: 1px solid #ffd3bf; border-bottom: 0; border-radius: 8px 8px 0 0 !important; cursor: pointer; transition: background .15s; }
.it-form .m-tabs button:hover { background: #ffdcca; color: #8f3f14; }
.it-form .m-tabs button.on { background: #ff6b3d; border-color: #ff6b3d; color: #fff; }
.it-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 11px; align-items: start; padding: 2px; }
.it-f { display: flex; flex-direction: column; min-width: 0; }
.it-f.wide { grid-column: span 2; }
.it-f > span:first-child { min-height: 32px; margin-bottom: 5px; font-size: 11px; font-weight: 800; color: #3e5876; line-height: 1.5; }
.it-f > span small { display: block; margin-top: 3px; font-size: 10px; font-weight: 400; color: var(--muted); }
.it-f .req { color: #dc2626; font-style: normal; margin-inline-start: 3px; }
.it-f input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .it-f select { width: 100%; min-height: 36px; box-sizing: border-box; }
.it-f input:focus, .it-f select:focus { border-color: #ff6b3d; background: #fff; box-shadow: 0 0 0 3px rgba(255,107,61,.1); outline: 0; }
.it-self { align-self: flex-start; margin-top: 6px; }
.it-box { position: relative; display: block; }
.it-box > input:not([type=hidden]) { text-align: right; padding-left: 76px; }
.it-tools { position: absolute; inset-block-start: 50%; inset-inline-end: 5px; transform: translateY(-50%); display: inline-flex; gap: 2px; z-index: 1; }
.it-form .it-box:has(.it-tools) > input { padding-left: 58px; }
.it-tools > a, .it-tools > button { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--primary-2); background: none; border: 0; border-radius: 6px !important; cursor: pointer; }
.it-tools > a:hover, .it-tools > button:hover:not(:disabled) { background: color-mix(in srgb, var(--primary-2) 12%, #fff); }
.it-tools > button:disabled { color: #c3cddb; cursor: not-allowed; }
.it-switch { position: absolute; inset-block-start: 50%; inset-inline-end: 5px; transform: translateY(-50%); display: inline-flex; gap: 2px; padding: 2px; background: color-mix(in srgb, var(--primary-2) 10%, #fff); border-radius: 8px !important; z-index: 1; }
.it-switch button { min-width: 26px; height: 22px; padding: 0 6px; font-size: 11px; font-weight: 700; color: var(--muted); background: none; border: 0; border-radius: 6px !important; cursor: pointer; }
.it-switch button.on { background: var(--primary-2); color: #fff; }
.it-ra .ra-l small { display: block; margin-top: 3px; font-size: 10px; font-weight: 400; color: var(--muted); }
.it-res { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; font-size: 10.5px; line-height: 1.9; }
.it-res.found { color: #16a34a; font-weight: 700; } .it-res.missing { color: #dc2626; font-weight: 700; } .it-res.invalid, .it-res.unavailable { color: var(--muted); } .it-res a { color: var(--primary-2); text-decoration: underline; }
.it-warn { margin: 6px 0 0; font-size: 10.5px; line-height: 1.8; color: #dc2626; flex: 1 1 100%; }
.it-pk { position: relative; } .it-pk-in { width: 100%; }
.it-pop { position: absolute; inset-inline: 0; top: calc(100% + 3px); z-index: 30; max-height: 230px; overflow: auto; background: #fff; border: 1px solid var(--mline); border-radius: 8px; box-shadow: 0 10px 28px rgba(20,30,60,.18); padding: 4px; }
.it-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 9px; font-size: 11.5px; border-radius: 6px; cursor: pointer; }
.it-opt:hover { background: color-mix(in srgb, var(--primary-2) 9%, #fff); } .it-opt.on { background: color-mix(in srgb, var(--primary-2) 14%, #fff); font-weight: 700; }
.it-opt.add { color: var(--primary-2); font-weight: 700; border-top: 1px solid var(--line); margin-top: 3px; border-radius: 0 0 6px 6px; }
.it-ed { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 4px; } .it-ed:hover { color: var(--primary-2); }
.it-unit-panel { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 7px; margin-top: 7px; padding: 9px 10px; background: var(--mc); border: 1px solid var(--mline); border-radius: 9px; }
.it-unit-panel label { display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; font-weight: 700; } .it-unit-panel label input { height: 30px; box-sizing: border-box; width: 120px; }
.btn.sm { padding: 4px 12px; font-size: 11px; } .btn.danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.it-specs { display: flex; flex-direction: column; gap: 6px; }
.it-spec { display: flex; align-items: center; gap: 6px; } .it-spec input:first-child { width: 140px; } .it-spec input:nth-child(2) { width: 110px; }
.it-x { width: 26px; height: 26px; display: grid; place-items: center; font-size: 15px; line-height: 1; color: #e0435a; background: none; border: 1px solid transparent; border-radius: 7px !important; cursor: pointer; }
.it-x:hover { background: rgba(224,67,90,.12); }
.it-check { display: flex; align-items: center; gap: 9px; min-height: 55px; padding: 8px 10px; background: var(--mc); border: 1px solid var(--mline); border-radius: 5px; cursor: pointer; }
.it-check.wide { grid-column: span 2; } .it-check input { width: 17px !important; height: 17px; accent-color: var(--primary-2); flex: none; }
.it-check span { display: block; } .it-check b { display: block; font-size: 11px; color: #335474; } .it-check small { display: block; margin-top: 3px; font-size: 10px; font-weight: 400; color: var(--muted); }
.it-sub { margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--mline); } .it-sub h4 { margin: 0 0 8px; font-size: 11.5px; color: color-mix(in srgb, var(--primary-2) 70%, #000); }
.it-hint { margin: 0 0 10px; font-size: 10.5px; line-height: 1.9; color: var(--muted); }
.it-rows { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; } #it-prices, #it-subs { display: flex; flex-direction: column; gap: 6px; }
.it-row { display: grid; align-items: center; gap: 8px; } .it-row.p { grid-template-columns: 150px 150px 1fr 30px; } .it-row.u { grid-template-columns: 200px 120px 1fr 30px; }
.it-row.head span { padding-right: 2px; font-size: 10px; font-weight: 700; color: #3e5876; }
.it-row input:not([type=hidden]) { width: 100%; min-height: 32px; box-sizing: border-box; } .it-amt { font-size: 12px; } .it-eq { font-size: 11px; color: var(--muted); }
.it-empty { margin: 6px 0 0; padding: 12px; text-align: center; font-size: 10.5px; color: var(--muted); border: 1px dashed var(--mline); border-radius: 8px; }
.it-gsearch { width: 100%; margin-bottom: 8px; height: 32px; box-sizing: border-box; }
.it-gchecks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 7px; margin-bottom: 10px; }
.it-gchecks .it-check { min-height: 44px; border-radius: 8px; } .it-gchecks .it-check.on { border-color: var(--primary-2); background: color-mix(in srgb, var(--primary-2) 9%, #fff); }
.it-gchecks .it-empty { grid-column: 1 / -1; }
@media (max-width: 760px) { .it-grid { grid-template-columns: 1fr 1fr; } .it-row.p, .it-row.u { grid-template-columns: 1fr 1fr auto; } .it-row.head { display: none; } }
@media (max-width: 480px) { .it-grid { grid-template-columns: 1fr; } .it-f.wide, .it-check.wide { grid-column: auto; } }

.ib.copy .ico { width: 15px; height: 15px; transform: translate(-50%, -50%); }

/* ───── اجزای مشترک لیست کالا ───── */
.tb-end { display: flex; align-items: center; gap: 6px; }
.tb.vid { border-color: #ffd3bf; color: #ff6b3d; background: transparent; }
.ctx-chip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 9px; border: 1px solid #b9cfe7; border-radius: 6px; background: #f5f9fe; font-size: 11px; color: #6c8298; white-space: nowrap; }
.ctx-chip strong { color: #174f88; font-weight: 700; }
html[data-theme="dark"] .ctx-chip { background: var(--panel2); border-color: var(--line); color: var(--muted); } html[data-theme="dark"] .ctx-chip strong { color: var(--link); }
.st-pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #e3f6ea; color: #167a3e; border: 1px solid #b6e3c6; }
.st-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-pill.off { background: #f3f4f6; color: #6b7280; border-color: #e1e4ea; }
.soon-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 200; background: #1f2a44; color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 12.5px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.mobile-dock, .dock-ov, .dock-sheet { display: none; }

/* ───── حالت موبایل (≤۷۶۰px) — مثل سایت اصلی: ریل پایین، منوی کشویی، جدول‌ها کارتی ───── */
.mob-menu { display: none; }
@media (max-width: 760px) {
  body { overflow: hidden; }
  .app { display: flex; flex-direction: column; height: 100dvh; }
  .tabsbar { order: 0; flex: none; padding: 4px 8px 0; min-height: 40px; gap: 4px; }
  .tabsbar .ctl, .mini-dock, .tabsbar .sub-badge, .tabsbar .frame-chip, .tabsbar .tb-plus { display: none; }
  .mob-menu { display: none; }
  .main { order: 1; flex: 1; min-height: 0; overflow-y: auto; }
  .statusbar { display: none; }
  .rail { display: none; }
  .side { position: fixed; top: 0; bottom: 0; right: 0; z-index: 60; width: min(86vw, 320px); transform: translateX(105%); transition: transform .2s; box-shadow: -10px 0 30px rgba(0,0,0,.25); }
  body.side-open .side { transform: none; }
  body.side-open::after { content: ""; position: fixed; inset: 0; z-index: 55; background: rgba(8,16,36,.4); }
  .crumbs { padding: 8px 12px 0; font-size: 11.5px; }

  .tabsbar { min-height: 0; padding: 6px 8px 0; } .tabsbar .tabs, .tabsbar .grow { display: none; }
  .toolbar { gap: 6px; padding: 6px 8px; }
  .toolbar .grow { display: none; }
  .toolbar .tb { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px !important; background: transparent; border: 1px solid #cfe0f7; color: #0b4f9e; box-shadow: 0 1px 2px rgba(16,40,90,.07); font-weight: 900; }
  .toolbar .tb.primary { background: #1f6ad0 !important; border-color: #1a5ec0 !important; color: #fff !important; box-shadow: 0 3px 8px rgba(31,106,208,.32); }
  .toolbar .tb.danger, .toolbar .tb.del { border-color: #f4ccd3; color: #b2334a !important; box-shadow: none; }
  .toolbar .tb[disabled], .toolbar .tb:disabled { opacity: .4; }
  .tsearch { order: 5; flex: 1 1 100%; height: 38px; display: flex; align-items: center; gap: 6px; padding: 0 11px; background: var(--panel2); border: 1px solid var(--line); border-radius: 9px !important; box-sizing: border-box; }
  .tsearch .ico { position: static; color: var(--primary-2); flex: none; }
  .tsearch input { flex: 1; width: auto; min-width: 0; height: 36px; padding: 0 !important; font-size: 14px; font-weight: 700; box-sizing: border-box; }
  .pagesize { order: 6; height: 30px; border-radius: 6px !important; font-size: 10px; font-weight: 700; padding: 0 9px 0 3px; }
  .pagesize select { font-size: 12px; font-weight: 800; }
  .grid-wrap { max-height: none; overflow-x: hidden; border: 0 !important; margin: 6px 8px; }
  table.g[data-grid], table.g[data-grid] tbody, table.g[data-grid] tbody tr { display: block; width: 100%; min-width: 0; }
  table.g[data-grid] thead { display: none; }
  table.g[data-grid] td[colspan] { grid-column: 1 / -1; align-items: center; text-align: center; }
  .grid-foot { padding: 6px 12px; }

  /* نوار پایین */
  .app { padding-bottom: 60px; }
  .mobile-dock { display: flex; position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; height: 64px; padding: 6px 8px; align-items: center; gap: 0; background: color-mix(in srgb, var(--primary) 16%, var(--panel)); border-radius: 24px 24px 0 0 !important; }
  .mobile-dock > * { flex: 1 1 0; min-width: 0; height: 56px; border: 0; background: transparent; border-radius: 14px !important; color: color-mix(in srgb, var(--primary-2) 70%, #000 0%); opacity: .85; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: inherit; font-size: 11px; text-decoration: none; cursor: pointer; white-space: nowrap; }
  .mobile-dock .dock-home { flex: 0 0 52px; width: 52px; height: 52px; margin-top: -12px; border-radius: 50% !important; background: var(--primary); color: var(--on-brand); opacity: 1; box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 38%, transparent); }
  .side { bottom: 0; }
  .tabsbar { position: absolute; top: 6px; left: 8px; z-index: 40; padding: 0; min-height: 0; background: transparent; border: 0; }
  .tabsbar .tabs, .tabsbar .grow, .tabsbar .tb-plus { display: none; }
  .crumbs { padding: 10px 12px 4px 52px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl; }
  .main { padding-top: 0; }
  .page { margin: 6px 8px; border-radius: 8px !important; }
  .toolbar { background: var(--panel); }
  .tb-end { flex: 1 1 100%; order: 7; display: flex; align-items: center; gap: 6px; }
  .tb-end .tb.vid { width: 38px; height: 36px; border-radius: 7px !important; background: var(--panel); order: 0; }
  .tb-end .pagesize { order: 1; margin: 0 auto; }
  .tb-end .ctx-chip { order: 2; height: 34px; box-sizing: border-box; }
  .pagesize { order: unset; }
  .tsearch { order: 6; }
  .grid-foot { border-top: 1px solid var(--line); }

  /* کارت‌های کالا — مثل سایت اصلی */

  /* برگه‌ی ماژول‌ها (دکمه‌ی خانه) */
  body.dock-open .dock-ov { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(12,10,30,.38); backdrop-filter: blur(2px); }
  body.dock-open .dock-sheet { display: block; position: fixed; z-index: 71; left: 0; right: 0; bottom: 0; max-height: 78vh; overflow-y: auto; padding: 8px 14px 14px; border-radius: 24px 24px 0 0; background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 14%, #fff), color-mix(in srgb, var(--primary) 22%, #fff)); box-shadow: 0 -10px 40px rgba(20,12,60,.28); animation: dockUp .22s ease-out; }
  @keyframes dockUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .dock-handle { display: block; width: 44px; height: 5px; margin: 2px auto 12px; border-radius: 9px; background: color-mix(in srgb, var(--primary) 40%, #fff); }
  .dock-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .dk { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 92px; padding: 10px 6px; border-radius: 18px !important; background: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.9); box-shadow: 0 2px 10px rgba(40,30,110,.10), inset 0 1px 0 #fff; text-decoration: none; color: #2a2550; }
  .dk b { font-size: 12px; font-weight: 700; text-align: center; line-height: 1.3; }
  .dk-i { position: relative; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; color: var(--c1); background: linear-gradient(145deg, rgba(255,255,255,.95) 0%, var(--c2) 100%); border: 1px solid rgba(255,255,255,.85); box-shadow: 0 6px 14px var(--c3), inset 0 1px 1px #fff, inset 0 -3px 6px rgba(255,255,255,.35); overflow: hidden; }
  .dk-i::before { content: ""; position: absolute; left: 3px; right: 3px; top: 2px; height: 45%; border-radius: 12px 12px 40% 40%; background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,0)); pointer-events: none; }
  .dk-i .ico { position: relative; filter: drop-shadow(0 1px 1px rgba(255,255,255,.7)); stroke-width: 1.9; }
  .dk-0 { --c1:#6247c9; --c2:#e1d9ff; --c3:rgba(98,71,201,.28); }
  .dk-1 { --c1:#2f6fd6; --c2:#d6e6ff; --c3:rgba(47,111,214,.26); }
  .dk-2 { --c1:#1f9a62; --c2:#cdf3e0; --c3:rgba(31,154,98,.26); }
  .dk-3 { --c1:#d9822b; --c2:#ffe6c7; --c3:rgba(217,130,43,.28); }
  .dk-4 { --c1:#12899a; --c2:#cbf1f6; --c3:rgba(18,137,154,.26); }
  .dk-5 { --c1:#c2455f; --c2:#ffd9e1; --c3:rgba(194,69,95,.26); }
  .dk-6 { --c1:#7a4fd0; --c2:#e6dcff; --c3:rgba(122,79,208,.26); }
  .dk-7 { --c1:#4f6b86; --c2:#dfe8f1; --c3:rgba(79,107,134,.24); }
  .dock-co { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 11px 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--primary) 35%, #fff); background: rgba(255,255,255,.55); font-size: 13px; font-weight: 700; color: #3a3270; }
  .dock-co em { font-style: normal; color: var(--primary); }

  /* زیرمنوی ماژول داخل برگه */
  .dk { font: inherit; cursor: pointer; }
  .dock-sub { display: none; } .dock-sub:not([hidden]) { display: block; }
  .dock-sub-h { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; font-size: 15px; font-weight: 700; color: color-mix(in srgb, var(--primary) 80%, #000); }
  .dock-sub-h button { width: 42px; height: 38px; border: 1px solid color-mix(in srgb, var(--primary) 30%, #fff); border-radius: 12px !important; background: rgba(255,255,255,.7); color: var(--primary); font-size: 18px; cursor: pointer; }
  .dock-sub-i { display: flex; align-items: center; justify-content: space-between; min-height: 50px; margin-bottom: 8px; padding: 0 16px; border-radius: 14px !important; border: 1px solid color-mix(in srgb, var(--primary) 26%, #fff); background: rgba(255,255,255,.55); color: #2f2870; text-decoration: none; }
  .dock-sub-i b { font-size: 13.5px; font-weight: 700; } .dock-sub-i i { font-style: normal; font-size: 20px; color: color-mix(in srgb, var(--primary) 60%, #fff); }
  .dock-sheet.sub .dock-grid, .dock-sheet.sub .dock-co { display: none; }

  /* ───── کارت‌بندی جدول‌ها: همان قواعد سایت اصلی (بر پایه‌ی برچسب هر ستون) ───── */
  table.g[data-grid] tbody tr { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: start; gap: 3px 8px; margin: 0 0 6px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 3px rgba(6,31,69,.06); }
  table.g[data-grid] tbody tr:has(td.ck input:checked) { border-color: #7fcf9b; background: color-mix(in srgb, #3ccf7a 18%, var(--panel)); }
  table.g[data-grid] tbody tr td { width: auto; display: flex; flex-direction: column; align-items: flex-start; grid-column: span 2; order: 20; min-width: 0; padding: 0; border: 0; background: transparent !important; text-align: right; white-space: normal; font-size: 12.5px; line-height: 1.35; gap: 0; }
  table.g[data-grid] tbody tr td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 400; line-height: 1.25; }
  table.g[data-grid] td.ck { order: 1; grid-column: span 1; } table.g[data-grid] td.rn { display: none; }
  table.g[data-grid] td.t { order: 2; grid-column: span 4; font-size: 14px; font-family: 'Vazirmatn', sans-serif !important; font-weight: 700 !important; line-height: 1.4; } table.g[data-grid] td.t::before { display: none; }
  table.g[data-grid] td.ops { width: auto; order: 3; grid-column: span 1; flex-direction: row; justify-content: flex-end; align-items: center; gap: 6px; overflow: visible; }
  table.g[data-grid] td.ops::before { display: none; }
  table.g[data-grid] td.ops form { display: inline-flex !important; }
  table.g[data-grid] td.ops .ib { flex: none; width: 32px; height: 32px; border-radius: 9px !important; }
  table.g[data-grid] td.ops .ib .ico { width: 17px; height: 17px; }
  table.g[data-grid] tbody tr td, table.g[data-grid] tbody tr td.num { direction: rtl; unicode-bidi: normal; text-align: right !important; }
  table.g[data-grid] td[colspan] { text-align: center !important; }
  table.g[data-grid] td[colspan] { grid-column: 1 / -1; align-items: center; text-align: center; }
  table.g[data-grid] tbody tr td[data-label="نام"] { order: 2; grid-column: span 4; font-size: 14px; font-family: 'Vazirmatn', sans-serif !important; font-weight: 800 !important; line-height: 1.4; }
  table.g[data-grid] tbody tr td[data-label="نام"]::before { display: none; }
  table.g[data-grid] tbody tr td[data-label="شرح"] { order: 2; grid-column: span 4; font-size: 13.5px; font-weight: 700; line-height: 1.5; }
  table.g[data-grid] tbody tr td[data-label="شرح"]::before { display: none; }
  table.g[data-grid] tbody tr td[data-label="نام کالا"] { order: 2; grid-column: span 4; font-size: 13.5px; font-weight: 700; line-height: 1.35; }
  table.g[data-grid] tbody tr td[data-label="نام کالا"]::before { display: none; }
  table.g[data-grid] tbody tr td[data-label="نام پرسنل"] { order: 2; grid-column: span 4; font-size: 14px; font-weight: 700; }
  table.g[data-grid] tbody tr td[data-label="نام پرسنل"]::before { display: none; }
  table.g[data-grid] tbody tr td[data-label="نام واحد اقتصادی"] { order: 2; grid-column: span 4; font-size: 14px; font-weight: 700; }
  table.g[data-grid] tbody tr td[data-label="نام واحد اقتصادی"]::before { display: none; }
  table.g[data-grid] tbody tr td[data-label="فروشنده"], table.g[data-grid] tbody tr td[data-label="تحویل‌دهنده"], table.g[data-grid] tbody tr td[data-label="تحویل‌گیرنده"] { order: 2; grid-column: span 5; font-size: 14px; font-weight: 700; line-height: 1.4; }
  table.g[data-grid] tbody tr td[data-label="فروشنده"]::before, table.g[data-grid] tbody tr td[data-label="تحویل‌دهنده"]::before, table.g[data-grid] tbody tr td[data-label="تحویل‌گیرنده"]::before { display: none; }
  table.g[data-grid] tbody tr td[data-label="کالا / خدمت"] { order: 2; grid-column: span 6; }
  table.g[data-grid] tbody tr td[data-label="کد"], table.g[data-grid] tbody tr td[data-label="کد تفصیل"], table.g[data-grid] tbody tr td[data-label="شماره"], table.g[data-grid] tbody tr td[data-label="کد کالا"] { order: 4; grid-column: span 2; }
  table.g[data-grid] tbody tr td[data-label="نوع شخص"], table.g[data-grid] tbody tr td[data-label="عطف"] { order: 5; grid-column: span 2; }
  table.g[data-grid] tbody tr td[data-label="نوع"] { order: 3; grid-column: span 3; }
  table.g[data-grid] tbody tr td[data-label="واحد"] { order: 5; grid-column: span 2; }
  table.g[data-grid] tbody tr td[data-label="سطح"], table.g[data-grid] tbody tr td[data-label="تاریخ"], table.g[data-grid] tbody tr td[data-label="اول دوره"] { order: 6; grid-column: span 2; }
  table.g[data-grid] tbody tr td[data-label="شناسه کالا/خدمت"], table.g[data-grid] tbody tr td[data-label="شناسه/کد ملی"] { order: 7; grid-column: span 4; }
  table.g[data-grid] tbody tr td[data-label="نرخ مالیات"], table.g[data-grid] tbody tr td[data-label="منبع"], table.g[data-grid] tbody tr td[data-label="صادره"], table.g[data-grid] tbody tr td[data-label="جمع صادره"] { order: 8; grid-column: span 2; }
  table.g[data-grid] tbody tr td[data-label="وارده"], table.g[data-grid] tbody tr td[data-label="جمع وارده"], table.g[data-grid] tbody tr td[data-label="تعداد"] { order: 7; grid-column: span 2; }
  table.g[data-grid] tbody tr td[data-label="نقش"], table.g[data-grid] tbody tr td[data-label="کد اقتصادی"], table.g[data-grid] tbody tr td[data-label="مبلغ سند"], table.g[data-grid] tbody tr td[data-label="رسید انبار"], table.g[data-grid] tbody tr td[data-label="مرجع"], table.g[data-grid] tbody tr td[data-label="نرخ"], table.g[data-grid] tbody tr td[data-label="بهای واحد"] { order: 9; grid-column: span 3; }
  table.g[data-grid] tbody tr td[data-label="قیمت"], table.g[data-grid] tbody tr td[data-label="کد پستی"], table.g[data-grid] tbody tr td[data-label="سند"], table.g[data-grid] tbody tr td[data-label="بهای حرکت"], table.g[data-grid] tbody tr td[data-label="بهای صادره"] { order: 10; grid-column: span 3; }
  table.g[data-grid] tbody tr td[data-label="وضعیت"], table.g[data-grid] tbody tr td[data-label="ارزش موجودی"] { order: 11; grid-column: span 3; }
  table.g[data-grid] tbody tr td[data-label="مانده"], table.g[data-grid] tbody tr td[data-label="موجودی"], table.g[data-grid] tbody tr td[data-label="مانده تعدادی"], table.g[data-grid] tbody tr td[data-label="مانده ریالی"] { order: 12; grid-column: span 3; }
  table.g[data-grid] tbody tr td[data-label="جمع کل"] { order: 7; grid-column: span 3; }
  table.g[data-grid] tbody tr td[data-label="تسویه خزانه"], table.g[data-grid] tbody tr td[data-label="نرخ واحد (ریال)"] { order: 8; grid-column: span 3; }
  table.g[data-grid] tbody tr td[data-label="انبار"], table.g[data-grid] tbody tr td[data-label="از انبار"] { order: 5; grid-column: span 3; }
  table.g[data-grid] tbody tr td[data-label="به انبار"] { order: 6; grid-column: span 3; }
  table.g[data-grid] tbody tr td[data-label="توضیحات"] { order: 15; grid-column: span 6; }
  table.g[data-grid] tbody tr td[data-label="زیر سیستم"] { order: 12; grid-column: span 6; }
  table.g[data-grid] tbody tr td[data-label="زیر سیستم"]:empty { display: none; }

  .tsearch input, .pagesize select { border: 0 !important; box-shadow: none !important; outline: 0 !important; background: transparent !important; }
  .pagesize select { height: auto; min-height: 0; padding: 0 2px; }
  .toolbar > .pagesize { order: 7; margin-inline-end: 0; }
  .toolbar > .tb-count { order: 8; margin-inline-start: auto; display: inline-flex; align-items: center; gap: 5px; height: 34px; box-sizing: border-box; padding: 3px 9px; border: 1px solid #b9cfe7; border-radius: 6px; background: #f5f9fe; font-size: 11px; color: #174f88; }
  .toolbar > .tb-count [data-gcount] { font-weight: 700; }
  .grid-wrap { padding-top: 2px; }
}


/* ===== Original design: Sakou font + brand palette (upd91) ===== */
button, input, select, textarea { font-family: inherit; }
html[data-theme="light"] {
  --primary: #6247c9; --primary-2: #4d36a8; --primary-soft: #efeafc;
  --head: #6247c9; --head-text: #ffffff;
  --text: color-mix(in srgb, #14102a 88%, #000); --muted: color-mix(in srgb, #5d5679 78%, #000);
  --line: color-mix(in srgb, #cec6e8 68%, #000); --line2: color-mix(in srgb, #cec6e8 80%, #000);
  --row-hover: #f3f0fc; --sel: #e2dafa; --row-alt: #faf8ff; --bg: #f4f1fb;
}
html[data-theme="light"] input:focus, html[data-theme="light"] select:focus, html[data-theme="light"] textarea:focus { box-shadow: 0 0 0 3px rgba(98,71,201,.18); }
table.g, table.g td, table.g th { font-family: Sakou, Vazirmatn, "Segoe UI", Tahoma, sans-serif; }
table.g thead th { font-size: 11px; font-weight: 700; }
table.g td { font-size: 11px; font-weight: 600; }
html[data-theme="light"] table.g td { color: rgb(72,67,94); }
.btn, button.btn { font-size: 11.5px; font-weight: 700; }
input, select, textarea { font-size: 13px; font-weight: 400; }
/* نوع آیکن منو (تنظیمات ← ماژول‌ها و منو): دورنگ و کاشی رنگی */
.ico.ico-duo :is(path, rect, circle, ellipse, polygon) { fill: currentColor; fill-opacity: .2; }
.ico.ico-tile { box-sizing: border-box; padding: 3px; border-radius: 28%; background: var(--tile, var(--primary)); color: #fff !important; stroke-width: 2.1; }

/* ماژول قفل در لایسنس */
.rail-btn { position: relative; } .rail-lock { position: absolute; top: 2px; inset-inline-end: 6px; font-style: normal; font-size: 10px; }

/* فرمول نادرست در خانه‌ی مبلغ */
input.money.f-err { outline: 2px solid #dc2626; outline-offset: -2px; }

/* دکمه‌ی خطرناک: قاعده‌ی .btn:not(.primary)… پس‌زمینه‌اش را می‌برد و متن سفید روی سفید می‌ماند */
.btn.danger:not(.primary):not(.add-line):not(.bk-add) { background: #dc2626; color: #fff; border-color: #dc2626; }

/* ابزار ← استعلام و شناسه کالا (طراحی کاریا) */
.inquiry-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-content: start; gap: 12px; max-width: 900px; padding: 12px 4px; }
.inquiry-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; box-shadow: 0 3px 12px rgba(31, 76, 133, .04); }
.inquiry-card header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.inquiry-card h2 { margin: 0; font-size: 13px; color: var(--primary); }
.inquiry-card header p { margin: 3px 0 0; font-size: 10.5px; line-height: 1.8; color: var(--muted); }
.inquiry-badge { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
.stuffid-box { position: relative; display: block; }
.inquiry-card .stuffid-box > input { width: 100%; height: 36px; padding: 0 10px 0 58px; border: 1px solid var(--line2); border-radius: 8px; color: var(--primary); font-weight: 800; text-align: right; }
.inquiry-card .stuffid-box > input:focus { border-color: #f97316; outline: 0; }
.inquiry-card .stuffid-box > input::placeholder { direction: rtl; font-weight: 600; opacity: .75; }
.stuffid-tools { position: absolute; inset-block-start: 50%; inset-inline-end: 5px; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 2px; }
.stuffid-tools > a, .stuffid-tools > button { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--primary); cursor: pointer; }
.stuffid-tools > a:hover, .stuffid-tools > button:hover:not(:disabled) { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.stuffid-tools > button:disabled { color: var(--line2); cursor: not-allowed; }
.stuffid-result { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 11px; line-height: 1.9; }
.stuffid-result[hidden], .inquiry-inline[hidden] { display: none; }
.stuffid-result.found { color: #16a34a; font-weight: 700; } .stuffid-result.missing { color: #dc2626; font-weight: 700; }
.stuffid-result.invalid, .stuffid-result.unavailable { color: var(--muted); } .stuffid-result a { color: var(--primary); text-decoration: underline; }
.inquiry-inline { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.inquiry-note { display: block; margin-top: 8px; font-size: 10.5px; line-height: 1.9; color: var(--muted); }
.inquiry-import { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; max-width: 900px; margin: 4px; padding: 10px; border: 1px dashed var(--line2); border-radius: 10px; }
