/* ERP1 · نمای برنامه — راست‌به‌چپ، روشن/تیره، موبایل */
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/vazirmatn.woff2') format('woff2-variations'), url('fonts/vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* تم NB (پیش‌فرض): سرمه‌ای اصلی، طلایی تأکید، قرمز فقط برای خطر و هشدار */
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --surface-3: #eef0f4;
  --border: #e1e4eb;
  --border-strong: #cdd2dc;
  --text: #1b2336;
  --text-2: #3f4859;
  --text-3: #6b7486;
  --primary: #1b2336;
  --primary-2: #27314a;
  --primary-soft: #e9ecf4;
  --primary-ink: #ffffff;
  --gold: #e7a900;
  --gold-2: #f2b705;
  --gold-soft: #fdf4d9;
  --gold-ink: #1b1400;
  --accent: #8a6100;
  --accent-soft: #fdf4d9;
  --danger: #c8361c;
  --danger-strong: #b42318;
  --danger-soft: #fdebe7;
  --ok: #157a3a;
  --ok-soft: #e6f4ea;
  --info: #1d4ed8;
  --info-soft: #e8eefc;
  --debit: #0f5e8c;
  --credit: #8a3b12;
  --shadow-sm: 0 1px 2px rgba(27, 35, 54, .06);
  --shadow: 0 1px 3px rgba(27, 35, 54, .08), 0 4px 16px rgba(27, 35, 54, .06);
  --shadow-lg: 0 10px 40px rgba(27, 35, 54, .18);
  --radius: 10px;
  --radius-sm: 7px;
  --sidebar: 248px;
  --topbar: 56px;
  --focus: 0 0 0 3px rgba(231, 169, 0, .35);
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #0e121b;
  --surface: #151b28;
  --surface-2: #1a2131;
  --surface-3: #212a3d;
  --border: #2a3448;
  --border-strong: #3a4660;
  --text: #e8ecf4;
  --text-2: #b8c1d3;
  --text-3: #8a95aa;
  --primary: #f2b705;
  --primary-2: #e7a900;
  --primary-soft: #2e2810;
  --primary-ink: #1b1400;
  --gold-soft: #2e2810;
  --accent: #f2b705;
  --accent-soft: #2e2810;
  --danger: #fb7a5c;
  --danger-strong: #f87171;
  --danger-soft: #3a1d14;
  --ok: #4ade80;
  --ok-soft: #12301d;
  --info: #93b4ff;
  --info-soft: #18233d;
  --debit: #7cc4f0;
  --credit: #f0a77c;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .55);
  --focus: 0 0 0 3px rgba(242, 183, 5, .3);
  color-scheme: dark;
}

/* تم خنثی (برای مشتری‌های دیگر) */
:root[data-brand='neutral'] {
  --bg: #f4f6f8;
  --surface-2: #f8fafb;
  --surface-3: #eef2f5;
  --border: #e2e7ec;
  --border-strong: #cfd7df;
  --text: #17212b;
  --text-2: #4a5866;
  --text-3: #7a8794;
  --primary: #0f766e;
  --primary-2: #0d9488;
  --primary-soft: #e6f4f2;
  --primary-ink: #ffffff;
  --gold: #b45309;
  --gold-2: #d97706;
  --gold-soft: #fdf3e5;
  --gold-ink: #ffffff;
  --accent: #b45309;
  --accent-soft: #fdf3e5;
  --danger: #c2410c;
  --danger-strong: #b91c1c;
  --focus: 0 0 0 3px rgba(13, 148, 136, .28);
}
:root[data-brand='neutral'][data-theme='dark'] {
  --bg: #0f1418;
  --surface: #161d23;
  --surface-2: #1b232a;
  --surface-3: #212b33;
  --border: #2a353f;
  --border-strong: #3a4753;
  --text: #e6edf2;
  --text-2: #b3c0cb;
  --text-3: #85939f;
  --primary: #2dd4bf;
  --primary-2: #14b8a6;
  --primary-soft: #12302d;
  --primary-ink: #04201c;
  --gold-soft: #3a2a10;
  --accent: #f59e0b;
  --accent-soft: #3a2a10;
  --danger: #fb923c;
  --focus: 0 0 0 3px rgba(45, 212, 191, .3);
}

* { box-sizing: border-box; }
/* ویژگی hidden همیشه پنهان کند، حتی روی عنصری که display دارد (برچسب‌ها، دکمه‌ها، کارت‌ها) */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01';
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.num, .mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.sep { height: 1px; background: var(--border); margin: 12px 0; }

/* ── پوسته ── */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; grid-template-rows: var(--topbar) 1fr; min-height: 100vh; }
.topbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; min-width: calc(var(--sidebar) - 32px); }
.brand .logo {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .5px;
}
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--text-3); margin-top: -4px; }
.topbar .ctx { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.sidebar {
  background: var(--surface); color: var(--text); border-left: 1px solid var(--border); padding: 12px 10px 24px;
  position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto;
}
/* گروه‌های جمع‌شوندهٔ منو */
.nav-sec { margin-top: 2px; }
.nav-group {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 0; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--text-2); cursor: pointer; text-align: start;
}
.nav-group > svg { color: var(--text-3); }
.nav-group:hover { background: var(--surface-3); color: var(--text); }
.nav-sec.open > .nav-group { color: var(--text); }
.nav-sec.open > .nav-items { display: block; margin-inline-start: 12px; padding-inline-start: 6px; border-inline-start: 1px solid var(--border); }
.nav-sec.open > .nav-items a { padding-block: 7px; }
.nav-group:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.nav-group-t { flex: 1; }
.nav-group .badge { font-size: 10.5px; padding: 0 6px; }
.nav-chev { display: inline-flex; transition: transform .15s ease; transform: rotate(90deg); opacity: .7; }
.nav-chev svg { width: 14px; height: 14px; }
.nav-sec.open > .nav-group .nav-chev { transform: none; }
.nav-sec.open > .nav-group .badge { display: none; }
.nav-sec.has-active > .nav-group, .nav-sec.has-active > .nav-group > svg { color: var(--primary); }
.nav-items { display: none; padding-bottom: 4px; }

.nav-all {
  display: flex; align-items: center; gap: 6px; margin: 10px 10px 2px auto; padding: 3px 8px; border: 0; border-radius: 6px;
  background: none; font: inherit; font-size: 11px; color: var(--text-3); cursor: pointer;
}
.nav-all:hover { background: var(--surface-3); color: var(--primary); }
.nav-all svg { width: 13px; height: 13px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2);
  font-weight: 500; text-decoration: none; margin-bottom: 2px;
}
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav a .badge { margin-inline-start: auto; }
.main { padding: 20px 24px 60px; min-width: 0; }
.main:focus { outline: none; }
.btn.menu-btn { display: none; }
.scrim { display: none; }

/* دسکتاپ: منو و محتوا هر کدام جدا جابه‌جا می‌شوند؛ نوار جابه‌جایی منو کنار لبهٔ راست صفحه
   و نوار جابه‌جایی محتوا کنار خود محتوا (چسبیده به منو) است، نه برعکس */
@media (min-width: 961px) {
  .shell { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; grid-template-rows: var(--topbar) minmax(0, 1fr); }
  .sidebar { position: relative; top: auto; height: auto; min-height: 0; direction: ltr; scrollbar-width: thin; scrollbar-color: transparent transparent; }
  .sidebar:hover, .sidebar:focus-within { scrollbar-color: var(--border-strong) transparent; }
  .sidebar > .nav { direction: rtl; }
  .main { overflow-y: auto; min-height: 0; direction: ltr; scrollbar-gutter: stable; }
  .main > * { direction: rtl; }
  .main .bi-panel { top: 10px; }
}

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: var(--topbar); right: 0; width: min(82vw, 300px); z-index: 40;
    transform: translateX(100%); transition: transform .2s ease; box-shadow: var(--shadow-lg);
  }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: var(--topbar) 0 0 0; background: rgba(0,0,0,.3); z-index: 35; }
  .btn.menu-btn { display: inline-flex; }
  .brand { min-width: 0; }
  .brand > div:last-child { display: none; }
  .topbar { gap: 8px; padding: 0 10px; }
  .select-pill { max-width: 150px; }
  .grid.k4 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .kpi .value { font-size: 17px; }
  .page-head .actions { margin-inline-start: 0; }
  .main { padding: 16px 16px 60px; }
  .topbar .ctx .hide-sm { display: none; }
}
@media (max-width: 560px) {
  .topbar .theme-btn, .user-chip .hide-sm { display: none; }
  .select-pill { max-width: 128px; }
  /* بخش ۵و: با دو شرکت (مثلاً طلا و ارز) دو انتخابگر کنار هم؛ جا را تقسیم می‌کنند و نوار بالا از صفحه بیرون نمی‌زند */
  .topbar { min-width: 0; }
  .topbar .ctx { overflow: hidden; }
  .topbar .ctx > * { min-width: 0; flex: 0 1 auto; }
  .topbar .ctx > .badge { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ── سرصفحه ── */
.page-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; margin: 0; font-weight: 800; letter-spacing: -.2px; }
.page-head .sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.page-head .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--text-3); margin-bottom: 4px; }
.crumbs a { color: var(--text-3); }

/* ── کارت ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { font-size: 15px; margin: 0; font-weight: 700; }
.card-body { padding: 16px; }
.card-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid.k4 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.kpi { padding: 14px 16px; }
.kpi .label { color: var(--text-3); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 21px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ── دکمه ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-2); }
.btn.danger { color: var(--danger-strong); border-color: color-mix(in srgb, var(--danger-strong) 40%, var(--border)); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn .kbd { font-size: 11px; opacity: .7; font-weight: 500; }
.btn.loading { pointer-events: none; opacity: .7; }

/* ── فرم ── */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .req { color: var(--danger-strong); }
.field .help { font-size: 12px; color: var(--text-3); }
.field .err { font-size: 12px; color: var(--danger-strong); }
.input, select.input, textarea.input {
  height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface);
  width: 100%; min-width: 0; transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; }
.input:focus { outline: none; border-color: var(--primary-2); box-shadow: var(--focus); }
.input.invalid, .invalid .input { border-color: var(--danger-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger-strong) 18%, transparent); }
.input[readonly] { background: var(--surface-2); }
.input.num { text-align: left; direction: ltr; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 0 12px; height: 34px; cursor: pointer; color: var(--text-2); font-weight: 600; }
.seg button + button { border-inline-start: 1px solid var(--border-strong); }
.seg button.on { background: var(--primary-soft); color: var(--primary); }

/* ── جدول ── */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
table.t th {
  text-align: right; font-size: 12.5px; font-weight: 700; color: var(--text-2); background: var(--surface-2);
  padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: var(--surface-2); }
