/* مانیکس پلاس — لایه‌ی ظاهری روی بوت‌استرپ RTL. همه‌ی دارایی‌ها محلی‌اند. */

/* ═══ فونت وزیرمتن (variable، سه زیرمجموعه) ═══ */
@font-face{
  font-family:'Vazirmatn';
  src:url("../fonts/vazirmatn-arabic-wght-normal.05d9ce2a23d3.woff2") format('woff2-variations');
  font-weight:100 900; font-display:swap;
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FEFF;
}
@font-face{
  font-family:'Vazirmatn';
  src:url("../fonts/vazirmatn-latin-wght-normal.e7eada615dc3.woff2") format('woff2-variations');
  font-weight:100 900; font-display:swap;
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face{
  font-family:'Vazirmatn';
  src:url("../fonts/vazirmatn-latin-ext-wght-normal.2b9f461883fd.woff2") format('woff2-variations');
  font-weight:100 900; font-display:swap;
  unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

:root{
  --bs-body-font-family:'Vazirmatn',Tahoma,system-ui,sans-serif;
  --bs-body-font-size:.92rem;
  --bs-body-bg:#f2f5f8;
  --bs-body-color:#132430;
  --mp-brand:#10a56e;
  --mp-brand-dark:#0d8a5c;
  --mp-side-1:#0b1f19;
  --mp-side-2:#123a2c;
  --mp-line:#e6ebf0;
  --bs-border-radius:.7rem;
  --bs-primary:#10a56e;
  --bs-primary-rgb:16,165,110;
}
body{font-family:var(--bs-body-font-family);background:var(--bs-body-bg)}
a{color:var(--mp-brand-dark);text-decoration:none}
a:hover{color:var(--mp-brand)}

.btn-primary{--bs-btn-bg:var(--mp-brand);--bs-btn-border-color:var(--mp-brand);
  --bs-btn-hover-bg:var(--mp-brand-dark);--bs-btn-hover-border-color:var(--mp-brand-dark);
  --bs-btn-active-bg:var(--mp-brand-dark);--bs-btn-active-border-color:var(--mp-brand-dark)}
.btn-outline-primary{--bs-btn-color:var(--mp-brand-dark);--bs-btn-border-color:var(--mp-brand);
  --bs-btn-hover-bg:var(--mp-brand);--bs-btn-hover-border-color:var(--mp-brand)}
.text-primary{color:var(--mp-brand-dark)!important}
.form-control:focus,.form-select:focus{border-color:var(--mp-brand);
  box-shadow:0 0 0 .22rem rgba(16,165,110,.15)}
.card{border-color:var(--mp-line);box-shadow:0 1px 2px rgba(13,36,48,.04),0 8px 24px -12px rgba(13,36,48,.10)}
.table{--bs-table-hover-bg:#f7fbf9}
.table th{font-size:.78rem;color:#8494a0;font-weight:600;background:#fafcfd;white-space:nowrap}
.table td,.table th{vertical-align:middle}
.num{font-variant-numeric:tabular-nums;white-space:nowrap}

/* ═══ پوسته ═══ */
.app{display:flex;min-height:100vh}
.app-sidebar{width:238px;flex-shrink:0;background:linear-gradient(180deg,var(--mp-side-1),var(--mp-side-2));
  color:#9fbcaf;padding:1rem .75rem;position:sticky;top:0;height:100vh;overflow-y:auto}
.app-main{flex:1;min-width:0;padding:1.4rem 1.6rem;max-width:1280px}
.brand{display:flex;align-items:center;gap:.55rem;color:#fff;font-weight:800;font-size:1.25rem;padding:.2rem .5rem 1rem}
.brand span{color:#2fd695}
/* فاصله‌ی بین دو بخش نام عمداً واقعی است، نه نیم‌فاصله: «مانیکس پلاس» */
.brand-name{white-space:nowrap}
.brand .dot{width:34px;height:34px;border-radius:11px;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#12b378,#0a6e49);font-size:1rem;box-shadow:0 6px 14px -4px rgba(18,179,120,.6)}
.nav-group{color:#6f8d7f;font-size:.66rem;font-weight:700;padding:.75rem .8rem .3rem;letter-spacing:.02em}
.nav-link-mp{display:flex;align-items:center;gap:.65rem;color:#9fbcaf;padding:.55rem .8rem;
  border-radius:.7rem;font-size:.86rem;font-weight:500}
.nav-link-mp:hover{background:rgba(255,255,255,.07);color:#dff2e9}
.nav-link-mp.active{background:linear-gradient(135deg,#12b378,#0d8a5c);color:#fff}
.nav-link-mp svg{width:18px;height:18px;flex-shrink:0;opacity:.92}
.side-foot{border-top:1px solid rgba(255,255,255,.08);margin-top:.8rem;padding-top:.7rem;font-size:.74rem;color:#7fa192;word-break:break-all}
#nav-toggle{display:none}

.page-head{display:flex;align-items:center;justify-content:space-between;gap:.8rem;flex-wrap:wrap;margin-bottom:1.1rem}
.page-head h1{font-size:1.3rem;font-weight:700;margin:0}

/* ═══ KPI ═══ */
.kpi{display:flex;align-items:center;gap:.8rem;padding:1rem}
.kpi .ico{width:44px;height:44px;border-radius:.85rem;display:flex;align-items:center;justify-content:center;font-size:1.2rem;flex-shrink:0}
.kpi .lbl{color:#71828f;font-size:.76rem}
.kpi .val{font-size:1.15rem;font-weight:800;margin-top:.1rem}
.kpi .hint{color:#8b98a3;font-size:.7rem}
.ico-green{background:#e2f5eb;color:#0d8a5c}.ico-blue{background:#e7f0fb;color:#2f6cb3}
.ico-orange{background:#fdf3dd;color:#a97e0d}.ico-red{background:#fdeeee;color:#c04a4a}
.ico-violet{background:#f0eafd;color:#7c4fe0}.ico-teal{background:#e0f4f4;color:#0f8f8f}

/* ═══ ورودی مبلغ ═══ */
.money-field{position:relative}
.money-field .input-group-text{font-size:.78rem;color:#71828f}
.amount-words{min-height:1.15rem;font-size:.74rem;color:#0d8a5c;margin-top:.2rem}
.amount-words:empty{min-height:0}

/* ═══ تقویم شمسی ═══ */
.jdp{position:absolute;z-index:1080;background:#fff;border:1px solid var(--mp-line);
  border-radius:1rem;padding:.8rem;width:292px;direction:rtl}
.jdp-head{display:flex;align-items:center;justify-content:space-between;gap:.35rem;margin-bottom:.5rem}
.jdp-nav{width:32px;height:32px;border:0;border-radius:.55rem;background:#eef2f5;font-size:1rem;line-height:1}
.jdp-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:3px;text-align:center}
.jdp-wd{font-size:.65rem;color:#8494a0;padding:.3rem 0;font-weight:600}
.jdp-d{border:0;background:transparent;height:32px;border-radius:.55rem;font-size:.8rem;color:#132430}
.jdp-d:hover{background:#e7f6ef}
.jdp-d.today{border:1.5px solid var(--mp-brand);font-weight:700}
.jdp-d.sel{background:linear-gradient(135deg,#12b378,#0d8a5c);color:#fff;font-weight:700}
.jdp-d.dim{opacity:0;pointer-events:none}
.jdp-foot{display:flex;justify-content:space-between;gap:.3rem;margin-top:.6rem}
input.jdate{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2371828f' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:left .7rem center;padding-left:2.1rem;cursor:pointer;background-color:#fff}

/* ═══ Tom Select ═══ */
.ts-wrapper.single .ts-control,.ts-wrapper.multi .ts-control{
  border:1px solid #dee2e6;border-radius:.7rem;padding:.42rem .75rem;min-height:calc(1.5em + .75rem + 2px);
  font-family:inherit;font-size:.92rem;direction:rtl;text-align:right;box-shadow:none}
.ts-wrapper.focus .ts-control{border-color:var(--mp-brand);box-shadow:0 0 0 .22rem rgba(16,165,110,.15)}
.ts-wrapper.disabled .ts-control{background:#e9ecef;opacity:1}
.ts-control input{font-family:inherit;font-size:.92rem}
.ts-dropdown{border:1px solid var(--mp-line);border-radius:.7rem;box-shadow:0 12px 32px -12px rgba(13,36,48,.3);
  margin-top:.25rem;direction:rtl;text-align:right;font-family:inherit;overflow:hidden;z-index:1085}
.ts-dropdown .option{padding:.5rem .75rem;font-size:.88rem}
.ts-dropdown .active{background:#e7f6ef;color:var(--mp-brand-dark)}
.ts-dropdown .opt-hint{color:#8b98a3;font-size:.74rem;margin-right:.4rem}
.ts-dropdown .create{padding:.5rem .75rem;font-size:.85rem;color:var(--mp-brand-dark)}
.ts-dropdown .no-results{padding:.6rem .75rem;color:#8b98a3;font-size:.8rem}
.ts-wrapper.single .ts-control:after{right:auto;left:.9rem}

/* ═══ توست ═══ */
#toasts{position:fixed;bottom:1.4rem;left:50%;transform:translateX(-50%);z-index:1090;
  display:flex;flex-direction:column;gap:.5rem;align-items:center;pointer-events:none}
.mp-toast{background:#122a21;color:#fff;padding:.6rem 1.1rem;border-radius:.8rem;font-size:.84rem;
  box-shadow:0 12px 32px -12px rgba(0,0,0,.5);animation:mpIn .25s ease}
.mp-toast.err{background:#7c2626}
@keyframes mpIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

/* ═══ ردیف‌های سند ═══ */
.doc-lines td{padding:.4rem .45rem}
.doc-lines .ts-wrapper{min-width:180px}
.line-remove{border:0;background:#fdeeee;color:#c04a4a;border-radius:.5rem;width:32px;height:32px}

/* ═══ چاپ ═══ */
.print-doc{font-size:.88rem}
.print-doc .doc-head{display:flex;justify-content:space-between;gap:1rem;
  border-bottom:2px solid var(--mp-line);padding-bottom:.7rem;margin-bottom:.9rem}
.print-doc .sign{margin-top:2.4rem;display:flex;justify-content:space-between;font-size:.8rem;color:#71828f}
@media print{
  .app-sidebar,.no-print,#toasts,.page-head .btn,nav,.modal-footer{display:none!important}
  .app-main{padding:0;max-width:none}
  .card{box-shadow:none;border:0}
  body{background:#fff}
  .table th{background:#f3f3f3!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  @page{size:A4;margin:14mm}
}

/* ═══ موبایل ═══ */
@media (max-width:991.98px){
  .app{flex-direction:column}
  .app-sidebar{position:static;width:100%;height:auto;display:flex;flex-wrap:wrap;align-items:center;
    gap:.4rem;padding:.7rem .9rem}
  .app-sidebar .brand{padding:0;flex:1}
  #nav-toggle{display:inline-flex}
  .app-sidebar .nav-body{display:none;width:100%}
  .app-sidebar.open .nav-body{display:block}
  .app-main{padding:1rem .9rem}
}
@media (max-width:575.98px){
  .app-main{padding:.85rem .7rem}
  .page-head h1{font-size:1.1rem}
  .table td,.table th{padding:.5rem .4rem;font-size:.82rem}
}

/* ═══ چیدمان صفحه‌ها ═══ */
.page-head .actions{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}
.search-bar{display:flex;gap:.5rem;align-items:center;margin-bottom:.9rem;max-width:620px}
.search-bar .form-control{max-width:340px}
.form-actions{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center;
  margin:1rem 0 2rem;padding-top:.9rem;border-top:1px solid var(--mp-line)}

/* ═══ کارت‌های شاخص ═══ */
.kpi-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:.8rem;margin-bottom:1rem}
.kpi{display:block;background:#fff;border:1px solid var(--mp-line);border-radius:.9rem;padding:.85rem 1rem;
  box-shadow:0 1px 2px rgba(13,36,48,.04)}
.kpi .l{color:#71828f;font-size:.76rem}
.kpi .v{font-size:1.18rem;font-weight:800;margin-top:.15rem;line-height:1.35}
.kpi .v small{font-size:.72rem;font-weight:500;color:#8b98a3}
.kpi .s{color:#8b98a3;font-size:.72rem;margin-top:.1rem}

/* ═══ کارت ماژول ═══ */
.module-card{display:flex;gap:.6rem;align-items:flex-start;width:100%;height:100%;cursor:pointer;
  background:#fff;border:1px solid var(--mp-line);border-radius:.85rem;padding:.8rem .9rem;transition:.15s}
.module-card:hover{border-color:var(--mp-brand)}
.module-card.on{border-color:#bfe6d5;background:#f7fdfa}
.module-card.locked{opacity:.6;cursor:not-allowed;background:#fafbfc}
.module-card .t{font-weight:600;font-size:.92rem;display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}
.module-card .d{color:#8b98a3;font-size:.76rem;margin-top:.15rem;line-height:1.6}
.module-card input{margin-top:.25rem;flex-shrink:0}

/* ═══ ردیف‌های سند ═══ */
.lines-table td{padding:.35rem .4rem;vertical-align:top}
.lines-table th{font-size:.72rem}
.lines-table .ts-wrapper{min-width:170px}
.lines-table .line-total{padding-top:.75rem;font-weight:600}
.lines-table .stock-hint{font-size:.7rem;margin-top:.15rem}
.lines-table .form-control{font-size:.88rem}
.line-del{line-height:1;padding:.25rem .5rem;font-size:1.05rem;margin-top:.15rem}

/* ═══ جمع‌های سند ═══ */
.totals .row-t{display:flex;justify-content:space-between;align-items:center;padding:.35rem 0;
  border-bottom:1px dashed var(--mp-line);font-size:.9rem}
.totals .row-t:last-of-type{border-bottom:0}
.totals .grand{font-size:1.1rem;font-weight:800;border-top:2px solid var(--mp-line);
  border-bottom:0;margin-top:.3rem;padding-top:.6rem}
.totals .amount-words{font-size:.82rem}

/* ═══ وضعیت چک ═══ */
.badge.status-inHand{background:#e7f0fb;color:#2f6cb3}
.badge.status-pending{background:#fdf3dd;color:#a97e0d}
.badge.status-passed{background:#e2f5eb;color:#0d8a5c}
.badge.status-bounced{background:#fdeeee;color:#c04a4a}
.badge.status-spent{background:#f0eafd;color:#7c4fe0}

/* ═══ صفحه‌های ورود ═══ */
.auth-body{background:linear-gradient(160deg,#0b2b20,#0d8a5c 140%);min-height:100vh;
  display:flex;align-items:center;justify-content:center;padding:1.2rem}
.auth-card{background:#fff;border-radius:1.1rem;padding:1.6rem;width:100%;max-width:420px;
  box-shadow:0 24px 60px -20px rgba(0,0,0,.45)}
.auth-brand{text-align:center;margin-bottom:1.2rem}
.auth-brand .dot{width:50px;height:50px;border-radius:16px;margin:0 auto .5rem;color:#fff;
  background:linear-gradient(135deg,#12b378,#0d8a5c);display:flex;align-items:center;
  justify-content:center;font-weight:800;font-size:1.5rem}
.auth-brand .t{font-weight:800;font-size:1.25rem}
.auth-brand .t span{color:#0d8a5c}
.auth-brand .s{color:#8b98a3;font-size:.8rem}

/* ═══ چاپ فاکتور ═══ */
.print-sheet{max-width:820px;margin:1.2rem auto;background:#fff;padding:1.4rem;
  border:1px solid var(--mp-line);border-radius:.8rem}
.print-head{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;
  border-bottom:2px solid var(--mp-line);padding-bottom:.8rem;margin-bottom:.8rem}
.print-head h2{font-size:1.1rem;font-weight:800;margin:0}
.print-head h3{font-size:1rem;font-weight:700;margin:0 0 .3rem}
.print-party{background:#f7fbf9;border-radius:.6rem;padding:.6rem .8rem;margin-bottom:.9rem;font-size:.86rem}
.print-table{font-size:.85rem}
.print-table th{background:#f3f7f5}
.print-totals{display:flex;justify-content:flex-start}
.print-totals table{min-width:280px;font-size:.88rem}
.print-totals td{padding:.25rem .5rem}
.print-totals .grand td{font-weight:800;border-top:2px solid var(--mp-line);font-size:1rem}
.print-words{font-size:.86rem;margin-top:.6rem;color:#0d8a5c}
.print-note,.print-footer{font-size:.82rem;color:#71828f;margin-top:.7rem}
/* سربرگِ کسب‌وکار روی سند: لوگو کنار نام، و مهر زیر «امضای فروشنده».
   اندازه‌ها عمداً سقف دارند — تصویرِ بزرگی که کاربر آپلود می‌کند نباید نصفِ
   کاغذ را بگیرد. */
.print-head .seller{display:flex;gap:.7rem;align-items:flex-start}
.print-logo{max-height:64px;max-width:150px;object-fit:contain}
.print-stamp{display:block;max-height:88px;max-width:180px;object-fit:contain;
  margin-top:.4rem;mix-blend-mode:multiply}
@media print{.print-logo{max-height:56px}.print-stamp{max-height:78px}}
.print-signs{display:flex;justify-content:space-between;margin-top:2.6rem;font-size:.82rem;color:#71828f}
@media print{
  .print-sheet{border:0;margin:0;padding:0;max-width:none}
}

/* ═══ اصلاحات موبایل ═══ */
.badge{white-space:nowrap}
@media (max-width:575.98px){
  .kpi-row{grid-template-columns:repeat(auto-fit,minmax(148px,1fr));gap:.55rem}
  .kpi{padding:.65rem .7rem}
  .kpi .v{font-size:1rem}
  .search-bar .form-control{max-width:none}
  .form-actions .btn{flex:1 1 auto}
}

/* ═══ فهرست پیشنهادها همیشه روی همه‌چیز ═══ */
/* با dropdownParent=body فهرست فرزند <body> است و هیچ overflowی نمی‌بُردش؛
   جای دقیقش را placeDropdown در app.js حساب می‌کند. */
.ts-dropdown{z-index:1100!important}
body > .ts-dropdown{position:absolute;overflow:auto;
  box-shadow:0 16px 40px -12px rgba(13,36,48,.45)}
.ts-dropdown .option{white-space:normal;line-height:1.75;padding:.55rem .8rem}
.ts-dropdown .opt-hint{display:block;margin:.15rem 0 0;font-size:.75rem}
.ts-dropdown .active{background:#e7f6ef}

/* ═══ نوار تفکیک کسب‌وکار ═══ */
.biz-bar{display:flex;gap:.4rem;flex-wrap:wrap;align-items:center;
  margin:-.35rem 0 1rem;padding-bottom:.7rem;border-bottom:1px solid var(--mp-line)}
.biz-chip{display:inline-flex;align-items:center;gap:.4rem;border:1px solid var(--mp-line);
  background:#fff;color:#51606c;border-radius:999px;padding:.3rem .85rem;font-size:.84rem;
  font-family:inherit;cursor:pointer;transition:.14s;text-decoration:none}
.biz-chip:hover{border-color:var(--mp-brand);color:var(--mp-brand-dark)}
.biz-chip .dot{width:8px;height:8px;border-radius:50%;background:currentColor;opacity:.75}
.biz-chip.on{background:var(--mp-brand-dark);border-color:var(--mp-brand-dark);color:#fff;font-weight:600}
.biz-chip.add{font-size:1rem;line-height:1;padding:.3rem .7rem;color:#8b98a3}
.biz-chip.c-teal{color:#0d8a5c}.biz-chip.c-blue{color:#2f6cb3}
.biz-chip.c-violet{color:#7c4fe0}.biz-chip.c-orange{color:#a97e0d}
.biz-chip.c-red{color:#c04a4a}.biz-chip.c-slate{color:#5a6b78}
.biz-chip.on.c-teal,.biz-chip.on.c-blue,.biz-chip.on.c-violet,
.biz-chip.on.c-orange,.biz-chip.on.c-red,.biz-chip.on.c-slate{color:#fff}
.biz-chip.on.c-blue{background:#2f6cb3;border-color:#2f6cb3}
.biz-chip.on.c-violet{background:#7c4fe0;border-color:#7c4fe0}
.biz-chip.on.c-orange{background:#a97e0d;border-color:#a97e0d}
.biz-chip.on.c-red{background:#c04a4a;border-color:#c04a4a}
.biz-chip.on.c-slate{background:#5a6b78;border-color:#5a6b78}

/* برچسب کسب‌وکار داخل فهرست‌ها */
.biz-tag{display:inline-flex;align-items:center;gap:.3rem;font-size:.72rem;color:#71828f}
.biz-tag .dot{width:7px;height:7px;border-radius:50%;background:currentColor}
.biz-tag.c-teal{color:#0d8a5c}.biz-tag.c-blue{color:#2f6cb3}
.biz-tag.c-violet{color:#7c4fe0}.biz-tag.c-orange{color:#a97e0d}
.biz-tag.c-red{color:#c04a4a}.biz-tag.c-slate{color:#5a6b78}

/* ── فیلترهای چیپی و فرم شخص ─────────────────────────────────────────── */
.chip-row{display:flex;flex-wrap:wrap;gap:.4rem}
.chip{display:inline-block;border:1px solid var(--mp-line);border-radius:999px;
      padding:.25rem .8rem;font-size:.85rem;color:#5a6b78;text-decoration:none;background:#fff}
.chip:hover{border-color:var(--mp-brand);color:var(--mp-brand-dark)}
.chip.active{background:var(--mp-brand-dark);border-color:var(--mp-brand-dark);
             color:#fff;font-weight:600}
.cat-chips{display:flex;flex-wrap:wrap;gap:.4rem}
.cat-chips .btn{border-radius:999px}
details.more-box{border:1px solid var(--mp-line);border-radius:10px;padding:.6rem .9rem;
                 background:#fbfcfd}
details.more-box>summary{cursor:pointer;font-weight:600;color:#5a6b78;list-style:none}
details.more-box>summary::-webkit-details-marker{display:none}
details.more-box>summary::before{content:'▸';display:inline-block;margin-left:.4rem;
                                 transition:transform .15s}
details.more-box[open]>summary::before{transform:rotate(-90deg)}
/* دکمه‌های رادیویی (نوع شخص، …) باید سبزِ برنامه باشند نه آبیِ پیش‌فرض بوت‌استرپ */
.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary{
  background:var(--mp-brand-dark);border-color:var(--mp-brand-dark);color:#fff}
.btn-outline-primary{color:var(--mp-brand-dark);border-color:var(--mp-brand-dark)}
.btn-outline-primary:hover{background:var(--mp-brand);border-color:var(--mp-brand);color:#fff}
.btn-check:checked + .btn-outline-secondary{
  background:var(--mp-brand-dark);border-color:var(--mp-brand-dark);color:#fff}

/* ── تصویر کالا ──────────────────────────────────────────────────────── */
.img-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:.6rem}
.img-cell{position:relative;margin:0;border:1px solid var(--mp-line);border-radius:10px;
          overflow:hidden;background:#f7f9fa;aspect-ratio:1/1}
.img-cell img{width:100%;height:100%;object-fit:cover;display:block}
.img-cell .badge{position:absolute;inset-inline-start:6px;top:6px;background:var(--mp-brand-dark);
                 color:#fff;font-size:.7rem;padding:.15rem .4rem;border-radius:6px}
.img-cell .img-x{position:absolute;inset-inline-end:4px;top:4px;width:24px;height:24px;
                 border:0;border-radius:50%;background:rgba(0,0,0,.55);color:#fff;
                 line-height:1;font-size:1rem;cursor:pointer;padding:0}
.img-cell .img-x:hover{background:#c04a4a}
.thumb{width:44px;height:44px;border-radius:8px;object-fit:cover;display:block;
       border:1px solid var(--mp-line);background:#f7f9fa}
.thumb-empty{display:flex;align-items:center;justify-content:center;color:#b6c0c7;font-size:.8rem}

/* ── کارهای امروز ────────────────────────────────────────────────────── */
.todo-row a{display:flex;align-items:baseline;gap:.6rem;color:inherit;text-decoration:none}
.todo-row a:hover span:nth-child(2){text-decoration:underline}
.todo-row b{min-width:2.2rem;text-align:center;border-radius:6px;padding:.05rem .4rem;
            font-size:.95rem}
.todo-row .text-muted{margin-inline-start:auto}
.todo-danger b{background:#fdecec;color:#a63030}
.todo-warn b{background:#fdf4e3;color:#8a6608}
.todo-info b{background:#e9f4ef;color:var(--mp-brand-dark)}

/* ── نمودار ۱۲ ماه ───────────────────────────────────────────────────── */
:root{--c-sales:#0d8a5c;--c-expense:#c0562a}
.chart-legend{display:inline-flex;gap:.9rem;font-size:.82rem;color:#5a6b78;font-weight:400}
.chart-legend .key{display:inline-flex;align-items:center;gap:.35rem}
.chart-legend i{width:10px;height:10px;border-radius:3px;display:inline-block}
.bars{display:flex;align-items:flex-end;gap:.5rem;height:180px;
      border-bottom:1px solid var(--mp-line);padding-bottom:0}
.bar-group{flex:1;display:flex;flex-direction:column;align-items:center;height:100%}
.bar-group .pair{flex:1;width:100%;display:flex;align-items:flex-end;justify-content:center;
                 gap:2px}
.bar{width:42%;max-width:16px;min-height:2px;border-radius:4px 4px 0 0;display:block;
     transition:opacity .12s}
.bar:hover{opacity:.72}
.b-sales{background:var(--c-sales)}
.b-expense{background:var(--c-expense)}
.bar-label{font-size:.72rem;color:#7b8892;padding-top:.35rem;white-space:nowrap}
@media (max-width:560px){.bars{height:140px}.bar-label{font-size:.62rem}}

/* ── جستجوی سراسری ───────────────────────────────────────────────────── */
/* کادرِ دیده‌شدنیِ جستجو — بالای هر صفحه، بالای نوار میانبرها.
   دکمه است نه input: کلیک که شد، همان پنجره‌ی Ctrl+K باز می‌شود، پس رفتارِ
   جستجو یک جا تعریف شده و دو مسیر از هم جدا نمی‌افتند. */
/* پیش‌نمایشِ لوگو و مهرِ کسب‌وکار — پس‌زمینه‌ی شطرنجی تا تصویرِ بدون
   پس‌زمینه (PNG شفاف) واقعاً دیده شود که شفاف است. */
.brand-preview{border:1px solid var(--mp-line);border-radius:10px;padding:.5rem;
  margin-bottom:.45rem;display:flex;align-items:center;justify-content:center;height:92px;
  background-image:linear-gradient(45deg,#f2f5f7 25%,transparent 25%),
    linear-gradient(-45deg,#f2f5f7 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#f2f5f7 75%),
    linear-gradient(-45deg,transparent 75%,#f2f5f7 75%);
  background-size:14px 14px;background-position:0 0,0 7px,7px -7px,-7px 0}
.brand-preview img{max-height:78px;max-width:100%;object-fit:contain}
.search-trigger{display:flex;align-items:center;gap:.55rem;width:100%;
  background:#fff;border:1px solid var(--mp-line);border-radius:12px;
  padding:.6rem .85rem;margin-bottom:.7rem;cursor:text;color:#8b98a3;
  font:inherit;font-size:.9rem;text-align:start;transition:border-color .15s,box-shadow .15s}
.search-trigger:hover{border-color:#c6d2d9}
.search-trigger:focus-visible{outline:none;border-color:var(--mp-brand);
  box-shadow:0 0 0 3px rgba(15,122,90,.12)}
.search-trigger svg{width:17px;height:17px;flex:none}
.search-trigger .t{flex:1}
.search-trigger .k{display:flex;gap:.2rem;flex:none}
.search-trigger .k kbd{background:#f1f4f6;border-radius:4px;padding:.05rem .35rem;
  font-size:.7rem;color:#8b98a3;font-family:inherit}
@media(max-width:640px){.search-trigger .k{display:none}}
.cmdk-tips{padding:1rem 1.1rem;color:#8b98a3;font-size:.85rem;
  display:grid;grid-template-columns:1fr 1fr;gap:.35rem .9rem}
@media(max-width:520px){.cmdk-tips{grid-template-columns:1fr}}
.cmdk{position:fixed;inset:0;background:rgba(15,28,36,.45);z-index:1080;
      display:flex;align-items:flex-start;justify-content:center;padding:8vh 1rem 1rem}
.cmdk[hidden]{display:none}
.cmdk-box{background:#fff;border-radius:14px;width:min(620px,100%);
          box-shadow:0 18px 50px rgba(0,0,0,.25);overflow:hidden;display:flex;
          flex-direction:column;max-height:78vh}
.cmdk-box input{border:0;border-bottom:1px solid var(--mp-line);padding:1rem 1.1rem;
                font-size:1.02rem;width:100%;outline:none;font-family:inherit}
.cmdk-results{overflow-y:auto;flex:1}
.cmdk-group{padding:.5rem 1.1rem .2rem;font-size:.75rem;color:#8b98a3;font-weight:600}
.cmdk-item{display:flex;align-items:baseline;gap:.6rem;padding:.55rem 1.1rem;
           color:inherit;text-decoration:none}
.cmdk-item .t{font-weight:500}
.cmdk-item .h{color:#8b98a3;font-size:.82rem;margin-inline-start:auto;
              white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:55%}
.cmdk-item:hover,.cmdk-item.on{background:#eef6f2}
.cmdk-hint{padding:1.4rem 1.1rem;color:#8b98a3;text-align:center}
.cmdk-foot{border-top:1px solid var(--mp-line);padding:.5rem 1.1rem;font-size:.75rem;
           color:#8b98a3;background:#fbfcfd}
.cmdk-foot kbd{background:#eef1f3;border-radius:4px;padding:.05rem .4rem;color:#425058;
               font-family:Consolas,Menlo,monospace;font-size:.72rem;
               display:inline-block;direction:ltr;unicode-bidi:isolate}

/* لینک اشتراک فاکتور */
.share-card{background:#fbfcfd}
.share-link{max-width:420px;flex:1 1 240px;direction:ltr;font-size:.8rem}
.file-pick{cursor:pointer}

/* ── نشانِ مانده‌ی طرف‌حساب (زیر انتخابگر) ─────────────────────────────── */
.party-badge{margin-top:.3rem;margin-bottom:.9rem}
.party-badge:empty{display:none}
.party-badge .pb-wait{font-size:.78rem;color:#8b98a3}
.pb-link{display:inline-flex;align-items:center;gap:.45rem;flex-wrap:wrap;
         padding:.22rem .6rem;border-radius:999px;background:#f2f6f8;
         border:1px solid var(--mp-line);font-size:.8rem;color:#42525c;
         text-decoration:none;transition:background .15s,border-color .15s}
a.pb-link:hover{background:#eef6f2;border-color:var(--mp-brand);color:#42525c}
.pb-state{font-weight:600}
.pb-debtor{color:#b5341f}
.pb-creditor{color:#0d8a5c}
.pb-clear{color:#8b98a3}
.pb-amount{font-weight:600;color:#2b3a42}
.pb-over{color:#fff;background:#c0392b;border-radius:999px;
         padding:.02rem .45rem;font-size:.72rem}
.pb-go{color:var(--mp-brand-dark);font-size:.75rem;margin-inline-start:.2rem}
.pb-flat{background:transparent;border-style:dashed}

/* ── نوار فیلتر یک‌خطی (هزینه و درآمد، گزارش‌ها) ─────────────────────────── */
.filter-bar{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-bottom:1rem}
.filter-bar .range-fields{display:inline-flex;gap:.4rem}
.filter-bar .ts-wrapper.form-select{width:260px;max-width:100%;padding:0;border:0;background:none;flex:0 1 auto}
.filter-bar .ts-wrapper.form-select-sm .ts-control{padding:.25rem .5rem;font-size:.85rem;min-height:31px}
.filter-bar>select.form-select-sm{width:auto}
.filter-bar input.form-control-sm[type=search]{width:200px}
.ts-dropdown .option.opt-child{padding-inline-start:1.6rem;color:#4b5a63}
.ts-dropdown .optgroup-header{font-size:.75rem;color:#8b98a3;font-weight:600;padding:.45rem .8rem .2rem}
@media (max-width:560px){.filter-bar>*{flex:1 1 100%}.filter-bar .ms-auto{margin-inline-start:0!important}}
button.chip{font:inherit;cursor:pointer}
.period-table td,.period-table th{white-space:nowrap}
.kpi-link{color:inherit;text-decoration:none;display:block}
.kpi-link:hover{border-color:var(--mp-brand);color:inherit}
.kpi-link.active{border-color:var(--mp-brand);box-shadow:0 0 0 .18rem rgba(16,165,110,.15)}

/* ── نمودارها (static/js/charts.js) ──────────────────────────────────────── */
.chart-box{width:100%;min-height:60px}
.chart-box svg{display:block;overflow:visible}
.chart-empty{display:flex;align-items:center;justify-content:center;min-height:120px;
             color:#93a0aa;font-size:.85rem;background:#fafcfd;border:1px dashed var(--mp-line);
             border-radius:10px}
.chart-legend{display:flex;flex-wrap:wrap;gap:.35rem .9rem;margin-top:.5rem;
              font-size:.78rem;color:#55606b}
.chart-legend span{display:inline-flex;align-items:center;gap:.32rem}
.chart-legend i{width:10px;height:10px;border-radius:3px;display:inline-block;flex:0 0 auto}
.chart-tip{position:fixed;z-index:1090;pointer-events:none;display:none;
           background:#1c2530;color:#fff;border-radius:8px;padding:.4rem .6rem;
           font-size:.78rem;line-height:1.6;box-shadow:0 6px 18px rgba(0,0,0,.22);
           max-width:240px}
.chart-tip b{font-weight:600}
.chart-card{background:#fff;border:1px solid var(--mp-line);border-radius:14px;padding:1rem}
.chart-card>h3{font-size:.95rem;font-weight:600;margin:0 0 .15rem;color:#1c2530}
.chart-card>.hint{font-size:.78rem;color:#8b98a3;margin:0 0 .7rem}

/* ── میانبرها (هدر + داشبورد) ────────────────────────────────────────────── */
.shortcut-bar{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;margin-bottom:.8rem}
.shortcut{display:inline-flex;align-items:center;gap:.35rem;padding:.3rem .7rem;
          border-radius:999px;background:#fff;border:1px solid var(--mp-line);
          font-size:.82rem;color:#2b3a42;text-decoration:none;white-space:nowrap;
          transition:border-color .15s,background .15s,box-shadow .15s}
.shortcut:hover{border-color:var(--mp-brand);background:#f3faf6;color:#1c2530}
.shortcut svg{width:15px;height:15px;flex:0 0 auto;color:var(--mp-brand-dark)}
.shortcut.edit{border-style:dashed;color:#8b98a3}
.shortcut-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(148px,1fr));gap:.6rem}
.shortcut-grid .shortcut{border-radius:12px;padding:.7rem .8rem;justify-content:flex-start}
.shortcut-pick{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:.45rem}
.shortcut-pick label{display:flex;align-items:center;gap:.45rem;padding:.45rem .6rem;
                     border:1px solid var(--mp-line);border-radius:10px;cursor:pointer;
                     font-size:.85rem;background:#fff}
.shortcut-pick input:checked+span{font-weight:600;color:var(--mp-brand-dark)}
@media print{.shortcut-bar{display:none}}

/* ── راس‌گیری ─────────────────────────────────────────────────────────────── */
.ras-result{background:linear-gradient(180deg,#f3faf6,#fff);border:1px solid var(--mp-brand);
            border-radius:14px;padding:1rem 1.1rem}
.ras-date{font-size:1.65rem;font-weight:700;color:var(--mp-brand-dark);line-height:1.3}
.ras-formula{font-size:.78rem;color:#6b7680;background:#fff;border:1px dashed var(--mp-line);
             border-radius:10px;padding:.5rem .7rem;margin-top:.6rem;direction:rtl}
.pick-bar{position:sticky;bottom:0;z-index:20;background:#fff;border-top:1px solid var(--mp-line);
          padding:.6rem .9rem;display:flex;gap:.6rem;align-items:center;flex-wrap:wrap;
          box-shadow:0 -6px 18px rgba(16,40,60,.07)}
.pick-bar.hidden{display:none}
.row-pick{width:1.05rem;height:1.05rem}

/* ── نشانِ مانیکس پلاس ────────────────────────────────────────────────────── */
/* لوگو گِرد است و خودش پس‌زمینه دارد، پس نه کادر لازم دارد نه سایه.
   کلاس عمداً `brand-mark` است نه `mark`: بوت‌استرپ کلاسِ `.mark` را برای
   هایلایتِ متن نگه داشته و پس‌زمینه‌ی زردِ #fff3cd به آن می‌دهد — که پشتِ لوگو
   یک مربعِ کِرِم می‌انداخت. */
.brand .brand-mark{width:34px;height:34px;flex:0 0 auto;display:block}
.auth-brand .brand-mark{width:64px;height:64px;margin:0 auto .55rem;display:block}
