:root {
    --fm-blue: #2563eb;
    --fm-blue-dark: #1d4ed8;
    --fm-ink: #102a43;
    --fm-muted: #6b7f93;
    --fm-border: #e4ebf3;
    --fm-bg: #f5f8fc;
    --fm-danger: #dc2626;
    --fm-green: #059669;
}

.fm-hidden { display: none !important; }
.fm-button-wrap { width: 100%; }
.fm-launch-button {
    border: 0; color: #fff; background: var(--fm-blue); min-height: 50px;
    padding: 13px 28px; border-radius: 12px; font: inherit; font-weight: 800;
    cursor: pointer; box-shadow: 0 10px 24px #2563eb3d; transition: transform .2s, box-shadow .2s, background .2s;
}
.fm-launch-button:hover { background: var(--fm-blue-dark); transform: translateY(-2px); box-shadow: 0 14px 28px #2563eb4d; }

#fm-overlay, .fm-modal, #fm-toast {
    font-family: Tahoma, Arial, sans-serif;
    box-sizing: border-box;
    font-size: 16px;
}
#fm-overlay *, .fm-modal *, #fm-toast * { box-sizing: border-box; }
#fm-overlay {
    position: fixed !important; inset: 0; z-index: 2147483000 !important; isolation: isolate; padding: 20px;
    background: #102a4388; backdrop-filter: blur(8px);
}
.fm-dashboard {
    width: min(1080px, 100%); height: min(840px, calc(100vh - 40px)); min-height: 0; margin: auto;
    display: flex; flex-direction: column; overflow: hidden; border-radius: 24px;
    background: var(--fm-bg); box-shadow: 0 25px 80px #102a4350; color: var(--fm-ink);
}
.fm-header {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    padding: 20px 28px; background: #fff; border-bottom: 1px solid #edf2f7;
}
.fm-brand { display: flex; align-items: center; gap: 13px; }
.fm-brand-mark {
    width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px;
    background: #e8f0ff; color: var(--fm-blue); font-size: 25px; font-weight: 900;
}
.fm-header h2, .fm-header p, .fm-section-heading h3, .fm-section-heading p,
.fm-modal-header h3, .fm-modal-header p { margin: 0; }
.fm-header h2 { font-size: 27px; line-height: 1.5; }
.fm-header p { margin-top: 3px; color: var(--fm-muted); font-size: 16px; }
.fm-icon-button {
    width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%;
    background: #f4f7fa; color: var(--fm-muted); font: inherit; font-size: 25px;
    line-height: 1; cursor: pointer; transition: .2s;
}
.fm-icon-button:hover { color: var(--fm-danger); background: #fee2e2; transform: rotate(8deg); }
.fm-tabs {
    display: flex; gap: 7px; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--fm-border);
}
.fm-tab {
    display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 118px;
    padding: 16px 19px; border: 0; border-bottom: 3px solid transparent; color: var(--fm-muted);
    background: transparent; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer;
}
.fm-tab span:first-child { font-size: 20px; line-height: 1; }
.fm-tab:hover { color: var(--fm-blue); background: #f8fbff; }
.fm-tab.active { color: var(--fm-blue); border-color: var(--fm-blue); }
.fm-content {
    flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 28px;
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
    scroll-padding-bottom: calc(40px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
}
.fm-panel { display: none; }
.fm-panel.active { display: block; animation: fm-in .18s ease-out; }
@keyframes fm-in { from { opacity: .3; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.fm-section-heading {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px;
}
.fm-kicker {
    display: block; margin-bottom: 5px; color: var(--fm-blue); font-size: 14px; font-weight: 900; letter-spacing: .3px;
}
.fm-section-heading h3 { font-size: 31px; line-height: 1.5; }
.fm-section-heading p { margin-top: 7px; color: var(--fm-muted); font-size: 17px; line-height: 1.9; }
.fm-employee-toolbar {
    position: sticky; top: -28px; z-index: 5; margin: -1px 0 22px; padding: 1px 0 15px; background: var(--fm-bg);
}
.fm-employee-add-button { display: block; width: 100%; min-height: 54px; margin: 0 auto; text-align: center; }
.fm-inventory-toolbar, .fm-report-toolbar { justify-content: flex-start; }
.fm-primary {
    border: 0; border-radius: 11px; padding: 12px 18px; color: #fff; background: var(--fm-blue);
    font: inherit; font-size: 17px; font-weight: 900; cursor: pointer; white-space: nowrap;
    box-shadow: 0 7px 16px #2563eb30; transition: .2s;
}
.fm-primary:hover { background: var(--fm-blue-dark); transform: translateY(-1px); }
.fm-primary:disabled { opacity: .6; cursor: wait; transform: none; }
.fm-wide { width: 100%; margin-top: 8px; }
.fm-card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 13px; }
.fm-employee-card {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 20px; background: #fff; border: 2px solid #cbd8e6; border-radius: 16px;
    box-shadow: 0 5px 14px #102a4308;
}
.fm-employee-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.fm-avatar {
    width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center;
    color: #1e40af; background: #dbeafe; border-radius: 13px; font-size: 19px; font-weight: 900;
}
.fm-employee-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 23px; font-weight: 900; }
.fm-employee-description { max-width: 360px; margin-top: 6px; color: #45627e; font-size: 15px; font-weight: 700; line-height: 1.7; overflow-wrap: anywhere; }
.fm-employee-description-empty { color: var(--fm-muted); font-size: 14px; font-weight: 500; }
.fm-card-actions { display: flex; gap: 5px; }
.fm-mini-button {
    width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9px; background: #f3f6fa;
    color: var(--fm-muted); font: inherit; cursor: pointer; font-size: 15px;
}
.fm-mini-button:hover { background: #eaf1ff; color: var(--fm-blue); }
.fm-mini-button.fm-delete:hover { background: #fee2e2; color: var(--fm-danger); }
.fm-empty {
    display: flex; align-items: center; flex-direction: column; justify-content: center; gap: 7px;
    min-height: 180px; border: 1px dashed #cbd7e5; border-radius: 17px; background: #fbfdff; text-align: center;
}
.fm-empty-icon { font-size: 34px; color: #9ab1ca; }
.fm-empty strong { font-size: 14px; }
.fm-empty small { color: var(--fm-muted); font-size: 11px; }
.fm-period-controls { display: flex; align-items: end; gap: 9px; }
.fm-period-controls label, .fm-form label {
    display: flex; flex-direction: column; gap: 7px; color: var(--fm-ink); font-size: 16px; font-weight: 900;
}
.fm-period-controls select, .fm-form input, .fm-form select, .fm-form textarea {
    width: 100%; min-height: 40px; border: 1px solid #d8e2ee; border-radius: 9px; background: #fff;
    color: var(--fm-ink); padding: 11px 13px; font: inherit; font-size: 17px; outline: 0;
}
.fm-form textarea { min-height: 92px; resize: vertical; line-height: 1.8; }
.fm-period-controls select { min-width: 125px; }
.fm-form input:focus, .fm-form select:focus, .fm-form textarea:focus { border-color: #7aa8f9; box-shadow: 0 0 0 3px #2563eb18; }
.fm-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.fm-summary-card {
    position: relative; overflow: hidden; padding: 17px; border-radius: 15px; background: #fff; border: 1px solid var(--fm-border);
}
.fm-summary-card:after { content: ""; position: absolute; left: -20px; bottom: -28px; width: 76px; height: 76px; border-radius: 50%; background: var(--card-color, #dbeafe); opacity: .4; }
.fm-summary-card .fm-summary-label { color: var(--fm-muted); font-size: 17px; font-weight: 900; line-height: 1.7; }
.fm-summary-amount { margin-top: 9px; direction: ltr; text-align: right; }
.fm-summary-card strong { display: block; color: var(--card-color, var(--fm-ink)); font-size: 34px; font-weight: 900; line-height: 1.35; white-space: nowrap; }
.fm-summary-card small { display: block; margin-top: 4px; color: var(--fm-muted); font-size: 15px; font-weight: 700; line-height: 1.6; white-space: nowrap; }
.fm-summary-card-account { border-width: 2px; }
.fm-action-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; margin-bottom: 22px; }
.fm-action-card {
    display: flex; align-items: center; gap: 10px; min-height: 78px; padding: 13px;
    border: 1px solid var(--fm-border); border-radius: 14px; background: #fff; text-align: right;
    font: inherit; cursor: pointer; transition: .2s;
}
.fm-action-card:hover { transform: translateY(-2px); box-shadow: 0 9px 20px #102a4310; }
.fm-action-icon { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 35px; border-radius: 11px; font-size: 22px; font-weight: 900; }
.fm-action-card strong, .fm-action-card small { display: block; }
.fm-action-card strong { color: var(--fm-ink); font-size: 17px; }
.fm-action-card small { margin-top: 4px; color: var(--fm-muted); font-size: 14px; line-height: 1.6; }
.fm-action-blue .fm-action-icon { color: #1d4ed8; background: #dbeafe; }
.fm-action-green .fm-action-icon { color: #047857; background: #d1fae5; }
.fm-action-purple .fm-action-icon { color: #7e22ce; background: #f3e8ff; }
.fm-action-orange .fm-action-icon { color: #c2410c; background: #ffedd5; }
.fm-action-teal .fm-action-icon { color: #0f766e; background: #ccfbf1; }
.fm-inventory-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.fm-list-box { min-width: 0; padding: 16px; border-radius: 16px; background: #fff; border: 1px solid var(--fm-border); }
.fm-list-box-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.fm-list-box-header h4 { margin: 0; font-size: 20px; }
.fm-list-box-header small { display: block; margin-top: 4px; color: var(--fm-muted); font-size: 15px; }
.fm-link-button { border: 0; background: transparent; color: var(--fm-blue); font: inherit; font-size: 16px; font-weight: 900; cursor: pointer; }
.fm-record-list { display: flex; flex-direction: column; gap: 8px; }
.fm-record {
    display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 10px 11px;
    border: 1px solid #edf1f5; border-radius: 11px; background: #fbfdff;
}
.fm-record-main { min-width: 0; }
.fm-record-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fm-ink); font-size: 18px; font-weight: 900; }
.fm-record-meta { margin-top: 4px; color: var(--fm-muted); font-size: 15px; line-height: 1.7; }
.fm-record-amount { direction: ltr; white-space: nowrap; color: var(--fm-green); font-size: 20px; font-weight: 900; }
.fm-record-expense .fm-record-amount { color: var(--fm-danger); }
.fm-record-payment .fm-record-amount { color: #d97706; }
.fm-record-actions { display: flex; align-items: center; gap: 4px; }
.fm-record-actions .fm-mini-button { width: 27px; height: 27px; font-size: 12px; }
.fm-attachment { color: var(--fm-blue); text-decoration: none; font-size: 13px; }
.fm-attachment:hover { text-decoration: underline; }
.fm-report-actions { display: flex; align-items: end; gap: 11px; }
.fm-print-buttons { display: flex; align-items: center; gap: 14px; margin-right: 8px; }
.fm-print-a4-button { background: #7c3aed; }
.fm-print-a4-button:hover { background: #6d28d9; }
.fm-print-a4-button.is-exporting { background: #6b7280; cursor: wait; }
.fm-report-content { min-height: 260px; }
.fm-report-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 18px; }
.fm-report-section { margin-top: 18px; padding: 17px; background: #fff; border: 1px solid var(--fm-border); border-radius: 15px; }
.fm-report-section h4 { margin: 0 0 12px; color: var(--fm-ink); font-size: 15px; }
.fm-report-table-wrap { overflow-x: auto; }
.fm-report-table { width: 100%; border-collapse: collapse; font-size: 17px; }
.fm-report-table caption { padding: 0 0 8px; color: var(--fm-ink); text-align: right; font-size: 16px; font-weight: 900; }
.fm-report-extra-payments { margin-top: 14px; }
.fm-report-table th, .fm-report-table td { padding: 13px 10px; border-bottom: 1px solid #edf1f5; text-align: right; white-space: nowrap; }
.fm-report-table th { background: #f7faff; color: var(--fm-muted); font-size: 15px; font-weight: 900; }
.fm-report-table td strong { color: var(--fm-ink); }
.fm-report-table td.ltr { direction: ltr; text-align: right; }
.fm-report-person { margin-top: 18px; padding: 18px; border: 2px solid #c7d5e4; border-radius: 15px; background: #fff; box-shadow: 0 5px 14px #102a4308; }
.fm-report-person:first-child { margin-top: 0; }
.fm-person-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fm-person-heading > h5 { min-width: 0; }
.fm-report-person h5 { margin: 0 0 12px; color: var(--fm-blue); font-size: 24px; font-weight: 900; line-height: 1.6; overflow-wrap: anywhere; }
.fm-person-actions { display: flex; gap: 4px; }
.fm-report-person-summary { display: flex; flex-direction: column; gap: 7px; margin-bottom: 8px; }
.fm-report-person-summary > div, .fm-report-total-lines > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 13px; border: 1px solid #d7e2ef; border-radius: 10px; background: #f7faff; }
.fm-report-person-summary span, .fm-report-person-summary strong { display: block; }
.fm-report-person-summary span { color: var(--fm-muted); font-size: 16px; font-weight: 800; }
.fm-report-amount { display: flex; flex-direction: column; align-items: flex-end; direction: ltr; text-align: right; white-space: nowrap; }
.fm-report-amount strong { color: var(--fm-ink); font-size: 23px; font-weight: 900; line-height: 1.35; }
.fm-report-amount small { margin-top: 2px; color: var(--fm-muted); font-size: 14px; font-weight: 800; line-height: 1.35; }
.fm-report-person-summary > div > strong { direction: ltr; text-align: right; font-size: 23px; font-weight: 900; white-space: nowrap; }
.fm-report-total-lines { display: flex; flex-direction: column; gap: 7px; }
.fm-report-total-lines > div > span { color: var(--fm-muted); font-size: 16px; font-weight: 800; }
.fm-report-note { margin-top: 12px; padding: 12px 14px; border-right: 4px solid var(--fm-blue); border-radius: 8px; color: var(--fm-muted); background: #f7faff; font-size: 15px; font-weight: 700; line-height: 1.8; }
.fm-report-empty { padding: 38px 15px; border: 1px dashed #cad7e5; border-radius: 14px; color: var(--fm-muted); text-align: center; font-size: 17px; font-weight: 700; }

.fm-modal {
    position: fixed !important; inset: 0; z-index: 2147483001 !important; isolation: isolate; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: #102a4366; backdrop-filter: blur(5px);
}
.fm-modal-box { width: min(560px, 100%); max-height: min(760px, calc(100vh - 40px)); overflow: auto; border-radius: 20px; background: #f8fbff; box-shadow: 0 25px 70px #102a4350; }
.fm-small-modal { width: min(420px, 100%); }
.fm-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 20px 22px 16px; background: #fff; border-bottom: 1px solid var(--fm-border); }
.fm-modal-header h3 { font-size: 22px; line-height: 1.5; }
.fm-form { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px 23px; }
.fm-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fm-file-field { padding: 12px; border: 1px dashed #b8c9db; border-radius: 11px; background: #fff; }
.fm-file-field input[type=file] { min-height: auto; padding: 7px; }
.fm-form label small { color: var(--fm-muted); font-size: 12px; font-weight: 400; line-height: 1.6; }
.fm-form-note { margin: -2px 0 0; color: var(--fm-muted); font-size: 13px; line-height: 1.8; }
.fm-money-preview { display: block; min-height: 18px; margin-top: -4px; color: var(--fm-blue); font-size: 13px; font-weight: 800; }
.fm-calculation-hint { padding: 11px 13px; border-radius: 10px; color: #31557c; background: #eaf2ff; font-size: 13px; line-height: 1.8; }
.fm-toast {
    position: fixed !important; right: 25px; bottom: 25px; z-index: 2147483002 !important; max-width: min(360px, calc(100vw - 40px));
    padding: 12px 17px; border-radius: 11px; color: #fff; background: #15395c; box-shadow: 0 12px 28px #102a4333;
    font-size: 14px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .22s;
}
.fm-toast.show { opacity: 1; transform: none; }
.fm-toast.error { background: var(--fm-danger); }
.fm-print-title { display: none; }
body.fm-modal-open { overflow: hidden !important; }

@media (max-width: 760px) {
    #fm-overlay { padding: 8px; }
    .fm-dashboard { height: calc(100vh - 16px); height: calc(100dvh - 16px); border-radius: 18px; }
    .fm-header { padding: 15px 16px; }
    .fm-content {
        padding: 19px 14px;
        padding-bottom: calc(88px + env(safe-area-inset-bottom));
        scroll-padding-bottom: calc(88px + env(safe-area-inset-bottom));
    }
    .fm-tabs {
        width: 100%; padding: 0; gap: 0; overflow: hidden; justify-content: stretch;
    }
    .fm-tab {
        min-width: 0; width: 33.3333%; flex: 1 1 0; min-height: 54px; padding: 12px 3px;
        gap: 4px; font-size: clamp(11px, 3.6vw, 14px); line-height: 1.6; white-space: nowrap;
    }
    .fm-tab span:first-child { font-size: clamp(14px, 4.5vw, 17px); }
    .fm-section-heading { align-items: stretch; flex-direction: column; gap: 13px; }
    .fm-section-heading .fm-primary { align-self: flex-start; }
    .fm-employee-toolbar { top: -19px; margin-top: -1px; padding-bottom: 13px; }
    .fm-employee-add-button { width: 100%; }
    .fm-heading-stack-mobile { gap: 15px; }
    .fm-period-controls { width: 100%; }
    .fm-period-controls label { flex: 1; }
    .fm-period-controls select { min-width: 0; }
    .fm-summary-grid, .fm-report-summary { grid-template-columns: 1fr; }
    .fm-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fm-inventory-columns { grid-template-columns: 1fr; }
    .fm-report-actions { align-items: stretch; flex-direction: column; }
    .fm-print-button { width: 100%; }
    .fm-report-table-wrap { overflow: visible; }
    .fm-report-table caption { padding-bottom: 6px; font-size: 14px; }
    .fm-report-extra-payments { margin-top: 12px; }
    .fm-report-table, .fm-report-table tbody, .fm-report-table tr, .fm-report-table td { display: block; width: 100%; }
    .fm-report-table thead { display: none; }
    .fm-report-table tr { margin-bottom: 10px; border: 1px solid #d7e2ef; border-radius: 11px; overflow: hidden; background: #fff; }
    .fm-report-table td { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 9px 10px; border-bottom: 1px solid #edf1f5; white-space: normal; text-align: left; direction: rtl; }
    .fm-report-table td:last-child { border-bottom: 0; }
    .fm-report-table td[data-label]::before { content: attr(data-label); flex: 0 0 46%; color: var(--fm-muted); font-size: 13px; font-weight: 900; text-align: right; }
    .fm-report-table td.ltr { direction: rtl; text-align: left; font-variant-numeric: tabular-nums; }
    .fm-report-table td[colspan] { display: block; text-align: center; }
    .fm-report-person-summary div { padding: 11px 12px; }
    .fm-report-person-summary span { font-size: 15px; }
    .fm-report-person-summary strong { font-size: 22px; }
}

@media (max-width: 460px) {
    .fm-form-grid { grid-template-columns: 1fr; }
    .fm-action-card { min-height: 70px; padding: 10px; }
    .fm-action-card small { font-size: 12px; }
    .fm-summary-card { padding: 13px 10px; }
    .fm-summary-card .fm-summary-label { font-size: 14px; }
    .fm-summary-card strong { font-size: 25px; }
}

@media (max-width: 620px) {
    .fm-print-buttons { width: 100%; margin-right: 0; flex-direction: column; align-items: stretch; gap: 10px; }
    .fm-print-buttons .fm-print-button { width: 100%; }
}

/* The hidden A4 canvas used by the direct PDF download button. */
.fm-pdf-export {
    width: 210mm !important;
    max-width: 210mm !important;
    min-width: 210mm !important;
    min-height: 297mm !important;
    height: auto !important;
    box-sizing: border-box !important;
    padding: 10mm 12mm !important;
    margin: 0 !important;
    background: #fff !important;
    color: #000 !important;
    /*
     * The outer sheet is intentionally LTR. html2canvas has a RTL fixed
     * positioning bug that moves the report to the right and clips it.
     * Persian layout is restored by .fm-pdf-export-content below.
     */
    direction: ltr !important;
    font-family: "B Nazanin", "BNazanin", "Nazanin", Tahoma, Arial, sans-serif !important;
    font-size: 10pt !important;
    font-weight: 900 !important;
    line-height: 1.35 !important;
    font-synthesis: weight !important;
    text-rendering: geometricPrecision !important;
    unicode-bidi: plaintext !important;
    -webkit-text-stroke: .12px #000 !important;
}
.fm-pdf-export * { box-sizing: border-box !important; }
.fm-pdf-export > .fm-pdf-export-content {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 100% !important;
    margin: 0 !important;
    direction: rtl !important;
    text-align: right !important;
}
.fm-pdf-export .fm-print-title {
    display: flex !important; flex-direction: column !important; gap: .8mm !important;
    margin: 0 0 2.5mm !important; padding: 0 0 1.5mm !important;
    border-bottom: .5mm solid #000 !important; color: #000 !important;
    text-align: center !important; font-size: 17pt !important; line-height: 1.2 !important;
}
.fm-pdf-export .fm-print-title span { font-size: 10.5pt !important; }
.fm-pdf-export .fm-report-summary {
    display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 1.5mm !important; margin: 0 0 2.5mm !important;
}
.fm-pdf-export .fm-summary-card {
    display: flex !important; flex-direction: column !important; align-items: stretch !important;
    gap: .7mm !important; min-width: 0 !important; margin: 0 !important; padding: 1.5mm !important;
    border: .3mm solid #000 !important; border-radius: 0 !important; background: #fff !important;
    direction: rtl !important; page-break-inside: avoid !important;
}
.fm-pdf-export .fm-summary-card:after { display: none !important; }
.fm-pdf-export .fm-summary-label {
    display: block !important; color: #000 !important; direction: rtl !important;
    text-align: right !important; font-size: 8.5pt !important; font-weight: 900 !important;
    line-height: 1.2 !important; overflow-wrap: break-word !important;
}
.fm-pdf-export .fm-summary-amount, .fm-pdf-export .fm-report-amount {
    direction: rtl !important; text-align: right !important; align-items: flex-start !important;
    white-space: nowrap !important;
}
.fm-pdf-export .fm-summary-card strong, .fm-pdf-export .fm-report-amount strong {
    display: block !important; color: #000 !important; font-size: 10pt !important;
    font-weight: 900 !important; line-height: 1.15 !important; white-space: nowrap !important;
}
.fm-pdf-export .fm-summary-card small, .fm-pdf-export .fm-report-amount small {
    display: block !important; margin-top: 1mm !important; color: #000 !important;
    font-size: 8pt !important; font-weight: 900 !important; line-height: 1.1 !important;
    white-space: nowrap !important;
}
.fm-pdf-export .fm-report-section {
    width: 100% !important; margin: 2.5mm 0 0 !important; padding: 1.5mm !important;
    border: .3mm solid #000 !important; border-radius: 0 !important; background: #fff !important;
    page-break-inside: auto !important;
}
.fm-pdf-export .fm-report-section h4 {
    margin: 0 0 1mm !important; color: #000 !important; font-size: 11pt !important;
    font-weight: 900 !important; line-height: 1.2 !important;
}
.fm-pdf-export .fm-report-table-wrap { width: 100% !important; overflow: visible !important; }
.fm-pdf-export .fm-report-table {
    width: 100% !important; margin: 0 !important; border-collapse: collapse !important;
    border-spacing: 0 !important;
    table-layout: fixed !important; color: #000 !important; font-size: 8pt !important;
    font-weight: 900 !important;
    direction: rtl !important;
    display: table !important;
}
.fm-pdf-export .fm-report-table tbody { display: table-row-group !important; }
.fm-pdf-export .fm-report-table thead { display: table-header-group !important; }
.fm-pdf-export .fm-report-table caption {
    display: table-caption !important; padding: 0 0 1mm !important; color: #000 !important;
    font-size: 8.5pt !important; font-weight: 900 !important; text-align: right !important;
}
.fm-pdf-export .fm-report-table tr {
    display: table-row !important; page-break-inside: avoid !important; break-inside: avoid !important;
}
.fm-pdf-export .fm-report-table th, .fm-pdf-export .fm-report-table td {
    display: table-cell !important; min-height: 0 !important; padding: .9mm 1.1mm !important;
    border: .25mm solid #000 !important; background: #fff !important; color: #000 !important;
    direction: rtl !important; text-align: right !important; line-height: 1.2 !important;
    white-space: normal !important; overflow-wrap: break-word !important; word-break: normal !important;
    vertical-align: middle !important;
    font-weight: 900 !important; font-synthesis: weight !important; unicode-bidi: plaintext !important;
}
.fm-pdf-export .fm-report-table th { background: #eeeeee !important; font-size: 8.2pt !important; }
.fm-pdf-export .fm-report-table td[data-label]::before { display: none !important; }
.fm-pdf-export .fm-report-table td.ltr {
    direction: rtl !important; text-align: right !important; font-weight: 900 !important;
    font-variant-numeric: tabular-nums !important; white-space: nowrap !important;
}
.fm-pdf-export .fm-report-table td[colspan] { display: table-cell !important; text-align: center !important; }
.fm-pdf-export .fm-account-balance-table td[data-label="پیوست"] { display: none !important; }
.fm-pdf-export .fm-account-balance-table th:nth-child(1),
.fm-pdf-export .fm-account-balance-table td:nth-child(1) { width: 20%; }
.fm-pdf-export .fm-account-balance-table th:nth-child(2),
.fm-pdf-export .fm-account-balance-table td:nth-child(2),
.fm-pdf-export .fm-account-balance-table th:nth-child(3),
.fm-pdf-export .fm-account-balance-table td:nth-child(3),
.fm-pdf-export .fm-account-balance-table th:nth-child(4),
.fm-pdf-export .fm-account-balance-table td:nth-child(4),
.fm-pdf-export .fm-account-balance-table th:nth-child(5),
.fm-pdf-export .fm-account-balance-table td:nth-child(5) { width: 20%; }
.fm-pdf-export .fm-report-person .fm-report-table:first-of-type th:nth-child(1),
.fm-pdf-export .fm-report-person .fm-report-table:first-of-type td:nth-child(1) { width: 8%; }
.fm-pdf-export .fm-report-person .fm-report-table:first-of-type th:nth-child(2),
.fm-pdf-export .fm-report-person .fm-report-table:first-of-type td:nth-child(2),
.fm-pdf-export .fm-report-person .fm-report-table:first-of-type th:nth-child(3),
.fm-pdf-export .fm-report-person .fm-report-table:first-of-type td:nth-child(3) { width: 15%; }
.fm-pdf-export .fm-report-person .fm-report-table:first-of-type th:nth-child(4),
.fm-pdf-export .fm-report-person .fm-report-table:first-of-type td:nth-child(4) { width: 24%; }
.fm-pdf-export .fm-report-person .fm-report-table:first-of-type th:nth-child(5),
.fm-pdf-export .fm-report-person .fm-report-table:first-of-type td:nth-child(5) { width: 38%; }
.fm-pdf-export .fm-report-person .fm-report-extra-payments .fm-report-table th:nth-child(1),
.fm-pdf-export .fm-report-person .fm-report-extra-payments .fm-report-table td:nth-child(1) { width: 7%; }
.fm-pdf-export .fm-report-person .fm-report-extra-payments .fm-report-table th:nth-child(2),
.fm-pdf-export .fm-report-person .fm-report-extra-payments .fm-report-table td:nth-child(2) { width: 18%; }
.fm-pdf-export .fm-report-person .fm-report-extra-payments .fm-report-table th:nth-child(3),
.fm-pdf-export .fm-report-person .fm-report-extra-payments .fm-report-table td:nth-child(3) { width: 25%; }
.fm-pdf-export .fm-report-person .fm-report-extra-payments .fm-report-table th:nth-child(4),
.fm-pdf-export .fm-report-person .fm-report-extra-payments .fm-report-table td:nth-child(4),
.fm-pdf-export .fm-report-person .fm-report-extra-payments .fm-report-table th:nth-child(5),
.fm-pdf-export .fm-report-person .fm-report-extra-payments .fm-report-table td:nth-child(5) { width: 15%; }
.fm-pdf-export .fm-report-person .fm-report-extra-payments .fm-report-table th:nth-child(6),
.fm-pdf-export .fm-report-person .fm-report-extra-payments .fm-report-table td:nth-child(6) { width: 20%; }
.fm-pdf-export .fm-report-section:last-of-type .fm-report-table th:nth-child(1),
.fm-pdf-export .fm-report-section:last-of-type .fm-report-table td:nth-child(1) { width: 7%; }
.fm-pdf-export .fm-report-section:last-of-type .fm-report-table th:nth-child(2),
.fm-pdf-export .fm-report-section:last-of-type .fm-report-table td:nth-child(2) { width: 15%; }
.fm-pdf-export .fm-report-section:last-of-type .fm-report-table th:nth-child(3),
.fm-pdf-export .fm-report-section:last-of-type .fm-report-table td:nth-child(3) { width: 17%; }
.fm-pdf-export .fm-report-section:last-of-type .fm-report-table th:nth-child(4),
.fm-pdf-export .fm-report-section:last-of-type .fm-report-table td:nth-child(4) { width: 22%; }
.fm-pdf-export .fm-report-section:last-of-type .fm-report-table th:nth-child(5),
.fm-pdf-export .fm-report-section:last-of-type .fm-report-table td:nth-child(5) { width: 17%; }
.fm-pdf-export .fm-report-section:last-of-type .fm-report-table th:nth-child(6),
.fm-pdf-export .fm-report-section:last-of-type .fm-report-table td:nth-child(6),
.fm-pdf-export .fm-report-section:last-of-type .fm-report-table th:nth-child(7),
.fm-pdf-export .fm-report-section:last-of-type .fm-report-table td:nth-child(7) { width: 11%; }
.fm-pdf-export .fm-report-person {
    width: 100% !important; margin-top: 2.5mm !important; padding: 1.5mm !important;
    border: .3mm solid #000 !important; border-radius: 0 !important; background: #fff !important;
    box-shadow: none !important; page-break-inside: avoid !important; break-inside: avoid !important;
}
.fm-pdf-export .fm-report-person h5 {
    margin: 0 0 1mm !important; color: #000 !important; font-size: 12.5pt !important;
    font-weight: 900 !important; line-height: 1.2 !important; page-break-after: avoid !important;
    break-after: avoid !important;
}
.fm-pdf-export .fm-report-person-summary {
    display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 1mm !important; margin-bottom: 1.5mm !important;
}
.fm-pdf-export .fm-report-person-summary > div, .fm-pdf-export .fm-report-total-lines > div {
    display: flex !important; flex-direction: column !important; align-items: stretch !important;
    gap: .6mm !important; min-width: 0 !important; padding: 1mm !important;
    border: .2mm solid #000 !important; border-radius: 0 !important; background: #fff !important;
    direction: rtl !important;
}
.fm-pdf-export .fm-report-person-summary > div > span, .fm-pdf-export .fm-report-total-lines > div > span {
    direction: rtl !important; text-align: right !important; color: #000 !important;
    font-size: 8pt !important; font-weight: 900 !important; line-height: 1.15 !important;
}
.fm-pdf-export .fm-report-person-summary > div > strong {
    direction: rtl !important; text-align: right !important; color: #000 !important;
    font-size: 9pt !important; font-weight: 900 !important; white-space: nowrap !important;
}
.fm-pdf-export .fm-report-note, .fm-pdf-export .fm-person-actions,
.fm-pdf-export .fm-record-actions, .fm-pdf-export .fm-link-button,
.fm-pdf-export .fm-attachment { display: none !important; }
.fm-pdf-export .fm-record-meta {
    margin: 1mm 0 !important; color: #000 !important; font-size: 8pt !important;
    font-weight: 900 !important; line-height: 1.2 !important; white-space: normal !important;
    overflow-wrap: break-word !important; text-align: right !important; direction: rtl !important;
}
.fm-pdf-export .fm-report-empty {
    padding: 2mm 1.5mm !important; border: .3mm solid #000 !important; color: #000 !important;
    font-size: 8.5pt !important; font-weight: 900 !important; text-align: center !important;
}

@media print {
    @page { size: 80mm auto; margin: 0; }
    html, body { width: 80mm !important; min-width: 80mm !important; margin: 0 !important; padding: 0 !important; background: #fff !important; }
    body * { visibility: hidden !important; }
    #fm-overlay, #fm-overlay * { visibility: visible !important; }
    #fm-overlay {
        position: static !important; display: block !important; width: 72mm !important; max-width: 72mm !important; padding: 0 !important;
        margin: 0 !important; background: #fff !important; overflow: visible !important;
    }
    .fm-dashboard {
        display: block !important; width: 72mm !important; max-width: 72mm !important; height: auto !important; min-height: 0 !important;
        margin: 0 !important; border-radius: 0 !important; box-shadow: none !important; overflow: visible !important; background: #fff !important;
    }
    .fm-header, .fm-tabs, #fm-panel-reports > .fm-section-heading { display: none !important; }
    .fm-content { display: block !important; width: 72mm !important; max-width: 72mm !important; padding: 0 !important; overflow: visible !important; }
    .fm-panel { display: none !important; }
    #fm-panel-reports { display: block !important; width: 72mm !important; max-width: 72mm !important; position: static !important; }
    .fm-report-content { display: block !important; width: 72mm !important; max-width: 72mm !important; min-height: 0 !important; }
    #fm-overlay, #fm-overlay * {
        color: #000 !important;
        background: #fff !important;
        box-shadow: none !important;
        text-shadow: none !important;
        font-family: Tahoma, Arial, sans-serif !important;
        font-weight: 700 !important;
    }
    .fm-print-title {
        display: flex !important; flex-direction: column; gap: 2px; padding: 0 0 8px; margin-bottom: 9px;
        border-bottom: 2px solid #000; color: #000; text-align: center; font-size: 15px; line-height: 1.6;
    }
    .fm-print-title span { font-size: 13px; }
    .fm-report-summary { display: block !important; margin: 0 0 8px; }
    .fm-summary-card { display: flex; align-items: center; justify-content: space-between; gap: 5px; direction: rtl; margin: 0; padding: 4px 2px; border: 0 !important; border-bottom: 1px solid #999 !important; border-radius: 0; page-break-inside: avoid; }
    .fm-summary-card:last-child { border-bottom: 0 !important; }
    .fm-summary-card:after { display: none; }
    .fm-summary-card .fm-summary-label { display: block; direction: rtl; text-align: right; font-size: 12px; }
    .fm-summary-amount { margin: 0; text-align: right; }
    .fm-summary-card strong { display: block; margin: 0; font-size: 14px; line-height: 1.25; }
    .fm-summary-card small { display: block; margin-top: 1px; font-size: 10px; line-height: 1.2; }
    .fm-report-section { margin-top: 5px; padding: 3px 0; border: 0 !important; border-top: 1.5px solid #000 !important; border-radius: 0; page-break-inside: auto; }
    .fm-report-section h4 { margin: 0 2px 4px; font-size: 13px; line-height: 1.45; }
    .fm-report-table-wrap { overflow: visible !important; }
    .fm-report-table, .fm-report-table tbody { display: block !important; width: 100% !important; font-size: 11px; font-weight: 700; }
    .fm-report-table thead { display: none !important; }
    .fm-report-table caption { display: block !important; padding: 4px 0 5px; font-size: 12px; text-align: right; }
    .fm-report-table tr { display: block !important; width: 100%; margin: 0 0 2px; border: 0 !important; border-bottom: 1px solid #999 !important; page-break-inside: avoid; }
    .fm-report-table td, .fm-report-table th {
        display: flex !important; align-items: center; justify-content: space-between; gap: 6px;
        width: 100%; min-height: 21px; padding: 3px 2px; border: 0 !important;
        border-bottom: 0 !important; white-space: normal; overflow-wrap: normal;
        word-break: normal; line-height: 1.35; direction: rtl; text-align: left;
    }
    .fm-report-table tr td:last-child { border-bottom: 0 !important; }
    .fm-report-table td[data-label]::before {
        content: attr(data-label); flex: 0 0 45%; color: #000; font-size: 10px;
        font-weight: 900; text-align: right;
    }
    .fm-report-table td.ltr { direction: rtl; text-align: left; font-weight: 900; font-variant-numeric: tabular-nums; -webkit-text-stroke: .15px #000; }
    .fm-report-table td[colspan] { display: block !important; text-align: center; }
    .fm-account-balance-table td[data-label="پیوست"] { display: none !important; }
    .fm-report-person { margin-top: 4px; padding: 3px 0; border: 0 !important; border-top: 1px solid #000 !important; border-radius: 0; page-break-inside: avoid; }
    .fm-report-person h5 { margin: 0 2px 4px; font-size: 16px; }
    .fm-report-person-summary { gap: 4px; margin-bottom: 6px; }
    .fm-report-person-summary > div, .fm-report-total-lines > div { direction: rtl; padding: 4px 2px; border: 0 !important; border-bottom: 1px solid #999 !important; border-radius: 0; }
    .fm-report-person-summary > div:last-child, .fm-report-total-lines > div:last-child { border-bottom: 0 !important; }
    .fm-report-person-summary span { font-size: 10.5px; }
    .fm-report-person-summary > div > span, .fm-report-total-lines > div > span { direction: rtl; text-align: right; }
    .fm-report-amount { align-items: flex-start; text-align: left; }
    .fm-report-amount strong { font-size: 13px; line-height: 1.25; }
    .fm-report-amount small { margin-top: 1px; font-size: 10px; line-height: 1.15; }
    .fm-report-person-summary > div > strong { font-size: 13px; direction: ltr; text-align: left; }
    .fm-report-note { display: none !important; }
    .fm-report-content .fm-report-section:last-child { page-break-inside: avoid; }
    .fm-person-actions, .fm-record-actions, .fm-link-button, .fm-attachment { display: none !important; }
    .fm-record-amount { font-size: 12px; }
    .fm-report-empty { padding: 10px 4px; border: 1px solid #000 !important; font-size: 11px; }
    .fm-record-meta { white-space: normal; overflow-wrap: normal; word-break: normal; }
}