table.t td.num, table.t th.num { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tfoot td { font-weight: 800; background: var(--surface-2); border-top: 1px solid var(--border-strong); }
table.t tr.inactive td { color: var(--text-3); }
table.t tr.lvl1 td { font-weight: 800; background: var(--surface-2); }
table.t tr.lvl2 td { font-weight: 700; }
.dr { color: var(--debit); }
.cr { color: var(--credit); }
.amount-tag { font-size: 11px; font-weight: 700; padding: 0 5px; border-radius: 4px; margin-inline-start: 4px; }
.amount-tag.dr { background: color-mix(in srgb, var(--debit) 12%, transparent); }
.amount-tag.cr { background: color-mix(in srgb, var(--credit) 12%, transparent); }

/* ── نشان و برچسب ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap; line-height: 1.7;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--accent-soft); color: var(--accent); }
.badge.bad { background: var(--danger-soft); color: var(--danger-strong); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ── پیام‌ها ── */
.toasts { position: fixed; bottom: 18px; left: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; animation: pop .18s ease;
  border-inline-start: 4px solid var(--primary);
}
.toast.err { border-inline-start-color: var(--danger-strong); }
.toast.ok { border-inline-start-color: var(--ok); }
.toast .t-title { font-weight: 700; }
.toast .t-hint { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.toast .t-code { font-size: 11px; color: var(--text-3); margin-top: 4px; direction: ltr; text-align: right; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.alert { padding: 12px 14px; border-radius: 9px; display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.alert.info { background: var(--info-soft); color: var(--info); }
.alert.warn { background: var(--accent-soft); color: var(--accent); }
.alert.bad { background: var(--danger-soft); color: var(--danger-strong); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert .body { color: var(--text); }

/* ── پنجره ── */
.modal-back { position: fixed; inset: 0; background: rgba(10, 16, 22, .45); z-index: 80; display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(560px, 100%);
  max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: pop .18s ease;
}
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; flex: 1; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-start; flex-direction: row-reverse; }

/* ── فهرست انتخاب (تکمیل خودکار) ── */
.ac { position: relative; }
.ac-list {
  position: fixed; z-index: 90; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px;
  box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; padding: 4px; min-width: 260px;
}
.ac-item { padding: 7px 10px; border-radius: 6px; cursor: pointer; display: flex; gap: 8px; align-items: baseline; }
.ac-item .code { font-variant-numeric: tabular-nums; color: var(--text-3); font-size: 12.5px; min-width: 56px; }
.ac-item .sub { font-size: 12px; color: var(--text-3); margin-inline-start: auto; white-space: nowrap; }
.ac-item.on, .ac-item:hover { background: var(--primary-soft); }
.ac-item.add { color: var(--primary); font-weight: 600; border-top: 1px dashed var(--border); margin-top: 4px; }
.ac-empty { padding: 10px; color: var(--text-3); font-size: 13px; }
.ac-chip { display: inline-flex; gap: 6px; align-items: center; }

/* ── تقویم شمسی ── */
.dp { position: fixed; z-index: 95; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 10px; width: 272px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-weight: 700; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dp-grid .wd { font-size: 11.5px; color: var(--text-3); padding: 4px 0; }
.dp-grid button { border: 0; background: transparent; height: 32px; border-radius: 7px; cursor: pointer; font-variant-numeric: tabular-nums; }
.dp-grid button:hover { background: var(--surface-3); }
.dp-grid button.today { box-shadow: inset 0 0 0 1px var(--primary-2); }
.dp-grid button.sel { background: var(--primary); color: var(--primary-ink); }
.dp-grid button.fri { color: var(--danger-strong); }
.dp-grid button.sel.fri { color: var(--primary-ink); }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; }

/* ── درخت سرفصل ── */
.tree-row td:first-child { white-space: nowrap; }
.tree-toggle { width: 22px; height: 22px; border: 0; background: transparent; cursor: pointer; border-radius: 5px; display: inline-grid; place-items: center; color: var(--text-3); vertical-align: middle; }
.tree-toggle:hover { background: var(--surface-3); }
.tree-toggle svg { transition: transform .15s; }
.tree-toggle.open svg { transform: rotate(-90deg); }
.toasts .toast:nth-last-child(n+4) { display: none; }
.indent-2 { padding-inline-start: 26px !important; }
.indent-3 { padding-inline-start: 52px !important; }
.code-cell { font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 600; }

/* ── سند ── */
.v-head { display: grid; grid-template-columns: 170px 1fr 220px 170px; gap: 14px; }
@media (max-width: 900px) { .v-head { grid-template-columns: 1fr 1fr; } }
.v-lines { width: 100%; border-collapse: separate; border-spacing: 0; }
.v-lines th { font-size: 12px; color: var(--text-2); font-weight: 700; padding: 8px 6px; background: var(--surface-2); border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.v-lines td { padding: 5px 4px; border-bottom: 1px solid var(--border); vertical-align: top; }
.v-lines td.idx { color: var(--text-3); text-align: center; width: 34px; padding-top: 12px; font-variant-numeric: tabular-nums; }
.v-lines .input { height: 34px; border-color: transparent; background: var(--surface-2); }
.v-lines .input:hover { border-color: var(--border); }
.v-lines .input:focus { background: var(--surface); border-color: var(--primary-2); }
.v-lines tr.row-err td { background: var(--danger-soft); }
.v-lines .dl-stack { display: flex; flex-direction: column; gap: 3px; }
.v-lines .dl-none { color: var(--text-3); font-size: 12px; padding: 8px 6px; }
.v-lines .need .input { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.v-lines .acc-sub { font-size: 11.5px; color: var(--text-3); padding: 0 10px; }
.v-lines col.c-acc { width: 26%; }
.v-lines col.c-det { width: 22%; }
.v-lines col.c-amt { width: 13%; }
@media (max-width: 760px) {
  .v-lines colgroup, .v-lines thead { display: none; }
  .v-lines, .v-lines tbody { display: block; }
  .v-lines tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .v-lines td { display: block; padding: 0; border: 0; }
  .v-lines td.idx { grid-column: 1 / -1; text-align: right; padding: 0; width: auto; }
  .v-lines td:nth-child(2), .v-lines td:nth-child(3), .v-lines td:nth-child(4), .v-lines td:nth-child(5), .v-lines td:last-child { grid-column: 1 / -1; }
  .v-lines td:last-child { text-align: left; }
  .v-lines td.hidden { display: none; }
  .v-lines .input { background: var(--surface-2); border-color: var(--border); }
  .v-lines .dl-none:empty { display: none; }
}
.v-total { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 12px 16px; background: var(--surface-2); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.v-total .sum { font-variant-numeric: tabular-nums; font-weight: 800; }
.v-total .diff.bad { color: var(--danger-strong); }
.v-total .diff.ok { color: var(--ok); }
.kbd-help { font-size: 12px; color: var(--text-3); }
kbd { font-family: inherit; font-size: 11px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface); }
.v-status { font-size: 13px; }

/* ── ورود ── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--primary-2) 18%, transparent), transparent),
  radial-gradient(900px 500px at -10% 110%, color-mix(in srgb, var(--accent) 10%, transparent), transparent), var(--bg); }
.auth-card { width: min(400px, 100%); padding: 28px; }
.auth-card h1 { margin: 6px 0 4px; font-size: 21px; font-weight: 800; }
.auth-card .brand { margin-bottom: 18px; }

/* ── متفرقه ── */
.empty { text-align: center; padding: 40px 16px; color: var(--text-3); }
.empty svg.i { width: 40px; height: 40px; stroke-width: 1.3; margin-bottom: 6px; }
.empty .title { font-weight: 700; color: var(--text-2); font-size: 15px; }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; height: 14px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs a, .tabs button { padding: 9px 14px; border: 0; background: none; cursor: pointer; color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.tabs .on { color: var(--primary); border-bottom-color: var(--primary); }
@media (min-width: 761px) { .tabs.wrap { flex-wrap: wrap; overflow-x: visible; } }
.checklist { display: flex; flex-direction: column; gap: 2px; }
.checklist .item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 9px; }
.checklist .item:hover { background: var(--surface-2); }
.checklist .mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-strong); color: var(--text-3); font-weight: 800; font-size: 12px; flex: none; }
.checklist .item.done .mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist .item.done .ttl { color: var(--text-3); text-decoration: line-through; }
.checklist .ttl { font-weight: 600; }
.pw-box { font-size: 22px; font-weight: 800; letter-spacing: 2px; text-align: center; padding: 14px; border-radius: 10px; background: var(--surface-3); direction: ltr; user-select: all; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.menu { position: fixed; z-index: 90; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 200px; }
.menu button, .menu a { display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 10px; border: 0; background: none; border-radius: 7px; cursor: pointer; text-align: right; color: var(--text); text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--surface-3); }
.menu .head { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.select-pill { height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); padding: 0 10px; max-width: 220px; }
.health-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.health-row:last-child { border-bottom: 0; }
.loading-bar { position: fixed; top: 0; right: 0; left: 0; height: 2px; z-index: 200; background: var(--primary-2); transform-origin: right; animation: lb 1s ease infinite; }
@keyframes lb { 0% { transform: scaleX(0); } 50% { transform: scaleX(.6); } 100% { transform: scaleX(1); opacity: 0; } }

/* ── انبار ── */
.qty { white-space: nowrap; font-variant-numeric: tabular-nums; }
.qty .u { font-size: 12px; color: var(--text-3); }
.qty .pk { display: block; font-size: 11.5px; color: var(--text-3); direction: rtl; text-align: inherit; }
.qty.neg b { color: var(--danger-strong); }
table.t tr.row-neg td { background: color-mix(in srgb, var(--danger-soft) 55%, transparent); }
.sm-input { height: 32px !important; min-width: 70px; }
.scan-input { height: 48px; font-size: 18px; font-weight: 600; letter-spacing: .5px; flex: 1; }
.scan-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); flex: none; }
.scan-icon svg.i { width: 22px; height: 22px; }
.scan-pending { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--primary-2); }
.scan-qty { width: 110px; height: 42px; font-size: 17px; font-weight: 700; }
.scan-flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; animation: pop .15s ease; }
.scan-flash .t { font-weight: 800; font-size: 15px; }
.scan-flash .s { font-size: 13px; margin-top: 2px; color: var(--text-2); }
.scan-flash.ok { background: var(--ok-soft); color: var(--ok); }
.scan-flash.bad { background: var(--danger-soft); color: var(--danger-strong); }
/* ت۴۰: کادر خواندن (همان ناحیه‌ای که بارکدخوان داخلی می‌خواند) و ابزار دوربین */
.scan-box { position: absolute; left: 8%; right: 8%; top: 22%; bottom: 22%; border: 2px solid rgba(255, 255, 255, .85); border-radius: 10px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .28); pointer-events: none; }
.scan-tools { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.scan-tools:empty { display: none; }
.scan-eng { text-align: center; font-size: 11.5px; }
.scan-frame { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-line { position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; background: #ef4444; box-shadow: 0 0 8px #ef4444; animation: scanline 1.6s ease-in-out infinite alternate; }
@keyframes scanline { from { transform: translateY(-60px); } to { transform: translateY(60px); } }
.grid.tiles { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tile { display: flex; gap: 12px; align-items: center; padding: 16px; text-decoration: none !important; color: inherit; transition: border-color .12s, box-shadow .12s; }
.tile:hover { border-color: var(--primary-2); box-shadow: var(--shadow); }
.tile .ttl { font-weight: 700; }
.tile-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.tile-icon svg.i { width: 22px; height: 22px; }
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card:not([open]) > summary { border-bottom: 0; }
.print-only { display: none; }
@media (max-width: 760px) {
  .scan-input { font-size: 16px; }
  .v-lines .sm-input { height: 36px !important; }
}

/* ── چاپ رسمی سند ── */
.print-page { background: #fff; color: #111; max-width: 210mm; margin: 0 auto; padding: 14mm 12mm; border: 1px solid var(--border); border-radius: 8px; position: relative; }
.print-page .muted { color: #666; }
.print-page.is-draft::after { content: 'پیش‌نویس'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 90px; font-weight: 900; color: rgba(200, 30, 30, .08); transform: rotate(-20deg); pointer-events: none; }
.pp-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; border-bottom: 2px solid #111; padding-bottom: 10px; margin-bottom: 10px; }
.pp-company { font-weight: 800; font-size: 16px; }
.pp-title { font-weight: 900; font-size: 20px; text-align: center; }
.pp-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; }
.pp-desc { display: flex; gap: 24px; font-size: 13px; margin: 6px 0; }
.pp-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 12.5px; }
.pp-table th, .pp-table td { border: 1px solid #444; padding: 5px 6px; vertical-align: top; }
.pp-table th { background: #eee; font-weight: 700; }
.pp-table td.c { text-align: center; white-space: nowrap; }
.pp-table td.n { text-align: left; direction: ltr; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pp-table tfoot td { font-weight: 800; background: #f4f4f4; }
.pp-words { font-size: 13px; margin: 8px 0 16px; padding: 8px; border: 1px dashed #888; border-radius: 6px; }
.pp-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; text-align: center; font-size: 13px; }
.pp-sign > div { border-top: 1px solid #444; padding-top: 6px; min-height: 70px; }
.pp-name { margin-top: 30px; font-weight: 700; }
.pp-foot { margin-top: 18px; text-align: center; }

/* رسید حرارتی ۸ سانتی و فاکتور A5 فروش */
.print-page.a5 { max-width: 148mm; }
.print-page.thermal { max-width: 72mm; padding: 4mm 3mm; font-size: 12px; line-height: 1.5; }
.th-head { text-align: center; border-bottom: 1px dashed #333; padding-bottom: 4px; margin-bottom: 4px; }
.th-co { font-weight: 800; font-size: 14px; }
.th-meta { display: grid; gap: 1px; border-bottom: 1px dashed #333; padding-bottom: 4px; margin-bottom: 4px; }
.th-table { width: 100%; border-collapse: collapse; }
.th-table td { padding: 1px 0; vertical-align: top; }
.th-table .th-sub td { color: #333; font-size: 11px; border-bottom: 1px dotted #bbb; padding-bottom: 3px; }
.th-table .n { text-align: left; white-space: nowrap; }
.th-tot { margin-top: 6px; border-top: 1px dashed #333; padding-top: 4px; }
.th-tot > div { display: flex; justify-content: space-between; gap: 8px; }
.th-grand { font-weight: 800; font-size: 14px; border-top: 1px solid #111; margin-top: 3px; padding-top: 3px; }
.th-foot { text-align: center; margin-top: 8px; border-top: 1px dashed #333; padding-top: 4px; }
.pay-row > .input { min-width: 0; }

@media print {
  .print-page { border: 0; padding: 0; max-width: none; }
  @page { size: A4; margin: 12mm; }
  .print-page.thermal { max-width: none; width: 72mm; padding: 2mm; }
  body:has(.print-page.thermal) { margin: 0; }
  .topbar, .sidebar, .page-head .actions, .no-print, .toasts { display: none !important; }
  .shell { display: block; height: auto !important; overflow: visible !important; }
  .main { padding: 0; overflow: visible !important; height: auto !important; direction: rtl !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  .card { border: 0; box-shadow: none; }
  table.t th { background: #f0f0f0 !important; }
  .print-only { display: grid !important; }
  .tabs, .alert { display: none !important; }
  table.grid-count select { appearance: none; border: 0; background: none; padding: 0; }
  table.grid-count input { border: 1px solid #999 !important; background: #fff !important; }
}

/* ── خرید ── */
.pur-lines td:nth-child(2) { min-width: 180px; }
.pur-lines td:nth-child(3) { width: 130px; }
.pur-lines td:nth-child(4) { width: 96px; }
.pur-lines td:nth-child(5) { width: 150px; }
.pur-lines td:nth-child(7) { width: 120px; }
.pur-lines td.num, .pur-lines .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pur-lines a { text-decoration: none; }
.pur-sum-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; min-height: 30px; }
.pur-sum-row b { font-variant-numeric: tabular-nums; }
.pur-sum-row.total { border-top: 1px dashed var(--border-strong); padding-top: 10px; margin-top: 4px; font-weight: 700; }
.big-total { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--primary); }
.pur-sum .input.num { text-align: left; }
.att-list { display: flex; flex-direction: column; gap: 6px; }
.att { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; }
.att-open { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: 0; flex: 1; text-align: right; }
@media (max-width: 760px) {
  .pur-lines tr { grid-template-columns: 1fr 1fr; }
  .pur-lines td:nth-child(2) { grid-column: 1 / -1; min-width: 0; }
  .pur-lines td:nth-child(3), .pur-lines td:nth-child(4) { grid-column: auto; width: auto; }
  .pur-lines td:nth-child(5) { grid-column: 1 / -1; width: auto; }
  .pur-lines td:nth-child(6), .pur-lines td:nth-child(8) { padding-top: 0 !important; }
  .pur-lines td:nth-child(6)::before { content: 'مبلغ: '; color: var(--text-3); font-size: 12px; }
  .pur-lines td:nth-child(8)::before { content: 'خالص: '; color: var(--text-3); font-size: 12px; font-weight: 400; }
  .pur-lines td:nth-child(7) { grid-column: 1 / -1; width: auto; }
  .pur-lines td:last-child { grid-column: 1 / -1; }
}

/* ── دریافت و پرداخت ── */
.cash-lines td:nth-child(2) { width: 150px; }
.cash-lines td:nth-child(3) { min-width: 200px; }
.cash-lines td:nth-child(4) { width: 160px; }
.cash-lines td:nth-child(5), .cash-lines td:nth-child(6) { width: 130px; }

/* ── مرکز تنظیمات ── */
.cfg { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.cfg-nav { display: flex; flex-direction: column; padding: 6px; gap: 2px; }
.cfg-nav a { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; }
.cfg-nav a svg { flex: none; margin-top: 2px; }
.cfg-nav a:hover { background: var(--surface-3); color: var(--text); }
.cfg-nav a.on { background: var(--primary-soft); color: var(--primary); }
.cfg-nav a.on b { color: var(--primary); }
@media (max-width: 760px) {
  .cfg { grid-template-columns: minmax(0, 1fr); }
  .cfg-nav { flex-direction: row; overflow-x: auto; }
  .cfg-nav a { flex: 0 0 auto; align-items: center; }
  .cfg-nav .small { display: none; }
  .cash-lines td:nth-child(2), .cash-lines td:nth-child(4), .cash-lines td:nth-child(5), .cash-lines td:nth-child(6) { width: auto; }
  .cash-lines td:nth-child(3) { grid-column: 1 / -1; min-width: 0; }
  .cash-lines td:last-child { grid-column: 1 / -1; }
}

/* ── چک: خط زمانی رویدادها و دکمه چک در ردیف ── */
.tl { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; position: relative; }
.tl-item + .tl-item { border-top: 1px dashed var(--border); }
.tl-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.tl-item.off { opacity: .55; }
.tl-item.off .tl-dot { background: var(--danger-soft); color: var(--danger-strong); }
.tl-item.off b { text-decoration: line-through; }
.cheque-btn { max-width: 100%; justify-content: flex-start; text-align: start; white-space: normal; }
.cheque-btn.warn { border-color: var(--accent); color: var(--accent); }
table.t tbody tr.on td { background: var(--primary-soft); }

/* ── گزارش‌ها ── */
.rpt-group { font-size: 14px; margin: 18px 2px 10px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.rpt-tile { justify-content: space-between; }
.rpt-star { font-size: 18px; color: var(--text-3); }
.rpt-star.on { color: var(--accent); }
.rpt-filters { gap: 8px; align-items: center; }
.rpt-meter { display: inline-block; width: 70px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; vertical-align: middle; }
.rpt-meter i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
table.t tr.rpt-total td { background: var(--primary-soft); }
table.rpt-pl td:first-child { white-space: nowrap; }
.rpt-chart { width: 100%; height: auto; display: block; direction: ltr; }
.rpt-chart .grid { stroke: var(--border); stroke-width: 1; }
.rpt-chart .zero { stroke: var(--danger-strong); stroke-width: 1; stroke-dasharray: 4 4; }
.rpt-chart .line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; }
.rpt-chart .pt circle { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }
.rpt-chart .pt circle.hit { fill: transparent; stroke: none; }
.rpt-chart .pt.neg circle:not(.hit) { fill: var(--danger-strong); }
.rpt-chart .pt:hover circle:not(.hit) { r: 6; }
.rpt-chart text { font-size: 11px; fill: var(--text-3); font-family: inherit; }
.rpt-chart .lbl { fill: var(--danger-strong); font-weight: 700; }
.rpt-print-head { gap: 2px; margin-bottom: 10px; }
@media print { .rpt-meter i { background: #555 !important; } }
@media (max-width: 760px) {
  .grid.k4.rpt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .rpt-kpis .kpi { padding: 10px 12px; }
  .rpt-kpis .kpi .value { font-size: 16px; }
  .rpt-filters > * { flex: 1 1 140px; }
}

/* ── بستن دوره ── */
.cls-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.cls-month { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none !important; color: inherit; background: var(--surface); transition: border-color .12s, box-shadow .12s; border-inline-start: 4px solid var(--ok); }
.cls-month:hover { border-color: var(--primary-2); box-shadow: var(--shadow); }
.cls-month.closed { border-inline-start-color: var(--accent); }
.cls-month.locked { border-inline-start-color: var(--danger-strong); background: var(--surface-2); }
.cls-month.next { box-shadow: 0 0 0 2px var(--primary-soft); border-color: var(--primary); }
.cls-list { display: flex; flex-direction: column; gap: 6px; }
.cls-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); }
.cls-item.block { background: var(--danger-soft); }
.cls-item.warn { background: var(--accent-soft); }
.cls-item .ttl { font-weight: 600; }
.cls-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface); }
.cls-item.block .cls-mark { color: var(--danger-strong); }
.cls-item.warn .cls-mark { color: var(--accent); }
.cls-task { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.cls-task:hover { background: var(--surface-2); }
.cls-task input { margin-top: 4px; }
.cls-task .ttl { font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cls-task.done .ttl { color: var(--text-3); }
.cls-step { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-strong); font-weight: 800; font-size: 12px; flex: none; color: var(--text-3); }
.cls-step.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.cls-step.bad { border-color: var(--danger-strong); color: var(--danger-strong); }
.cls-legal .card-head { flex-wrap: wrap; }
.cls-legal.virtual { border-style: dashed; }
@media print { .cls-legal { break-inside: avoid; border: 1px solid #999; margin-bottom: 8px; } .cls-legal.virtual { border-style: dashed; } }
@media (max-width: 760px) { .cls-months { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .cls-month { padding: 10px; } }

/* ── گردش کار و تأیید ── */
.wf-bell { position: relative; }
.wf-bell .dot { position: absolute; top: 1px; inset-inline-end: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center; }
.wf-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.wf-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wf-head input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--primary); }
.wf-sum { color: var(--text-2); }
.wf-needs { margin: 0; padding-inline-start: 18px; color: var(--text-2); }
.wf-meta { gap: 14px; }
.wf-meta span { display: inline-flex; align-items: center; gap: 4px; }
.wf-meta .ic, .wf-meta svg { width: 14px; height: 14px; }
.wf-actions { border-top: 1px solid var(--border); padding-top: 10px; }
.wf-cut { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-tl { list-style: none; margin: 0; padding: 0; position: relative; }
.wf-tl li { position: relative; padding: 0 22px 14px 0; }
.wf-tl li::before { content: ''; position: absolute; right: 4px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.wf-tl li::after { content: ''; position: absolute; right: 8px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.wf-tl li:last-child::after { display: none; }
.wf-tl li.done::before { background: var(--ok, #15803d); }
.wf-tl li.bad::before { background: var(--danger); }
.wf-tl li.cur::before { background: var(--info); box-shadow: 0 0 0 4px var(--info-soft); }
.wf-banners { margin-bottom: 16px; gap: 8px; }
.wf-banner { align-items: flex-start; }
.wf-banner .row { flex-shrink: 0; }
.wf-rule { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 12px;
  border-radius: 9px; background: var(--surface-2); }
.wf-rule.on { background: var(--primary-soft); }
.wf-rule-name { align-items: flex-start; flex: 1 1 320px; }
.wf-rule-name input { margin-top: 3px; }
.wf-rule-ctl { gap: 8px; }
.wf-rule-ctl .input { height: 34px; }
.wf-rule-ctl input[name=threshold] { width: 170px; }
.wf-rule-ctl input[name=pct] { width: 70px; }
.wf-rule-ctl select { width: auto; }
@media (max-width: 640px) {
  .wf-banner { flex-wrap: wrap; }
  .wf-rule-ctl { width: 100%; }
  .wf-cut { max-width: 160px; }
}

/* ── دسترسی‌ها و ورود دومرحله‌ای ── */
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.input.otp { font-size: 24px; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; height: 52px; }
.mfa-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.mfa-qr-wrap { display: flex; justify-content: center; }
.mfa-qr { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--border); image-rendering: pixelated; }
.mfa-key { font-size: 16px; letter-spacing: 1px; word-break: break-all; }
.mfa-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.mfa-codes code { font-size: 15px; padding: 8px; text-align: center; border-radius: 8px; background: var(--surface-3); user-select: all; letter-spacing: 1px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.role-check { align-items: flex-start; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.role-check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.role-check input { margin-top: 3px; }
.scope-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.scope-part { border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: grid; gap: 8px; align-content: start; }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.perm-group { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.perm-head { padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--border); width: 100%; }
.perm-list { display: grid; gap: 8px; }
.perm-row { align-items: flex-start; }
.perm-row input { margin-top: 3px; }
.wf-steps .input { width: auto; min-width: 150px; }
@media (max-width: 560px) {
  .mfa-qr { width: 180px; height: 180px; }
  .perm-groups { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .mfa-codes code { background: none; border: 1px solid #999; }
}

/* ── اجرای موازی با محک ── */
.par-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; margin-bottom: 16px; }
.par-hero { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.par-hero::before { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 5px; background: var(--info); }
.par-hero.ok::before { background: var(--ok); }
.par-hero.ready::before { background: var(--primary); }
.par-hero.warn::before { background: var(--accent); }
.par-hero-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--info-soft); color: var(--info); }
.par-hero.ok .par-hero-icon { background: var(--ok-soft); color: var(--ok); }
.par-hero.ready .par-hero-icon { background: var(--primary-soft); color: var(--primary); }
.par-hero.warn .par-hero-icon { background: var(--accent-soft); color: var(--accent); }
.par-hero-icon svg.i { width: 26px; height: 26px; }
.par-hero-title { font-size: 16.5px; font-weight: 800; margin-bottom: 3px; }
.par-ready { display: flex; gap: 14px; align-items: center; padding: 14px 18px; }
.par-ready.done { background: linear-gradient(135deg, var(--ok-soft), var(--surface) 70%); border-color: var(--ok); }
.par-ring-wrap { position: relative; width: 84px; height: 84px; flex: none; }
.par-ring { width: 84px; height: 84px; }
.par-ring circle { fill: none; stroke-width: 8; }
.par-ring .bg { stroke: var(--surface-3); }
.par-ring .fg { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.par-ready.done .par-ring .fg { stroke: var(--ok); }
.par-ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.par-ring-label b { font-size: 22px; }
.par-ring-label span { font-size: 11px; color: var(--text-3); }
.par-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.par-kind { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-top: 3px solid var(--border-strong); transition: box-shadow .15s, transform .15s; }
.par-kind:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.par-kind.s-ok { border-top-color: var(--ok); }
.par-kind.s-diff { border-top-color: var(--danger); }
.par-kind-head { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none !important; }
.par-kind-head .ttl { font-weight: 800; font-size: 15px; }
.par-figs { display: flex; gap: 8px; }
.par-figs > div { flex: 1; background: var(--surface-2); border-radius: 9px; padding: 8px 10px; min-width: 0; }
.par-figs span { display: block; font-size: 11.5px; color: var(--text-3); }
.par-figs b { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.par-bar { height: 6px; border-radius: 3px; background: var(--danger-soft); overflow: hidden; }
.par-bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; transition: width .4s ease; }
.par-src { min-height: 2.6em; }
.par-kind-foot { display: flex; gap: 6px; justify-content: space-between; margin-top: auto; }
.par-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.par-diff { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.par-diff.up { color: var(--debit); }
.par-diff.down { color: var(--danger-strong); }
table.t tr.par-row.s-ok td { color: var(--text-2); }
table.t tr.par-row.s-diff td:first-child, table.t tr.par-row.s-unmapped td:first-child, table.t tr.par-row.s-erp_only td:first-child { box-shadow: inset -3px 0 0 var(--danger); }
table.t tr.par-row.s-accepted td:first-child { box-shadow: inset -3px 0 0 var(--info); }
table.t tr.sel td { background: var(--primary-soft); }
.par-reason { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.par-kpi-bad .value { color: var(--danger-strong); }
.par-kpi-ok .value { color: var(--ok); }
.modal.par-modal { width: min(980px, 100%); }
.par-drop { border: 2px dashed var(--border-strong); border-radius: 14px; padding: 22px; display: grid; justify-items: center; gap: 8px; text-align: center; background: var(--surface-2); transition: border-color .15s, background .15s; }
.par-drop.over { border-color: var(--primary); background: var(--primary-soft); }
.par-drop > svg.i { width: 30px; height: 30px; color: var(--primary); }
.par-drop .ttl { font-weight: 700; }
.par-drop.compact { padding: 10px; grid-template-columns: auto 1fr auto; justify-items: start; text-align: start; }
.par-drop.compact > svg.i { width: 20px; height: 20px; }
.par-drop.compact .small { display: none; }
.par-paste { font-family: inherit; resize: vertical; min-height: 64px; }
.par-preview { max-height: 260px; border: 1px solid var(--border); border-radius: 10px; }
.par-preview th, .par-preview td { white-space: nowrap; font-size: 12.5px; }
.par-preview th.on, .par-preview td.on { background: var(--primary-soft); }
@media (max-width: 860px) {
  .par-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .par-kinds { grid-template-columns: minmax(0, 1fr); }
  .par-hero { flex-wrap: wrap; padding: 14px; }
  .par-hero .btn { width: 100%; }
  .par-drop.compact { grid-template-columns: auto 1fr; }
}

/* ── جابه‌جایی بین برنامه‌ها ── */
.apps-pop { position: fixed; z-index: 95; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-lg);
  padding: 10px; animation: apps-in .14s ease-out; }
@keyframes apps-in { from { opacity: 0; transform: translateY(-4px); } }
.apps-pop-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800; color: var(--text-3); padding: 4px 6px 10px; }
.apps-pop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.apps-tile { display: grid; gap: 3px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  text-decoration: none !important; transition: border-color .12s, transform .12s; min-width: 0; }
.apps-tile:hover { border-color: var(--primary); transform: translateY(-1px); }
.apps-tile.on { border-color: var(--primary); background: var(--primary-soft); }
.apps-tile b { font-size: 13.5px; }
.apps-tile > span:last-child { font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.apps-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; margin-bottom: 4px;
  background: linear-gradient(135deg, #14b8a6, #0f766e); }
.apps-ic .i { width: 18px; height: 18px; }
.apps-desk { background: linear-gradient(135deg, #f59e0b, #b45309); }
.apps-pos { background: linear-gradient(135deg, #6366f1, #4338ca); }
.apps-buy { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.apps-superapp { background: linear-gradient(135deg, #ec4899, #9d174d); }

/* ── میز مدیر ── */
.desk-hero { display: flex; gap: 18px; align-items: stretch; justify-content: space-between; flex-wrap: wrap; border-radius: 20px; padding: 22px 24px; margin-bottom: 16px;
  color: #fff; position: relative; overflow: hidden; background: radial-gradient(120% 160% at 100% 0%, #14b8a6 0%, #0f766e 42%, #0b3f3b 100%);
  box-shadow: 0 16px 44px rgba(15, 118, 110, .26); }
.desk-hero::before { content: ''; position: absolute; inset-inline-end: -70px; bottom: -110px; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 180, 92, .28), transparent 70%); }
.desk-hero > * { position: relative; z-index: 1; }
.desk-hero-main { min-width: 0; flex: 1 1 320px; }
.desk-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .2px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); color: #fdf3e5; }
.desk-eyebrow .i { width: 14px; height: 14px; }
.desk-hero h1 { margin: 10px 0 4px; font-size: 24px; }
.desk-hero .sub { opacity: .85; font-size: 13.5px; }
.desk-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.desk-link { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); color: #fff !important; text-decoration: none !important; }
.desk-link:hover { background: rgba(255, 255, 255, .2); }
.desk-link .i { width: 15px; height: 15px; }
.desk-hero-fig { display: grid; align-content: center; gap: 4px; min-width: 240px; padding: 14px 18px; border-radius: 16px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(4px); }
.desk-hero-fig > span:first-child { font-size: 12.5px; opacity: .85; }
.desk-hero-fig b { font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; color: #fde9c4; line-height: 1.25; }
.desk-hero-fig b small { font-size: 13px; font-weight: 600; color: #fff; opacity: .8; }
.desk-hero-fig .small { opacity: .85; }
.desk-delta { font-size: 12.5px; font-weight: 800; }
.desk-delta.up { color: #a7f3d0; }
.desk-delta.down { color: #fecaca; }
.desk-delta.flat { color: #e2e8f0; opacity: .85; font-weight: 600; }
.desk-kpis { margin-bottom: 16px; }
.desk-kpi { text-decoration: none !important; color: inherit; transition: border-color .12s, transform .12s; }
.desk-kpi:hover { border-color: var(--primary); transform: translateY(-1px); }
.desk-kpi.neg .value { color: var(--danger-strong); }
.desk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.desk-card { min-width: 0; }
.desk-unit { display: grid; gap: 6px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.desk-unit:last-child { border-bottom: 0; padding-bottom: 0; }
.desk-unit .num { font-weight: 800; font-variant-numeric: tabular-nums; }
.desk-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.desk-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary-2), var(--primary)); }
.desk-chart-wrap { position: relative; }
.desk-chart { width: 100%; height: auto; display: block; overflow: visible; }
.desk-chart .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.desk-chart .base { stroke: var(--border-strong); stroke-width: 1; }
.desk-chart .bar path { fill: var(--primary-2); opacity: .78; transition: opacity .12s; }
.desk-chart .bar.today path { fill: #c8962e; opacity: 1; }
.desk-chart .bar:hover path { opacity: 1; }
.desk-chart .hit { fill: transparent; cursor: pointer; }
.desk-chart text { font-family: inherit; text-anchor: middle; fill: var(--text-3); font-size: 11px; }
.desk-chart text.small { font-size: 9.5px; }
.desk-chart text.strong { fill: var(--text); font-weight: 800; }
.desk-chart text.val { fill: var(--text-2); font-size: 10.5px; font-weight: 700; }
.desk-tip { position: absolute; width: 150px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg); font-size: 12px; pointer-events: none; display: grid; gap: 2px; z-index: 5; }
.desk-req { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.desk-req b { display: block; font-size: 13.5px; }
.desk-req-sum { color: var(--text-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.desk-ok { display: flex; gap: 8px; align-items: center; color: var(--ok); font-weight: 700; padding: 8px 0; }
.desk-health { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); color: inherit; text-decoration: none !important; }
a.desk-health:hover { border-color: var(--primary); }
.desk-health .mk { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.desk-health .mk .i { width: 16px; height: 16px; }
.desk-health.ok .mk { background: var(--ok-soft); color: var(--ok); }
.desk-health.bad .mk { background: var(--danger-soft); color: var(--danger-strong); }
.desk-health.warn .mk { background: var(--accent-soft); color: var(--accent); }
.desk-health b { font-size: 13.5px; }
.desk-ring { width: 30px; height: 30px; flex-shrink: 0; }
.desk-ring .bg { fill: none; stroke: var(--surface-3); stroke-width: 5; }
.desk-ring .fg { fill: none; stroke: var(--primary-2); stroke-width: 5; stroke-linecap: round; }
.desk-health.ok .desk-ring .fg { stroke: var(--ok); }
.desk-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px; }
:root[data-theme='dark'] .desk-hero { background: radial-gradient(120% 160% at 100% 0%, #0f766e 0%, #0b4f4a 45%, #072a27 100%); }
@media (max-width: 900px) {
  .desk-grid { grid-template-columns: minmax(0, 1fr); }
  .desk-hero { padding: 18px; border-radius: 16px; }
  .desk-hero h1 { font-size: 20px; }
  .desk-hero-fig { min-width: 0; flex: 1 1 100%; }
  .desk-hero-fig b { font-size: 26px; }
  .grid.k4.desk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .desk-kpis .kpi { padding: 10px 12px; }
  .desk-kpis .kpi .value { font-size: 16px; }
  .desk-kpis .kpi .hint { font-size: 11px; }
  .desk-req { flex-wrap: wrap; }
}
.desk-kpi.warn .hint { color: var(--accent); }
.desk-chart text, .desk-chart path, .desk-chart line { pointer-events: none; }
.desk-chart .hit { pointer-events: all; }

/* ── قیمت‌گذاری و طرح‌های تشویقی ── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-2 > .card { margin-bottom: 0; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 18px; }
.kv-grid > div { display: grid; gap: 4px; align-content: start; }
.kv-grid > div > span:first-child { color: var(--text-3); font-size: 12px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; display: grid; gap: 6px; align-content: start; }
.stat > span { color: var(--text-3); font-size: 12.5px; }
.stat > b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; }
.chip.old { background: var(--accent-soft); border-color: transparent; }
.chip b { font-variant-numeric: tabular-nums; }
.icon-btn { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--text-3); display: inline-grid; place-items: center; border-radius: 6px; }
.icon-btn:hover { background: var(--surface-3); color: var(--danger-strong); }
.icon-btn .i { width: 14px; height: 14px; }
.promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.promo-card { display: grid; gap: 10px; padding: 16px; margin: 0; text-decoration: none !important; color: inherit; border-top: 4px solid var(--primary-2); transition: transform .12s, box-shadow .12s; }
.promo-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.promo-card.k-tiered { border-top-color: #7c3aed; }
.promo-card.k-gift { border-top-color: #db2777; }
.promo-card.k-basket { border-top-color: #c8962e; }
.promo-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.promo-ic .i { width: 19px; height: 19px; }
.promo-card.k-tiered .promo-ic { background: #ede9fe; color: #6d28d9; }
.promo-card.k-gift .promo-ic { background: #fce7f3; color: #be185d; }
.promo-card.k-basket .promo-ic { background: var(--accent-soft); color: var(--accent); }
.promo-rule { font-weight: 800; font-size: 15px; color: var(--primary); line-height: 1.6; }
.promo-rule.big { font-size: 20px; }
.promo-stats { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); border-top: 1px dashed var(--border); padding-top: 8px; }
.promo-stats b { font-variant-numeric: tabular-nums; }
.promo-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.promo-kind { display: grid; gap: 4px; justify-items: start; text-align: start; padding: 14px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; font: inherit; color: inherit; transition: border-color .12s, box-shadow .12s; }
.promo-kind .i { width: 22px; height: 22px; color: var(--primary); }
.promo-kind:hover:not(:disabled) { border-color: var(--primary-2); }
.promo-kind.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-soft); }
.promo-kind:disabled:not(.on) { opacity: .45; cursor: default; }
:root[data-theme='dark'] .promo-card.k-tiered .promo-ic { background: rgba(124, 58, 237, .18); color: #c4b5fd; }
:root[data-theme='dark'] .promo-card.k-gift .promo-ic { background: rgba(219, 39, 119, .18); color: #f9a8d4; }
/* برچسب قیمت قفسه */
.label-sheet { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.label-sheet:empty { display: none; }
.shelf-label { border: 1px dashed #9aa5a5; border-radius: 8px; padding: 8px 10px; display: grid; gap: 4px; background: #fff; color: #000;
  break-inside: avoid; min-height: 34mm; align-content: space-between; }
.sl-name { font-weight: 800; font-size: 13px; line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sl-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.sl-price b { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.sl-price s { color: #888; font-size: 13px; }
.sl-price span { font-size: 11px; color: #555; }
.sl-price .sl-off { margin-inline-start: auto; background: #b3261e; color: #fff; border-radius: 4px; padding: 0 5px; font-weight: 800; font-size: 11px; }
.sl-foot { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: #555; gap: 6px; }
.sl-promo { background: #c8962e; color: #fff; border-radius: 4px; padding: 0 6px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.shelf-label.promo { border: 2px solid #c8962e; }
.sl-bc svg { max-width: 100%; height: 34px; display: block; margin: 0 auto; }
.sl-code { font-family: monospace; font-size: 11px; text-align: center; color: #333; }
.label-sheet.sz-a4_14 .sl-price b { font-size: 34px; }
.label-sheet.sz-a4_14 .shelf-label { min-height: 52mm; }
.label-sheet.sz-a4_40 .sl-price b { font-size: 18px; }
.label-sheet.sz-a4_40 .shelf-label { min-height: 25mm; padding: 5px 6px; }
.label-sheet.sz-a4_40 .sl-name { font-size: 11px; }
/* خواستهٔ ۱ آبان: برچسب وسط‌چین (نام ← مصرف‌کننده ← فروش با درصد کوچک ← بارکد)؛ ۱۶تایی ۴ × ۴ */
.shelf-label { text-align: center; justify-items: center; }
.shelf-label .sl-name { width: 100%; }
.sl-cons { font-size: 12px; color: #666; }
.sl-cons s { font-variant-numeric: tabular-nums; }
.shelf-label .sl-price { justify-content: center; }
.shelf-label .sl-price .sl-off { margin-inline-start: 4px; font-size: 10px; padding: 0 4px; }
.shelf-label .sl-foot { width: 100%; }
.label-sheet.sz-a4_16 .shelf-label { min-height: 62mm; padding: 8px 6px; }
.label-sheet.sz-a4_16 .sl-name { font-size: 14px; }
.label-sheet.sz-a4_16 .sl-price b { font-size: 26px; }
.label-sheet.sz-a4_16 .sl-bc svg { height: 40px; }
@media print {
  body:has(.label-sheet:not(:empty)) .page-head { display: none !important; }
  .label-sheet.sz-a4_16 .shelf-label { height: 68mm; min-height: 0; padding: 6px 4px; }
  .label-sheet.sz-a4_16 .sl-price { flex-wrap: nowrap; gap: 3px; }
  .label-sheet.sz-a4_16 .sl-price b { font-size: 20px; letter-spacing: -.5px; }
  .label-sheet.sz-a4_16 .sl-price .sl-off { font-size: 9px; }
  .label-sheet.sz-a4_16 .sl-name { font-size: 13px; }
  .label-sheet { gap: 0; margin-top: 0; }
  .shelf-label { border: 1px solid #bbb; border-radius: 0; }
  .shelf-label.promo { border: 2px solid #000; }
  .sl-promo { background: #000 !important; }
}
/* دکمه‌های گزینه‌ای که در کارت باریک به چند سطر می‌روند (بدون شکستن متن دکمه) */
.seg.seg-wrap { display: flex; flex-wrap: wrap; gap: 6px; border: 0; overflow: visible; border-radius: 0; }
.seg.seg-wrap button { flex: 1 1 auto; white-space: nowrap; border: 1px solid var(--border-strong); border-radius: 8px; }
.seg.seg-wrap button + button { border-inline-start: 1px solid var(--border-strong); }
.seg.seg-wrap button.on { border-color: var(--primary); }
/* کالای بسته‌ای/عددی */
.pack-wh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.pk-sealed { color: var(--primary); font-weight: 700; }
.pk-loose { color: var(--accent); font-weight: 700; }
.pack-wh > .grow { flex: 1 1 200px; }
/* تبدیل و برش (قصابی) */
.conv-top { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(280px, 1.2fr); gap: 16px; margin-bottom: 16px; }
.conv-top > .card { margin: 0; }
.conv-in { display: grid; gap: 6px; font-weight: 700; }
.input.big-num { font-size: 20px; font-weight: 800; height: 46px; max-width: 160px; text-align: center; font-variant-numeric: tabular-nums; }
.conv-bal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.conv-bal .stat small { font-size: 12px; }
.conv-loss.ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.conv-loss.warn { border-color: var(--accent); background: var(--accent-soft); }
.conv-loss.bad { border-color: var(--danger); background: var(--danger-soft); }
.conv-loss.bad > b { color: var(--danger-strong); }
.conv-meter { position: relative; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: visible; }
.conv-meter > i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 99px; background: var(--ok); }
.conv-loss.warn .conv-meter > i { background: var(--accent); }
.conv-loss.bad .conv-meter > i { background: var(--danger); }
.conv-meter > em { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-2); }
.conv-table td { vertical-align: middle; }
.conv-table td.warn { color: var(--accent); font-weight: 700; }
.conv-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.conv-tpls > .card { margin: 0; }
.conv-tpl.off { opacity: .65; }
.conv-parts { display: flex; flex-wrap: wrap; gap: 6px; }
.conv-tl { padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); flex-wrap: wrap; }
@media (max-width: 760px) {
  .conv-top { grid-template-columns: 1fr; }
  .conv-bal { grid-template-columns: 1fr 1fr; }
  .conv-bal > .conv-loss { grid-column: 1 / -1; }
  .input.big-num { max-width: 120px; font-size: 18px; }
}
.conv-table th.num, .conv-table td.num { width: 104px; white-space: nowrap; }
.conv-meter:empty, .conv-loss.idle .conv-meter > i { background: transparent; }
@media (max-width: 760px) {
  .conv-table thead { display: none; }
  .conv-table, .conv-table tbody { display: block; width: 100%; }
  .conv-table tr { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .conv-table td { display: block; padding: 0; border: 0; width: auto !important; }
  .conv-table td:first-child { grid-column: 1 / -1; }
  .conv-table td:nth-child(2) { grid-column: 1 / 2; }
  .conv-table td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--text-3); font-weight: 400; }
}
/* کافی‌شاپ: دستور ساخت */
.rcp-line { padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); flex-wrap: wrap; }
.rcp-sum { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--primary-soft); }
/* هزینه و بودجه */
.grid.exp-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.grid.exp-two > .card { margin: 0; }
.exp-meter { display: inline-block; width: 80px; height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; vertical-align: middle; }
.exp-meter i { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.exp-meter.over i { background: var(--danger); }
.exp-bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 18px; }
.exp-bar { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; position: relative; }
.exp-bar i { display: block; width: 100%; max-width: 46px; min-height: 2px; background: var(--primary-soft); border: 1px solid var(--primary); border-radius: 6px 6px 2px 2px; }
.exp-bar.on i { background: var(--primary); }
.exp-bar .v { font-size: 11px; color: var(--text-2); margin-bottom: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.exp-bar .l { font-size: 11.5px; color: var(--text-3); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.exp-hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.exp-hbar .b { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.exp-hbar .b i { display: block; height: 100%; background: var(--primary); border-radius: 5px; }
.exp-hbar.neg .b i { background: var(--danger); }
.exp-hbar .v { font-variant-numeric: tabular-nums; min-width: 110px; text-align: left; }
.exp-rec { gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.exp-lines td.exp-acc { min-width: 230px; }
.exp-lines td { vertical-align: middle; }
.exp-acc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; max-height: 240px; overflow: auto; }
.exp-grid { max-height: 70vh; }
.exp-grid table { min-width: 1500px; }
.exp-grid th, .exp-grid td { padding: 6px 6px; }
.exp-grid .exp-sticky { position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; min-width: 190px; box-shadow: -1px 0 0 var(--border) inset; }
.exp-grid thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; }
.exp-grid thead th.exp-sticky { z-index: 3; }
.exp-grid .input.exp-cell { width: 96px; height: 30px; padding: 0 6px; font-size: 12.5px; }
.exp-grid tr.exp-inc .exp-sticky { background: var(--ok-soft); }
.exp-grid tfoot td { background: var(--surface-2); border-top: 2px solid var(--border-strong); }
.exp-pl-table tr.exp-pl td { border-top: 1px solid var(--border); }
.exp-pl-table tr.exp-pl.strong td { background: var(--surface-2); }
.exp-pl-table tr.exp-pl.net td { background: var(--primary-soft); font-size: 14px; }
.exp-pl-table tr.exp-sub td { background: var(--surface); padding-top: 3px; padding-bottom: 3px; }
.exp-pl-table tr.exp-sub td:first-child { padding-inline-start: 28px; }
.exp-caret { display: inline-block; width: 16px; color: var(--text-3); }
@media (max-width: 760px) {
  .grid.k4.exp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .grid.exp-two { grid-template-columns: 1fr; }
  .exp-bars { gap: 5px; height: 150px; }
  .exp-bar .v { font-size: 9.5px; }
  .exp-hbar { grid-template-columns: 80px 1fr; }
  .exp-hbar .v { grid-column: 1 / -1; text-align: right; min-width: 0; font-size: 12px; }
  .exp-lines td.exp-acc { min-width: 200px; }
}

/* ── تطبیق بانکی (bnk) ── */
.bnk-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.bnk-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, background .15s; }
.bnk-chip:hover { border-color: var(--border-strong); }
.bnk-chip.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary) inset; }
.bnk-chip.off { opacity: .6; }
.bnk-chip > svg.i { color: var(--primary); }
.bnk-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
@media (max-width: 1100px) { .bnk-two { grid-template-columns: minmax(0, 1fr); } }
.bnk-two .table-wrap { max-height: 62vh; overflow: auto; }
.bnk-two thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
.bnk-amt { font-variant-numeric: tabular-nums; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.bnk-amt.in { color: var(--ok); }
.bnk-amt.out { color: var(--danger); }
.bnk-desc { max-width: 340px; overflow-wrap: anywhere; font-size: 12.5px; line-height: 1.6; }
table.t tr.sel td { background: var(--primary-soft); }
table.t tr.bnk-hint td { background: var(--accent-soft); }
.bnk-bar { position: sticky; bottom: 0; z-index: 5; display: none; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--primary); border-radius: 14px; background: var(--surface); box-shadow: 0 -6px 20px rgba(0, 0, 0, .12); }
.bnk-bar.show { display: flex; }
.bnk-matches > summary { cursor: pointer; list-style: none; }
.bnk-matches > summary::-webkit-details-marker { display: none; }
.bnk-recon table.t td { padding: 9px 12px; }
.bnk-recon tr.strong td { background: var(--surface-2); font-size: 14px; border-top: 2px solid var(--border-strong); }
.bnk-raw { white-space: pre-wrap; background: var(--surface-2); padding: 6px 8px; border-radius: 8px; margin: 4px 0; }
@media print { .no-print, .bnk-chips, .tabs { display: none !important; } }
.bnk-ok { color: var(--ok); }
.bnk-bad { color: var(--danger-strong); }
.bnk-warn { color: var(--accent); }
.kpi .value.ok { color: var(--ok); }
.kpi .value.warn { color: var(--accent); }
.kpi .value.bad { color: var(--danger-strong); }

/* ── ویزیتوری و پورسانت (vis) ── */
.vis-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.vis-num.neg { color: var(--danger-strong); }
.vis-ok { color: var(--ok); }
.vis-meter { display: inline-block; width: 110px; height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; vertical-align: middle; }
.vis-meter i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.vis-meter.ok i { background: var(--ok); }
.vis-bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 18px; }
.vis-bar { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.vis-bar i { display: block; width: 100%; max-width: 46px; min-height: 2px; background: var(--primary-soft); border: 1px solid var(--primary); border-radius: 6px 6px 2px 2px; }
.vis-bar.on i { background: var(--primary); }
.vis-bar .v { font-size: 11px; color: var(--text-2); margin-bottom: 3px; white-space: nowrap; }
.vis-bar .l { font-size: 11.5px; color: var(--text-3); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.vis-bulk { gap: 8px; align-items: center; padding: 10px 12px; margin-bottom: 10px; position: sticky; top: 0; z-index: 3; }
.vis-plan.off { opacity: .65; }
.vis-example { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.vis-total { text-align: left; font-size: 15px; padding: 6px 4px; }
.vis-grid { max-height: 70vh; }
.vis-grid table { min-width: 1450px; }
.vis-grid th, .vis-grid td { padding: 6px; vertical-align: top; }
.vis-grid .vis-sticky { position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; min-width: 150px; box-shadow: -1px 0 0 var(--border) inset; }
.vis-grid thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; }
.vis-grid thead th.vis-sticky { z-index: 3; }
.vis-grid .input.vis-cell { width: 100px; height: 30px; padding: 0 6px; font-size: 12.5px; }
.vis-me { max-width: 760px; margin: 0 auto; }
.vis-hero { padding: 16px; display: grid; gap: 14px; justify-items: stretch; }
.vis-hero h1 { margin: 0; font-size: 20px; }
.vis-ring { --p: 0; width: 150px; height: 150px; border-radius: 50%; justify-self: center; display: grid; place-items: center;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-3) 0); }
.vis-ring > div { width: 118px; height: 118px; border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; gap: 2px; }
.vis-ring b { font-size: 24px; }
.vis-me-k { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vis-me-k .kpi .value { font-size: 18px; }
.vis-cust { display: grid; }
.vis-cust-row { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); }
.vis-cust-row .num { text-align: left; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .vis-me-k { grid-template-columns: minmax(0, 1fr); } }
.vis-ring.done { background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--surface-3) 0); }

/* ═════ نمودارها (charts.js) و گزارش‌ساز/داشبورد (bi) — گام ۲۹ ═════ */
:root { --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; }
:root[data-theme='dark'] { --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; }
.ch-nums { display: grid; gap: 10px; }
.ch-num-l { font-size: 12.5px; color: var(--text-3); }
.ch-num-v { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.3px; line-height: 1.25; }
.ch-num.sub .ch-num-v { font-size: 17px; font-weight: 700; }
.ch-num-d { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ch-num-d span { color: var(--text-3); }
.ch-num-d.good { color: var(--ok); } .ch-num-d.bad { color: var(--danger); } .ch-num-d.flat { color: var(--text-2); }
.ch-bars { display: grid; gap: 4px; }
.ch-bar-row { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: 10px; align-items: center; min-height: 26px; padding: 1px 4px; border-radius: 6px; }
.ch-bar-row:hover { background: var(--surface-2); }
.ch-bar-row.click { cursor: pointer; }
.ch-bar-l { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-bar-t { height: 12px; position: relative; border-inline-start: 1px solid var(--border-strong); }
.ch-bar-t i { display: block; height: 100%; border-start-end-radius: 4px; border-end-end-radius: 4px; }
.ch-bar-t i.neg { background: var(--danger); opacity: .85; }
.ch-bar-v { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: left; min-width: 64px; }
.ch-bar-x { display: block; font-size: 11px; font-weight: 400; color: var(--text-3); }
.ch-line-box { display: grid; gap: 6px; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-2); }
.ch-legend span, .ch-tip div { display: inline-flex; align-items: center; gap: 6px; }
.ch-legend i, .ch-tip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.ch-line-wrap { position: relative; direction: ltr; }
.ch-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ch-grid { stroke: var(--border); stroke-width: 1; }
.ch-zero { stroke: var(--border-strong); stroke-width: 1; }
.ch-ax { fill: var(--text-3); font-size: 11px; font-family: inherit; }
.ch-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot, .ch-mark { stroke: var(--surface); stroke-width: 2; }
.ch-cross { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.ch-tip { position: absolute; top: 4px; pointer-events: none; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 8px;
  padding: 6px 10px; font-size: 12px; direction: rtl; display: grid; gap: 2px; min-width: 120px; z-index: 2; color: var(--text); }
.ch-tip.hidden { display: none; }
.ch-tip b { font-variant-numeric: tabular-nums; }

.bi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; grid-auto-flow: row dense; }
.bi-w { margin: 0; min-width: 0; }
.bi-w.size-s { grid-column: span 1; } .bi-w.size-m { grid-column: span 2; } .bi-w.size-l { grid-column: span 4; }
.bi-w .card-head { padding: 10px 14px; gap: 8px; }
.bi-w .card-head h2 { font-size: 14px; }
.bi-w-body { padding: 12px 14px 14px; min-height: 92px; }
.bi-w.editing { outline: 2px dashed var(--border-strong); outline-offset: 2px; }
.bi-w.editing .bi-w-body { min-height: 60px; }
.bi-w .card-head select.input { height: 30px; padding: 0 6px; font-size: 12.5px; }
.bi-skel { height: 70px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: bi-sk 1.2s linear infinite; }
@keyframes bi-sk { to { background-position: -200% 0; } }
.bi-empty { color: var(--text-3); font-size: 13px; padding: 18px 4px; text-align: center; }
.bi-totals { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.bi-totals b { color: var(--text); font-variant-numeric: tabular-nums; }
.bi-table td.bi-neg { color: var(--danger); }
.bi-table .bi-good { color: var(--ok); } .bi-table .bi-bad { color: var(--danger); } .bi-table .bi-flat { color: var(--text-2); }
.bi-table tfoot td { font-weight: 700; background: var(--surface-2); }
.bi-builder { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 14px; align-items: start; }
.bi-panel { position: sticky; top: calc(var(--topbar) + 10px); margin: 0; }
.bi-preview { margin: 0; min-width: 0; }
.bi-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bi-chip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12.5px; cursor: pointer; }
.bi-chip:hover { border-color: var(--primary); color: var(--text); }
.bi-chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 700; }
:root[data-theme='dark'] .bi-chip.on { color: var(--text); }
.bi-chip:focus-visible { outline: none; box-shadow: var(--focus); }
.bi-filters summary { cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 13px; }
.bi-rep { margin: 0; }
.bi-rep .card-head a { color: inherit; text-decoration: none; }
.bi-rep .card-head a:hover { color: var(--primary); }
@media (max-width: 1100px) { .bi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bi-w.size-l { grid-column: span 2; } .bi-builder { grid-template-columns: minmax(0, 1fr); } .bi-panel { position: static; } }
@media (max-width: 640px) { .bi-grid { grid-template-columns: minmax(0, 1fr); } .bi-w.size-s, .bi-w.size-m, .bi-w.size-l { grid-column: span 1; } .ch-bar-row { grid-template-columns: minmax(70px, 38%) 1fr auto; } .ch-num-v { font-size: 22px; } }
.bi-w-t { min-width: 0; }
.bi-w-t h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bi-w-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bi-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }

/* ═════ حقوق و دستمزد (pay) — گام ۳۰ ═════ */
.pay-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.pay-month { margin: 0; padding: 12px 14px; display: grid; gap: 4px; }
.pay-month.future { opacity: .55; }
.pay-month.st-posted { border-inline-start: 3px solid var(--ok); }
.pay-month.st-draft { border-inline-start: 3px solid var(--accent); }
.pay-month-n { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pay-grid { max-height: 70vh; }
.pay-grid table { min-width: 1100px; }
.pay-grid th, .pay-grid td { padding: 6px; vertical-align: middle; }
.pay-grid .pay-sticky { position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; min-width: 170px; box-shadow: -1px 0 0 var(--border) inset; }
.pay-grid thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; }
.pay-grid thead th.pay-sticky { z-index: 3; }
.pay-grid tfoot td { font-weight: 700; background: var(--surface-2); }
.pay-grid .input.pay-cell { width: 110px; height: 32px; padding: 0 8px; font-size: 13px; }
.pay-grid .input.pay-cell.saving { border-color: var(--primary); box-shadow: var(--focus); }
.pay-slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 14px; }
.pay-slip { margin: 0; padding: 16px; display: grid; gap: 8px; break-inside: avoid; }
.pay-slip-h { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.pay-slip-b { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pay-slip-t { font-weight: 700; font-size: 13px; margin-bottom: 4px; color: var(--text-2); }
.pay-slip-r { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 2px 0; font-variant-numeric: tabular-nums; }
.pay-slip-r > span:first-child { white-space: nowrap; color: var(--text-2); }
.pay-slip-r.tot > span:first-child { color: var(--text); }
.pay-slip-r.tot { border-top: 1px dashed var(--border-strong); margin-top: 4px; padding-top: 4px; font-weight: 700; }
.pay-slip-net { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-size: 15px; }
:root[data-theme='dark'] .pay-slip-net { color: var(--text); }
.pay-me { max-width: 720px; margin: 0 auto; }
.pay-me-row { margin: 0; display: flex; align-items: center; gap: 10px; padding: 14px 16px; width: 100%; font: inherit; color: inherit; cursor: pointer; text-align: start; }
.pay-me-row:hover { border-color: var(--primary); }
@media (max-width: 560px) { .pay-slips { grid-template-columns: minmax(0, 1fr); } .pay-slip-b { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
@media print { .pay-slips { display: block; } .pay-slip { margin-bottom: 12px; box-shadow: none; } }

/* ═════ دارایی ثابت (ast) — گام ۳۱ ═════ */
.ast-info { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 16px; }
.ast-info > div { display: grid; gap: 2px; }
.ast-info span { font-size: 12px; }
.ast-sched { max-height: 420px; overflow: auto; }
.ast-group td { background: var(--surface-2); }

/* ═══════════ پایهٔ پلتفرم سوپر اپ (گام ۳۲) ═══════════ */
.brand .logo { background: var(--primary); color: var(--gold-2, #f2b705); }
:root[data-theme='dark'] .brand .logo { background: var(--gold-2); color: var(--gold-ink); }
.page-head .page-tools { display: flex; gap: 2px; align-items: center; margin-inline-end: -4px; }
.page-tools .help-btn { font-weight: 800; font-size: 16px; }
.notif-bell { position: relative; }
.notif-bell .dot { position: absolute; top: 1px; inset-inline-end: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--gold); color: var(--gold-ink); font-size: 10.5px; font-weight: 800; display: grid; place-items: center; width: auto; }
.notif-bell .dot.urgent { background: var(--danger); color: #fff; }
.bottom-bar { display: none; }
@media (max-width: 760px) {
  .bottom-bar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--border); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(27, 35, 54, .06);
  }
  .bb-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; position: relative;
    color: var(--text-3); font-size: 11.5px; font-weight: 600; text-decoration: none !important; background: none; border: 0; font-family: inherit; cursor: pointer;
  }
  .bb-item .i { width: 22px; height: 22px; }
  .bb-item.on { color: var(--primary); }
  .bb-dot { position: absolute; top: 4px; inset-inline-end: calc(50% - 22px); min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
    background: var(--gold); color: var(--gold-ink); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
  .shell .main { padding-bottom: 84px; }
  .topbar .notif-bell { display: none; }
  /* نوار چسبان پایین صفحه‌ها (مثل تطبیق بانک) بالای نوار پایین می‌نشیند، نه زیرش */
  .bnk-bar { bottom: calc(66px + env(safe-area-inset-bottom)); }
}
/* خانه */
.plt-hello { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.plt-hello h1 { font-size: 21px; margin: 0; font-weight: 800; }
.plt-hand { width: 46px; height: 46px; border-radius: 14px; background: var(--gold-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.plt-hand .i { width: 26px; height: 26px; }
.plt-hello-act { margin-inline-start: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.plt-msg { background: var(--primary); color: #fff; border-radius: 14px; padding: 14px 18px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
:root[data-theme='dark'] .plt-msg { background: #27314a; }
.plt-msg-k { color: var(--gold-2); font-weight: 700; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.plt-msg-k .i { width: 16px; height: 16px; }
.plt-msg p { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.9; }
.plt-msg-by { font-size: 12px; color: #b9c2d6; }
.plt-quote { display: flex; gap: 12px; align-items: center; padding: 12px 16px; margin-bottom: 14px; }
.plt-q-mark { font-size: 40px; line-height: 1; color: var(--gold); font-weight: 800; }
.plt-quote p { margin: 0; font-weight: 600; line-height: 1.8; }
.plt-quote small { color: var(--text-3); }
.plt-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.plt-tile { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; min-height: 128px; text-decoration: none !important; color: inherit;
  transition: border-color .12s, box-shadow .12s, transform .12s; }
.plt-tile:hover { border-color: var(--primary-2); box-shadow: var(--shadow); }
.plt-tile .plt-ti { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.plt-tile .plt-ti .i { width: 22px; height: 22px; }
.plt-tile b { font-size: 15px; }
.plt-tile small { color: var(--text-3); font-size: 12.5px; line-height: 1.6; }
.plt-tile .plt-st { position: absolute; top: 12px; inset-inline-end: 12px; }
.plt-tile.lit { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; background: linear-gradient(180deg, var(--gold-soft), var(--surface) 60%); }
.plt-tile.lit .plt-ti { background: var(--gold); color: var(--gold-ink); }
.badge.plt-new { background: var(--gold); color: var(--gold-ink); }
.plt-seen { width: 26px; height: 26px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
.plt-seen .i { width: 16px; height: 16px; }
.plt-tile.locked { opacity: .62; cursor: default; }
.plt-tile.locked .plt-ti { background: var(--surface-3); color: var(--text-3); }
.plt-h2 { font-size: 15px; font-weight: 800; margin: 6px 0 10px; }
@media (max-width: 1100px) { .plt-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .plt-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .plt-tile { min-height: 112px; padding: 12px; }
  .plt-hello-act { margin-inline-start: 0; width: 100%; }
}
/* اعلان‌ها */
.plt-notifs { padding: 4px 0; }
.plt-n { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none !important; }
.plt-n:last-child { border-bottom: 0; }
.plt-n:hover { background: var(--surface-2); }
.plt-n b { font-weight: 700; }
.plt-n.read b { font-weight: 500; color: var(--text-2); }
.plt-n:not(.read) { background: color-mix(in srgb, var(--gold-soft) 55%, transparent); }
.plt-n-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.plt-n.urgent:not(.read) .plt-n-ic { background: var(--gold); color: var(--gold-ink); }
.plt-n > div { flex: 1; min-width: 0; }
.plt-chk { display: flex; gap: 10px; align-items: flex-start; }
.plt-chk-i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.plt-chk-i.ok { background: var(--ok-soft); color: var(--ok); }
.plt-chk-i.bad { background: var(--danger-soft); color: var(--danger-strong); }
.plt-chk-i.warn { background: var(--accent-soft); color: var(--accent); }
.plt-chk-i .i { width: 15px; height: 15px; }
.plt-tips { margin: 0; padding-inline-start: 18px; line-height: 2; }
/* دستگاه‌ها */
.plt-switch { align-items: flex-start; }
.plt-pending { border-color: var(--gold); }
.plt-dev { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.plt-dev-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--gold-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.plt-roles { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.plt-order { display: flex; flex-direction: column; gap: 4px; }
.plt-order-row { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.plt-order-row.off { opacity: .55; }
.plt-order-n { width: 24px; text-align: center; color: var(--text-3); font-size: 12px; }
@media print { .page-tools, .bottom-bar { display: none !important; } }

/* ── مرکز تنظیمات ← صندوق فروش (گام ۳۳) ── */
.pos-lay-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.pos-lay-opt { display: grid; gap: 6px; justify-items: start; text-align: start; padding: 12px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.pos-lay-opt:hover { border-color: var(--border-strong); }
.pos-lay-opt.on { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.pos-lay-ic { width: 100%; height: 54px; border-radius: 8px; background: var(--surface-3); display: grid; gap: 4px; padding: 6px; box-sizing: border-box; }
.pos-lay-ic i { display: block; border-radius: 3px; background: var(--border-strong); }
.pos-lay-ic.l-compact { grid-template-columns: 2.4fr 1fr; grid-template-rows: 1fr 8px; }
.pos-lay-ic.l-compact i:nth-child(1) { grid-row: 1; }
.pos-lay-ic.l-compact i:nth-child(3) { grid-column: 1 / -1; background: var(--primary); }
.pos-lay-ic.l-mahak { grid-template-rows: 8px 1fr 12px; }
.pos-lay-ic.l-mahak i:nth-child(3) { background: var(--primary); }
.pos-lay-ic.l-erp { grid-template-columns: 1fr 1.6fr; grid-template-rows: 1fr 8px; }
.pos-lay-ic.l-erp i:nth-child(3) { grid-column: 1 / -1; background: var(--primary); }
.pos-qg { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.pos-qg-n { min-width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); font-weight: 800; font-size: 13px; }

/* ── هشدار بزرگ (امنیت فاکتور، گام ۳۴): خودش محو نمی‌شود؛ Enter = «ثبت نکن» ── */
.bigwarn-back { z-index: 2000; background: rgba(15, 20, 35, .62); }
.bigwarn { width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; background: var(--surface); color: var(--text);
  border: 3px solid var(--danger); border-radius: 16px; box-shadow: var(--shadow-lg); }
.bigwarn-head { background: var(--danger); color: #fff; padding: 16px 20px; display: flex; align-items: center; gap: 12px; font-size: 20px; }
.bigwarn-head .ico { width: 28px; height: 28px; }
.bigwarn-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.bigwarn-msg { font-size: 16px; line-height: 1.8; margin: 0; }
.bigwarn-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bigwarn-cmp > div { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); min-width: 0; }
.bigwarn-cmp small { display: block; color: var(--text-3); font-size: 12px; }
.bigwarn-cmp b { font-size: 16px; }
.bigwarn-lines { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.bigwarn-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.bigwarn-acts .btn { flex: 1 1 220px; min-height: 56px; font-size: 16px; justify-content: center; }
.bigwarn-yes .kbd { opacity: .8; }
.bigwarn.shake { animation: bigwarn-shake .35s; }
@keyframes bigwarn-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .bigwarn.shake { animation: none; outline: 4px solid var(--gold); } }
@media (max-width: 560px) { .bigwarn-cmp { grid-template-columns: 1fr; } .bigwarn-head { font-size: 17px; } }
.pos-lay-ic.l-auto { grid-template-columns: 1fr 1fr 1fr; background: repeating-linear-gradient(135deg, var(--surface-3) 0 6px, var(--surface-2) 6px 12px); }
.pos-lay-ic.l-auto i { background: var(--gold); opacity: .7; }

/* ── جستجوی سراسری و پنجرهٔ شناور (بستهٔ اصلاحی ۲، ت۴ و ت۱۳) ── */
.nav-search {
  display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 10px; padding: 8px 10px; direction: rtl;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text-3);
  font: inherit; font-size: 13px; cursor: text; text-align: start;
}
.nav-search:hover, .nav-search:focus-visible { border-color: var(--primary); color: var(--text-2); outline: none; }
.nav-search > span:nth-child(2) { flex: 1; }
.nav-search .kbd, .srch .kbd {
  font-size: 10.5px; padding: 1px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface);
  color: var(--text-3); font-family: inherit; white-space: nowrap; direction: ltr;
}
.srch-back {
  position: fixed; inset: 0; z-index: 85; background: rgba(10, 16, 22, .38); display: flex; justify-content: center;
  align-items: flex-start; padding: 9vh 16px 16px; animation: fade .12s ease;
}
.srch {
  width: min(640px, 100%); max-height: min(70vh, 620px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-lg);
}
.srch-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.srch-head > svg { color: var(--text-3); flex: none; }
.srch-in.input { border: 0; box-shadow: none; padding: 6px 0; font-size: 15px; background: transparent; min-width: 0; }
.srch-in.input:focus { box-shadow: none; outline: none; }
.srch-list { overflow-y: auto; padding: 6px; min-height: 0; }
.srch-sec { font-size: 11.5px; font-weight: 700; color: var(--text-3); padding: 8px 10px 4px; }
.srch-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.srch-row.on { background: var(--primary-soft); }
.srch-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--surface-3); color: var(--text-2); }
.srch-row.on .srch-ic { color: var(--primary); background: var(--surface); }
.srch-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.srch-t > b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-t > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-go { opacity: 0; }
.srch-row.on .srch-go, .srch-row:hover .srch-go { opacity: 1; }
.srch-status:not(:empty) { padding: 8px 16px; }
.srch-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--border); background: var(--surface-2); }
@media (max-width: 720px) {
  .srch .hide-sm, .fw .hide-sm { display: none; }
  .srch-back { padding: 8px; }
  .srch { max-height: calc(100dvh - 16px); }
  .srch-go { opacity: 1; }
}
.fw {
  position: fixed; z-index: 60; display: flex; flex-direction: column; min-width: 320px; min-height: 220px;
  max-width: 100vw; max-height: 100vh; resize: both; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.fw.front { z-index: 61; }
.fw-head {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; cursor: move; user-select: none; touch-action: none;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.fw-head > svg { color: var(--text-3); margin-inline-start: 6px; }
.fw-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.fw-frame { flex: 1; width: 100%; border: 0; background: var(--bg); }
.fw.max { inset: 8px !important; width: auto !important; height: auto !important; resize: none; }
.fw.max .fw-head { cursor: default; }
.fw-dragging .fw-frame { pointer-events: none; }
@media (max-width: 720px) { .fw.max { inset: 0 !important; border-radius: 0; } }
/* داخل پنجرهٔ شناور: بدون منو و نوار بالا */
.shell.embed { display: block; height: auto; min-height: 100vh; overflow: visible; }
.shell.embed .main { padding: 14px 16px 40px; overflow: visible; direction: rtl; }
/* فلش برگشت و «؟» روی صفحه‌های سرآغاز (بستهٔ اصلاحی ۲، ت۲۱) */
.desk-top { display: flex; align-items: center; gap: 8px; }
.desk-hero .page-tools .btn { color: #fff; }
.desk-hero .page-tools .btn:hover { background: rgba(255, 255, 255, .14); }
.plt-hello > .page-tools, .vis-hero .page-tools { align-self: flex-start; }
.page-head > .page-tools:first-child { flex: none; }
/* دستگاه‌ها: کارهای مجاز، قفل‌ها و راه‌اندازی اول (بستهٔ اصلاحی ۲) */
.dev-sec { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.dev-tasks, .dev-locks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 16px; }
.text-bad { color: var(--bad, #b42318); }
.dev-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.dev-steps li { display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 12px; border-radius: 999px; background: var(--surface-3); color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.dev-steps li > span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-weight: 700; font-size: 11.5px; }
.dev-steps li > span svg { width: 13px; height: 13px; }
.dev-steps li.on { background: var(--primary); color: var(--primary-ink); }
.dev-steps li.on > span { color: var(--primary); }
.dev-steps li.done { background: var(--primary-soft); color: var(--primary); }
.dev-wizard { max-width: 760px; }
@media (max-width: 720px) { .dev-steps li:not(.on) b { display: none; } }

/* ── رسید حرارتی پنل فروش (۸۰ یا ۵۸ میلی‌متر) و تنظیمات چاپ رسید؛ مشترک پنل فروش و صفحهٔ «تنظیم صندوق» ERP (بستهٔ اصلاحی ۳) ──
   اندازهٔ کاغذ (@page) را خود چاپ رسید هنگام چاپ می‌گذارد تا چاپ‌های دیگر ERP (A4) دست نخورند */
/* ── چاپ رسید حرارتی ۸۰ میلی‌متری ── */
.pos-print { display: none; }
@media print {
  body.pos-printing { background: #fff !important; color: #000 !important; overflow: visible; }
  body.pos-printing > *:not(.pos-print) { display: none !important; }
  body.pos-printing .pos-print { display: block; width: 72mm; font-size: 11.5px; line-height: 1.55; color: #000; }
}
.pos-print .c { text-align: center; }
.pos-print h2 { font-size: 15px; margin: 0 0 2px; text-align: center; }
.pos-print .muted { color: #333; }
.pos-print table { width: 100%; border-collapse: collapse; }
.pos-print td, .pos-print th { padding: 2px 0; vertical-align: top; }
.pos-print th { border-bottom: 1px solid #000; font-size: 10.5px; text-align: right; }
.pos-print td.n, .pos-print th.n { text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos-print .sep { border-top: 1px dashed #000; margin: 5px 0; }
.pos-print .tot { font-size: 15px; font-weight: 900; }
.pos-print .big { font-size: 22px; font-weight: 900; text-align: center; margin: 4px 0; }
.pos-print .copy { border: 2px solid #000; text-align: center; font-size: 17px; font-weight: 900; padding: 3px 0; margin-bottom: 6px; }
.pos-print .copy small { font-size: 11px; font-weight: 700; }
/* ── بستهٔ اصلاحی ۳ (ت۱۶ح): تنظیمات چاپ رسید داخل پنل؛ فرم راست، پیش‌نمایش کاغذ ۸۰ میلی‌متری چپ ── */
.pos-prset { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: start; }
.pos-prset-form textarea.input { resize: vertical; min-height: 72px; font: inherit; }
.pos-prset-note { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.pos-prset-note svg { flex: none; margin-top: 2px; }
.pos-prset-pv { display: grid; gap: 6px; justify-items: center; padding: 12px; border-radius: 10px; background: var(--surface-2); max-height: calc(100vh - 230px); overflow: auto; box-sizing: border-box; }
.pos-print.pos-print-preview { display: block; width: 72mm; box-sizing: content-box; padding: 4mm 3mm 6mm; background: #fff; color: #000; font-size: 11.5px; line-height: 1.55;
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 6px 18px rgba(0,0,0,.10); border-radius: 2px; }
@media (max-width: 760px) { .pos-prset { grid-template-columns: 1fr; } }
.pos-prset-form { max-height: calc(100vh - 230px); overflow: auto; padding-inline-end: 4px; align-content: start; }
.pos-prset-sec { display: grid; gap: 10px; }
.pos-prset-sec.hidden { display: none; }
.pos-prset-tabs { align-self: start; }
.pos-prset-h select { flex: 1; }
.pos-prset-sec h4 { margin: 0; font-size: 14px; }
.pos-prset-h { display: flex; align-items: center; gap: 6px; }
.pos-prset-parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
.pos-prset-parts .check { font-size: 13px; }
.pos-print .note { white-space: pre-line; font-weight: 700; margin-top: 3px; }
.pos-print .save { display: flex; justify-content: space-between; border: 1.5px solid #000; padding: 3px 5px; margin: 4px 0; font-weight: 900; font-size: 13px; }
.pos-print .pos-copy-break { break-before: page; page-break-before: always; }
.pos-print.pos-print-preview .pos-copy-break { margin-top: 10px; border-top: 2px dashed #999; padding-top: 8px; }
.pos-print.pos-print-preview.w58 { width: 50mm; font-size: 10px; }
.pos-print.w58 h2 { font-size: 13px; }
.pos-print.w58 .tot { font-size: 13px; }
.pos-print.w58 .save { font-size: 11.5px; }
@media print { body.pos-printing .pos-print.w58 { width: 50mm; font-size: 10px; } }
.pos-prset-form > * { flex-shrink: 0; }

/* ── پیش‌نمایش زندهٔ پنل فروش در «تنظیم صندوق» (بستهٔ اصلاحی ۳، ت۱۵) ── */
.pss-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.pss-grid > .pspv { order: -1; }
.pspv .card-head { gap: 8px; flex-wrap: wrap; }
.pspv .seg button { height: 30px; font-size: 12.5px; }
.pspv-box { position: relative; overflow: hidden; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.pspv-frame { position: absolute; top: 0; right: 0; border: 0; transform-origin: top right; pointer-events: none; background: var(--bg); }
.pspv.big { position: fixed; inset: 12px; z-index: 60; overflow: auto; box-shadow: var(--shadow-lg); }
.pss-wrap { container-type: inline-size; }
@container (min-width: 1000px) {
  .pss-grid { grid-template-columns: minmax(0, 1fr) minmax(380px, 46%); align-items: start; }
  .pss-grid > .pspv { order: 0; position: sticky; top: 12px; }
  .pss-grid > .pspv.big { position: fixed; }
}

/* ── مرکز تنظیمات ← رنگ‌ها (بستهٔ اصلاحی ۳، ت۱) ── */
.clr-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.clr-preset { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: start; }
.clr-preset:hover { border-color: var(--border-strong); }
.clr-preset.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.clr-preset b { font-size: 13px; }
.clr-sw { display: flex; height: 26px; border-radius: 7px; overflow: hidden; border: 1px solid rgba(0, 0, 0, .08); }
.clr-sw i { flex: 1; }
.clr-list, .clr-secs { display: grid; gap: 8px; }
.clr-secs { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.clr-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px 96px auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; }
.clr-row.custom { background: var(--surface-2); }
.clr-lbl b { font-size: 13.5px; }
.clr-pick { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); cursor: pointer; }
.clr-hex { height: 34px; font-size: 13px; text-align: left; }
.clr-warn { color: var(--danger-strong); }
.clr-warn:empty { display: none; }

/* ── بستهٔ اصلاحی ۳: مرکز سلامت کوتاه (ت۲۶) و ردپای تغییرات روزانه (ت۲۷) ── */
.health-more > summary { cursor: pointer; padding: 10px 0 4px; color: var(--text-2); font-weight: 600; }
.health-ok .health-row { padding: 6px 0; }
.audit-day { border-bottom: 1px solid var(--border); }
.audit-day > summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; background: var(--surface-2); }
.audit-day[open] > summary { border-bottom: 1px solid var(--border); }

/* گام ۳۵: میز مدیر — زبانه‌های تأییدیه */
.desk-approvals .desk-tabs { max-width: 100%; overflow-x: auto; }
.desk-approvals .desk-tabs .badge { margin-inline-start: 2px; }
.desk-approvals .desk-reqs { max-height: 440px; overflow-y: auto; padding-inline-end: 2px; }
@media (max-width: 640px) { .desk-approvals .desk-reqs { max-height: none; } }

/* ── گام ۳۵ بستهٔ ب: قالب چاپ (طراح فرم) — برگ‌ها به میلی‌متر ── */
.pf-page { position: relative; background: #fff; color: #111; overflow: hidden; box-sizing: border-box; font-family: 'Vazirmatn', system-ui, sans-serif; direction: rtl; flex: none; }
.pf-page.is-draft::after { content: 'پیش‌نویس'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 60pt; font-weight: 900; color: rgba(200, 30, 30, .08); transform: rotate(-20deg); pointer-events: none; }
.pf-sheet { display: grid; gap: 0; align-content: start; justify-content: center; }
.pf-label { position: relative; overflow: hidden; background: #fff; box-sizing: border-box; }
.pf-b { overflow: hidden; }
.pf-b .pf-lbl { color: #555; font-weight: 600; }
.pf-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pf-table th { background: #f1f1f1; font-weight: 800; padding: .6mm 1mm; text-align: center; white-space: nowrap; overflow: hidden; }
.pf-table td { padding: .5mm 1mm; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pf-table td.n { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; }
.pf-table td.c { text-align: center; }
.pf-table.bd th, .pf-table.bd td { border: .2mm solid #777; }
.pf-table.zb tbody tr:nth-child(even) td { background: #f7f7f7; }
.pf-totals .pf-tr, .pf-b .pf-tr { display: flex; justify-content: space-between; gap: 2mm; padding: .4mm 0; border-bottom: .15mm dotted #bbb; }
.pf-b .pf-tr.big b { font-size: 1.15em; }
.pf-sign-l { font-weight: 700; }
.pf-sign-n { margin-top: 1mm; min-height: 4mm; border-top: .2mm solid #999; padding-top: .8mm; color: #333; }
.pf-bc { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.pf-bc svg { width: 100%; height: 100%; }
.pf-ph { width: 100%; height: 100%; display: grid; place-items: center; border: .3mm dashed #aaa; color: #888; font-size: 8pt; }
.pf-preview { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px; background: var(--surface-3); border-radius: 12px; overflow: auto; }
.pf-preview .pf-pwrap { zoom: var(--pf-scale, 1); box-shadow: 0 4px 18px rgba(0, 0, 0, .18); }
.pf-print { display: none; }
@media print {
  body.pf-printing > *:not(.pf-print) { display: none !important; }
  body.pf-printing .pf-print { display: block; }
  body.pf-printing { margin: 0; background: #fff; }
  .pf-print .pf-page { break-after: page; page-break-after: always; box-shadow: none; }
  .pf-print .pf-page:last-child { break-after: auto; page-break-after: auto; }
}
/* طراح فرم */
.pf-bar { display: flex; align-items: end; flex-wrap: wrap; gap: 10px 16px; padding: 10px 14px !important; margin-bottom: 10px; }
.pf-bar .field { min-width: 220px; margin: 0; }
.pf-designer { display: grid; grid-template-columns: 210px minmax(0, 1fr) 290px; gap: 10px; min-height: 70vh; align-items: start; }
.pf-pal, .pf-props { padding: 10px !important; display: flex; flex-direction: column; gap: 8px; position: sticky; top: 10px; max-height: calc(100vh - 120px); overflow-y: auto; }
.pf-sec { font-size: 12.5px; font-weight: 800; color: var(--text-2); display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.pf-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pf-tool { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 700; cursor: grab; }
.pf-tool:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); }
.pf-tool svg.i { width: 15px; height: 15px; color: var(--accent); }
.pf-fields { display: flex; flex-wrap: wrap; gap: 4px; }
.pf-fld { height: 26px; padding: 0 8px; border: 1px dashed var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 11.5px; cursor: grab; }
.pf-fld:hover:not(:disabled) { background: var(--gold-soft); color: var(--text); border-style: solid; }
.pf-canvas { min-height: 60vh; background: var(--surface-3); border-radius: 12px; padding: 20px; overflow: auto; display: flex; justify-content: center; align-items: flex-start; }
.pf-stage { position: relative; flex: none; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.pf-stage.grid .pf-page { background-image: linear-gradient(rgba(60, 90, 160, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(60, 90, 160, .08) 1px, transparent 1px),
  linear-gradient(rgba(60, 90, 160, .16) 1px, transparent 1px), linear-gradient(90deg, rgba(60, 90, 160, .16) 1px, transparent 1px);
  background-size: 1mm 1mm, 1mm 1mm, 10mm 10mm, 10mm 10mm; }
.pf-margin { position: absolute; border: 1px dashed rgba(200, 60, 40, .35); pointer-events: none; }
.pf-design .pf-b { cursor: move; outline: 1px dashed rgba(60, 90, 160, .28); outline-offset: 0; }
.pf-design .pf-b:hover { outline-color: rgba(60, 90, 160, .7); }
.pf-design .pf-b.sel { outline: 2px solid #2563eb; z-index: 5; overflow: visible; }
.pf-design .pf-line { min-height: 2mm; }
.pf-h { position: absolute; width: 2.4mm; height: 2.4mm; background: #2563eb; border: .3mm solid #fff; border-radius: .6mm; z-index: 6; }
.pf-h.br { right: -1.2mm; bottom: -1.2mm; cursor: nwse-resize; }
.pf-h.bl { left: -1.2mm; bottom: -1.2mm; cursor: nesw-resize; }
.pf-h.r { right: -1.2mm; top: calc(50% - 1.2mm); cursor: ew-resize; }
.pf-h.b { bottom: -1.2mm; left: calc(50% - 1.2mm); cursor: ns-resize; }
.pf-g2 { grid-template-columns: 1fr 1fr !important; gap: 6px !important; }
.pf-props .field { margin: 0; }
.pf-cols { display: grid; gap: 4px; }
.pf-col { display: grid; grid-template-columns: 20px 1fr 56px; gap: 4px; align-items: center; }
.pf-col.off .input { opacity: .5; }
.pf-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.pf-row.off { opacity: .65; }
.pf-row .badge { margin-inline-start: 6px; }
@media (max-width: 1100px) {
  .pf-designer { grid-template-columns: 1fr; }
  .pf-pal, .pf-props { position: static; max-height: none; }
}
/* بازبینی بستهٔ ب */
.pf-page.is-cancelled::after { content: 'برگشت خورده'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 48pt; font-weight: 900; color: rgba(200, 30, 30, .12); transform: rotate(-20deg); pointer-events: none; }
.pf-design .pf-b { touch-action: none; }
.pf-usebar { gap: 8px; align-items: center; margin-bottom: 10px; }
@media print {
  /* Ctrl+P روی صفحهٔ چاپ با قالب انتخابی: خود برگ‌ها به اندازهٔ واقعی */
  .pf-view .pf-preview { background: none; padding: 0; gap: 0; display: block; }
  .pf-view .pf-pwrap { zoom: 1 !important; box-shadow: none; }
  .pf-view .pf-page { break-after: page; }
}

/* ── گام ۳۵ بستهٔ ج: گزارش نوشتاری مدیر ── */
.narr-bar { gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.narr-nav { gap: 6px; flex-wrap: wrap; }
.narr-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.narr-line { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); line-height: 1.9; }
.narr-line .mk { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; }
.narr-line .mk .i { width: 15px; height: 15px; }
.narr-line.ok .mk { background: var(--ok-soft); color: var(--ok); }
.narr-line.bad .mk { background: var(--danger-soft); color: var(--danger-strong); }
.narr-line.warn .mk { background: var(--accent-soft); color: var(--accent); }
.narr-line.info .mk { background: var(--info-soft); color: var(--info); }
.narr-line .grow { min-width: 0; overflow-wrap: anywhere; }
.narr-more { white-space: nowrap; margin-top: 4px; }
.narr-cost { font-size: 11px; color: var(--text-3); border: 1px solid var(--border); border-radius: 6px; padding: 0 5px; margin-inline-start: 4px; }
.narr-kpis .kpi .value { font-size: 18px; }
@media (max-width: 640px) { .narr-bar { flex-direction: column; align-items: stretch; } .narr-line { padding: 8px 10px; } .narr-kpis { grid-template-columns: 1fr 1fr !important; gap: 8px; } .narr-kpis .kpi .value { font-size: 15px; } }
@media print {
  .narr-card { border: 0; box-shadow: none; }
  .narr-line { break-inside: avoid; border-color: #bbb; }
  .narr-line .mk { border: 1px solid #999; background: none !important; color: #000 !important; }
}
.desk-narr { margin-bottom: 16px; }

/* ── بستهٔ اصلاحی ۶: ماژول «نسیه» (ت۴۴ و ت۴۹؛ موبایل‌اول) ── */
.cr-page { max-width: 1100px; }
.cr-tabs { display: inline-flex; }
.cr-tabs a.seg-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; height: 38px; background: var(--surface); color: var(--text-2); font-weight: 700; text-decoration: none; }
.cr-tabs a.seg-btn + a.seg-btn { border-inline-start: 1px solid var(--border-strong); }
.cr-tabs a.seg-btn.on { background: var(--primary-soft); color: var(--primary); }
.cr-tabs svg.i { width: 16px; height: 16px; }
.cr-policy { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.cr-policy input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.cr-filter { gap: 8px; }
.cr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 10px; }
.cr-card { padding: 12px 14px; display: grid; gap: 8px; }
.cr-card.off { opacity: .65; }
.cr-card-h { display: flex; align-items: flex-start; gap: 8px; }
.cr-card-h b { font-size: 15px; }
.cr-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.cr-nums > div { display: grid; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.cr-nums small { color: var(--text-3); font-size: 11.5px; }
.cr-nums b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-nums b.bad { color: var(--danger-strong); }
.cr-room { background: var(--gold-soft) !important; }
.cr-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-actions:empty { display: none; }
.cr-ok { color: var(--ok); }
.cr-lh { padding-inline: 0; flex-wrap: wrap; gap: 8px; }
.cr-photo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cr-photo img { max-height: 160px; max-width: 100%; border-radius: 10px; border: 1px solid var(--border); }
.cr-photo-big { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; border-radius: 10px; }
@media (max-width: 640px) {
  .cr-nums { grid-template-columns: 1fr 1fr; }
  .cr-actions .btn { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  .cr-tabs { display: flex; } .cr-tabs a.seg-btn { flex: 1; justify-content: center; }
}

/* ═════════════ پرسنل (گام ۳۶، بخش ۱) — پیشوند stf- ═════════════ */
.stf-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: thin; }
.stf-tab { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; height: 36px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap; flex: none; }
.stf-tab svg.i { width: 16px; height: 16px; }
.stf-tab.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.stf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.stf-narrow { max-width: 760px; }
.stf-filter { gap: 8px; margin-bottom: 12px; align-items: flex-end; }
.stf-filter .field { margin: 0; }
.stf-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.stf-acts:empty { display: none; }
.stf-me { padding: 16px; display: grid; gap: 14px; }
.stf-me-h { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.stf-me-h h2 { margin: 0; font-size: 17px; }
.stf-punch { display: grid; place-items: center; gap: 2px; width: 100%; min-height: 128px; border: 0; border-radius: 18px; cursor: pointer; font-family: inherit; color: #fff;
  background: linear-gradient(135deg, #157a3a, #1f9a4c); box-shadow: 0 6px 20px rgba(21, 122, 58, .28); transition: transform .08s ease, filter .15s ease; }
.stf-punch.out { background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 6px 20px rgba(27, 35, 54, .28); }
:root[data-theme='dark'] .stf-punch.out { color: var(--primary-ink); }
.stf-punch svg.i { width: 34px; height: 34px; }
.stf-punch b { font-size: 28px; font-weight: 900; }
.stf-punch small { opacity: .9; font-size: 12.5px; }
.stf-punch:active { transform: scale(.985); }
.stf-punch:disabled { filter: grayscale(.9); opacity: .55; cursor: not-allowed; }
.stf-punch.loading { opacity: .7; pointer-events: none; }
.stf-today { display: grid; gap: 6px; }
.stf-sline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stf-plist { display: flex; flex-wrap: wrap; gap: 6px; }
.stf-pchip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; font-variant-numeric: tabular-nums; }
.stf-pchip svg.i { width: 14px; height: 14px; }
.stf-pchip small { color: var(--text-3); }
.stf-pchip.void { text-decoration: line-through; opacity: .6; }
.stf-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stf-nums > div { display: grid; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.stf-nums small { color: var(--text-3); font-size: 11.5px; }
.stf-nums b { font-size: 16px; font-variant-numeric: tabular-nums; }
.stf-room { background: var(--gold-soft) !important; }
.stf-week { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.stf-wrow { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; }
.stf-wrow.today { background: var(--gold-soft); }
.stf-wrow > b { white-space: nowrap; }
.stf-wrow > .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stf-wd { width: 108px; flex: none; color: var(--text-2); font-size: 13px; }
.stf-req { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.stf-req:last-child { border-bottom: 0; }
.stf-req .bad, .stf-ap .bad, .stf-paycard td.bad, .stf-table td.bad, .t td.bad { color: var(--danger-strong); }
.t td.warn { color: var(--accent); }
.stf-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.stf-day { display: grid; gap: 1px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); border-inline-start: 3px solid var(--border-strong); font-size: 12.5px; }
.stf-day.present { border-color: var(--ok); }
.stf-day.absent { border-color: var(--danger-strong); background: var(--danger-soft); }
.stf-day.leave { border-color: var(--info); }
.stf-day.no_out { border-color: var(--accent); background: var(--accent-soft); }
.stf-day small { color: var(--text-3); }
.stf-day small.bad { color: var(--danger-strong); }
.stf-aplist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 10px; }
.stf-ap { padding: 12px 14px; display: grid; gap: 8px; }
.stf-ap-h { display: flex; align-items: flex-start; gap: 8px; }
.stf-weekbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.stf-weekbar b { font-variant-numeric: tabular-nums; }
.stf-weekbar select { width: auto; max-width: 220px; }
.stf-table th, .stf-table td { vertical-align: top; }
.stf-table thead th { text-align: center; white-space: nowrap; }
.stf-table thead th small { display: block; color: var(--text-3); font-weight: 600; }
.stf-table thead th.today { color: var(--accent); }
.stf-name { text-align: start; min-width: 120px; position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; }
.stf-name b, .stf-name small { display: block; }
.stf-name small { color: var(--text-3); font-weight: 500; font-size: 11.5px; }
.stf-table tr.other .stf-name b { color: var(--text-2); }
.stf-cell { min-width: 96px; padding: 6px !important; }
.stf-cell.today { background: color-mix(in srgb, var(--gold-soft) 60%, transparent); }
.stf-cell.leave { background: var(--danger-soft); }
.stf-chip { display: grid; gap: 1px; width: 100%; padding: 5px 6px; margin-bottom: 4px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-family: inherit; text-align: center; color: var(--text); font-variant-numeric: tabular-nums; }
.stf-chip.published { background: var(--primary-soft); border-color: transparent; }
.stf-chip.draft { border-style: dashed; background: var(--surface-2); color: var(--text-2); }
.stf-chip.mine { box-shadow: inset 0 0 0 2px var(--gold); }
.stf-chip small { font-size: 11px; color: var(--text-3); }
.stf-add { width: 100%; height: 26px; border: 1px dashed var(--border-strong); border-radius: 7px; background: transparent; color: var(--text-3); cursor: pointer; display: grid; place-items: center; opacity: .55; }
.stf-add:hover, .stf-add:focus-visible { opacity: 1; color: var(--primary); border-color: var(--primary); }
.stf-add svg.i { width: 14px; height: 14px; }
.stf-lv { display: flex; align-items: center; gap: 3px; justify-content: center; font-size: 11.5px; color: var(--danger-strong); margin-bottom: 4px; }
.stf-lv.pending { color: var(--accent); }
.stf-lv svg.i { width: 13px; height: 13px; }
.stf-mdays { display: none; }
.stf-mday { padding: 10px 12px; display: grid; gap: 6px; }
.stf-mday.today { box-shadow: inset 0 0 0 2px var(--gold); }
.stf-mday-h { display: flex; align-items: center; justify-content: space-between; }
.stf-mrow { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); font-family: inherit; color: var(--text); cursor: pointer; text-align: start; }
.stf-mrow b { flex: 1; }
.stf-mrow span { font-variant-numeric: tabular-nums; }
.stf-mrow.draft { border-style: dashed; }
.stf-mrow.mine { box-shadow: inset 0 0 0 2px var(--gold); }
.stf-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.stf-people, .stf-dir { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px; }
.stf-pcard, .stf-dcard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: inherit; text-decoration: none; min-width: 0; }
.stf-pcard:hover { border-color: var(--border-strong); }
.stf-pcard.off { opacity: .6; }
.stf-pcard .grow, .stf-dcard .grow { min-width: 0; }
.stf-pcard .avatar, .stf-dcard .avatar { width: 40px; height: 40px; font-size: 16px; flex: none; }
.stf-dcard { flex-wrap: wrap; }
.stf-dcall { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.stf-dcall .btn { justify-content: flex-start; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; flex: none; }
.stf-info { display: grid; gap: 14px; }
.stf-who { display: flex; gap: 12px; align-items: center; }
.stf-who h2 { margin: 0 0 2px; font-size: 18px; }
.stf-kvs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 8px; }
.stf-kv { display: grid; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 7px 10px; min-width: 0; }
.stf-kv small { color: var(--text-3); font-size: 11.5px; }
.stf-kv b, .stf-kv a { overflow-wrap: anywhere; }
.stf-hist { display: grid; gap: 2px; }
.stf-hrow { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--border); }
.stf-hrow:last-child { border-bottom: 0; }
.stf-hrow > b { width: 70px; flex: none; font-size: 13px; }
.stf-doc { display: flex; align-items: center; gap: 10px; }
.stf-doc.off { opacity: .55; }
.stf-docimg { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; border-radius: 10px; }
.stf-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.stf-bunit.gap { box-shadow: inset 0 0 0 2px var(--danger); }
.stf-brow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }
.stf-brow b { flex: 1 1 120px; }
.stf-brow .num { font-variant-numeric: tabular-nums; }
.stf-brow.gap { background: var(--danger-soft); }
.stf-brow.gap b { color: var(--danger-strong); text-decoration: line-through; }
.stf-free { display: grid; gap: 6px; }
.stf-free > div { display: flex; flex-wrap: wrap; gap: 4px; }
.stf-paycard { margin-top: 14px; }
@media (max-width: 960px) {
  .stf-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .stf-gridwrap { display: none; }
  .stf-mdays { display: grid; gap: 10px; }
  .stf-nums { grid-template-columns: 1fr 1fr; }
  .stf-acts .btn { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  .stf-dcall { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .stf-dcall .btn { flex: 1 1 auto; min-height: 44px; }
  .stf-wd { width: 88px; }
}

/* ═════════════ یک نشانی (بخش ۱) ═════════════ */
.mv-card { text-align: center; }
.mv-ic { width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; background: var(--gold-soft); color: var(--accent); display: grid; place-items: center; }
.mv-ic svg.i { width: 28px; height: 28px; }
.mv-url { font-size: 18px; font-weight: 800; padding: 10px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong); }
.mv-card .alert { text-align: start; }
.mv-hint { margin-bottom: 12px; text-align: start; line-height: 1.8; }
.plt-groups { display: grid; gap: 4px; }
.plt-group .plt-tiles { margin-bottom: 10px; }

/* ── بخش ۲: عملیات فروشگاه (ops-) و ارتباطات (cm-) ── */
.ops-bar { gap: 8px; margin-bottom: 12px; align-items: center; }
.ops-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.ops-task { display: grid; gap: 6px; padding: 12px 14px; color: inherit; text-decoration: none; min-width: 0; border-inline-start: 4px solid var(--border); }
a.ops-task:hover { border-color: var(--primary); }
.ops-task.hot { border-inline-start-color: var(--gold); }
.ops-task.late { border-inline-start-color: var(--danger); background: var(--danger-soft); }
.ops-task.ok { border-inline-start-color: var(--ok); }
.ops-task.off { opacity: .6; }
.ops-task-h { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.ops-task-h > b { min-width: 0; overflow-wrap: anywhere; line-height: 1.6; }
.ops-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; min-width: 0; }
.ops-meta > span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.ops-meta svg.i { width: 14px; height: 14px; flex: none; }
.ops-meta .warn { color: var(--accent); font-weight: 700; }
.ops-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.ops-acts:empty { display: none; }
.ops-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.ops-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 6px; }
.ops-kv > div { display: grid; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 7px 10px; min-width: 0; }
.ops-kv small { color: var(--text-3); font-size: 11.5px; }
.ops-photos { display: flex; flex-wrap: wrap; gap: 6px; }
.ops-photo { display: block; max-width: 100%; max-height: 72vh; margin: 0 auto; border-radius: 8px; object-fit: contain; }
.ops-thumb-lg { display: block; max-width: 100%; max-height: 40vh; border-radius: 8px; object-fit: contain; }
.ops-events { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }
.ops-events li { overflow-wrap: anywhere; }
.ops-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ops-num { display: grid; gap: 2px; padding: 10px 12px; color: inherit; text-decoration: none; min-width: 0; }
.ops-num small { color: var(--text-3); font-size: 12px; }
.ops-num b { font-size: 22px; font-variant-numeric: tabular-nums; }
.ops-num.bad b { color: var(--danger-strong); }
.ops-num.warn b { color: var(--accent); }
.ops-wds { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.ops-items { gap: 6px; }
.ops-item { gap: 8px; align-items: center; min-width: 0; }
.ops-item > .grow { min-width: 0; }
.ops-item .input { width: 100%; }
.ops-run { gap: 8px; }
.ops-ck { display: grid; gap: 8px; padding: 12px 14px; border-inline-start: 4px solid var(--border); min-width: 0; }
.ops-ck.ok { border-inline-start-color: var(--ok); }
.ops-ck.no { border-inline-start-color: var(--danger); }
.ops-ck > .seg, .ops-ck > .btn, .ops-ck > .badge { justify-self: start; }
.ops-yn button, .ops-score button { min-width: 44px; height: 40px; }
.ops-score { flex-wrap: wrap; }
.ops-foot { position: sticky; bottom: 0; display: flex; gap: 8px; justify-content: flex-end; padding: 10px 0; background: var(--bg); z-index: 2; }
.ops-h3 { margin: 6px 0 8px; font-size: 15px; color: var(--text-2); }
.ops-zone.mine { border-inline-start-color: var(--primary); }
.cm-targets { gap: 6px; }
.cm-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.cm-x { border: 0; background: none; cursor: pointer; color: inherit; font-size: 16px; line-height: 1; padding: 0 2px; }
.cm-ann { display: grid; gap: 6px; padding: 12px 14px; color: inherit; text-decoration: none; min-width: 0; border-inline-start: 4px solid var(--border); }
.cm-ann.pin { border-inline-start-color: var(--gold); }
.cm-ann.unread { border-inline-start-color: var(--primary); background: var(--primary-soft); }
.cm-pre { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; margin: 0; }
.cm-bar { position: relative; overflow: hidden; border-radius: 8px; background: var(--surface-2); padding: 8px 10px; display: flex; gap: 8px; justify-content: space-between; min-width: 0; }
.cm-bar > :not(.cm-bar-fill) { position: relative; overflow-wrap: anywhere; }
.cm-bar-fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--primary-soft); }
.cm-bar.mine { outline: 2px solid var(--primary); }
.cm-opt { padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; }
.cm-occ { gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; flex-wrap: wrap; min-width: 0; }
.cm-occ.today { background: var(--gold-soft); }
.cm-occ.off { opacity: .55; }
.cm-chats { display: grid; gap: 8px; }
.cm-chat { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: inherit; text-decoration: none; min-width: 0; }
.cm-chat.unread { background: var(--primary-soft); }
.cm-av { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); flex: none; }
.cm-chat-b { min-width: 0; display: grid; gap: 2px; }
.cm-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-chat-s { display: grid; gap: 4px; justify-items: end; flex: none; }
.cm-room { display: flex; flex-direction: column; height: calc(100dvh - 230px); min-height: 360px; overflow: hidden; }
.cm-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 12px; background: var(--surface-2); }
.cm-msg { align-self: flex-start; max-width: min(80%, 560px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px 10px; display: grid; gap: 2px; min-width: 0; }
.cm-msg.mine { align-self: flex-end; background: var(--primary-soft); border-color: transparent; }
.cm-msg.del { opacity: .65; }
.cm-by { color: var(--primary); font-weight: 700; }
.cm-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.cm-hm { color: var(--text-3); font-size: 11px; display: flex; gap: 4px; align-items: center; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.cm-seen { color: var(--primary); }
.cm-del { border: 0; background: none; cursor: pointer; color: var(--danger); font-size: 15px; line-height: 1; padding: 0 2px; }
.cm-send { display: flex; gap: 6px; align-items: flex-end; padding: 8px; border-top: 1px solid var(--border); background: var(--surface); }
.cm-input { flex: 1; min-width: 0; resize: none; max-height: 120px; min-height: 40px; }
@media (max-width: 720px) {
  .ops-sum { gap: 6px; }
  .ops-num b { font-size: 18px; }
  .cm-room { height: calc(100dvh - 190px); }
  .cm-msg { max-width: 88%; }
  .ops-ck > .seg { justify-self: stretch; display: flex; }
  .ops-ck > .seg button { flex: 1; }
}

/* ── امتیاز پرسنل (گام ۳۹) ── */
.kp-hero { display: flex; align-items: center; gap: 16px; padding: 16px; min-width: 0; flex-wrap: wrap; }
.kp-hero-t { display: grid; gap: 6px; min-width: 0; flex: 1 1 180px; }
.kp-ring-wrap { position: relative; display: grid; place-items: center; flex: none; }
.kp-ring .bg { fill: none; stroke: var(--surface-3); stroke-width: 10; }
.kp-ring .fg { fill: none; stroke: var(--primary-2); stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.kp-ring.ok .fg { stroke: var(--ok); }
.kp-ring.warn .fg { stroke: var(--gold); }
.kp-ring.bad .fg { stroke: var(--danger); }
.kp-ring-v { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.kp-ring-v b { font-size: 28px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kp-ring-v small { color: var(--text-3); font-size: 11.5px; }
.kp-rank { font-size: 20px; font-weight: 800; }
.kp-rank small { font-size: 13px; font-weight: 600; color: var(--text-3); }
.kp-medal { justify-self: start; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: 13px; background: var(--gold-soft); color: var(--accent); }
.kp-medal.silver { background: var(--surface-3); color: var(--text-2); }
.kp-medal.bronze { background: #f7e6d8; color: #8a4a17; }
.kp-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.kp-bdg { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--primary-soft); font-size: 12px; font-weight: 700; }
.kp-bdg svg.i { width: 14px; height: 14px; }
.kp-rows { display: grid; gap: 12px; }
.kp-row { display: grid; gap: 6px; min-width: 0; }
.kp-row.off { opacity: .6; }
.kp-row-h { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kp-row-h svg.i { width: 16px; height: 16px; flex: none; color: var(--text-3); }
.kp-v { font-weight: 800; font-variant-numeric: tabular-nums; }
.kp-v.ok, .kp-table .ok, .kp-hist .ok { color: var(--ok); }
.kp-v.warn, .kp-table .warn, .kp-hist .warn { color: var(--accent); }
.kp-v.bad, .kp-table .bad, .kp-hist .bad { color: var(--danger-strong); }
.kp-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; min-width: 40px; }
.kp-bar > i { display: block; height: 100%; border-radius: 99px; background: var(--primary-2); }
.kp-bar > i.ok { background: var(--ok); }
.kp-bar > i.warn { background: var(--gold); }
.kp-bar > i.bad { background: var(--danger); }
.kp-pt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); min-width: 0; }
.kp-pt > .grow { min-width: 0; overflow-wrap: anywhere; }
.kp-pt-n { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.kp-pt.up .kp-pt-n { color: var(--ok); }
.kp-pt.down .kp-pt-n { color: var(--danger-strong); }
.kp-pt.void { opacity: .55; text-decoration: line-through; }
.kp-hist { display: grid; grid-template-columns: minmax(84px, auto) 1fr auto 22px; gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.kp-hist-m { font-size: 13px; white-space: nowrap; }
.kp-table .kp-tr { cursor: pointer; }
.kp-table .kp-tr:hover td, .kp-table .kp-tr:focus-visible td { background: var(--surface-2); }
.kp-score-td { min-width: 90px; }
.kp-score-td .kp-bar { margin-top: 4px; }
.kp-prof { display: grid; gap: 4px; text-align: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: inherit; font: inherit; cursor: pointer; min-width: 0; }
.kp-prof:hover { border-color: var(--primary); }
.kp-prof.off { opacity: .6; }
.kp-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 6px; }
.kp-month { width: auto; min-width: 170px; max-width: 260px; }
.ops-pick { width: 20px; height: 20px; flex: none; margin-top: 4px; accent-color: var(--primary); }

/* ── رسید کارت‌به‌کارت (گام ۴۰) ── */
.c2c-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; margin-bottom: 16px; }
.c2c-btn { display: grid; justify-items: center; gap: 4px; padding: 18px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow-sm); min-width: 0; }
.c2c-btn:hover, .c2c-btn:focus-visible { border-color: var(--gold); box-shadow: var(--shadow); }
.c2c-btn svg.i { width: 30px; height: 30px; color: var(--accent); }
.c2c-btn b { font-size: 18px; overflow-wrap: anywhere; }
.c2c-btn small { color: var(--text-3); font-size: 12px; }
.c2c-amt { font-variant-numeric: tabular-nums; }
.c2c-thumb { display: grid; place-items: center; gap: 6px; min-height: 140px; border: 2px dashed var(--border-strong); border-radius: 12px; color: var(--text-3); cursor: pointer; background: var(--surface-2); overflow: hidden; }
.c2c-thumb svg.i { width: 32px; height: 32px; }
.c2c-thumb img { display: block; max-width: 100%; max-height: 38vh; object-fit: contain; }
.c2c-amount { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.c2c-words { margin-top: 4px; }
.c2c-more summary { cursor: pointer; color: var(--text-2); font-weight: 700; font-size: 13px; padding: 4px 0; }
.c2c-more[open] summary { margin-bottom: 8px; }
.c2c-done { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 8px 0; }
.c2c-done > svg.i { width: 56px; height: 56px; padding: 10px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.c2c-done b { font-size: 18px; }
.c2c-done .ok { color: var(--ok); font-weight: 700; }
.c2c-date { width: min(100%, 170px); }
.c2c-big { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.c2c-cand { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); min-width: 0; flex-wrap: wrap; }
.c2c-cand > .grow { min-width: 0; overflow-wrap: anywhere; display: grid; gap: 2px; }
.c2c-night td.ok { color: var(--ok); }
.c2c-night td.warn { color: var(--accent); }
.c2c-night td.bad, .c2c-night .bad { color: var(--danger-strong); }
.c2c-inbox { display: grid; gap: 6px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); min-width: 0; }
.c2c-inbox .bnk-raw { max-height: 140px; overflow: auto; font-family: inherit; letter-spacing: normal; unicode-bidi: plaintext; text-align: start; }
.c2c-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.c2c-guide summary { cursor: pointer; font-weight: 700; color: var(--info); font-size: 13px; }
.c2c-guide ol { margin: 8px 0 0; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 13px; line-height: 1.8; }
@media (max-width: 720px) {
  .kp-hide-m { display: none; }
  .kp-hero { justify-content: center; text-align: center; }
  .kp-hero-t { justify-items: center; }
  .kp-medal { justify-self: center; }
  .c2c-btn { padding: 14px 10px; }
  .c2c-date { width: 100%; }
  .kp-month { flex: 1 1 160px; max-width: none; }
  .c2c-thumb img { max-height: 26vh; }
  .c2c-thumb { min-height: 110px; }
}

/* ── بخش ۴ (گام ۴۲): مخاطبین، ویزیتورها، باشگاه، پیامک ── */
.crm-search { flex: 1 1 260px; max-width: 420px; }
.crm-secs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 10px; }
.crm-sec { display: grid; justify-items: center; gap: 6px; padding: 18px 12px; color: inherit; text-decoration: none; text-align: center; min-width: 0; }
.crm-sec:hover, .crm-sec:focus-visible { border-color: var(--gold); box-shadow: var(--shadow); }
.crm-sec svg.i { width: 28px; height: 28px; color: var(--accent); }
.crm-sec b { overflow-wrap: anywhere; }
.crm-n { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-2); }
.crm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 10px; }
.crm-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 14px; min-width: 0; }
.crm-card > .grow { min-width: 0; flex: 1 1 140px; overflow-wrap: anywhere; display: grid; gap: 2px; }
.crm-card .avatar { width: 40px; height: 40px; font-size: 16px; flex: none; }
.crm-phones { display: flex; flex-direction: column; gap: 4px; align-items: stretch; min-width: 0; }
.crm-phones .btn { justify-content: flex-start; gap: 6px; }
.crm-ph { display: flex; align-items: center; gap: 2px; min-width: 0; }
.crm-ph > a:first-child { flex: 1 1 auto; min-width: 0; }
.crm-phones small { font-size: 11px; }
.crm-acts { display: flex; gap: 2px; flex: none; }
.crm-ph-ed .row { flex-wrap: nowrap; }
.crm-ph-ed select { width: 110px; flex: none; }
.crm-ph-ed .input { flex: 1 1 auto; min-width: 0; }
.crm-days { display: flex; flex-wrap: wrap; gap: 6px; }
.crm-days .chip { cursor: pointer; font: inherit; font-size: 13px; color: var(--text-2); }
.crm-days .chip.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.crm-stars { display: inline-flex; gap: 1px; font-size: 15px; line-height: 1; letter-spacing: 0; }
.crm-stars i { font-style: normal; color: var(--border-strong); }
.crm-stars i.on { color: var(--gold); }
.crm-member { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: inherit; text-decoration: none; min-width: 0; }
.crm-member > .grow { min-width: 0; display: grid; gap: 4px; overflow-wrap: anywhere; }
.crm-mob { text-align: start; unicode-bidi: plaintext; }
.crm-pts { display: grid; justify-items: center; gap: 2px; flex: none; text-align: center; }
.crm-pts b { font-size: 20px; font-variant-numeric: tabular-nums; }
.crm-pts small { font-size: 11.5px; color: var(--text-3); }
.crm-findbox .row { flex-wrap: nowrap; }
.crm-find { font-size: 20px; letter-spacing: 1px; flex: 1 1 auto; min-width: 0; }
.crm-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 10px; margin: 12px 0; }
.crm-kpi { display: grid; gap: 4px; padding: 12px 14px; min-width: 0; }
.crm-kpi > small:first-child { color: var(--text-3); font-size: 12px; }
.crm-kpi b { font-size: 20px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.crm-stars-ed { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.crm-stars-ed small { color: var(--text-3); }
.crm-ta { min-height: 84px; resize: vertical; line-height: 1.8; padding: 8px 10px; font: inherit; }
.crm-body { overflow-wrap: anywhere; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.crm-sms { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px 14px 4px 14px; padding: 10px 12px; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.9; }
.crm-pv { background: var(--surface-2); }

/* ── بخش ۴ (گام ۴۲): سوییت ── */
.rnt-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; }
.rnt-suite { display: grid; gap: 8px; padding: 12px 14px; border-inline-start: 5px solid var(--border); min-width: 0; }
.rnt-suite.in { border-inline-start-color: var(--danger); }
.rnt-suite.res { border-inline-start-color: var(--gold); }
.rnt-suite.dirty { border-inline-start-color: var(--info); background: var(--info-soft); }
.rnt-suite.free { border-inline-start-color: var(--ok); }
.rnt-suite-h { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rnt-suite-h b { font-size: 17px; overflow-wrap: anywhere; }
.rnt-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.rnt-dot::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.rnt-dot.in { color: var(--danger-strong); }
.rnt-dot.in::before { background: var(--danger); }
.rnt-dot.res::before { background: var(--gold); }
.rnt-dot.dirty { color: var(--info); }
.rnt-dot.dirty::before { background: var(--info); }
.rnt-dot.free::before { background: var(--ok); }
.rnt-bk { display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: inherit; text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.rnt-kx-t th, .rnt-kx-t td { vertical-align: top; }
.rnt-kx-t thead th { text-align: center; white-space: nowrap; }
.rnt-kx-t tbody th { white-space: nowrap; position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; }
.rnt-kx-td { min-width: 112px; }
.rnt-kx { display: grid; gap: 1px; padding: 4px 6px; margin-bottom: 4px; border-radius: 6px; font-size: 12px; color: inherit; text-decoration: none; background: var(--gold-soft); border-inline-start: 3px solid var(--gold); }
.rnt-kx.in { background: var(--danger-soft); border-inline-start-color: var(--danger); }
.rnt-kx.out { background: var(--ok-soft); border-inline-start-color: var(--ok); }
.rnt-kx b { font-variant-numeric: tabular-nums; }
.rnt-kx span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.rnt-kx-add { display: block; text-align: center; color: var(--text-3); text-decoration: none; border: 1px dashed var(--border); border-radius: 6px; line-height: 22px; }
.rnt-kx-add:hover { color: var(--primary); border-color: var(--primary); }
.rnt-quote { min-height: 56px; }
.rnt-prop { font-size: 20px; font-variant-numeric: tabular-nums; }
.rnt-amount { font-size: 18px; font-weight: 800; }
.rnt-bk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 10px; margin-bottom: 12px; }
.rnt-money { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; }
.rnt-money b { font-variant-numeric: tabular-nums; text-align: end; }
.rnt-money .rnt-span { grid-column: 1 / -1; }
.rnt-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 8px; }
.rnt-check { padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.rnt-check input { width: 20px; height: 20px; }
.rnt-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 150px), 1fr)); gap: 8px; }
.rnt-ph { margin: 0; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--surface-2); min-width: 0; }
.rnt-ph.main { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.rnt-ph img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-3); }
.rnt-ph figcaption { padding: 2px 6px; gap: 2px; }
.rnt-big { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 8px; }
.rnt-me { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px; color: inherit; text-decoration: none; min-width: 0; }
.rnt-me .grow { display: grid; gap: 4px; min-width: 0; }
.rnt-me b { font-size: 18px; font-variant-numeric: tabular-nums; }
.rnt-medal { display: grid; justify-items: center; font-size: 30px; line-height: 1; flex: none; }
.rnt-medal small { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.rnt-me-big { margin-bottom: 12px; }
.rnt-guest { display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.rnt-guest .warn { color: var(--accent); }
.rnt-day { display: grid; gap: 6px; min-width: 680px; padding: 4px 0; }
.rnt-day-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; }
.rnt-day-row > b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rnt-day-hours { display: grid; grid-template-columns: repeat(24, 1fr); font-size: 10.5px; color: var(--text-3); text-align: center; }
.rnt-day-track { position: relative; height: 34px; border-radius: 6px; background: repeating-linear-gradient(to left, var(--surface-2) 0, var(--surface-2) calc(100% / 24 - 1px), var(--border) calc(100% / 24 - 1px), var(--border) calc(100% / 24)); }
.rnt-day-bk { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; background: var(--gold-soft); border: 1px solid var(--gold); color: inherit; text-decoration: none; font-size: 11.5px; overflow: hidden; padding: 0 4px; display: flex; align-items: center; }
.rnt-day-bk.in { background: var(--danger-soft); border-color: var(--danger); }
.rnt-day-bk.out { background: var(--ok-soft); border-color: var(--ok); }
.rnt-day-bk span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) {
  .crm-card .crm-phones { flex-basis: 100%; }
  .crm-stars-ed { grid-template-columns: repeat(5, minmax(56px, 1fr)); overflow-x: auto; }
  .rnt-suite-h b { font-size: 16px; }
}

/* ── بخش ۴ ب (گام ۴۳): فروشگاه آنلاین و پیک (کارکنان) ── */
.shp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px; }
.shp-o.new { border-inline-start-color: var(--danger); }
.shp-o.accepted, .shp-o.picking { border-inline-start-color: var(--gold); }
.shp-o.ready, .shp-o.out { border-inline-start-color: var(--info); }
.shp-o.delivered { border-inline-start-color: var(--ok); }
.shp-o.cancelled { opacity: .7; }
.shp-addr { overflow-wrap: anywhere; line-height: 1.8; }
.shp-chips { gap: 6px; margin-bottom: 10px; }
.shp-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--surface-2); font-size: 11.5px; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.shp-n.hot { background: var(--danger); color: #fff; }
.shp-filters { gap: 8px; margin-bottom: 10px; }
.shp-filters > * { flex: 1 1 160px; min-width: 0; }
.shp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px; margin-bottom: 12px; }
.shp-head { gap: 6px; margin-bottom: 10px; }
.shp-sum { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; }
.shp-due { color: var(--accent); font-size: 17px; }
.shp-lines { display: grid; gap: 8px; }
.shp-line { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-width: 0; border-inline-start: 4px solid var(--border); }
.shp-line.ok { border-inline-start-color: var(--ok); }
.shp-line.miss { border-inline-start-color: var(--danger); opacity: .8; }
.shp-line .grow { min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.shp-th { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); }
.shp-pick { display: flex; gap: 4px; align-items: center; flex: none; }
.shp-pq { width: 72px; text-align: center; }
.shp-scanrow { gap: 8px; margin-bottom: 10px; }
.shp-scan { flex: 1; font-size: 16px; min-width: 0; }
.shp-tl { display: grid; gap: 8px; }
.shp-ev { display: flex; gap: 10px; align-items: flex-start; }
.shp-ev.priv { opacity: .75; }
.shp-ev > b { flex: none; min-width: 44px; font-variant-numeric: tabular-nums; }
.shp-run { display: grid; gap: 8px; padding: 12px 14px; min-width: 0; border-inline-start: 4px solid var(--border); }
.shp-run.out { border-inline-start-color: var(--info); }
.shp-run.ready { border-inline-start-color: var(--gold); }
.shp-run.delivered, .shp-run.off { opacity: .72; }
.shp-big { font-size: 20px; font-weight: 800; text-align: center; padding: 10px; background: var(--gold-soft); border-radius: 10px; }
.shp-prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.shp-prod { display: flex; gap: 10px; align-items: center; padding: 10px; color: inherit; text-decoration: none; min-width: 0; }
.shp-prod.off { opacity: .6; }
.shp-prod img, .shp-noimg { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); }
.shp-prod .grow { min-width: 0; display: grid; gap: 3px; }
.shp-prod b { overflow-wrap: anywhere; }
.shp-phs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.shp-ph { display: grid; gap: 6px; }
.shp-ph img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.shp-banners { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 10px; }
.shp-banner { display: grid; gap: 6px; }
.shp-banner.off { opacity: .6; }
.shp-banner img { width: 100%; aspect-ratio: 3 / 1; object-fit: cover; border-radius: 10px; }
.shp-band { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.shp-band .input { width: 110px; }
.shp-rcpt { max-width: 100%; max-height: 70vh; display: block; margin: auto; }
.shp-open { font-size: 15px; }
@media print { .shp-line { break-inside: avoid; } .shp-th { display: none; } }

/* ═════ بخش ۵ب: مرجوعی به تأمین‌کننده (rt-) و چاپ چک ═════ */
.rt-form { max-width: 720px; }
.rt-scan { gap: 8px; align-items: center; }
.rt-scan .grow { min-width: 0; }
.rt-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--primary-soft); color: var(--text); min-width: 0; }
.rt-item b { overflow-wrap: anywhere; }
.rt-item.muted { background: var(--surface-2); }
.rt-qty { max-width: 140px; font-size: 18px; text-align: center; }
.rt-reasons button { min-height: 40px; }
.rt-thumb { width: 100%; font: inherit; }
.rt-thumb img { max-height: 30vh; }
.rt-go { min-width: 180px; justify-content: center; }
.rt-sr { margin-top: 14px; }
.rt-photo { padding: 10px; display: grid; place-items: center; }
.rt-photo img { max-width: 100%; max-height: 50vh; border-radius: 8px; object-fit: contain; }
.rt-tot { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.rt-ho .input { min-width: 0; }
.rt-ho tr.inactive td { opacity: .5; }
.rt-notice { margin-bottom: 12px; align-items: center; }
.rt-notice .grow { min-width: 0; }
.rt-badge { display: inline-flex; align-items: center; gap: 4px; }
.rt-badge svg.i { width: 13px; height: 13px; }
.rt-slot:empty { display: none; }
.chq-pv .pf-preview { padding: 8px; }
@media (max-width: 640px) {
  .rt-go { width: 100%; }
  .rt-ho .t th:nth-child(5), .rt-ho .t td:nth-child(5) { min-width: 110px; }
}

/* ═════ بخش ۵د: دستیار هوشمند (aix-) ═════ */
.aix-chat { display: flex; flex-direction: column; min-height: 50vh; }
.aix-log { display: grid; gap: 14px; padding: 14px; max-height: 58vh; overflow-y: auto; }
.aix-qa { display: grid; gap: 6px; }
.aix-q, .aix-a { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; min-width: 0; }
.aix-q { background: var(--surface-2); justify-self: start; max-width: 85%; }
.aix-a { background: var(--primary-soft); justify-self: end; max-width: 92%; }
.aix-q svg.i, .aix-a svg.i { flex: none; margin-top: 3px; }
.aix-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; }
.aix-samples { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.aix-samples .chip { cursor: pointer; font: inherit; font-size: 12.5px; color: var(--text-2); }
.aix-samples .chip:hover { border-color: var(--primary); color: var(--primary); }
.aix-bar { display: flex; gap: 8px; align-items: flex-end; padding: 12px 14px; border-top: 1px solid var(--border); margin-top: auto; }
.aix-input { flex: 1; min-width: 0; resize: vertical; min-height: 44px; }
.aix-sup.urgent { border-inline-start: 4px solid var(--danger); }
.aix-chart { width: 100%; height: auto; display: block; overflow: visible; }
.aix-chart .base { stroke: var(--border-strong); stroke-width: 1; }
.aix-chart .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.aix-chart .bar rect { fill: var(--primary-2); opacity: .8; }
.aix-chart .bar.fc rect { fill: #c8962e; opacity: .55; }
.aix-chart .bar.fc rect.actual { fill: #c8962e; opacity: 1; }
.aix-chart .bar.low rect { fill: var(--danger); opacity: .75; }
.aix-chart .bar rect.hit { fill: transparent; opacity: 1; cursor: pointer; pointer-events: all; }
.aix-chart text { font-family: inherit; text-anchor: middle; fill: var(--text-3); font-size: 11px; pointer-events: none; }
.aix-chart text.strong { fill: var(--text); font-weight: 800; }
.aix-legend { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.aix-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--primary-2); margin-inline-start: 8px; }
.aix-dot.fc { background: #c8962e; opacity: .7; }
.aix-feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 8px; }
.aix-narr .aix-text { margin-bottom: 8px; }
.aix-slot:empty { display: none; }
@media (max-width: 640px) {
  .aix-log { max-height: 52vh; padding: 10px; }
  .aix-q, .aix-a { max-width: 100%; }
  .aix-chart text { font-size: 13px; }
}
@media (max-width: 640px) { .grid.k4.aix-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── بخش ۵ه: لایسنس و API عمومی ── */
.lic-facts { align-items: start; }
.lic-fact { min-width: 0; overflow-wrap: anywhere; }
.lic-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.lic-meter { display: flex; flex-direction: column; gap: 6px; }
.lic-bar { height: 8px; border-radius: 99px; background: var(--border); overflow: hidden; }
.lic-bar > span { display: block; height: 100%; background: var(--ok, #16a34a); border-radius: 99px; }
.lic-bar > span.near { background: var(--accent); }
.lic-bar > span.full { background: var(--danger); }
.lic-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.lic-pub, .ext-key { overflow-wrap: anywhere; word-break: break-all; font-size: 12px; }
.ext-key { display: block; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 8px; user-select: all; }
.lic-hist ul { margin: 6px 0 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; }
.ext-scopes { display: flex; flex-wrap: wrap; gap: 4px; }
.ext-ex pre { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; min-width: 0; }
.ext-ex .row { align-items: flex-start; gap: 8px; }
.ext-docs h4 { margin: 8px 0 4px; }
.lic-banner { margin-bottom: 12px; }
.lic-banner a { margin-inline-start: 8px; }

/* ── بخش ۵ج: طلا و ارز ── */
.gld-actions { gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.gld-up { color: var(--ok, #15803d); }
.gld-down { color: var(--danger); }
.gld-kpis .kpi.warn .value { color: var(--accent); }
.gld-vs b { font-size: 16px; }
.gld-prices { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.gld-price { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.gld-price b { display: block; font-size: 15px; margin: 2px 0; }
.gld-price.stale { border-style: dashed; border-color: var(--accent); }
.gld-chart { width: 100%; }
.gld-svg { width: 100%; height: auto; display: block; }
.gld-svg .gld-grid { stroke: var(--border); stroke-width: 1; }
.gld-svg .gld-line { fill: none; stroke: var(--series-1, #b8860b); stroke-width: 2.2; stroke-linejoin: round; }
.gld-svg .gld-tick { fill: var(--text-3); font-size: 11px; }
.gld-svg .gld-buy { fill: var(--ok, #16a34a); stroke: var(--bg, #fff); stroke-width: 1.5; }
.gld-svg .gld-sell { fill: var(--danger); stroke: var(--bg, #fff); stroke-width: 1.5; }
.gld-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.gld-dot.buy { background: var(--ok, #16a34a); }
.gld-dot.sell { background: var(--danger); }
.gld-total { font-size: 15px; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); }
.gld-filters { margin-bottom: 12px; }
.gld-filters .field { min-width: 140px; }

/* ── مرکز آموزش (بخش ۵و) ── */
.hlp-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 12px; margin-bottom: 12px; }
.hlp-search .input { border: 0; box-shadow: none; background: transparent; flex: 1; min-width: 0; }
.hlp-gh { margin: 6px 0 0; font-size: 15px; }
.hlp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.hlp-card { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none; min-width: 0; }
.hlp-card:hover, .hlp-card:focus-visible { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.hlp-card > .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hlp-card b { font-size: 14px; }
.hlp-ic { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
:root[data-theme='dark'] .hlp-ic { color: var(--text); }
.hlp-lesson { display: flex; flex-direction: column; gap: 14px; max-width: 980px; }
.hlp-lead { margin: 0; line-height: 2; font-size: 15px; }
.hlp-lesson h3 { margin: 0 0 6px; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.hlp-steps { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 8px; line-height: 1.9; }
.hlp-steps li::marker { font-weight: 700; color: var(--accent); }
.hlp-box { border-radius: var(--radius); padding: 12px 14px; border: 1px solid var(--border); }
.hlp-box ul { margin: 0; padding-inline-start: 20px; line-height: 1.9; }
.hlp-box.ok { background: var(--ok-soft); border-color: transparent; }
.hlp-box.warn { background: var(--gold-soft); border-color: transparent; }
:root[data-theme='dark'] .hlp-box.ok, :root[data-theme='dark'] .hlp-box.warn { background: var(--surface-2); border-color: var(--border); }
.hlp-shot { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.hlp-seg { display: flex; gap: 6px; }
.hlp-frame { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.hlp-frame img { display: block; width: 100%; height: auto; }
.hlp-shot.phone .hlp-frame { max-width: 340px; border-radius: 22px; border-width: 6px; border-color: var(--primary); }
.hlp-path { margin: 0; padding-inline-start: 26px; display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.hlp-path li::marker { font-weight: 700; color: var(--accent); }
@media print {
  .hlp-lesson { max-width: none; gap: 8px; }
  .hlp-print .hlp-lesson { break-before: page; }
  .hlp-print .hlp-lesson:first-child { break-before: auto; }
  .hlp-frame { break-inside: avoid; max-height: 120mm; }
  .hlp-frame img { max-height: 118mm; object-fit: contain; }
  .hlp-box { break-inside: avoid; background: none !important; border: 1px solid #999; }
}

/* ت۲۴: نوار ساعت کاری (روز بی‌شیفت، صندوق باز بعد از ساعت، پایان شیفت) */
.work-bar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 14px; font-size: 13px; font-weight: 600; text-align: center; }
.work-bar.info { background: var(--info-soft); color: var(--info); }
.work-bar.warn { background: var(--accent-soft); color: var(--accent); }
.work-bar svg { width: 16px; height: 16px; flex: none; }

/* erp049: فروش آزاد تا انبارگردانی (تنظیمات انبار) */
.freesale-list { display: grid; }
.freesale-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.freesale-row:last-child { border-bottom: 0; }
.freesale-row .grow { min-width: 0; }
@media (max-width: 560px) { .freesale-row { flex-wrap: wrap; } .freesale-row > .btn { margin-inline-start: auto; } }

/* erp050: مرتب‌سازی کالاها */
.tdy-kx { margin-bottom: 14px; }
.tdy-kx .card-head { flex-wrap: wrap; }
.tdy-warn { color: var(--accent); font-weight: 600; }
.tdy-kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.tdy-kt { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.tdy-kt.pending { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft) inset; }
.tdy-kt-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.tdy-kt-no { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 44px; height: 44px; border-radius: 9px;
  background: var(--primary-soft); color: var(--primary); font-size: 20px; font-weight: 800; line-height: 1; }
.tdy-kt-no small { font-size: 10px; font-weight: 600; margin-bottom: 2px; }
.tdy-kt-foot { padding: 8px 12px; gap: 8px; align-items: center; border-top: 1px solid var(--border); margin-top: auto; }
table.t.tdy-sample th, table.t.tdy-sample td { padding: 5px 10px; font-size: 12.5px; }
.tdy-filters { gap: 8px; }
.tdy-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.tdy-flag { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px;
  font-size: 13px; cursor: pointer; white-space: nowrap; background: var(--surface); }
.tdy-flag:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.tdy-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; background: var(--primary-soft); border-bottom: 1px solid var(--border); }
.tdy-bulk[hidden], .tdy-bulk.hidden { display: none; }
table.t.tdy-t th { white-space: nowrap; vertical-align: bottom; }
table.t.tdy-t th.tdy-gh { text-align: center; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-3); padding-bottom: 2px; }
table.t.tdy-t tr.picked td { background: var(--primary-soft); }
table.t.tdy-t .neg { color: var(--danger-strong); }
.tdy-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.tdy-sort.on { color: var(--primary); }
.tdy-sort svg { width: 13px; height: 13px; }
.tdy-u { color: var(--text-3); font-size: 11.5px; }
.tdy-day { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tdy-src { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.tdy-src.erp { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
@media (max-width: 560px) { .tdy-kgrid { grid-template-columns: 1fr; } .tdy-flag { height: 32px; font-size: 12.5px; } }
table.t.tdy-t td:nth-child(3) { min-width: 200px; }
table.t.tdy-t td:nth-child(4) { min-width: 80px; }
