@davoodmehraban89 / Factor-easy-2 Mirror · read-only
Fork 0

سامانه صدور فاکتور و حسابداری

Mirrored from https://github.com/davoodmehraban89/Factor-easy.git

Synced Dec 3, 23:15 UTC

fix/admin-central-password-reset-20261028
audit-remediation-wave3-4-20261002 audit-remediation-wave3-verify-20261002 audit-remediation-wave4-20261002 audit-remediation-wave4b-20261002 audit-remediation-wave5a-identity-20261002 audit-remediation-wave5b-offboarding-20261002 audit-remediation-wave5c-authorization-20261002 audit-security-intent-review-20261002 audit/finora-financial-core-20261115 audit/finora-master-prompt-phase0-20261016 audit/finora-stage3-legacy-source-readonly-20261023 audit/full-controls-20261030 audit/owner-live-state-reconcile-20261012 audit/owner-review-20261007 audit/phase1-live-permissions-readonly-20261013 audit/reconcile-live-state-20261006 audit/reconcile-state-20261002 audit/wp0-hardening-baseline-20261102 branding-login-favicon-20261002 c8-workflow-task1 c8-workflow-task2 c8-workflow-task3 chore/wave0-pages-gate-closeout claude-code-plugins-setup design/finora-c01-authoritative-source-draft-20261124 docs-wave4b-verified-20261002 docs/active-company-invoice-release-evidence-20261014 docs/agent-operating-model-20261114 docs/chart-taxpayer-release-evidence-20261004 docs/cloud-only-agent-orchestration-20261115 docs/confirm-finora-product-charter-20261115 docs/continuation-20261030 docs/d4a-verified docs/external-work-review-20261121 docs/finora-audit-continuity-20261014 docs/finora-backup-merge-evidence-20261014 docs/finora-ci-reconciliation-20261122 docs/finora-codex-master-prompt docs/finora-eight-phase-plan-20261011 docs/finora-f002-live-buyer-filter-verified-20261015 docs/finora-license-race-release-evidence-20261014 docs/finora-license-rollout-acceptance-20261015 docs/finora-phase0-repeat-and-pages-nav-verified-20261015 docs/finora-phase0-repeat-evidence-20261015 docs/finora-selectors-release-and-fixture-qa-20261015 docs/finora-stagea-pr240-ci-triage-20261123 docs/finora-test-license-live-pass-20261015 docs/finora-v2-m01-coverage-20261124 docs/handoff-charter-v2-20261124 docs/invoice-product-search-release-20261011 docs/invoice-workspace-release-20261007 docs/phase-status-20261031 docs/phase0-acceptance-release-evidence-20261012 docs/phase0-admin-provision-release-evidence-20261012 docs/phase0-core-bundle-owner-login-open-20261013 docs/phase0-duplicate-js-release-20261016 docs/phase0-f001-auth-rest-shared-timeout-20261013 docs/phase0-f001-owner-login-observed-20261013 docs/phase0-f001-second-device-fail-40s-20261013 docs/phase0-f003-release-verification-20261011 docs/phase0-f004-print-release-evidence-20261012 docs/phase0-f004-watermark-release-evidence-20261012 docs/phase0-f005-large-selector-release-20261012 docs/phase0-f005-release-evidence-20261012 docs/phase0-f006-dark-release-evidence-20261012 docs/phase0-f008-final-pr-closure-evidence-20261012 docs/phase0-f008-reconcile-stale-prs-20261012 docs/phase0-f107-production-evidence-20261012 docs/phase0-kavenegar-otp-preflight-release-20261012 docs/phase0-login-release-evidence-20261012 docs/phase0-login-rest-bootstrap-stage-release-20261012 docs/phase0-owner-app-assets-bundle-release-20261013 docs/phase0-owner-login-csp-release-20261012 docs/phase0-reconcile-postmerge-evidence-20261012 docs/phase0-site-probe-release-evidence-20261012 docs/phase0-startup-release-evidence-20261012 docs/phase3-treasury-release-evidence-20261014 docs/pilot-posted-correction-release-evidence-20261014 docs/pilot-purchase-correction-release-evidence-20261014 docs/print-persian-release-verification-20261011 docs/qa-ci-triage-218-20261122 docs/real-account-qa-20261030 docs/release-state-20261007 docs/seamless-amendment-release-20261014 docs/seamless-document-correction-release-20261014 docs/settings-login-release-20261025 docs/stripe-qa-deployment-evidence-20261011 docs/ux-f2-release-evidence-20261011 docs/ux-f2-release-verification-20261011 docs/wave0-closeout docs/wave2-closeout exec-phase1-architecture exec-phase1-implementation exec-phase1-qa exec-phase1-security-release exec-phase1-ux feat/accounting-document-draft-approval-20261011 feat/accounting-document-release-candidate-20261011 feat/active-company-strict-isolation-20261014 feat/admin-provisioning-reconciled-20261011 feat/admin-secure-user-provisioning-20261011 feat/admin-user-provisioning-merged-20261011 feat/d4a-request-work-queue feat/document-lifecycle-atf-20261118 feat/document-lifecycle-temp-permanent-atef feat/draft-first-attachment-lifecycle-216 feat/finora-offline-encrypted-backup-20261014 feat/finora-phase-a-navigation-20261023 feat/finora-stripe-sandbox-edge-gate feat/immutable-attachment-temporary-vouchers feat/iran-accounting-design-audit feat/journal-document-lifecycle-20261118 feat/journal-rpc-repository-adapter-20261117 feat/office-c7-fulltext-ocr-provenance feat/password-recovery-admin-reset-20261025 feat/pilot-expense-income-inplace-amendment-20261014 feat/pilot-journal-invoice-correction-20261014 feat/pilot-purchase-correction-20261014 feat/pilot-treasury-unallocated-correction-20261014 feat/retain-document-editor-after-save-20261014 feat/seamless-financial-document-correction-20261014 feat/slice-b-tenant-rbac feat/stripe-sandbox-invoice-probe feature/accounting-core-p0 feature/accounting-product-guidance feature/admin-identity-phone-auth feature/commercial-rnd feature/finora-phase1a-supabase-cli-20261016 feature/finora-stage2-manual-canary-20261017 feature/finora-stage3-commercial-payload-20261023 feature/finora-stage3-enforce-invoice-rpc-20261023 feature/finora-stage3-enforce-purchase-red-20261023 feature/invoice-workspace-cleanup feature/phase0-kavenegar-otp-preflight-20261012 feature/ux-commerce-settings-r2 fix-shell-scroll-live-cache-20261002 fix-shell-scrollbar-explicit-ownership-20261002 fix-shell-scrollbar-ownership-20261002 fix-shell-scrollbar-right-edge-20261002 fix/about-bug-report-20261114 fix/active-company-invoice-scope-20261014 fix/active-company-isolation-reconcile-20261014 fix/admin-central-password-reset-20261028 fix/auth-network-diagnostics fix/chart-taxpayer-reference-20261003 fix/combobox-enter-reliability fix/combobox-live-search fix/combobox-production-cache fix/combobox-release-asset-v2 fix/company-edit-action-20261028 fix/company-edit-pilot-delete-20261014 fix/company-form-action-state-20261014 fix/company-form-action-state-rebased-20261014 fix/contact-operational-balance-20261111 fix/dark-theme-contrast fix/financial-lifecycle-recovery-20261124 fix/finora-accounting-test-organization-readiness-20261015 fix/finora-b01-safe-org-switch-20261124 fix/finora-b02-sync-recovery-20261124 fix/finora-b03-conflict-review-20261124 fix/finora-org-license-bootstrap-race-20261014 fix/finora-stage3-posted-source-immutable-20261023 fix/finora-v2-b03-r2-qa-20261124 fix/finora-v2-b03-r3-readonly-20261124 fix/g01-asof-financial-position-20261128 fix/invoice-product-search-rehydrate-20261011 fix/invoice-search-cache-bust fix/issue229-linked-draft-status-20261122 fix/login-assets-retry-20261014 fix/login-inert-startup-20261110 fix/login-member-access-20261101 fix/login-resilience-20261017 fix/login-short-viewport-20261028 fix/login-startup-readiness-20261024 fix/navigation-utilities-placement-20261105 fix/office-c7-source-ref-binding fix/office-c7-source-ref-binding-v2 fix/owner-login-network-20261026 fix/password-recovery-invalid-cancel-20261026 fix/payment-amount-format-20261111 fix/phase0-admin-provision-seat-bootstrap-20261012 fix/phase0-auth-bundled-assets-for-unstable-isp-20261013 fix/phase0-auth-handler-binding-stalled-session-20261012 fix/phase0-login-context-stage-visibility-20261012 fix/phase0-login-single-local-bundle-20261013 fix/phase0-login-site-probe-clarity-20261012 fix/phase0-login-ui-ready-20261012 fix/phase0-modal-dashboard-drill-20261011 fix/phase0-pages-blocking-core-bundles-20261013 fix/phase0-print-no-draft-watermark-20261012 fix/phase0-startup-parallel-asset-load-20261012 fix/phase3-behavioral-verification fix/preserve-pending-edits-20261121 fix/print-persian-digit-consistency-20261011 fix/recovery-login-startup-20261027 fix/report-opening-balance-release-20261130 fix/settings-checkbox-persistence-20261024 fix/taxpayer-arithmetic-20261004 fix/ux-keyboard-search-f2-20261011 fix/wave2-request-input-integrity hardening/c01-source-draft-20261129 hardening/global-draft-conversion-20261113 hardening/wp1-ledger-integrity-20261102 integration/finora-execution-20261124 integration/issue229-ui-qa-20261122 integration/wp1-ledger-core-20261115 integration/wp2-manual-journal-rpc-20261116 main ops-heartbeat-v2-20261002 ops-progress-heartbeat-rule-20261002 ops/wave4-production-20261003 plan/financial-core-phase1-approval-20261016 qa/attachment-allocator-two-session-20261122 qa/draft-first-save-red-evidence-20261122 qa/finora-autopost-retry-identity-red-20261122 qa/finora-identity-rpc-security-tripwire-20261122 qa/finora-issue223-manual-kardex-browser-red-20261123 qa/finora-issue223-stock-real-jwt-20261123 qa/finora-issue238-inventory-count-browser-red-20261123 qa/finora-issue238-save-browser-red-20261122 qa/finora-login-cors-header-preflight-20261025 qa/finora-phase0-saved-session-repeat-20261015 qa/finora-phase5-posted-insert-jwt-red-20261123 qa/finora-stage3-ui-jwt-autopost-20261023 qa/finora-v2-g01-report-reconciliation-20261125 qa/free-supabase-local-wp2-20261116 qa/issue229-approval-boundary-jwt-20261122 qa/issue229-sale-save-linked-draft-red-20261122 qa/phase0-acceptance-start-20261012 qa/phase0-f005-account-project-contract-stress-20261012 qa/phase0-f005-selector-stress-20261012 qa/phase0-f006-dark-contrast-20261012 qa/post-wave4-verification-20261003 qa/posted-source-immutable-jwt-20261122 qa/pr219-wp1-disposable-dburl-proof-20261123 qa/purchase-source-jwt-20261122 qa/real-settings-acceptance-20261025 qa/recovery-mail-acceptance-20261026 qa/source-autopost-jwt-atomicity-20261122 qa/wave0-negative-gate-proof qa/wp2-auth-tenant-e2e-20261117 qa/wp2-authorized-journal-write-20261122 qa/wp2-financial-paths-reconciliation-20261122 qa/wp3-financial-tenant-isolation-20261117 remediation/wave0-liveqa-wave1 remediation/wave2-request-integrity staging/finora-stage22-free-20261022 state-scroll-verified-20261002 state-wave4b-production-20261002 state-wave5a-production-20261002 test/finora-accounting-boot-readiness-20261015 test/finora-f0-02-production-selectors-20261015 test/finora-pages-commerce-event-wiring-20261015 test/finora-pages-invoice-selectors-readonly-20261015 test/finora-stage3-jwt-source-post-20261023 test/phase0-invoice-fixture-bootstrap-20261016 test/phase0-invoice-persistence-20261011 test/phase0-pages-delayed-dispatcher-20261016 ux-scroll-ownership-20261002 work/finora-stage3-enforce-purchase-green-20261023 work/finora-stage3-enforce-sale-green-20261023 work/finora-stage3-payload-green-20261023
html 977 lines 106 KB
Raw
1 <!DOCTYPE html>
2 <html lang="fa" dir="rtl">
3 <head>
4 <meta charset="UTF-8" />
5 <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
6 <title>نرم‌افزار ERP سازمانی فینورا</title>
7 <link rel="manifest" href="manifest.json?v=20261002-brand-v1" />
8 <link rel="icon" type="image/png" sizes="32x32" href="assets/finora-favicon-32.png?v=20261002-brand-v1" />
9 <link rel="apple-touch-icon" sizes="180x180" href="assets/finora-icon-180.png?v=20261002-brand-v1" />
10 <meta name="application-name" content="نرم‌افزار ERP سازمانی فینورا" />
11 <meta name="description" content="نرم‌افزار ERP سازمانی فینورا؛ مدیریت یکپارچه مالی، بازرگانی، خزانه، انبار، پیمان و عملیات سازمانی" />
12 <meta name="referrer" content="strict-origin-when-cross-origin" />
13 <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; font-src 'self' https://cdn.jsdelivr.net data:; img-src 'self' data: blob:; connect-src 'self' https://hcsixhqbyuhpshfwqpjx.supabase.co; object-src 'none'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests" />
14 <meta name="apple-mobile-web-app-capable" content="yes" />
15 <meta name="theme-color" content="#071a48" />
16 <link rel="preload" as="script" href="js/core.js?v=20261025-password-recovery-v1" />
17 <link rel="preload" as="script" href="js/login-connectivity.js?v=20261026-preflight-compare-v5" />
18 <script src="vendor/supabase.js"></script>
19 <script async src="https://cdn.jsdelivr.net/npm/xlsx@0.18.5/dist/xlsx.full.min.js"></script>
20 <link id="finora-optional-font" rel="stylesheet" media="print" href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/misc/Farsi-Digits/Vazirmatn-FD-font-face.css" />
21 <style>
22 :root{--primary:#2563eb;--primary-hover:#1d4ed8;--bg:#f8fafc;--card-bg:#fff;--text:#0f172a;--text-muted:#64748b;--border:#cbd5e1;--danger:#dc2626;--success:#059669;--warning:#d97706;--sidebar-w:240px;--nav-h:70px}
23 html,body{width:100%;max-width:100%;overflow-x:hidden!important;position:relative}
24 *{box-sizing:border-box;margin:0;padding:0;font-family:'Vazirmatn FD',-apple-system,BlinkMacSystemFont,Tahoma,sans-serif;-webkit-tap-highlight-color:transparent}
25 body{background-color:var(--bg);color:var(--text);font-size:14px}
26 #auth-screen{position:fixed;inset:0;background:radial-gradient(circle at 14% 12%,rgba(71,153,255,.18),transparent 32%),linear-gradient(135deg,#f8fbff 0%,#eef4ff 48%,#e8f1ff 100%);z-index:9999;display:flex;align-items:flex-start;justify-content:center;padding:clamp(14px,3vw,42px);overflow:auto}
27 .auth-shell{width:min(1180px,100%);flex-shrink:0;margin-block:auto;min-height:min(760px,calc(100vh - 56px));display:grid;grid-template-columns:minmax(0,.94fr) minmax(0,1.06fr);background:#fff;border:1px solid rgba(148,163,184,.22);border-radius:32px;overflow:hidden;box-shadow:0 34px 90px rgba(15,42,91,.18),0 8px 28px rgba(37,99,235,.08)}
28 .auth-card{background:linear-gradient(180deg,#fff,#fbfdff);width:100%;padding:clamp(32px,5vw,68px);text-align:right;display:flex;flex-direction:column;justify-content:center}
29 .auth-brand{display:flex;align-items:center;gap:14px;margin-bottom:28px}.auth-brand-logo{width:58px;height:58px;border-radius:16px;box-shadow:0 12px 28px rgba(24,94,214,.22);flex:none}.auth-brand h1{font-size:24px;color:#0b1739;letter-spacing:-.5px}.auth-brand p{font-size:12px;color:#64748b;margin-top:3px}
30 .auth-card .form-group label{color:#334155}.auth-card .form-control{min-height:50px;border-radius:12px;border-color:#dbe4f0;background:#fff;padding:10px 14px}.auth-card .form-control:focus{border-color:#2b75ff;box-shadow:0 0 0 4px rgba(43,117,255,.10)}
31 .auth-google{width:100%;min-height:50px;margin-bottom:16px;background:#fff!important;color:#172033!important;border:1px solid #dbe4f0!important;border-radius:12px!important;box-shadow:0 4px 12px rgba(15,23,42,.04)}.auth-google:hover{background:#f8fafc!important}.auth-google-mark{font-family:Arial,sans-serif;font-weight:800;color:#4285f4;font-size:18px}
32 .auth-divider{display:flex;align-items:center;gap:12px;color:#94a3b8;font-size:11.5px;margin:12px 0 18px}.auth-divider:before,.auth-divider:after{content:"";height:1px;background:#e7edf5;flex:1}
33 .auth-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:18px}.auth-actions .btn{border-radius:12px;min-height:48px}.auth-signup{width:100%;margin-top:10px;border-radius:12px;background:#eef4ff!important;color:#1556c0!important}.auth-note{font-size:11px;color:#7c8aa0;margin-top:14px;line-height:1.9}
34 .auth-visual{position:relative;isolation:isolate;overflow:hidden;background:linear-gradient(145deg,#061335 0%,#071d55 50%,#063ba4 100%);color:#fff;display:flex;align-items:center;justify-content:center;padding:56px}.auth-visual:before{content:"";position:absolute;width:620px;height:620px;border-radius:50%;background:radial-gradient(circle,rgba(0,201,255,.30),rgba(0,91,255,.08) 45%,transparent 68%);left:-220px;bottom:-290px;z-index:-1}.auth-visual:after{content:"";position:absolute;inset:auto -140px -210px 120px;height:430px;background:linear-gradient(135deg,rgba(20,106,255,.46),rgba(0,217,255,.08));transform:rotate(-12deg);border-radius:80px;filter:blur(1px);z-index:-1}
35 .auth-hero{width:min(470px,100%);text-align:center;display:flex;flex-direction:column;align-items:center}.auth-hero-logo{width:96px;height:96px;border-radius:25px;box-shadow:0 22px 48px rgba(0,0,0,.28);margin-bottom:18px}.auth-hero h2{font-family:Arial,sans-serif;font-size:52px;letter-spacing:-1.5px;line-height:1}.auth-hero .erp{font-family:Arial,sans-serif;font-size:13px;letter-spacing:6px;color:#c9dcff;margin-top:8px}.auth-hero .tagline{font-size:14px;color:#d9e7ff;margin-top:22px}
36 .auth-dashboard-art{width:100%;height:260px;margin-top:34px;position:relative;perspective:900px}.auth-glass{position:absolute;border:1px solid rgba(118,210,255,.58);background:linear-gradient(145deg,rgba(65,152,255,.18),rgba(4,36,105,.28));box-shadow:inset 0 0 30px rgba(65,192,255,.08),0 25px 50px rgba(0,0,0,.18);backdrop-filter:blur(7px)}.auth-glass-main{right:9%;left:12%;top:18px;bottom:0;border-radius:22px;transform:rotateY(-8deg)}.auth-glass-side{right:0;width:76px;top:0;bottom:18px;border-radius:18px;display:flex;flex-direction:column;gap:14px;align-items:center;justify-content:center}.auth-glass-side span{width:34px;height:34px;border-radius:10px;background:rgba(88,185,255,.24);display:grid;place-items:center;color:#8be8ff}.auth-chart{position:absolute;left:21%;right:22%;top:80px;height:95px;border-left:1px solid rgba(139,232,255,.24);border-bottom:1px solid rgba(139,232,255,.24)}.auth-chart:after{content:"";position:absolute;inset:12px 6px 8px;background:linear-gradient(135deg,transparent 0 18%,#39c8ff 19% 21%,transparent 22% 37%,#39c8ff 38% 40%,transparent 41% 58%,#39c8ff 59% 61%,transparent 62% 76%,#39c8ff 77% 79%,transparent 80%);filter:drop-shadow(0 0 6px #27bfff)}
37 @media(max-width:900px){.auth-shell{grid-template-columns:1fr;min-height:0;max-width:560px}.auth-visual{display:none}.auth-card{padding:32px 24px}.auth-brand{justify-content:center;text-align:center}.auth-actions{grid-template-columns:1fr}#auth-screen{align-items:flex-start}.auth-card{min-height:calc(100vh - 28px)}}
38 @media(min-width:901px) and (max-height:800px){
39 #auth-screen{padding:8px 20px}.auth-shell{min-height:0}.auth-card{padding:12px 24px;line-height:1.5}
40 .auth-brand{gap:10px;margin-bottom:8px}.auth-brand-logo{width:44px;height:44px;border-radius:12px}.auth-brand h1{font-size:20px;line-height:1.3}
41 .auth-card .form-group{margin-bottom:8px}.auth-card .form-group label{margin-bottom:4px}.auth-card .form-control{min-height:44px;padding:8px 12px}
42 .auth-google{min-height:44px;margin-bottom:4px}.auth-divider{margin:4px 0 6px}.auth-actions{margin-top:6px}.auth-actions .btn{min-height:44px}.auth-note{margin-top:8px;line-height:1.5}#auth-connectivity-result:empty{display:none}
43 .auth-visual{padding:28px}.auth-hero-logo{width:72px;height:72px;margin-bottom:12px}.auth-hero h2{font-size:42px}.auth-hero .tagline{margin-top:16px}.auth-dashboard-art{height:180px;margin-top:20px}
44 }
45 .app-root{display:flex;min-height:100vh;width:100%;max-width:100%;overflow-x:hidden}
46 .sidebar{width:var(--sidebar-w);background:var(--card-bg);border-left:1px solid var(--border);display:flex;flex-direction:column;position:fixed;top:0;bottom:0;right:0;z-index:100}
47 .brand-box{padding:20px;display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--border)}
48 .brand-icon{width:40px;height:40px;background:var(--primary);border-radius:10px;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:bold;font-size:14px}
49 .sidebar-menu{list-style:none;padding:16px 8px;flex:1;overflow-y:auto}
50 .sidebar-menu li a{display:flex;align-items:center;gap:12px;padding:12px 16px;color:var(--text);text-decoration:none;border-radius:8px;margin-bottom:4px;font-size:14px;font-weight:500;transition:all .2s;cursor:pointer}
51 .sidebar-menu li a:hover,.sidebar-menu li a.active{background:#eff6ff;color:var(--primary);font-weight:bold}
52 .sidebar-footer{padding:12px;border-top:1px solid var(--border);font-size:12px;color:var(--text-muted);text-align:center;display:flex;flex-direction:column;gap:6px}
53 .main-surface{flex:1;margin-right:var(--sidebar-w);padding:20px;padding-bottom:100px;max-width:calc(100% - var(--sidebar-w));overflow-x:hidden}
54 .mobile-dock{display:none;position:fixed;bottom:0;left:0;right:0;min-height:var(--nav-h);background:rgba(255,255,255,.98);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-top:1px solid #cbd5e1;z-index:200;align-items:stretch;padding-bottom:env(safe-area-inset-bottom);box-shadow:0 -4px 12px rgba(0,0,0,.06);overflow-x:auto;scrollbar-width:none}.mobile-dock::-webkit-scrollbar{display:none}
55 .dock-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:#475569;text-decoration:none;font-size:10.5px;font-weight:600;flex:0 0 76px;min-height:64px;cursor:pointer;white-space:nowrap}
56 .dock-tab.active{color:var(--primary);font-weight:800}
57 .dock-tab svg{width:20px;height:20px;stroke-width:2}
58 .whatsapp-support{position:fixed;bottom:90px;left:20px;z-index:250;display:flex;align-items:center;gap:8px;background:linear-gradient(135deg,#25D366,#128C7E);color:#fff;text-decoration:none;padding:10px 16px 10px 12px;border-radius:50px;box-shadow:0 8px 24px rgba(37,211,102,.4);font-weight:700;font-size:13px;transition:all .25s ease}
59 .whatsapp-support:hover{transform:translateY(-3px);box-shadow:0 12px 28px rgba(37,211,102,.55)}
60 .whatsapp-support svg{width:22px;height:22px;flex-shrink:0}
61 .card{background:var(--card-bg);border:1px solid var(--border);border-radius:12px;padding:18px;margin-bottom:18px;box-shadow:0 1px 3px rgba(0,0,0,.03);width:100%;max-width:100%;overflow:hidden}
62 .grid-kpi{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;margin-bottom:18px}
63 .kpi-gradient{box-shadow:0 4px 14px rgba(0,0,0,.12);border:none}
64 .quick-actions-row{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:16px}
65 .qa-btn{display:flex;align-items:center;gap:6px;border:none;color:#fff;padding:11px 16px;border-radius:12px;font-size:13px;font-weight:600;cursor:pointer;box-shadow:0 3px 10px rgba(0,0,0,.15);flex:1;min-width:130px;justify-content:center}
66 .qa-btn:hover{filter:brightness(1.08)}
67 .report-bar-wrap{display:flex;align-items:flex-end;gap:6px;height:160px;padding:10px 4px;overflow-x:auto}
68 .report-bar-col{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:38px}
69 .report-bar{width:26px;border-radius:6px 6px 0 0;background:linear-gradient(180deg,#8b5cf6,#6d28d9);transition:height .3s}
70 .report-bar-label{font-size:10px;color:var(--text-muted);white-space:nowrap}
71 .report-bar-value{font-size:10px;font-weight:bold;color:var(--text)}
72 .kpi-unit{background:var(--card-bg);border:1px solid var(--border);border-radius:10px;padding:16px;display:flex;align-items:center;gap:14px}
73 .kpi-icon{width:44px;height:44px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:20px}
74 .kpi-val{font-size:17px;font-weight:bold;margin-top:4px}
75 .kpi-lbl{color:var(--text-muted);font-size:12px;font-weight:500}
76 .btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:8px 16px;background:var(--primary);color:#fff;border:none;border-radius:8px;cursor:pointer;font-size:14px;font-weight:600;transition:background .2s;text-decoration:none}
77 .btn:hover{background:var(--primary-hover)}
78 .btn-secondary{background:#e2e8f0;color:var(--text)}
79 .btn-secondary:hover{background:#cbd5e1}
80 .btn-success{background:var(--success)}
81 .btn-danger{background:var(--danger)}
82 .btn-warning{background:var(--warning);color:#fff}
83 .form-group{margin-bottom:14px;width:100%}
84 .form-group label{display:block;margin-bottom:6px;font-size:13px;font-weight:600;color:#334155}
85 .form-control{width:100%;min-height:44px;padding:8px 12px;border:1px solid var(--border);border-radius:8px;font-size:14px;outline:none;background:#fff;transition:border-color .2s;direction:rtl}
86 .form-control:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.15)}
87 .form-control:disabled{background-color:#f1f5f9;color:#94a3b8;cursor:not-allowed}
88 .form-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;width:100%}
89 .table-responsive{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid var(--border);border-radius:8px}
90 table{width:100%;border-collapse:collapse;text-align:right;font-size:13px;min-width:500px}
91 th,td{padding:10px 10px;border-bottom:1px solid var(--border)}
92 th{background:#f1f5f9;color:#334155;font-weight:700}
93 #invoice-items-table{direction:rtl;width:100%;table-layout:auto}
94 #invoice-items-table th,#invoice-items-table td{text-align:right}
95 #invoice-items-table th:first-child,#invoice-items-table td:first-child{text-align:center}
96 #invoice-items-table th:last-child,#invoice-items-table td:last-child{text-align:center}
97 .badge{display:inline-block;padding:3px 8px;border-radius:6px;font-size:11px;font-weight:600}
98 .badge-success{background:#d1fae5;color:#065f46}
99 .badge-warning{background:#fef3c7;color:#92400e}
100 .badge-danger{background:#fee2e2;color:#991b1b}
101 .badge-info{background:#e0f2fe;color:#0369a1}
102 .view-pane{display:none}
103 .view-pane.active{display:block}
104 .modal-backdrop{display:none;position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(15,23,42,.6);backdrop-filter:blur(4px);z-index:999;align-items:center;justify-content:center;padding:16px}
105 .modal-backdrop.active{display:flex}
106 .modal-card{background:#fff;border-radius:14px;max-width:600px;width:100%;max-height:90vh;overflow-y:auto;padding:20px;box-shadow:0 20px 25px -5px rgba(0,0,0,.1)}
107 .accordion-item{border:1px solid var(--border);border-radius:10px;margin-bottom:12px;overflow:hidden;background:#fff}
108 .accordion-header{padding:14px 18px;background:#f8fafc;font-weight:bold;display:flex;justify-content:space-between;align-items:center;cursor:pointer;user-select:none}
109 .accordion-body{padding:16px;border-top:1px solid var(--border);display:none;background:#fff}
110 .accordion-item.open .accordion-body{display:block}
111 .about-dev-card{background:linear-gradient(135deg,#eff6ff,#f8fafc);border:1.5px solid #bfdbfe;border-radius:12px;padding:16px 18px;margin:14px 0;display:flex;align-items:center;gap:14px;flex-wrap:wrap}
112 .about-dev-avatar{width:52px;height:52px;background:linear-gradient(135deg,var(--primary),#1e40af);color:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:bold;flex-shrink:0}
113 .about-dev-info{flex:1;min-width:180px}
114 .about-dev-info h4{font-size:15px;color:#1e293b;margin-bottom:4px}
115 .about-dev-info p{font-size:12.5px;color:#64748b;margin-bottom:2px}
116 .about-dev-actions{display:flex;gap:8px;flex-wrap:wrap}
117 .about-dev-actions a{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:8px;font-size:12.5px;font-weight:700;text-decoration:none;transition:all .2s}
118 .about-dev-actions .btn-wa{background:linear-gradient(135deg,#25D366,#128C7E);color:#fff}
119 .about-dev-actions .btn-call{background:var(--primary);color:#fff}
120 @media print{
121 @page{size:A4 landscape;margin:8mm 10mm}
122 html,body{background:#fff!important;color:#000!important;margin:0!important;padding:0!important;width:100%!important}
123 .sidebar,.mobile-dock,.no-print,#auth-screen,.modal-backdrop,.whatsapp-support{display:none!important}
124 .view-pane{display:none!important}
125 .main-surface{margin:0!important;padding:0!important;max-width:100%!important;width:100%!important}
126 .main-surface>*:not(#printable-invoice){display:none!important}
127 .card{border:none!important;box-shadow:none!important;padding:0!important;margin:0!important}
128 .invoice-a4-page{width:100%!important;margin:0 auto!important;page-break-after:always!important;break-after:page!important;box-sizing:border-box!important}
129 .invoice-a4-page:last-child{page-break-after:avoid!important;break-after:avoid!important}
130 #printable-invoice{display:block!important}
131 }
132 @media (max-width:768px){
133 .sidebar{display:none}
134 .main-surface{margin-right:0;padding:12px;padding-bottom:calc(var(--nav-h) + 20px);max-width:100%}
135 .mobile-dock{display:flex}
136 .btn{width:100%}
137 .btn-inline{width:auto}
138 .form-row{grid-template-columns:1fr}
139 .whatsapp-support{bottom:84px;left:12px;padding:8px 12px 8px 10px;font-size:11.5px}
140 }
141
142 /* Finora Phase 1 — scalable enterprise shell */
143 :root{--shell-rail:82px;--shell-panel:238px;--shell-top:72px;--shell-line:#e5eaf1;--shell-soft:#f4f8fc;--shell-accent:#078b9b;--shell-accent-soft:#e9f8fa}
144 body{background:#f6f9fc}
145 .app-shell-nav.sidebar{width:var(--shell-rail);border-left:1px solid var(--shell-line);box-shadow:none;background:#fff;z-index:320}
146 .app-shell-nav .brand-box{height:var(--shell-top);padding:9px 6px;display:flex;flex-direction:column;justify-content:center;gap:2px;text-align:center;border-bottom:1px solid var(--shell-line)}
147 .app-shell-nav .brand-icon{display:none}
148 .app-shell-nav .brand-copy h2{font-size:18px;line-height:1.2;color:#10204b;letter-spacing:-.3px}
149 .app-shell-nav .brand-copy small{font-size:10px;color:#1685d1;font-weight:800}
150 .module-rail{display:flex;flex:1;flex-direction:column;gap:4px;padding:8px 6px;overflow-y:auto;scrollbar-width:thin}
151 .module-tab{appearance:none;border:0;background:transparent;color:#334155;border-radius:9px;min-height:55px;padding:6px 3px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;cursor:pointer;font:inherit;transition:.16s ease}
152 .module-tab span{font-family:Arial,sans-serif;font-size:21px;line-height:1}
153 .module-tab b{font-size:10.5px;font-weight:650;white-space:nowrap}
154 .module-tab:hover{background:#f2f7fb;color:#0f6470}
155 .module-tab.active{background:linear-gradient(145deg,#0795a5,#057b8b);color:#fff;box-shadow:0 5px 14px rgba(7,139,155,.18)}
156 .app-shell-nav .sidebar-footer{padding:7px 4px;gap:5px;border-top:1px solid var(--shell-line);font-size:9.5px;overflow:hidden}
157 .shell-logout{border:0;background:transparent;color:#64748b;font:inherit;font-size:10px;cursor:pointer}
158 .module-panel{position:fixed;top:0;bottom:0;right:var(--shell-rail);width:var(--shell-panel);z-index:310;background:#fff;border-left:1px solid var(--shell-line);transition:transform .2s ease,opacity .2s ease}
159 .module-panel-head{height:var(--shell-top);display:flex;align-items:center;justify-content:space-between;padding:13px 16px;border-bottom:1px solid var(--shell-line)}
160 .module-panel-head small{display:block;color:#94a3b8;font-size:10px;margin-bottom:3px}
161 .module-panel-head h3{font-size:16px;color:#0f172a}
162 .module-panel-handle{position:fixed;z-index:325;top:50%;right:calc(var(--shell-rail) + var(--shell-panel) - 1px);transform:translate(50%,-50%);width:24px;height:54px;border:1px solid #cbd5e1;border-radius:10px 0 0 10px;background:#fff;color:#087c8a;box-shadow:0 4px 14px rgba(15,23,42,.12);cursor:pointer;font:700 20px/1 Arial,sans-serif;transition:right .2s ease,background .15s ease}
163 .module-panel-handle:hover{background:#effafb}
164 .module-panel-handle:focus-visible{outline:3px solid rgba(7,139,155,.22);outline-offset:2px}
165 /* Critical desktop scroll ownership lives in HTML too, so a stale cached ui.js cannot restore the old mapping. */
166 @media (min-width:821px){
167 html,body{height:100%;overflow-y:hidden!important}
168 .app-root{height:100vh;min-height:0;overflow:hidden}
169 .module-rail,.module-panel-links,.main-surface{direction:ltr;overscroll-behavior:contain;scrollbar-gutter:stable}
170 .module-rail>*,.module-panel-links>*,.main-surface>*{direction:rtl}
171 .main-surface{height:100vh;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin}
172 }
173 .module-panel-links{height:calc(100vh - var(--shell-top));overflow-y:auto;padding:11px}
174 .module-group{padding:5px 0 11px;border-bottom:1px solid #f0f3f7;margin-bottom:8px}
175 .module-group:last-child{border-bottom:0}
176 .module-group-title{font-size:10.5px;color:#94a3b8;font-weight:700;padding:5px 8px 7px}
177 .module-link{width:100%;border:0;background:transparent;color:#334155;border-radius:8px;min-height:38px;padding:8px 9px;display:flex;align-items:center;gap:9px;text-align:right;font:inherit;font-size:12px;cursor:pointer}
178 .module-link .mi{width:22px;text-align:center;font-family:Arial,sans-serif;color:#64748b;font-size:15px}
179 .module-link:hover{background:#f6f9fc;color:#075f6a}
180 .module-link.active{background:var(--shell-accent-soft);color:#087c8a;font-weight:800;box-shadow:inset -3px 0 #0a9baa}
181 .module-link.active .mi{color:#078b9b}
182 .topbar{position:fixed;z-index:300;top:0;right:calc(var(--shell-rail) + var(--shell-panel));left:0;height:var(--shell-top);display:flex;align-items:center;gap:12px;padding:10px 20px;background:rgba(255,255,255,.96);border-bottom:1px solid var(--shell-line);backdrop-filter:blur(12px)}
183 .topbar-menu{display:none;width:38px;height:38px;border:1px solid var(--shell-line);border-radius:9px;background:#fff;color:#334155;cursor:pointer}
184 .global-search{position:relative;flex:1;max-width:600px;margin-inline:auto;display:flex;align-items:center;gap:7px;height:40px;padding:0 12px;background:#f8fafc;border:1px solid #dce4ee;border-radius:9px}
185 .global-search:focus-within{background:#fff;border-color:#8ecbd3;box-shadow:0 0 0 3px rgba(7,139,155,.08)}
186 .global-search>span{color:#64748b;font-size:18px}
187 .global-search input{width:100%;border:0;outline:0;background:transparent;font:inherit;color:#0f172a;font-size:12px}
188 .command-results{display:none;position:absolute;top:46px;right:0;left:0;background:#fff;border:1px solid var(--shell-line);border-radius:10px;padding:6px;box-shadow:0 16px 35px rgba(15,23,42,.13);max-height:330px;overflow:auto}
189 .command-results.open{display:block}
190 .command-result{padding:9px 10px;border-radius:7px;cursor:pointer;color:#334155;font-size:12px}
191 .command-result:hover{background:#f0f8fa;color:#087c8a}
192 .command-result small{float:left;color:#94a3b8}
193 .topbar-actions{display:flex;gap:7px;align-items:center}
194 .topbar-pill{height:38px;border:1px solid #dce4ee;border-radius:9px;background:#fff;color:#334155;padding:0 11px;font:inherit;font-size:11.5px;font-weight:650;cursor:pointer;white-space:nowrap}
195 .topbar-pill:hover{border-color:#a9cbd0;background:#f7fbfc}
196 .quick-create{position:relative}.quick-create-menu{display:none;position:absolute;top:44px;left:0;width:230px;background:#fff;border:1px solid var(--shell-line);border-radius:10px;padding:7px;box-shadow:0 16px 35px rgba(15,23,42,.14);z-index:420}.quick-create-menu.open{display:block}.quick-create-menu button{width:100%;border:0;background:transparent;border-radius:7px;padding:9px 10px;text-align:right;font:inherit;font-size:11.5px;color:#334155;cursor:pointer}.quick-create-menu button:hover{background:#f0f8fa;color:#087c8a}.quick-create-menu .quick-create-group{padding:5px 8px 4px;color:#94a3b8;font-size:9.5px;font-weight:800}
197 .main-surface{margin-right:calc(var(--shell-rail) + var(--shell-panel));padding:calc(var(--shell-top) + 18px) 22px 90px;max-width:calc(100% - var(--shell-rail) - var(--shell-panel));transition:margin-right .2s ease,max-width .2s ease}
198 .workspace-context{display:flex;align-items:center;gap:9px;margin:0 0 14px;padding:0 2px;color:#64748b;font-size:11px}
199 .workspace-context strong{color:#0f172a;font-size:13px}
200 .workspace-eyebrow{color:#078b9b;font-weight:800}
201 .shell-panel-collapsed .module-panel{transform:translateX(100%);opacity:0;pointer-events:none}
202 .shell-panel-collapsed .module-panel-handle{right:calc(var(--shell-rail) - 1px)}
203 .shell-panel-collapsed .topbar{right:var(--shell-rail)}
204 .shell-panel-collapsed .main-surface{margin-right:var(--shell-rail);max-width:calc(100% - var(--shell-rail))}
205 .grid-kpi .kpi-gradient{background:#fff!important;border:1px solid var(--shell-line)!important;box-shadow:0 2px 7px rgba(15,23,42,.035)!important}
206 .grid-kpi .kpi-gradient .kpi-lbl{color:#475569!important}
207 .grid-kpi .kpi-gradient .kpi-val{color:#10204b!important;font-size:19px}
208 .grid-kpi .kpi-gradient .kpi-icon{background:#f1f7fb!important;color:#087c8a!important}
209 .card,.kpi-unit{border-color:var(--shell-line);box-shadow:0 2px 7px rgba(15,23,42,.035)}
210 .fin-dashboard-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin:2px 0 16px}.fin-dashboard-head h1{font-size:25px;color:#10204b;margin:3px 0}.fin-dashboard-head p,.fin-breadcrumb{font-size:11px;color:#64748b}.fin-dashboard-actions{display:flex;gap:8px}
211 .fin-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}.fin-kpi-card{background:#fff;border:1px solid var(--shell-line);border-radius:10px;padding:16px;display:flex;align-items:flex-start;gap:12px;min-height:118px;box-shadow:0 2px 7px rgba(15,23,42,.035)}.fin-kpi-icon{width:42px;height:42px;border-radius:10px;background:#edf7fb;color:#1685d1;display:grid;place-items:center;font-size:21px;flex:0 0 auto}.fin-kpi-card small{display:block;color:#475569;font-size:11.5px;margin-bottom:8px}.fin-kpi-card strong{display:block;color:#10204b;font-size:20px;direction:rtl}.fin-kpi-card em{display:block;color:#94a3b8;font-style:normal;font-size:10px;margin-top:7px}
212 .fin-dashboard-grid{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(280px,.9fr);gap:12px}.fin-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.fin-card-head h3{font-size:14px;color:#10204b}.fin-card-head small{display:block;color:#94a3b8;font-size:10px;margin-top:3px}.fin-cash-chart{min-height:255px;display:flex;align-items:center;justify-content:center}.fin-cash-chart svg{width:100%;height:245px;overflow:visible}.fin-chart-legend{display:flex;gap:14px;font-size:10px;color:#64748b}.fin-chart-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-left:4px}.fin-status-row{padding:10px 0;border-bottom:1px solid #f0f3f7}.fin-status-row:last-child{border-bottom:0}.fin-status-line{display:flex;justify-content:space-between;gap:8px;font-size:11px;color:#334155;margin-bottom:6px}.fin-status-track{height:7px;background:#edf2f7;border-radius:999px;overflow:hidden}.fin-status-fill{height:100%;background:#0a9baa;border-radius:999px}.fin-dashboard-bottom{display:grid;grid-template-columns:minmax(280px,.8fr) minmax(0,1.7fr);gap:12px;margin-top:12px}.fin-quick-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}.fin-quick-grid button{border:1px solid #e5eaf1;background:#fff;border-radius:8px;min-height:72px;padding:8px 4px;font:inherit;font-size:10.5px;color:#334155;cursor:pointer}.fin-quick-grid button:hover{border-color:#9bd0d6;background:#f3fbfc;color:#087c8a}.fin-quick-grid span{display:block;font-size:20px;color:#1685d1;margin-bottom:5px}.fin-text-btn{border:0;background:transparent;color:#1685d1;font:inherit;font-size:11px;cursor:pointer}
213 @media(max-width:1180px){.fin-kpi-grid{grid-template-columns:repeat(2,1fr)}.fin-dashboard-grid,.fin-dashboard-bottom{grid-template-columns:1fr}}@media(max-width:620px){.fin-dashboard-head{align-items:flex-start;flex-direction:column}.fin-kpi-grid{grid-template-columns:1fr 1fr}.fin-kpi-card{padding:11px;min-height:100px}.fin-kpi-card strong{font-size:15px}.fin-quick-grid{grid-template-columns:repeat(2,1fr)}}
214 @media(max-width:1100px){:root{--shell-panel:210px}.topbar{padding-inline:12px}.topbar-pill.fiscal-pill{display:none}}
215 @media(max-width:820px){
216 .app-shell-nav,.module-panel,.module-panel-handle{display:none!important}
217 .topbar,.shell-panel-collapsed .topbar{right:0;height:58px;padding:8px 10px;gap:7px}
218 .topbar-menu{display:none}
219 .topbar-actions .topbar-pill{display:none}
220 .global-search{height:38px;max-width:none}
221 .main-surface,.shell-panel-collapsed .main-surface{margin-right:0;max-width:100%;padding:72px 12px 92px}
222 .workspace-context{overflow:hidden;white-space:nowrap}
223 .mobile-dock{display:flex}
224 .whatsapp-support{bottom:84px}
225 }
226 @media(max-width:520px){.grid-kpi{grid-template-columns:1fr 1fr}.kpi-unit{padding:11px;gap:8px}.grid-kpi .kpi-gradient .kpi-val{font-size:14px}.kpi-icon{width:36px;height:36px}.workspace-context{font-size:10px}}
227 @media print{.topbar,.module-panel,.app-shell-nav,.workspace-context{display:none!important}.main-surface{margin:0!important;max-width:none!important;padding:0!important}}
228 </style>
229 </head>
230 <body>
231
232 <div id="auth-screen">
233 <div class="auth-shell">
234 <div class="auth-card">
235 <div class="auth-brand">
236 <img class="auth-brand-logo" src="assets/finora-icon-180.png?v=20261002-brand-v1" alt="نشان فینورا" />
237 <div><h1>نرم‌افزار ERP سازمانی فینورا</h1><p>ورود یا ثبت‌نام امن در محیط سازمانی</p></div>
238 </div>
239 <div id="auth-form-container">
240 <button disabled class="btn auth-google" onclick="signInWithGoogle()"><span class="auth-google-mark">G</span><span>ادامه با Google</span></button>
241 <div class="auth-divider">یا با ایمیل</div>
242 <div class="form-group"><label>ایمیل</label><input type="email" id="auth-email" class="form-control" placeholder="name@example.com" autocomplete="email" autocapitalize="none" dir="ltr" /></div>
243 <div class="form-group"><label>رمز عبور</label><input type="password" id="auth-password" class="form-control" placeholder="رمز عبور" autocomplete="current-password" dir="ltr" /></div>
244 <div class="auth-actions">
245 <button id="auth-login-button" class="btn btn-primary" onclick="handleLogin()" disabled>ورود با رمز</button>
246 <button disabled class="btn btn-secondary" onclick="startEmailOtp(false,false)">ورود با کد ایمیل</button>
247 </div>
248 <button disabled type="button" id="auth-forgot-password" class="btn btn-secondary" style="width:100%;margin-top:10px" onclick="finoraRequestPasswordRecovery()">فراموشی رمز عبور</button>
249 <p id="auth-login-status" aria-live="polite" data-state="loading" style="font-size:12px;line-height:1.9;margin-top:8px;min-height:24px;color:#475569">در حال آماده‌سازی فرم ورود...</p>
250 <button disabled type="button" id="auth-connectivity-check" class="btn btn-secondary" style="width:100%;margin-top:10px" onclick="checkAuthConnectivity()">بررسی اتصال به سرور ورود</button>
251 <p id="auth-connectivity-result" aria-live="polite" style="font-size:12px;line-height:1.9;margin-top:8px;overflow-wrap:anywhere"></p>
252 <button disabled class="btn auth-signup" onclick="startEmailOtp(false,true)">ثبت‌نام با کد ایمیل</button>
253 <p class="auth-note">ورود با کد ایمیل برای حساب موجود است. ایجاد حساب جدید فقط از مسیر «ثبت‌نام با کد ایمیل» انجام می‌شود.</p>
254 </div>
255 <div id="auth-otp-container" style="display:none">
256 <p style="font-size:13px;line-height:1.9;margin-bottom:12px">کد یک‌بارمصرف به <strong dir="ltr" id="auth-otp-email-label"></strong> ارسال شد. پوشه‌ی هرزنامه را هم ببینید.</p>
257 <div class="form-group"><label>کد تأیید</label><input type="text" id="auth-otp" class="form-control" inputmode="numeric" autocomplete="one-time-code" placeholder="------" dir="ltr" /></div>
258 <div class="auth-actions"><button disabled class="btn btn-primary" onclick="verifyEmailOtp()">تأیید کد</button><button disabled class="btn btn-secondary" onclick="startEmailOtp(true)">ارسال دوباره</button></div>
259 <button disabled class="btn btn-secondary" style="width:100%;margin-top:10px" onclick="backToAuthMain()">بازگشت</button>
260 </div>
261 <div id="auth-setpass-container" style="display:none">
262 <p style="font-size:13px;line-height:1.9;margin-bottom:12px">ایمیل شما تأیید شد. برای ورودهای بعدی می‌توانید یک رمز عبور تعیین کنید.</p>
263 <div class="form-group"><label>رمز عبور جدید</label><input type="password" id="auth-newpass" class="form-control" placeholder="حداقل ۸ کاراکتر" autocomplete="new-password" dir="ltr" /></div>
264 <div class="form-group"><label>تکرار رمز عبور</label><input type="password" id="auth-newpass2" class="form-control" placeholder="تکرار رمز" autocomplete="new-password" dir="ltr" /></div>
265 <button disabled class="btn btn-primary" style="width:100%;margin-top:16px" onclick="saveNewPassword()">ذخیره رمز و ورود</button>
266 <button disabled class="btn btn-secondary" style="width:100%;margin-top:10px" onclick="skipSetPassword()">فعلاً بدون رمز ادامه بده</button>
267 </div>
268 <div id="auth-recovery-container" style="display:none">
269 <h2 style="font-size:18px;margin-bottom:12px">تعیین رمز عبور جدید</h2>
270 <p id="auth-recovery-status" aria-live="polite" data-state="loading" style="font-size:13px;line-height:1.9;margin-bottom:12px">در حال بررسی پیوند بازیابی...</p>
271 <div class="form-group"><label for="auth-recovery-password">رمز عبور جدید</label><input disabled type="password" id="auth-recovery-password" class="form-control" autocomplete="new-password" dir="ltr" /></div>
272 <div class="form-group"><label for="auth-recovery-confirm">تکرار رمز عبور جدید</label><input disabled type="password" id="auth-recovery-confirm" class="form-control" autocomplete="new-password" dir="ltr" /></div>
273 <button disabled id="auth-recovery-submit" class="btn btn-primary" style="width:100%" onclick="finoraSaveRecoveredPassword()">ذخیره رمز جدید و ورود</button>
274 <button disabled id="auth-recovery-cancel" class="btn btn-secondary" style="width:100%;margin-top:10px" onclick="finoraCancelPasswordRecovery()">بازگشت به ورود</button>
275 </div>
276 </div>
277 <aside class="auth-visual" aria-label="معرفی فینورا">
278 <div class="auth-hero">
279 <img class="auth-hero-logo" src="assets/finora-icon-180.png?v=20261002-brand-v1" alt="" aria-hidden="true" />
280 <h2>Finora</h2><div class="erp">ENTERPRISE ERP</div>
281 <p class="tagline">مدیریت یکپارچه، تصمیم‌گیری هوشمند، رشد پایدار</p>
282 <div class="auth-dashboard-art" aria-hidden="true"><div class="auth-glass auth-glass-main"></div><div class="auth-glass auth-glass-side"><span>⌂</span><span>▥</span><span>♙</span><span>◇</span></div><div class="auth-chart"></div></div>
283 </div>
284 </aside>
285 </div>
286 </div>
287
288 <div id="sync-badge" style="display:none;position:fixed;bottom:80px;left:12px;z-index:9999;color:#fff;padding:6px 12px;border-radius:999px;font-size:12px;box-shadow:0 2px 8px rgba(0,0,0,.25)"></div>
289 <div class="app-root">
290 <aside class="sidebar app-shell-nav no-print" aria-label="ناوبری اصلی">
291 <div class="brand-box">
292 <img class="brand-icon" src="assets/finora-icon-180.png?v=20261002-brand-v1" alt="" aria-hidden="true" />
293 <div class="brand-copy"><h2>فینورا</h2><small>نسخه ۱.۰</small><span class="sr-only">فینورا — نسخه ۱.۰</span></div>
294 </div>
295 <div class="module-rail" id="module-rail">
296 <button class="module-tab active" data-module="dashboard" data-view="view-dashboard" onclick="openModule('dashboard','view-dashboard','overview')" title="داشبورد"><span>⌂</span><b>داشبورد</b></button>
297 <button class="module-tab" data-module="accounting" data-view="view-accounting-foundation" onclick="openModule('accounting','view-accounting-foundation','accounts')" title="حسابداری"><span>▦</span><b>حسابداری</b></button>
298 <button class="module-tab" data-module="commerce" data-view="view-invoices" onclick="openModule('commerce','view-invoices')" title="بازرگانی"><span>⇄</span><b>بازرگانی</b></button>
299 <button class="module-tab" data-module="treasury" data-view="view-payments" onclick="openModule('treasury','view-payments')" title="خزانه‌داری"><span>◈</span><b>خزانه</b></button>
300 <button class="module-tab" data-module="projects" data-view="view-contracting" onclick="openModule('projects','view-contracting')" title="پیمان‌ها"><span>▧</span><b>پیمان‌ها</b></button>
301 <button class="module-tab" data-module="inventory" data-view="view-inventory" onclick="openModule('inventory','view-inventory','stock')" title="انبار"><span>▦</span><b>انبار</b></button>
302 <button class="module-tab" data-module="assets" data-view="view-assets" onclick="openModule('assets','view-assets','asset-register')" title="دارایی ثابت"><span>◆</span><b>دارایی</b></button>
303 <button class="module-tab" data-module="enterprise" data-view="view-enterprise" onclick="openModule('enterprise','view-enterprise','employees')" title="سازمان"><span>♙</span><b>سازمان</b></button>
304 <button class="module-tab" data-module="reports" data-view="view-reports" onclick="openModule('reports','view-reports')" title="گزارش‌ها"><span>▥</span><b>گزارش</b></button>
305 <button class="module-tab" data-module="settings" data-view="view-settings" onclick="openModule('settings','view-settings')" title="تنظیمات"><span>⚙</span><b>تنظیمات</b></button>
306 </div>
307 <div class="sidebar-footer">
308 <span id="logged-user-label">کاربر</span>
309 <button class="shell-logout" onclick="handleLogout()" title="خروج">خروج</button>
310 </div>
311 </aside>
312 <aside class="module-panel no-print" id="module-panel" aria-label="زیرمنوی ماژول">
313 <div class="module-panel-head">
314 <div><small>زیرسیستم</small><h3 id="module-panel-title">داشبورد</h3></div>
315 </div>
316 <div id="module-panel-links" class="module-panel-links"></div>
317 </aside>
318 <button id="module-panel-handle" class="module-panel-handle no-print" type="button" onclick="toggleModulePanel()" aria-label="جمع کردن پنل زیرسیستم" aria-controls="module-panel" aria-expanded="true" title="جمع/باز کردن پنل زیرسیستم">›</button>
319 <header class="topbar no-print">
320 <button class="topbar-menu" onclick="toggleModulePanel()" aria-label="منو">☰</button>
321 <div class="global-search">
322 <span>⌕</span><input id="global-command-search" type="search" placeholder="جست‌وجوی منو؛ مثلاً فروش، چک، گزارش..." autocomplete="off" oninput="renderCommandSearch(this.value)" onkeydown="handleCommandSearchKey(event)" />
323 <div id="command-search-results" class="command-results"></div>
324 </div>
325 <div class="topbar-actions">
326 <button class="topbar-pill fiscal-pill" id="topbar-fiscal-year" onclick="navigateShell('accounting','view-accounting-foundation','fiscal')" title="سال مالی">سال مالی جاری</button>
327 <button class="topbar-pill" id="topbar-company" onclick="navigateShell('settings','view-settings','company')" title="شرکت فعال">شرکت فعال</button>
328 <div class="quick-create">
329 <button class="topbar-pill" id="quick-create-toggle" onclick="toggleQuickCreateMenu(event)" aria-haspopup="true" aria-expanded="false" title="ایجاد سریع">+ ایجاد سریع</button>
330 <div class="quick-create-menu" id="quick-create-menu" role="menu" aria-label="ایجاد سریع">
331 <div class="quick-create-group">اسناد و عملیات</div>
332 <button onclick="navigateShell('commerce','view-invoices');closeQuickCreateMenu()">فاکتور فروش</button>
333 <button onclick="navigateShell('commerce','view-purchases');closeQuickCreateMenu()">فاکتور خرید</button>
334 <button onclick="navigateShell('treasury','view-payments');closeQuickCreateMenu()">دریافت / پرداخت</button>
335 <button onclick="navigateShell('accounting','view-journal','new');closeQuickCreateMenu()">سند حسابداری</button>
336 <div class="quick-create-group">اطلاعات پایه</div>
337 <button onclick="navigateShell('commerce','view-contacts');closeQuickCreateMenu()">طرف حساب</button>
338 <button onclick="navigateShell('commerce','view-products');closeQuickCreateMenu()">کالا / خدمت</button>
339 </div>
340 </div>
341 </div>
342 </header>
343
344 <a class="whatsapp-support no-print" href="https://wa.me/989124376991?text=سلام%20داود%20عزیز،%20درباره%20نرم‌افزار%20فینورا%20سؤال%20داشتم." target="_blank" rel="noopener" title="پشتیبانی واتس‌اپ">
345 <svg viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.451.03-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/></svg>
346 <span>پشتیبانی واتس‌اپ</span>
347 </a>
348
349 <main class="main-surface">
350 <div class="workspace-context no-print"><span class="workspace-eyebrow">مسیر کاری</span><strong id="workspace-title">داشبورد</strong><span id="workspace-context-text">نمای یکپارچه عملیات مالی</span></div>
351
352
353 <section id="view-dashboard" class="view-pane active">
354 <div class="fin-dashboard-head"><div><div class="fin-breadcrumb">داشبورد / نمای مالی</div><h1>داشبورد مالی</h1><p id="dashboard-date-display"></p></div><div class="fin-dashboard-actions no-print"><span id="user-license-status-badge" class="badge badge-warning">در حال بررسی...</span><button class="btn btn-secondary btn-inline" onclick="navigateShell('accounting','view-journal','new')">+ سند حسابداری</button><button class="btn btn-primary btn-inline" onclick="startNewInvoice()">+ فاکتور فروش</button></div></div>
355 <div id="dashboard-license-details"></div>
356 <div class="fin-kpi-grid">
357 <div class="fin-kpi-card"><span class="fin-kpi-icon">◔</span><div><small>جمع دارایی‌ها</small><strong id="kpi-assets-sum">۰</strong><em>بر اساس دفتر قطعی</em></div></div>
358 <div class="fin-kpi-card"><span class="fin-kpi-icon">▰</span><div><small>مانده نقد و بانک</small><strong id="kpi-cash-sum">۰</strong><em>حساب نقش نقد/بانک</em></div></div>
359 <div class="fin-kpi-card"><span class="fin-kpi-icon">◎</span><div><small>دریافتنی‌های جاری</small><strong id="kpi-receivable-sum">۰</strong><em>مانده فاکتورهای نسیه</em></div></div>
360 <div class="fin-kpi-card"><span class="fin-kpi-icon">▣</span><div><small>پرداختنی‌های جاری</small><strong id="kpi-payable-sum">۰</strong><em>مانده خریدهای نسیه</em></div></div>
361 </div>
362 <div class="fin-dashboard-grid">
363 <div class="card fin-chart-card"><div class="fin-card-head"><div><h3>گردش ورود و خروج نقدینگی</h3><small>شش ماه اخیر بر اساس دریافت و پرداخت ثبت‌شده</small></div></div><div id="dashboard-cashflow-chart" class="fin-cash-chart"></div></div>
364 <div class="card fin-status-card"><div class="fin-card-head"><div><h3>وضعیت حساب‌ها</h3><small>ترکیب مانده‌های عملیاتی</small></div></div><div id="dashboard-account-status"></div></div>
365 </div>
366 <div class="fin-dashboard-bottom">
367 <div class="card fin-quick-card"><div class="fin-card-head"><h3>دسترسی سریع</h3></div><div class="fin-quick-grid">
368 <button onclick="navigateShell('accounting','view-accounting-foundation','fiscal')"><span>▣</span>سال مالی</button>
369 <button onclick="navigateShell('accounting','view-accounting-foundation','dimensions')"><span>⌘</span>تفصیلی‌های شناور</button>
370 <button onclick="navigateShell('accounting','view-accounting-foundation','accounts')"><span>▦</span>کدینگ حساب‌ها</button>
371 <button onclick="navigateShell('accounting','view-journal','new')"><span>+</span>سند حسابداری</button>
372 <button onclick="navigateShell('accounting','view-accounting-reports','trial')"><span>▥</span>تراز آزمایشی</button>
373 <button onclick="navigateShell('accounting','view-accounting-reports','ledger')"><span>▤</span>دفاتر حسابداری</button>
374 <button onclick="navigateShell('treasury','view-payments')"><span>↔</span>گردش حساب</button>
375 <button onclick="navigateShell('settings','view-data-center','data-backup')"><span>⇅</span>پشتیبان و داده</button>
376 </div></div>
377 <div class="card fin-recent-card"><div class="fin-card-head"><h3>آخرین اسناد حسابداری</h3><button class="fin-text-btn" onclick="navigateShell('accounting','view-journal','register')">همه اسناد</button></div><div class="table-responsive"><table><thead><tr><th>شماره سند</th><th>تاریخ</th><th>شرح</th><th>جمع بدهکار</th><th>جمع بستانکار</th><th>وضعیت</th></tr></thead><tbody id="dashboard-recent-journals"><tr><td colspan="6" class="af-empty">سندی ثبت نشده است.</td></tr></tbody></table></div></div>
378 </div>
379 </section>
380
381 <section id="view-reports" class="view-pane">
382 <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;flex-wrap:wrap;gap:10px">
383 <h1 style="font-size:20px;font-weight:bold">📈 گزارشات مالی</h1>
384 <select id="report-year-select" class="form-control" style="max-width:160px" onchange="renderFinancialReports()"></select>
385 </div>
386
387 <div class="grid-kpi">
388 <div class="kpi-unit kpi-gradient" style="background:linear-gradient(135deg,#6366f1,#4338ca)"><div class="kpi-icon" style="background:rgba(255,255,255,.2);color:#fff">💵</div><div><div class="kpi-lbl" style="color:rgba(255,255,255,.85)">مجموع فروش سال</div><div class="kpi-val" style="color:#fff" id="rep-year-total">۰</div></div></div>
389 <div class="kpi-unit kpi-gradient" style="background:linear-gradient(135deg,#ec4899,#be185d)"><div class="kpi-icon" style="background:rgba(255,255,255,.2);color:#fff">📊</div><div><div class="kpi-lbl" style="color:rgba(255,255,255,.85)">میانگین فروش ماهانه</div><div class="kpi-val" style="color:#fff" id="rep-year-avg">۰</div></div></div>
390 <div class="kpi-unit kpi-gradient" style="background:linear-gradient(135deg,#14b8a6,#0f766e)"><div class="kpi-icon" style="background:rgba(255,255,255,.2);color:#fff">🏆</div><div><div class="kpi-lbl" style="color:rgba(255,255,255,.85)">پرفروش‌ترین ماه</div><div class="kpi-val" style="color:#fff" id="rep-best-month">—</div></div></div>
391 <div class="kpi-unit kpi-gradient" style="background:linear-gradient(135deg,#f97316,#c2410c)"><div class="kpi-icon" style="background:rgba(255,255,255,.2);color:#fff">🧾</div><div><div class="kpi-lbl" style="color:rgba(255,255,255,.85)">تعداد فاکتور صادرشده</div><div class="kpi-val" style="color:#fff" id="rep-invoice-count">۰</div></div></div>
392 </div>
393
394 <div class="card">
395 <h3 style="font-size:15px;margin-bottom:6px">روند فروش ماهانه</h3>
396 <div class="report-bar-wrap" id="report-monthly-chart"></div>
397 </div>
398
399 <div class="card">
400 <h3 style="font-size:15px;margin-bottom:12px">مشتریان برتر (بر اساس مبلغ خرید)</h3>
401 <div class="table-responsive">
402 <table>
403 <thead><tr><th>مشتری</th><th>تعداد فاکتور</th><th>جمع خرید (<span class="cur-label">ریال</span>)</th></tr></thead>
404 <tbody id="report-top-customers"><tr><td colspan="3" style="text-align:center;color:var(--text-muted);padding:20px">داده‌ای برای نمایش وجود ندارد.</td></tr></tbody>
405 </table>
406 </div>
407 </div>
408
409 <div class="card">
410 <h3 style="font-size:15px;margin-bottom:12px">تفکیک نوع فاکتور</h3>
411 <div style="display:flex;gap:24px;flex-wrap:wrap">
412 <div>🔴 رسمی: <strong id="rep-formal-count">۰</strong> فقره — <strong id="rep-formal-sum">۰</strong></div>
413 <div>🟢 غیررسمی: <strong id="rep-informal-count">۰</strong> فقره — <strong id="rep-informal-sum">۰</strong></div>
414 </div>
415 </div>
416 <div class="card">
417 <h3 style="font-size:15px;margin-bottom:12px">خلاصه سود و زیان و جریان نقدی</h3>
418 <div class="grid-kpi" style="margin-bottom:12px">
419 <div class="kpi-unit"><div><div class="kpi-lbl">خرید سال</div><div class="kpi-val" id="rep-purchase-total">۰</div></div></div>
420 <div class="kpi-unit"><div><div class="kpi-lbl">هزینه‌ها</div><div class="kpi-val" id="rep-expense-total">۰</div></div></div>
421 <div class="kpi-unit"><div><div class="kpi-lbl">سود تعهدی</div><div class="kpi-val" id="rep-accrual-profit">۰</div></div></div>
422 <div class="kpi-unit"><div><div class="kpi-lbl">خالص جریان نقدی</div><div class="kpi-val" id="rep-cash-net">۰</div></div></div>
423 </div>
424 <div class="table-responsive"><table><thead><tr><th>شاخص</th><th>مبلغ (<span class="cur-label">ریال</span>)</th></tr></thead><tbody id="report-financial-summary"></tbody></table></div>
425 </div>
426 </section>
427
428 <section id="view-accounting-reports" class="view-pane"><div style="margin-bottom:14px"><h1 style="font-size:20px;font-weight:bold">گزارش‌های حرفه‌ای حسابداری</h1><p style="font-size:12px;color:var(--text-muted)">مبنای گزارش: اسناد قطعی دفتر کل؛ فیلترها در فضای گزارش اعمال می‌شوند.</p></div><div id="p6-reporting-root"></div></section>
429
430 <section id="view-invoices" class="view-pane">
431 <div class="card no-print">
432 <div class="finora-commercial-head" style="display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;flex-wrap:wrap;gap:10px">
433 <h2 style="font-size:17px" id="invoice-form-title">صدور سند تجاری</h2>
434 <div class="finora-commercial-actions" style="display:flex;gap:8px;flex-wrap:wrap;align-items:center">
435 <label class="btn btn-secondary btn-inline" style="min-height:34px;padding:4px 10px;font-size:12px">📥 ورود اقلام از اکسل<input type="file" id="excel-import-invoice-items" style="display:none" onchange="importInvoiceItemsFromExcel(event)" accept=".xlsx, .xls" /></label>
436 <button type="button" class="btn btn-secondary btn-inline" onclick="finoraShowGuide('invoices')">؟ راهنما</button>
437 <button class="btn btn-secondary btn-inline" style="display:none;padding:4px 10px;font-size:12px" id="btn-cancel-edit" onclick="cancelInvoiceEdit()">انصراف از ویرایش</button>
438 </div>
439 </div>
440 <input type="hidden" id="edit-invoice-id" value="" />
441 <div class="form-row" style="background:#f1f5f9;padding:12px;border-radius:10px;margin-bottom:14px">
442 <div class="form-group" style="margin-bottom:0"><label>تاریخ فاکتور</label><input type="text" id="invoice-date-input" class="form-control" /></div>
443 <div class="form-group" style="margin-bottom:0"><label>شماره فاکتور</label><input type="text" id="invoice-number" class="form-control" placeholder="PINV-31" /></div>
444 <div class="form-group" style="margin-bottom:0;display:none" aria-hidden="true">
445 <label>قالب داخلی سند</label>
446 <select id="invoice-kind" class="form-control" onchange="handleInvoiceKindChange()">
447 <option value="non_formal">فاکتور غیررسمی</option>
448 <option value="formal">فاکتور رسمی</option>
449 <option value="pre_invoice">پیش‌فاکتور فروش</option>
450 <option value="contract_statement">صورت وضعیت پیمان</option>
451 </select>
452 </div>
453 </div>
454 <div class="form-row">
455 <div class="form-group"><label>فروشنده (سربرگ شرکت)</label><select id="invoice-company-id" class="form-control" onchange="onActiveCompanyFilterChange()"></select></div>
456 <div class="form-group">
457 <label style="display:flex;justify-content:space-between"><span>نام خریدار را وارد یا انتخاب کنید</span><a href="#" style="color:var(--primary);text-decoration:none" onclick="openQuickContactModal();return false">➕ شخص جدید</a></label>
458 <div style="display:flex;gap:8px">
459 <select id="invoice-contact-id" class="form-control" style="flex:1" onchange="handleInvoiceContactChange()"></select>
460 <button class="btn btn-secondary btn-inline" type="button" onclick="openQuickContactModal()" style="padding:0 12px;min-height:42px">➕</button>
461 </div>
462 </div>
463 </div>
464 <div class="form-row"><div class="form-group"><label>نحوه تسویه</label><select id="invoice-payment-method" class="form-control"><option value="cash">نقدی / تسویه‌شده</option><option value="credit">نسیه / ایجاد مطالبات</option></select></div><div class="form-group"><label>انبار خروج کالا</label><select id="invoice-warehouse-id" class="form-control"></select></div></div>
465 <div class="form-row" id="box-invoice-project-row" style="display:none">
466 <div class="form-group"><label>پروژه طرف‌حساب</label><select id="invoice-project-id" class="form-control"></select></div>
467 </div>
468 <div class="form-row" id="box-invoice-contract-number" style="display:none;background:#fef3c7;padding:12px;border-radius:10px;margin-bottom:14px">
469 <div class="form-group" style="margin-bottom:0"><label>شماره پیمان <span style="color:var(--danger)">*</span></label><input type="text" id="invoice-contract-number" class="form-control" placeholder="شماره پیمان الزامی است" /></div>
470 </div>
471 <div style="margin:16px 0">
472 <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:8px">
473 <h4 style="font-size:14px">اقلام کالا یا خدمات</h4>
474 <button class="btn btn-secondary btn-inline" style="font-size:12px;min-height:34px;padding:4px 10px" onclick="openQuickProductModal()">➕ کالای جدید</button>
475 </div>
476 <div class="table-responsive">
477 <table id="invoice-items-table">
478 <thead><tr style="background:#e2e8f0"><th style="width:40px;text-align:center">#</th><th>شرح کالا | خدمات</th><th style="width:90px;text-align:center">واحد</th><th style="width:100px;text-align:center">مقدار</th><th style="width:160px;text-align:left">قیمت واحد (<span class="cur-label">ریال</span>)</th><th style="width:170px;text-align:left">قیمت کل (<span class="cur-label">ریال</span>)</th><th style="width:50px;text-align:center">حذف</th></tr></thead>
479 <tbody id="invoice-items-table-body"></tbody>
480 </table>
481 </div>
482 <button class="btn btn-secondary btn-inline" style="margin-top:10px;width:100%;border:1.5px dashed var(--primary);color:var(--primary);background:#eff6ff" onclick="addInvoiceItemRow()">+ افزودن ردیف</button>
483 </div>
484 <div class="form-row" style="background:#f1f5f9;padding:14px;border-radius:10px;margin-top:12px">
485 <div class="form-group" style="background:#fff;padding:12px;border-radius:8px;border:1px solid var(--border);margin-bottom:0">
486 <label style="font-weight:bold;border-bottom:1px solid #eee;padding-bottom:6px;margin-bottom:8px">مالیات و تخفیف</label>
487 <div id="box-invoice-vat-mode-row" style="display:flex;justify-content:space-between;align-items:center;margin-bottom:8px">
488 <span>مالیات ارزش افزوده</span>
489 <select id="invoice-vat-mode" class="form-control" style="width:140px;min-height:36px" onchange="handleVatModeChange()"><option value="none">غیرفعال</option><option value="with_vat">فعال</option></select>
490 </div>
491 <div id="box-invoice-vat-rate" style="display:none;justify-content:space-between;align-items:center;margin-bottom:8px;gap:8px">
492 <select id="invoice-vat-type" class="form-control" style="width:110px;min-height:36px" onchange="handleVatTypeChange()"><option value="percent">درصدی</option><option value="fixed">مبلغ ثابت</option></select>
493 <input type="text" inputmode="decimal" id="invoice-vat-rate-input" class="form-control" style="width:100px;min-height:36px" value="10" oninput="handleMoneyInput(this);recomputeTotals()" />
494 </div>
495 <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;gap:8px">
496 <span>تخفیف کلی فاکتور</span>
497 <select id="invoice-discount-type" class="form-control" style="width:110px;min-height:36px" onchange="handleDiscountTypeChange()"><option value="fixed">مبلغ ثابت</option><option value="percent">درصدی</option></select>
498 </div>
499 <div style="display:flex;justify-content:space-between;align-items:center">
500 <span id="label-invoice-discount-value">مبلغ تخفیف (ریال)</span>
501 <input type="text" inputmode="decimal" id="invoice-discount-fixed" class="form-control" style="width:140px;min-height:36px" value="0" oninput="handleMoneyInput(this);recomputeTotals()" />
502 </div>
503 </div>
504 <div class="form-group" style="background:#fff;padding:12px;border-radius:8px;border:1px solid var(--border);margin-bottom:0">
505 <label style="font-weight:bold;border-bottom:1px solid #eee;padding-bottom:6px;margin-bottom:8px">جمع‌بندی نهایی</label>
506 <div style="display:flex;justify-content:space-between;margin-bottom:6px;font-size:13px"><span>جمع کل:</span><span id="summary-subtotal" style="font-weight:bold">۰ ریال</span></div>
507 <div style="display:flex;justify-content:space-between;margin-bottom:6px;font-size:13px"><span>مالیات:</span><span id="summary-vat" style="font-weight:bold">۰ ریال</span></div>
508 <div style="display:flex;justify-content:space-between;margin-bottom:6px;font-size:14px;border-top:1px solid #eee;padding-top:6px"><span style="font-weight:bold;color:var(--primary)">قابل پرداخت:</span><span id="summary-grandtotal" style="font-weight:bold;color:var(--primary)">۰ ریال</span></div>
509 <div style="font-size:11px;color:var(--text-muted);margin-top:4px" id="summary-words">به حروف: صفر ریال</div>
510 </div>
511 </div>
512 <div class="form-row" style="margin-top:14px">
513 <div class="form-group" style="margin-bottom:0"><label>توضیحات فاکتور</label><textarea id="invoice-desc-input" class="form-control" rows="2" placeholder="توضیحات تکمیلی..."></textarea></div>
514 </div>
515 <div id="box-enable-electronic-doc" style="display:none;margin-top:14px;padding:14px;background:#fef3c7;border-radius:10px;border:1.5px solid #fcd34d">
516 <label style="display:flex;align-items:center;gap:10px;cursor:pointer">
517 <input type="checkbox" id="enable-electronic-doc" onchange="toggleElectronicDoc()" style="width:18px;height:18px" />
518 <span style="font-weight:bold;font-size:14px;color:#92400e">📄 صدور سند الکترونیکی سامانه مودیان</span>
519 </label>
520 <div id="edoc-status" style="font-size:12px;color:#475569;margin-top:8px"></div>
521 </div>
522 <div style="display:flex;gap:10px;margin-top:16px;flex-wrap:wrap">
523 <button class="btn btn-success" id="btn-save-invoice" onclick="commitSaveInvoice()">💾 ثبت فاکتور</button>
524 </div>
525 </div>
526
527 <div class="card no-print">
528 <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;flex-wrap:wrap;gap:10px">
529 <h3 style="font-size:15px">دفتر بایگانی فاکتورها</h3>
530 <select id="filter-invoice-company" class="form-control" style="width:200px;min-height:36px" onchange="renderInvoices()"></select>
531 </div>
532 <div class="table-responsive">
533 <table>
534 <thead><tr><th>شماره</th><th>فروشنده</th><th>خریدار</th><th>نوع</th><th>تاریخ</th><th>قابل پرداخت (<span class="cur-label">ریال</span>)</th><th>عملیات</th></tr></thead>
535 <tbody id="invoice-archive-table-body"></tbody>
536 </table>
537 </div>
538 </div>
539 </section>
540
541 <section id="view-products" class="view-pane">
542 <div class="card no-print">
543 <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;flex-wrap:wrap;gap:10px">
544 <div style="display:flex;align-items:center;gap:8px"><h2 style="font-size:17px">تعریف کالا / خدمت جدید</h2><button type="button" class="btn btn-secondary btn-inline" onclick="finoraShowGuide('products')">؟ راهنما</button></div>
545 <div style="display:flex;gap:8px">
546 <label class="btn btn-secondary btn-inline" style="min-height:36px;padding:4px 12px;font-size:13px">📥 ورود از اکسل<input type="file" id="excel-import-products" style="display:none" onchange="importProductsFromExcel(event)" accept=".xlsx, .xls" /></label>
547 <button class="btn btn-secondary btn-inline" style="min-height:36px;padding:4px 12px;font-size:13px" onclick="downloadProductsExcelTemplate()">📄 نمونه اکسل</button>
548 </div>
549 </div>
550 <div class="form-row">
551 <div class="form-group"><label>کد کالا</label><input type="text" id="prod-code-input" class="form-control" placeholder="خودکار پس از ثبت" readonly /><small style="color:var(--text-muted)">کد ۶ رقمی توسط گروه، زیرگروه و شماره ترتیبی کالا ساخته می‌شود.</small></div>
552 <div class="form-group"><label>عنوان کالا</label><input type="text" id="prod-name-input" class="form-control" placeholder="هارد سرور..." /></div>
553 <div class="form-group"><label>مشخصه / مدل</label><input type="text" id="prod-spec-input" class="form-control" placeholder="2.5 اینچ SAS" /></div>
554 <div class="form-group"><label>واحد</label><input type="text" id="prod-unit-input" class="form-control" value="عدد" /></div>
555 </div>
556 <div class="form-row">
557 <div class="form-group"><label>نوع</label><select id="prod-type-input" class="form-control"><option value="good">کالا (انبارشونده)</option><option value="service">خدمت (غیرانبارشونده)</option></select></div>
558 <div class="form-group"><label>گروه اصلی</label><input type="text" id="prod-category-input" class="form-control" list="prod-category-list" placeholder="مثلاً مصالح ساختمانی" oninput="refreshProductCategories()"><datalist id="prod-category-list"></datalist></div><div class="form-group"><label>زیرگروه</label><input type="text" id="prod-subcategory-input" class="form-control" list="prod-subcategory-list" placeholder="مثلاً بلوک سیمانی"><datalist id="prod-subcategory-list"></datalist><small style="color:var(--text-muted)">برای کالای جدید، دو رقم اول کد از گروه و زیرگروه ساخته می‌شود.</small></div>
559 <div class="form-group"><label>بارکد</label><input type="text" id="prod-barcode-input" class="form-control" /></div>
560 <div class="form-group"><label>حداقل موجودی</label><input type="text" id="prod-min-stock-input" class="form-control" value="0" /></div>
561 </div>
562 <div class="form-row">
563 <div class="form-group"><label>قیمت خرید (<span class="cur-label">ریال</span>)</label><input type="text" inputmode="decimal" id="prod-buy-input" class="form-control" value="0" oninput="handleMoneyInput(this)" /></div>
564 <div class="form-group"><label>قیمت فروش (<span class="cur-label">ریال</span>)</label><input type="text" inputmode="decimal" id="prod-sale-input" class="form-control" value="0" oninput="handleMoneyInput(this)" /></div>
565 <div class="form-group"><label>شناسه کالا/خدمت سامانه مالیاتی (خارجی)</label><input type="text" id="prod-official-id-input" class="form-control" placeholder="در صورت وجود ثبت کنید" /><small style="color:var(--text-muted)">اگر خالی باشد هنگام صدور سند الکترونیکی دریافت می‌شود.</small></div>
566 </div>
567 <div style="display:flex;gap:8px;flex-wrap:wrap"><button id="product-save-btn" class="btn btn-success" onclick="commitSaveProduct()">➕ ثبت کالا</button><button id="product-edit-cancel-btn" class="btn btn-secondary" style="display:none" onclick="cancelProductEdit()">انصراف از اصلاح</button></div>
568 </div>
569 <div class="card">
570 <h3 style="font-size:15px;margin-bottom:12px">کالاهای ثبت‌شده</h3>
571 <div class="table-responsive">
572 <table><thead><tr><th>کد</th><th>نام</th><th>نوع</th><th>گروه</th><th>واحد</th><th>قیمت فروش (<span class="cur-label">ریال</span>)</th><th>بارکد / شناسه</th><th>عملیات</th></tr></thead><tbody id="products-catalog-table-body"></tbody></table>
573 </div>
574 </div>
575 </section>
576
577 <section id="view-contacts" class="view-pane">
578 <div class="card no-print">
579 <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;flex-wrap:wrap;gap:10px">
580 <h2 style="font-size:17px">ثبت طرف حساب جدید</h2>
581 <div style="display:flex;gap:8px">
582 <label class="btn btn-secondary btn-inline" style="min-height:36px;padding:4px 12px;font-size:13px">📥 ورود از اکسل<input type="file" id="excel-import-contacts" style="display:none" onchange="importContactsFromExcel(event)" accept=".xlsx, .xls" /></label>
583 <button class="btn btn-secondary btn-inline" style="min-height:36px;padding:4px 12px;font-size:13px" onclick="downloadContactsExcelTemplate()">📄 نمونه اکسل</button>
584 </div>
585 </div>
586 <div class="form-row">
587 <div class="form-group"><label>نوع شخص</label><select id="contact-entity-type" class="form-control" onchange="handleContactEntityChange()"><option value="natural">شخص حقیقی</option><option value="legal">شخص حقوقی</option></select></div>
588 <div class="form-group" id="box-contact-prefix"><label>پیشوند</label><select id="contact-prefix-select" class="form-control"><option value="آقا/خانم">آقا / خانم</option><option value="فروشگاه">فروشگاه</option></select></div>
589 <div class="form-group" style="grid-column:span 2" id="box-contact-name"><label>نام طرف حساب</label><input type="text" id="contact-name-input" class="form-control" placeholder="دانشگاه صنعتی شریف..." /></div>
590 </div>
591 <div class="form-row">
592 <div class="form-group"><label>نقش</label><select id="contact-role-input" class="form-control"><option value="customer">مشتری / خریدار</option><option value="supplier">تأمین‌کننده / فروشنده</option><option value="both">هر دو (خرید و فروش)</option></select></div>
593 <div class="form-group"><label>همراه</label><input type="text" id="contact-mobile-input" class="form-control" /></div>
594 <div class="form-group"><label id="label-contact-national">شناسه ملی</label><input type="text" id="contact-national-input" class="form-control" /></div>
595 <div class="form-group" id="box-contact-economic"><label>کد اقتصادی</label><input type="text" id="contact-economic-input" class="form-control" /></div>
596 </div>
597 <div class="form-row">
598 <div class="form-group" id="box-contact-reg"><label>شماره ثبت</label><input type="text" id="contact-reg-input" class="form-control" /></div>
599 <div class="form-group"><label>کد پستی</label><input type="text" id="contact-postal-input" class="form-control" /></div>
600 <div class="form-group" style="grid-column:span 2"><label>نشانی</label><input type="text" id="contact-address-input" class="form-control" /></div>
601 </div>
602 <div class="form-row">
603 <div class="form-group"><label>حالت پروژه</label><select id="contact-project-mode" class="form-control"><option value="single">بدون پروژه</option><option value="multi">پروژه‌محور (پروژه و زیرپروژه)</option></select></div>
604 </div>
605 <div style="display:flex;gap:8px;flex-wrap:wrap"><button id="contact-save-btn" class="btn btn-success" onclick="commitSaveContact()">➕ ثبت طرف حساب</button><button id="contact-edit-cancel-btn" class="btn btn-secondary" style="display:none" onclick="cancelContactEdit()">انصراف از اصلاح</button></div>
606 </div>
607 <div class="card">
608 <h3 style="font-size:15px;margin-bottom:12px">دفتر اشخاص</h3>
609 <div class="table-responsive">
610 <table><thead><tr><th>نام</th><th>نوع</th><th>شناسه / کد ملی</th><th>کد اقتصادی</th><th>کد پستی</th><th>همراه</th><th>مانده (<span class="cur-label">ریال</span>)</th><th>پروژه‌ها</th><th>عملیات</th></tr></thead><tbody id="contacts-ledger-table-body"></tbody></table>
611 </div>
612 </div>
613 </section>
614
615 <section id="view-cheques" class="view-pane">
616 <div class="card">
617 <h2 style="font-size:17px;margin-bottom:14px">ثبت چک صیادی</h2>
618 <div class="form-row">
619 <div class="form-group"><label>نوع</label><select id="chq-direction-input" class="form-control"><option value="inbound">دریافتی</option><option value="outbound">پرداختی</option></select></div>
620 <div class="form-group"><label>طرف حساب</label><select id="chq-contact-select" class="form-control"></select></div>
621 <div class="form-group"><label>شناسه صیادی</label><input type="text" id="chq-sayad-input" class="form-control" /></div>
622 <div class="form-group"><label>بانک</label><input type="text" id="chq-bank-input" class="form-control" /></div>
623 </div>
624 <div class="form-row">
625 <div class="form-group"><label>مبلغ (<span class="cur-label">ریال</span>)</label><input type="text" inputmode="decimal" id="chq-amount-input" class="form-control" oninput="handleMoneyInput(this)" /></div>
626 <div class="form-group"><label>سررسید</label><input type="text" id="chq-due-input" class="form-control" placeholder="1405/06/30" /></div>
627 <div class="form-group"><label>وضعیت</label><select id="chq-status-input" class="form-control"><option value="registered">در جریان</option><option value="cleared">وصول / پرداخت شده</option><option value="bounced">برگشتی / ناموفق</option><option value="cancelled">باطل شده</option></select></div>
628 </div>
629 <div style="display:flex;gap:8px;flex-wrap:wrap"><button id="cheque-save-btn" class="btn btn-success" onclick="commitSaveCheque()">➕ ثبت چک</button><button id="cheque-edit-cancel-btn" class="btn btn-secondary" style="display:none" onclick="cancelChequeEdit()">انصراف از اصلاح</button></div>
630 </div>
631 <div class="card">
632 <h3 style="font-size:15px;margin-bottom:12px">لیست چک‌ها</h3>
633 <div class="table-responsive"><table><thead><tr><th>نوع</th><th>طرف حساب</th><th>بانک / صیاد</th><th>مبلغ (<span class="cur-label">ریال</span>)</th><th>سررسید</th><th>وضعیت</th><th>عملیات</th></tr></thead><tbody id="cheques-ledger-table-body"></tbody></table></div>
634 </div>
635 </section>
636
637 <section id="view-expenses" class="view-pane">
638 <div class="card">
639 <h2 style="font-size:17px;margin-bottom:14px">ثبت هزینه / درآمد</h2>
640 <div class="form-row">
641 <div class="form-group"><label>نوع</label><select id="trx-kind-input" class="form-control"><option value="expense">هزینه</option><option value="income">درآمد</option></select></div>
642 <div class="form-group"><label>سرفصل</label><select id="trx-category-input" class="form-control"><option value="قبوض">قبوض</option><option value="حقوق">حقوق</option><option value="سایر">سایر</option></select></div>
643 <div class="form-group"><label>طرف حساب (اختیاری)</label><select id="trx-contact-select" class="form-control" onchange="refreshExpenseProjects()"><option value="">بدون طرف حساب</option></select></div>
644 <div class="form-group"><label>پروژه / مرکز هزینه (اختیاری)</label><select id="trx-project-select" class="form-control"><option value="">بدون پروژه</option></select></div>
645 <div class="form-group"><label>مبلغ (<span class="cur-label">ریال</span>)</label><input type="text" inputmode="decimal" id="trx-amount-input" class="form-control" oninput="handleMoneyInput(this)" /></div>
646 <div class="form-group"><label>شرح</label><input type="text" id="trx-desc-input" class="form-control" /></div>
647 </div>
648 <div style="display:flex;gap:8px;flex-wrap:wrap"><button id="expense-save-btn" class="btn btn-success" onclick="commitSaveExpense()">➕ ثبت سند</button><button id="expense-edit-cancel-btn" class="btn btn-secondary" style="display:none" onclick="cancelExpenseEdit()">انصراف از اصلاح</button></div>
649 </div>
650 <div class="card">
651 <h3 style="font-size:15px;margin-bottom:12px">گردش هزینه و درآمد</h3>
652 <div class="table-responsive"><table><thead><tr><th>نوع</th><th>سرفصل</th><th>طرف حساب</th><th>پروژه / مرکز هزینه</th><th>شرح</th><th>مبلغ (<span class="cur-label">ریال</span>)</th><th>عملیات</th></tr></thead><tbody id="expenses-ledger-table-body"></tbody></table></div>
653 </div>
654 </section>
655
656 <section id="view-contracting" class="view-pane"><div id="phase4-root"></div></section>
657 <section id="view-inventory" class="view-pane"><div id="p5-inventory-root"></div></section>
658 <section id="view-assets" class="view-pane"><div id="p5-assets-root"></div></section>
659 <section id="view-currency" class="view-pane"><div id="p5-currency-root"></div></section>
660 <section id="view-data-center" class="view-pane"><div id="p5-data-root"></div></section>
661 <section id="view-integrations" class="view-pane"><div id="p5-integrations-root"></div></section>
662
663 <section id="view-settings" class="view-pane">
664 <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:14px">
665 <h2 style="font-size:17px">⚙️ تنظیمات و شرکت‌ها</h2>
666 <button class="btn btn-danger btn-inline no-print" style="padding:6px 12px;font-size:12px;min-height:32px" onclick="handleLogout()">🚪 خروج از حساب کاربری</button>
667 </div>
668
669 <div class="accordion-item" data-finora-task="account">
670 <div class="accordion-header" onclick="toggleAccordion(this)"><span>🔐 حساب کاربری و رمز عبور</span><span>▼</span></div>
671 <div class="accordion-body">
672 <p style="font-size:13px;color:var(--text-muted);margin-bottom:10px">با تعیین رمز عبور، دفعات بعد می‌توانید علاوه بر ورود با گوگل، مستقیم با ایمیل و رمز عبور هم وارد سامانه شوید.</p>
673 <div class="form-row">
674 <div class="form-group"><label>رمز عبور جدید</label><input type="password" id="acct-newpass" class="form-control" placeholder="حداقل ۸ کاراکتر" /></div>
675 <div class="form-group"><label>تکرار رمز عبور</label><input type="password" id="acct-newpass2" class="form-control" /></div>
676 </div>
677 <button class="btn btn-primary" onclick="changeAccountPassword()">💾 ذخیره رمز عبور</button>
678 </div>
679 </div>
680
681 <div class="accordion-item open" data-finora-task="company">
682 <div class="accordion-header" onclick="toggleAccordion(this)"><span>🏢 اطلاعات فروشگاه و چاپ (مدیریت شرکت‌ها)</span><span>▼</span></div>
683 <div class="accordion-body">
684 <div class="form-row">
685 <div class="form-group"><label>نوع شخص</label><select id="company-entity-type" class="form-control" onchange="handleCompanyEntityTypeChange()"><option value="legal">حقوقی</option><option value="natural">حقیقی / کسب‌وکار فردی</option></select></div>
686 <div class="form-group" id="company-sector-box"><label>ماهیت مالکیت / بخش</label><select id="company-sector" class="form-control"><option value="private">خصوصی</option><option value="cooperative">تعاونی</option><option value="public_non_government">عمومی غیردولتی</option><option value="government">دولتی / حکومتی</option><option value="other">سایر</option></select></div><div class="form-group" id="company-organization-box"><label>جایگاه در گروه شرکت‌ها</label><select id="company-organization-role" class="form-control" onchange="handleCompanyOrganizationRoleChange()"><option value="standalone">شرکت / واحد مستقل</option><option value="holding_parent">شرکت مادر / هلدینگ</option><option value="subsidiary">شرکت تابعه</option></select></div><div class="form-group" id="company-parent-box" style="display:none"><label>شرکت مادر</label><select id="company-parent-id" class="form-control"><option value="">— انتخاب شرکت مادر —</option></select><small style="color:var(--text-muted)">این رابطه فعلاً ساختار سازمانی را ثبت می‌کند؛ تلفیق، حذف معاملات درون‌گروهی و گزارش گروهی ماژول جداگانه خواهند بود.</small></div>
687 <div class="form-group" id="company-legal-form-box"><label>قالب حقوقی ثبت</label><select id="company-legal-form" class="form-control"><option value="private_joint_stock">سهامی خاص</option><option value="public_joint_stock">سهامی عام</option><option value="limited_liability">با مسئولیت محدود</option><option value="general_partnership">تضامنی</option><option value="relative_partnership">نسبی</option><option value="mixed_non_stock">مختلط غیرسهامی</option><option value="mixed_stock">مختلط سهامی</option><option value="cooperative">تعاونی</option><option value="noncommercial_institution">مؤسسه غیرتجاری</option><option value="other">سایر / نامشخص</option></select></div>
688 <div class="form-group"><label>نوع فعالیت عملیاتی</label><select id="company-activity-type" class="form-control"><option value="trading">بازرگانی</option><option value="service">خدماتی</option><option value="manufacturing">تولیدی</option><option value="contracting">پیمانکاری</option><option value="retail">فروشگاهی</option><option value="distribution">پخش</option><option value="nonprofit">غیرانتفاعی</option><option value="professional">خدمات حرفه‌ای</option></select></div>
689 </div>
690 <div class="form-row">
691 <div class="form-group"><label>راه‌اندازی حسابداری</label><select id="company-accounting-template" class="form-control"><option value="recommended">اعمال کدینگ پیشنهادی Finora</option><option value="empty">شروع با کدینگ خالی</option></select></div>
692 <div class="form-group"><label id="company-name-label">نام شرکت / کسب‌وکار</label><input type="text" id="company-name-input" class="form-control" placeholder="آرا سپهر راستین" /></div>
693 <div class="form-group"><label>تلفن</label><input type="text" id="company-phone-input" class="form-control" /></div>
694 </div>
695 <div class="form-row">
696 <div class="form-group"><label id="company-national-label">شناسه ملی</label><input type="text" id="company-national-input" class="form-control" /></div>
697 <div class="form-group"><label>کد اقتصادی</label><input type="text" id="company-economic-input" class="form-control" /></div>
698 <div class="form-group" id="company-registration-box"><label>شماره ثبت</label><input type="text" id="company-reg-input" class="form-control" /></div>
699 <div class="form-group"><label>کد پستی</label><input type="text" id="company-postal-input" class="form-control" /></div>
700 </div>
701 <div class="form-group"><label>نشانی کامل</label><input type="text" id="company-address-input" class="form-control" /></div>
702 <div class="form-group"><label>پاورقی فاکتور</label><textarea id="company-footer-input" class="form-control" rows="2"></textarea></div>
703 <div style="display:flex;gap:8px;flex-wrap:wrap"><button id="company-save-btn" class="btn btn-success" onclick="commitSaveCompany()">➕ ثبت شرکت جدید</button><button id="company-edit-cancel-btn" class="btn btn-secondary" style="display:none" onclick="cancelCompanyEdit()">انصراف از اصلاح</button></div>
704 <div style="margin-top:16px">
705 <h4 style="font-size:14px;margin-bottom:8px">لیست شرکت‌های ثبت‌شده</h4>
706 <div class="table-responsive"><table><thead><tr><th>نام</th><th>شخصیت / قالب</th><th>نوع فعالیت</th><th>شناسه ملی</th><th>کد اقتصادی</th><th>پیش‌فرض</th><th>عملیات</th></tr></thead><tbody id="companies-table-body"></tbody></table></div>
707 </div>
708 </div>
709 </div>
710
711 <div class="accordion-item" data-finora-task="invoice-defaults">
712 <div class="accordion-header" onclick="toggleAccordion(this)"><span>⚙️ مالیات، تخفیف و واحد پول (پیش‌فرض فاکتور جدید)</span><span>▼</span></div>
713 <div class="accordion-body">
714 <div class="form-row">
715 <div class="form-group"><label>قالب پیش‌فرض فاکتور</label><select id="def-invoice-kind" class="form-control"><option value="non_formal">فاکتور غیررسمی</option><option value="formal">فاکتور رسمی</option><option value="pre_invoice">پیش‌فاکتور فروش</option><option value="contract_statement">صورت وضعیت پیمان</option></select></div>
716 <div class="form-group"><label>وضعیت پیش‌فرض ارزش افزوده</label><select id="def-vat-mode" class="form-control"><option value="none">بدون ارزش افزوده</option><option value="with_vat">با ارزش افزوده</option></select></div>
717 <div class="form-group"><label>نرخ ارزش افزوده (درصد)</label><input type="text" inputmode="decimal" id="def-vat-rate" class="form-control" value="10" oninput="handleMoneyInput(this)" /></div>
718 </div>
719 <div class="form-row">
720 <div class="form-group"><label>واحد پول</label><select id="def-currency-mode" class="form-control" onchange="handleCurrencyModeChange()"><option value="rial">ریال</option><option value="toman">تومان</option><option value="custom">سایر (دلخواه)</option></select></div>
721 <div class="form-group" id="box-currency-custom" style="display:none"><label>نام واحد پول دلخواه</label><input type="text" id="def-currency-custom" class="form-control" placeholder="مثلاً: یورو، دلار، درهم..." /></div>
722 </div>
723 <button class="btn btn-primary" onclick="commitSaveDefaultSettings()">ذخیره پیش‌فرض‌ها</button>
724 </div>
725 </div>
726
727 <div class="accordion-item" data-finora-task="legacy-backup">
728 <div class="accordion-header" onclick="toggleAccordion(this)"><span>💾 دیتابیس و پشتیبان‌گیری</span><span>▼</span></div>
729 <div class="accordion-body">
730 <p style="font-size:13px;color:var(--text-muted);margin-bottom:12px">وضعیت دیتابیس: <span class="badge badge-success">تفکیک کاربر فعال</span></p>
731 <div style="display:flex;gap:10px;flex-wrap:wrap">
732 <button class="btn btn-secondary" onclick="exportDataBlob()">📥 دانلود فایل پشتیبان (JSON)</button>
733 <label class="btn btn-secondary" style="margin-bottom:0">📤 بازگردانی فایل<input type="file" id="import-json-file" style="display:none" onchange="importDataBlob(event)" accept=".json" /></label>
734 </div>
735 </div>
736 </div>
737
738 <div class="accordion-item" data-finora-task="about">
739 <div class="accordion-header" onclick="toggleAccordion(this)"><span>ℹ️ درباره نرم‌افزار</span><span>▼</span></div>
740 <div class="accordion-body">
741 <h3 style="font-size:16px;font-weight:bold">فینورا - Finora</h3>
742 <p style="color:var(--text-muted);font-size:13px;margin:6px 0 12px 0">نرم‌افزار ERP سازمانی فینورا</p>
743 <p style="font-size:13px;margin-bottom:8px">نگارش فعال: <strong>نسخه ۱.۰</strong></p>
744 <div class="about-dev-card">
745 <div class="about-dev-avatar">د.م</div>
746 <div class="about-dev-info">
747 <h4>داود مهربان</h4>
748 <p>طراح و توسعه‌دهنده نرم‌افزار</p>
749 <p>📱 <span dir="ltr" style="font-family:Tahoma">0912-437-6991</span></p>
750 </div>
751 <div class="about-dev-actions">
752 <a class="btn-wa" href="https://wa.me/989124376991?text=سلام%20داود%20عزیز،%20درباره%20نرم‌افزار%20فینورا%20سؤال%20داشتم." target="_blank" rel="noopener">
753 <svg viewBox="0 0 24 24" fill="currentColor" width="14" height="14"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.451.03-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/></svg>
754 واتس‌اپ
755 </a>
756 <a class="btn-call" href="tel:+989124376991">📞 تماس</a>
757 </div>
758 </div>
759 <div style="display:flex;gap:10px;margin-top:10px">
760 <button class="btn btn-primary" onclick="alert('آخرین نگارش نصب است.')">بررسی آپدیت</button>
761 <button class="btn btn-secondary" onclick="alert('پشتیبانی فعال است.')">گزارش باگ</button>
762 </div>
763 </div>
764 </div>
765 </section>
766
767 <section id="view-admin" class="view-pane">
768 <div class="card">
769 <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;flex-wrap:wrap;gap:10px">
770 <div><h2 style="font-size:18px;color:var(--danger)">👑 پنل مدیریت مرکزی کاربران و لایسنس‌ها</h2><p style="color:var(--text-muted);font-size:13px;margin-top:4px">تعریف کاربران، تخصیص طرح‌های لایسنس، تمدید، تغییر مدت و لغو اشتراک.</p></div>
771 <div style="display:flex;gap:8px;flex-wrap:wrap"><button id="admin-create-user-button" class="btn btn-success btn-inline" type="button" onclick="adminOpenCreateUser()">+ ایجاد کاربر جدید</button><button class="btn btn-primary btn-inline" onclick="refreshAdminPanel()">🔄 تازه‌سازی لیست</button></div>
772 </div>
773 <div style="background:#eff6ff;border:1px solid #bfdbfe;border-radius:10px;padding:14px;margin-bottom:20px;font-size:13px;line-height:1.9">مدیر سیستم سراسری می‌تواند حساب عادی بسازد، لایسنس را مدیریت کند و در صورت درخواست کاربر رمز تازه تعیین کند. مدیر هر شرکت فقط پیوند بازیابی می‌فرستد. تغییر رمز حسابی که در چند شرکت عضو است بر همهٔ آن شرکت‌ها اثر می‌گذارد؛ رمز را فقط از مسیر امن در اختیار کاربر بگذارید.</div>
774 <div class="table-responsive">
775 <table><thead><tr><th>کاربر</th><th>وضعیت حساب</th><th>نوع اشتراک</th><th>ظرفیت شرکت</th><th>ظرفیت کاربران</th><th>تاریخ شروع</th><th>تاریخ پایان</th><th>روزهای باقیمانده</th><th>عملیات مدیریت لایسنس</th></tr></thead><tbody id="admin-users-table-body"><tr><td colspan="9" style="text-align:center;padding:20px">در حال بارگذاری کاربران...</td></tr></tbody></table>
776 </div>
777 </div>
778 </section>
779
780 <div id="printable-invoice" style="display:none"></div>
781 </main>
782 </div>
783
784 <div class="modal-backdrop" id="modal-user-onboarding"><div class="modal-card" style="max-width:520px"><h3 style="font-size:18px;margin-bottom:6px">خوش آمدید به فینورا</h3><p style="font-size:12.5px;color:var(--text-muted);line-height:1.9;margin-bottom:14px">برای شخصی‌سازی محیط کاری، نام و نقش حرفه‌ای خودتان را مشخص کنید. این نقش فقط برای تجربه کاربری است و دسترسی «مدیر سیستم» ایجاد نمی‌کند.</p><div class="form-group"><label>نام و نام خانوادگی</label><input id="onboarding-full-name" class="form-control" maxlength="80" placeholder="مثلاً محمد رضایی" autocomplete="name"></div><div class="form-group"><label>در فینورا با چه نقشی کار می‌کنید؟</label><select id="onboarding-professional-role" class="form-control"><option value="business_owner">مالک / مدیر کسب‌وکار</option><option value="financial_manager">مدیر مالی</option><option value="chief_accountant">رئیس حسابداری</option><option value="accountant">حسابدار</option><option value="treasury">خزانه‌دار</option><option value="sales">فروش / بازرگانی</option><option value="warehouse">انباردار</option><option value="auditor">حسابرس / ناظر</option><option value="other">سایر</option></select></div><button class="btn btn-primary" style="width:100%;margin-top:12px" onclick="saveUserOnboarding()">ذخیره و ورود به محیط کار</button></div></div>
785
786 <div class="modal-backdrop" id="modal-quick-contact">
787 <div class="modal-card">
788 <h3 style="font-size:16px;margin-bottom:12px">➕ تعریف سریع خریدار</h3>
789 <div class="form-row">
790 <div class="form-group"><label>نوع</label><select id="quick-c-entity" class="form-control" onchange="handleQuickCEntityChange()"><option value="natural">شخص حقیقی</option><option value="legal">شخص حقوقی</option></select></div>
791 <div class="form-group" id="box-quick-c-prefix"><label>پیشوند</label><select id="quick-c-prefix" class="form-control"><option value="آقا/خانم">آقا / خانم</option><option value="فروشگاه">فروشگاه</option></select></div>
792 <div class="form-group" style="grid-column:span 2" id="box-quick-c-name"><label>نام</label><input type="text" id="quick-c-name" class="form-control" /></div>
793 </div>
794 <div class="form-row">
795 <div class="form-group"><label id="label-quick-c-national">شناسه ملی</label><input type="text" id="quick-c-national" class="form-control" /></div>
796 <div class="form-group" id="box-quick-c-economic"><label>کد اقتصادی</label><input type="text" id="quick-c-economic" class="form-control" /></div>
797 <div class="form-group" id="box-quick-c-reg"><label>شماره ثبت</label><input type="text" id="quick-c-reg" class="form-control" /></div>
798 </div>
799 <div class="form-row">
800 <div class="form-group"><label>کد پستی</label><input type="text" id="quick-c-postal" class="form-control" /></div>
801 <div class="form-group"><label>تلفن</label><input type="text" id="quick-c-mobile" class="form-control" /></div>
802 </div>
803 <div class="form-group"><label>نشانی</label><input type="text" id="quick-c-address" class="form-control" /></div>
804 <div style="display:flex;gap:10px;margin-top:12px">
805 <button class="btn btn-success" onclick="saveQuickContact()">ذخیره و انتخاب</button>
806 <button class="btn btn-secondary" onclick="closeQuickContactModal()">انصراف</button>
807 </div>
808 </div>
809 </div>
810
811 <div class="modal-backdrop" id="modal-quick-product">
812 <div class="modal-card">
813 <h3 style="font-size:16px;margin-bottom:12px">➕ تعریف سریع کالا</h3>
814 <div class="form-row">
815 <div class="form-group"><label>کد</label><input type="text" id="quick-p-code" class="form-control" /></div>
816 <div class="form-group"><label>عنوان</label><input type="text" id="quick-p-name" class="form-control" /></div>
817 <div class="form-group"><label>مشخصه</label><input type="text" id="quick-p-spec" class="form-control" /></div>
818 </div>
819 <div class="form-row">
820 <div class="form-group"><label>واحد</label><input type="text" id="quick-p-unit" class="form-control" value="عدد" /></div>
821 <div class="form-group"><label>قیمت فروش (<span class="cur-label">ریال</span>)</label><input type="text" inputmode="decimal" id="quick-p-price" class="form-control" value="0" oninput="handleMoneyInput(this)" /></div>
822 <div class="form-group"><label>شناسه کالا/خدمت سامانه مالیاتی</label><input type="text" id="quick-p-official-id" class="form-control" /></div>
823 </div>
824 <div style="display:flex;gap:10px;margin-top:12px">
825 <button class="btn btn-success" onclick="saveQuickProduct()">ذخیره و افزودن</button>
826 <button class="btn btn-secondary" onclick="closeQuickProductModal()">انصراف</button>
827 </div>
828 </div>
829 </div>
830
831 <div class="modal-backdrop" id="modal-admin-create-user">
832 <div class="modal-card" style="max-width:570px" role="dialog" aria-modal="true" aria-labelledby="admin-create-title">
833 <h3 id="admin-create-title">ایجاد کاربر جدید توسط مدیر سیستم</h3>
834 <p class="af-hint">حساب در سامانه احراز هویت سرور ساخته می‌شود. از این فرم برای اعطای دسترسی مدیر سیستم استفاده نمی‌شود؛ نقش اولیه «کاربر عادی» است.</p>
835 <div class="form-group"><label for="admin-new-fullname">نام کاربر</label><input id="admin-new-fullname" class="form-control" maxlength="120" autocomplete="off"></div>
836 <div class="form-group"><label for="admin-new-email">ایمیل ورود <span aria-hidden="true">*</span></label><input id="admin-new-email" class="form-control" type="email" maxlength="254" autocomplete="off" dir="ltr"></div>
837 <div class="form-group"><label for="admin-new-username">نام کاربری اختیاری (لاتین)</label><input id="admin-new-username" class="form-control" maxlength="40" autocomplete="off" dir="ltr" placeholder="user_123"></div>
838 <div class="form-group"><label for="admin-new-password">رمز اولیه <span aria-hidden="true">*</span></label><input id="admin-new-password" class="form-control" type="password" minlength="12" maxlength="128" autocomplete="new-password" dir="ltr"><small>حداقل ۱۲ کاراکتر شامل حرف بزرگ، حرف کوچک، عدد و نماد. رمز در مرورگر ذخیره نمی‌شود.</small></div>
839 <div id="admin-create-status" aria-live="polite" class="af-hint"></div>
840 <div style="display:flex;flex-wrap:wrap;gap:8px;margin-top:15px">
841 <button id="admin-create-submit" class="btn btn-primary" type="button" onclick="adminCreateUser()">ایجاد حساب</button>
842 <button class="btn btn-secondary" type="button" onclick="adminCloseCreateUser()">بستن</button>
843 </div>
844 </div></div>
845 <div class="modal-backdrop" id="modal-admin-reset-password">
846 <div class="modal-card" style="max-width:520px" role="dialog" aria-modal="true" aria-labelledby="admin-password-reset-title">
847 <h3 id="admin-password-reset-title">تعیین رمز جدید کاربر</h3>
848 <p class="af-hint">حساب انتخاب‌شده: <strong id="admin-password-reset-user"></strong></p>
849 <p class="af-hint">این عملیات رمز مشترک حساب کاربر را در همهٔ شرکت‌هایش عوض می‌کند. رمز باید حداقل ۱۲ نویسه و شامل حرف بزرگ، حرف کوچک، عدد و نماد باشد.</p>
850 <div class="form-group"><label for="admin-reset-password">رمز جدید</label><input id="admin-reset-password" class="form-control" type="password" minlength="12" maxlength="128" autocomplete="new-password" dir="ltr"></div>
851 <div class="form-group"><label for="admin-reset-password-confirm">تکرار رمز جدید</label><input id="admin-reset-password-confirm" class="form-control" type="password" minlength="12" maxlength="128" autocomplete="new-password" dir="ltr"></div>
852 <p id="admin-password-reset-status" class="af-hint" aria-live="polite"></p>
853 <div style="display:flex;flex-wrap:wrap;gap:8px;margin-top:15px">
854 <button id="admin-reset-password-submit" class="btn btn-primary" type="button" onclick="adminSetPassword()">ثبت رمز جدید</button>
855 <button class="btn btn-secondary" type="button" onclick="adminClosePasswordReset()">بستن</button>
856 </div>
857 </div></div>
858 <div class="modal-backdrop" id="modal-admin-license-edit">
859 <div class="modal-card">
860 <h3 style="font-size:16px;margin-bottom:12px" id="modal-license-user-title">تغییر مدت و لایسنس کاربر</h3>
861 <input type="hidden" id="modal-license-target-username" />
862 <div class="form-group"><label>انتخاب مدت و نوع لایسنس جدید</label><select id="modal-license-duration-select" class="form-control"><option value="monthly">اشتراک ۱ ماهه (۳۰ روز)</option><option value="three_months">اشتراک ۳ ماهه (۹۰ روز)</option><option value="annual">اشتراک ۱ ساله (۳۶۵ روز)</option><option value="lifetime">اشتراک دائمی (Lifetime)</option></select></div><div class="form-row"><div class="form-group"><label>حداکثر تعداد شرکت حقوقی</label><input id="modal-license-company-limit" type="number" min="1" max="1000" value="1" class="form-control"><small id="modal-license-company-limit-hint" style="color:var(--text-muted)">ناحیه/واحد سهمیه شرکت مصرف نمی‌کند.</small></div><div class="form-group"><label>حداکثر کاربران نام‌دار</label><input id="modal-license-user-limit" type="number" min="1" max="100000" value="1" class="form-control"><small id="modal-license-user-limit-hint" style="color:var(--text-muted)">هر عضو فعال یک Seat مصرف می‌کند.</small></div></div>
863 <div style="display:flex;gap:10px;margin-top:16px">
864 <button class="btn btn-success" style="flex:1" onclick="applyLicenseDurationChange()">تایید و اعمال لایسنس</button>
865 <button class="btn btn-secondary" style="flex:1" onclick="closeLicenseEditModal()">انصراف</button>
866 </div>
867 </div>
868 </div>
869
870 <div class="modal-backdrop" id="modal-electronic-doc">
871 <div class="modal-card" style="max-width:850px">
872 <h3 style="font-size:16px;margin-bottom:6px">📄 سند الکترونیکی سامانه مودیان</h3>
873 <p style="font-size:12px;color:var(--text-muted);margin-bottom:14px">اطلاعات این سند فقط برای فاکتور رسمی قابل تکمیل است.</p>
874
875 <h4 style="font-size:14px;margin-bottom:8px;color:#1e3a8a;border-bottom:1px solid #e2e8f0;padding-bottom:6px">الف) سربرگ صورتحساب</h4>
876 <div class="form-row">
877 <div class="form-group"><label>شماره منحصر به فرد مالیاتی</label><input type="text" id="edoc-unique-number" class="form-control" placeholder="A2EAG4050E000000043C9" /></div>
878 <div class="form-group"><label>شماره مالیاتی مندرج در برگه تشخیص</label><input type="text" id="edoc-tax-number" class="form-control" placeholder="0000000043C" /></div>
879 </div>
880 <div class="form-row">
881 <div class="form-group"><label>تاریخ و زمان صدور</label><input type="text" id="edoc-issue-datetime" class="form-control" placeholder="1405/06/17 11:35:00" /></div>
882 <div class="form-group"><label>نوع صورتحساب</label><select id="edoc-kind" class="form-control"><option value="اصل">اصل</option><option value="برگشت">برگشت</option><option value="اصلاحی">اصلاحی</option></select></div>
883 </div>
884 <div class="form-row">
885 <div class="form-group"><label>تاریخ صورتحساب الکترونیکی اصلی</label><input type="text" id="edoc-original-date" class="form-control" placeholder="1405/06/17" /></div>
886 <div class="form-group"><label>شماره صورتحساب الکترونیکی اصلی</label><input type="text" id="edoc-original-number" class="form-control" placeholder="140505" /></div>
887 </div>
888 <div class="form-row">
889 <div class="form-group"><label>الگو / موضوع صورتحساب</label><select id="edoc-pattern" class="form-control" onchange="handleEdocPatternChange()"><option value="کالا">فروش کالا</option><option value="خدمات">خدمات</option><option value="پیمانکاری">قرارداد پیمانکاری</option><option value="هردو">هر دو (کالا و خدمات)</option></select></div>
890 </div>
891
892 <h4 style="font-size:14px;margin:14px 0 8px 0;color:#1e3a8a;border-bottom:1px solid #e2e8f0;padding-bottom:6px">ب) اقلام کالا/خدمت</h4>
893 <div id="edoc-items-container"></div>
894
895 <h4 style="font-size:14px;margin:14px 0 8px 0;color:#1e3a8a;border-bottom:1px solid #e2e8f0;padding-bottom:6px">ج) موارد اختصاصی قرارداد پیمانکاری</h4>
896 <div id="box-edoc-contract" style="display:none">
897 <div class="form-group"><label>شناسه یکتای ثبت قرارداد</label><input type="text" id="edoc-contract-id" class="form-control" placeholder="205108734859" /></div>
898 </div>
899 <div id="edoc-contract-hint" style="font-size:12px;color:var(--text-muted);padding:8px;background:#f8fafc;border-radius:6px">این بخش فقط برای الگوی «قرارداد پیمانکاری» فعال است.</div>
900
901 <div style="display:flex;gap:10px;margin-top:16px">
902 <button class="btn btn-success" onclick="saveElectronicDocToPending()">💾 ذخیره اطلاعات سند</button>
903 <button class="btn btn-secondary" onclick="cancelElectronicDoc()">انصراف</button>
904 </div>
905 </div>
906 </div>
907
908 <nav class="mobile-dock" aria-label="ناوبری موبایل">
909 <div class="dock-tab active" data-view="view-dashboard" onclick="switchView('view-dashboard')"><span>📊</span><span>داشبورد</span></div>
910 <div class="dock-tab" data-view="view-invoices" onclick="switchView('view-invoices')"><span>🧾</span><span>فاکتور</span></div>
911 <div class="dock-tab" data-view="view-purchases" onclick="switchView('view-purchases')"><span>🛒</span><span>خرید</span></div>
912 <div class="dock-tab" data-view="view-payments" onclick="switchView('view-payments')"><span>💳</span><span>دریافت/پرداخت</span></div>
913 <div class="dock-tab" data-view="view-inventory" onclick="switchView('view-inventory')"><span>🏭</span><span>انبار</span></div>
914 <div class="dock-tab" data-view="view-reports" onclick="switchView('view-reports')"><span>📈</span><span>گزارش</span></div>
915 <div class="dock-tab" data-view="view-contacts" onclick="switchView('view-contacts')"><span>👥</span><span>اشخاص</span></div>
916 <div class="dock-tab" data-view="view-products" onclick="switchView('view-products')"><span>📦</span><span>کالا</span></div>
917 <div class="dock-tab" data-view="view-cheques" onclick="switchView('view-cheques')"><span>🏦</span><span>چک</span></div>
918 <div class="dock-tab" data-view="view-expenses" onclick="switchView('view-expenses')"><span>💰</span><span>هزینه/درآمد</span></div>
919 <div class="dock-tab" data-view="view-settings" onclick="switchView('view-settings')"><span>⚙️</span><span>تنظیمات</span></div>
920 </nav>
921
922 <!-- The credential-free connectivity action must be loaded before core declares
923 login actions interactive. Hardened Pages binds static handlers just before core. -->
924 <script src="js/login-connectivity.js?v=20261026-preflight-compare-v5"></script>
925 <script src="js/password-recovery.js?v=20261026-recovery-cancel-v2"></script>
926 <script src="js/core.js?v=20261025-password-recovery-v1"></script>
927 <script src="js/admin.js?v=20261028-central-password-reset-v1"></script>
928 <script src="js/sync.js?v=20261012-login-read-cancel-v1"></script>
929 <script src="js/ui.js?v=20261002-shell-scroll-ownership-v2"></script>
930 <script src="js/invoices.js?v=20261024-settings-zero-vat-v1"></script>
931 <script src="js/print.js?v=20261012-clean-invoice-print-v1"></script>
932 <script src="js/products.js"></script>
933 <script src="js/contacts.js?v=20260928-roles-v3"></script>
934 <script src="js/cheques.js"></script>
935 <script src="js/expenses.js"></script>
936 <script src="js/companies.js?v=20261028-company-edit-v1"></script>
937 <script src="js/backup.js?v=20260928-data-v3"></script>
938 <script src="js/words.js"></script>
939 <script src="js/bootstrap.js?v=20261025-password-recovery-v1"></script>
940
941 <style>
942 .form-control, textarea, select { direction: rtl; }
943 </style>
944
945 <script src="js/patches.js"></script>
946 <script src="js/idle-and-reports.js?v=20260928-phase3-v5"></script>
947 <script src="js/money-format.js"></script>
948
949 <script src="js/projects.js?v=20260928-projects-v7"></script>
950 <script src="js/invoice-excel-import.js"></script>
951 <script src="js/purchases.js?v=20261011-persian-print-v1"></script>
952 <script src="js/commercial-rnd.js?v=20261007-commerce-r1"></script>
953 <script src="js/operations.js?v=20260928-phase3-final"></script>
954 <script src="js/payments.js?v=20260928-phase3-final"></script>
955 <script src="js/accounting.js?v=20260928-accounting-v3"></script>
956 <style id="phase2-accounting-style">
957 .af-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px}.af-head h1{font-size:20px;color:#0f172a}.af-head p,.af-hint{font-size:12px;color:#64748b;margin-top:5px}.af-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.af-space,.af-list{margin-top:14px}.af-chip{display:inline-flex;align-items:center;gap:6px;background:#eef7f8;color:#0b6874;border:1px solid #cce9ec;border-radius:999px;padding:6px 10px;margin:3px;font-size:11px}.af-chip button{border:0;background:transparent;color:#b91c1c;cursor:pointer;font-size:15px}.af-master-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px;border-bottom:1px solid #edf1f5}.af-master-row:last-child{border-bottom:0}.af-master-row small{display:block;color:#64748b;margin-top:3px}.af-empty{text-align:center;padding:18px;color:#64748b}@media(max-width:820px){.af-grid{grid-template-columns:1fr}}
958 </style>
959 <script src="js/accounting-foundation.js?v=20261007-p0-r1"></script>
960 <script src="js/journal-engine.js?v=20261007-p0-r1"></script>
961 <script src="js/context-help.js?v=20261007-help-v1"></script>
962 <script src="js/accounting-foundation-ui.js?v=20261007-guidance-v1"></script>
963 <script src="js/accounting-foundation-render.js?v=20260928-phase2-v1"></script>
964 <script src="js/journal-ui.js?v=20261011-doc-manager-v1"></script>
965 <script src="js/document-management.js?v=20261011-doc-manager-v1"></script>
966 <script src="js/drilldown.js?v=20261011-financial-cards-v1"></script>
967 <script src="js/phase4-contracting.js?v=20260929-phase4-v1"></script>
968 <script src="js/phase5-domain.js?v=20260929-phase5-v1"></script>
969 <script src="js/phase5-enterprise.js?v=20261024-settings-save-v1"></script>
970 <script src="js/phase6-reporting.js?v=20260929-phase6-v1"></script>
971 <script src="js/enterprise-iran.js?v=20260930-iran-erp-v1"></script>
972 <script src="js/enterprise-iran-v2.js?v=20260930-iran-erp-v2"></script>
973 <script src="js/selfcheck.js?v=20260928-release-1-0"></script>
974 <script src="js/ux-hardening-r2.js?v=20261024-complete-settings-v2"></script>
975
976 </body>
977 </html>