/* Persian (fa) + RTL layer for Worklenz. Only active when <html class="fa-rtl">. */

/* Weight mapping (compared side by side with Inter in the browser): Inter 500 looks like IRANSans Regular, Inter 600 like
   IRANSans Medium, Inter 700 like IRANSans Bold. 500 -> Regular keeps the 500/600 hierarchy that was lost when both used Medium. */
/* ---- Fonts -------------------------------------------------------------
   IRANSans files live in fa-plugin/fonts/ (copied to /fa-plugin/fonts/ at build time).
   One @font-face per weight; local() is deliberately NOT used so that what works on the
   developer machine is exactly what visitors get.
   IRANSans has a very tall line box (ascent 1.09em + descent 0.61em = 1.70em vs ~1.21em for Inter) and wide
   glyphs; size-adjust + metric overrides bring its boxes close to Inter so controls, rows and tabs keep the
   same height/wrapping as the English UI. */
@font-face { font-family: 'FaPrimary'; font-weight: 200; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F;
  size-adjust: 103%; ascent-override: 90%; descent-override: 35%; line-gap-override: 0%;
  src: url('/fa-plugin/fonts/IRANSans-UltraLight.ttf?v=1792526654371') format('truetype'); }
@font-face { font-family: 'FaPrimary'; font-weight: 300; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F;
  size-adjust: 103%; ascent-override: 90%; descent-override: 35%; line-gap-override: 0%;
  src: url('/fa-plugin/fonts/IRANSans-Light.ttf?v=1792526654371') format('truetype'); }
@font-face { font-family: 'FaPrimary'; font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F;
  size-adjust: 103%; ascent-override: 90%; descent-override: 35%; line-gap-override: 0%;
  src: url('/fa-plugin/fonts/IRANSans-Regular.ttf?v=1792526654371') format('truetype'); }
@font-face { font-family: 'FaPrimary'; font-weight: 500; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F;
  size-adjust: 103%; ascent-override: 90%; descent-override: 35%; line-gap-override: 0%;
  src: url('/fa-plugin/fonts/IRANSans-Regular.ttf?v=1792526654371') format('truetype'); }
@font-face { font-family: 'FaPrimary'; font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F;
  size-adjust: 103%; ascent-override: 90%; descent-override: 35%; line-gap-override: 0%;
  src: url('/fa-plugin/fonts/IRANSans-Medium.ttf?v=1792526654371') format('truetype'); }
@font-face { font-family: 'FaPrimary'; font-weight: 700 900; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F;
  size-adjust: 103%; ascent-override: 90%; descent-override: 35%; line-gap-override: 0%;
  src: url('/fa-plugin/fonts/IRANSans-Bold.ttf?v=1792526654371') format('truetype'); }

:root {
  --fa-font: 'FaPrimary', 'Inter', Tahoma, 'Segoe UI', sans-serif;
}

/* One rule for the whole UI: every element (and pseudo-element) uses the Persian font, whatever
   class/inline style the app put on it. Code-like elements keep their monospace font. */
html.fa-rtl *:not(code):not(pre):not(kbd):not(samp),
html.fa-rtl *::before,
html.fa-rtl *::after {
  font-family: var(--fa-font) !important;
}


/* English UI: Persian/Arabic-script text (names, comments, project titles) still renders in IRANSans.
   Upstream's font stack starts with 'Inter'; these extra @font-face rules for the SAME family only claim Arabic-script
   code points (unicode-range) and come after upstream's own Inter face, so they win for those characters (system fonts such
   as Arial also contain Arabic glyphs and would otherwise be picked). Latin text keeps the real Inter; no universal
   !important rule is needed. */
/* Latin counterparts. CSS font matching picks the face whose weight descriptor matches first and only then looks at
   unicode-range, so with the single-weight Arabic faces below an upstream face declared as "100 900" is never consulted
   for weights 200-600 (Latin text silently fell back to a system font). Same variable font, one face per weight. */
@font-face { font-family: 'Inter'; font-weight: 200; font-style: normal; font-display: swap;
  unicode-range: U+0000-05FF, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-214F, U+2190-21FF, U+2212, U+2215, U+FEFF, U+FFFD;
  src: url('/fonts/inter-var.fa1.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 300; font-style: normal; font-display: swap;
  unicode-range: U+0000-05FF, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-214F, U+2190-21FF, U+2212, U+2215, U+FEFF, U+FFFD;
  src: url('/fonts/inter-var.fa1.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-05FF, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-214F, U+2190-21FF, U+2212, U+2215, U+FEFF, U+FFFD;
  src: url('/fonts/inter-var.fa1.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-style: normal; font-display: swap;
  unicode-range: U+0000-05FF, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-214F, U+2190-21FF, U+2212, U+2215, U+FEFF, U+FFFD;
  src: url('/fonts/inter-var.fa1.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0000-05FF, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-214F, U+2190-21FF, U+2212, U+2215, U+FEFF, U+FFFD;
  src: url('/fonts/inter-var.fa1.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-05FF, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-214F, U+2190-21FF, U+2212, U+2215, U+FEFF, U+FFFD;
  src: url('/fonts/inter-var.fa1.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 200; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200D;
  size-adjust: 103%; ascent-override: 90%; descent-override: 35%; line-gap-override: 0%;
  src: url('/fa-plugin/fonts/IRANSans-UltraLight.ttf?v=1792526654371') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 300; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200D;
  size-adjust: 103%; ascent-override: 90%; descent-override: 35%; line-gap-override: 0%;
  src: url('/fa-plugin/fonts/IRANSans-Light.ttf?v=1792526654371') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200D;
  size-adjust: 103%; ascent-override: 90%; descent-override: 35%; line-gap-override: 0%;
  src: url('/fa-plugin/fonts/IRANSans-Regular.ttf?v=1792526654371') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200D;
  size-adjust: 103%; ascent-override: 90%; descent-override: 35%; line-gap-override: 0%;
  src: url('/fa-plugin/fonts/IRANSans-Regular.ttf?v=1792526654371') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200D;
  size-adjust: 103%; ascent-override: 90%; descent-override: 35%; line-gap-override: 0%;
  src: url('/fa-plugin/fonts/IRANSans-Medium.ttf?v=1792526654371') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 700 900; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200D;
  size-adjust: 103%; ascent-override: 90%; descent-override: 35%; line-gap-override: 0%;
  src: url('/fa-plugin/fonts/IRANSans-Bold.ttf?v=1792526654371') format('truetype'); }
/* Project Gantt: bars are positioned with physical left offsets and header/body sync through scrollLeft, so the whole chart stays left-to-right. */
html.fa-rtl .gantt-scroll-container { direction: ltr; }

/* Table pagination: antd keeps 'bottomRight' on the physical right in RTL; mirror it like the rest of the layout. */
html.fa-rtl .ant-table-pagination.ant-pagination.ant-pagination-start { justify-content: flex-end; }
html.fa-rtl .ant-table-pagination.ant-pagination.ant-pagination-end { justify-content: flex-start; }

/* Sticky table columns: Tailwind classes use left offsets; mirror them for RTL (inline-style ones are handled by fa-runtime.js). */
html.fa-rtl .sticky.left-0 { left: auto !important; right: 0 !important; }
html.fa-rtl .sticky.left-\[240px\] { left: auto !important; right: 240px !important; }

/* Keep code, ids and emails readable left-to-right inside RTL text. */
html.fa-rtl code,
html.fa-rtl pre,
html.fa-rtl kbd,
html.fa-rtl input[type='email'],
html.fa-rtl input[type='url'],
html.fa-rtl input[type='password'],
html.fa-rtl .ltr-text {
  direction: ltr;
  text-align: right;
}

html.fa-rtl input[type='email']::placeholder,
html.fa-rtl input[type='password']::placeholder {
  text-align: right;
}

/* Rich-text editor and task descriptions follow the document direction. */
html.fa-rtl .ql-editor,
html.fa-rtl [contenteditable='true'] {
  text-align: start;
}

/* Inline styles authored for LTR (icon spacing etc.) are mirrored under RTL. antd handles its own components. */
html.fa-rtl [style*='margin-right: 2px'] { margin-right: 0 !important; margin-left: 2px !important; }
html.fa-rtl [style*='margin-left: 2px'] { margin-left: 0 !important; margin-right: 2px !important; }
html.fa-rtl [style*='padding-right: 2px'] { padding-right: 0 !important; padding-left: 2px !important; }
html.fa-rtl [style*='padding-left: 2px'] { padding-left: 0 !important; padding-right: 2px !important; }
html.fa-rtl [style*='margin-right: 4px'] { margin-right: 0 !important; margin-left: 4px !important; }
html.fa-rtl [style*='margin-left: 4px'] { margin-left: 0 !important; margin-right: 4px !important; }
html.fa-rtl [style*='padding-right: 4px'] { padding-right: 0 !important; padding-left: 4px !important; }
html.fa-rtl [style*='padding-left: 4px'] { padding-left: 0 !important; padding-right: 4px !important; }
html.fa-rtl [style*='margin-right: 5px'] { margin-right: 0 !important; margin-left: 5px !important; }
html.fa-rtl [style*='margin-left: 5px'] { margin-left: 0 !important; margin-right: 5px !important; }
html.fa-rtl [style*='padding-right: 5px'] { padding-right: 0 !important; padding-left: 5px !important; }
html.fa-rtl [style*='padding-left: 5px'] { padding-left: 0 !important; padding-right: 5px !important; }
html.fa-rtl [style*='margin-right: 6px'] { margin-right: 0 !important; margin-left: 6px !important; }
html.fa-rtl [style*='margin-left: 6px'] { margin-left: 0 !important; margin-right: 6px !important; }
html.fa-rtl [style*='padding-right: 6px'] { padding-right: 0 !important; padding-left: 6px !important; }
html.fa-rtl [style*='padding-left: 6px'] { padding-left: 0 !important; padding-right: 6px !important; }
html.fa-rtl [style*='margin-right: 8px'] { margin-right: 0 !important; margin-left: 8px !important; }
html.fa-rtl [style*='margin-left: 8px'] { margin-left: 0 !important; margin-right: 8px !important; }
html.fa-rtl [style*='padding-right: 8px'] { padding-right: 0 !important; padding-left: 8px !important; }
html.fa-rtl [style*='padding-left: 8px'] { padding-left: 0 !important; padding-right: 8px !important; }
html.fa-rtl [style*='margin-right: 10px'] { margin-right: 0 !important; margin-left: 10px !important; }
html.fa-rtl [style*='margin-left: 10px'] { margin-left: 0 !important; margin-right: 10px !important; }
html.fa-rtl [style*='padding-right: 10px'] { padding-right: 0 !important; padding-left: 10px !important; }
html.fa-rtl [style*='padding-left: 10px'] { padding-left: 0 !important; padding-right: 10px !important; }
html.fa-rtl [style*='margin-right: 12px'] { margin-right: 0 !important; margin-left: 12px !important; }
html.fa-rtl [style*='margin-left: 12px'] { margin-left: 0 !important; margin-right: 12px !important; }
html.fa-rtl [style*='padding-right: 12px'] { padding-right: 0 !important; padding-left: 12px !important; }
html.fa-rtl [style*='padding-left: 12px'] { padding-left: 0 !important; padding-right: 12px !important; }
html.fa-rtl [style*='margin-right: 16px'] { margin-right: 0 !important; margin-left: 16px !important; }
html.fa-rtl [style*='margin-left: 16px'] { margin-left: 0 !important; margin-right: 16px !important; }
html.fa-rtl [style*='padding-right: 16px'] { padding-right: 0 !important; padding-left: 16px !important; }
html.fa-rtl [style*='padding-left: 16px'] { padding-left: 0 !important; padding-right: 16px !important; }
html.fa-rtl [style*='margin-right: 20px'] { margin-right: 0 !important; margin-left: 20px !important; }
html.fa-rtl [style*='margin-left: 20px'] { margin-left: 0 !important; margin-right: 20px !important; }
html.fa-rtl [style*='padding-right: 20px'] { padding-right: 0 !important; padding-left: 20px !important; }
html.fa-rtl [style*='padding-left: 20px'] { padding-left: 0 !important; padding-right: 20px !important; }
html.fa-rtl [style*='margin-right: 24px'] { margin-right: 0 !important; margin-left: 24px !important; }
html.fa-rtl [style*='margin-left: 24px'] { margin-left: 0 !important; margin-right: 24px !important; }
html.fa-rtl [style*='padding-right: 24px'] { padding-right: 0 !important; padding-left: 24px !important; }
html.fa-rtl [style*='padding-left: 24px'] { padding-left: 0 !important; padding-right: 24px !important; }
html.fa-rtl [style*='text-align: left'] { text-align: right !important; }
html.fa-rtl [style*='text-align: right'] { text-align: left !important; }
html.fa-rtl [style*='float: left'] { float: right !important; }
html.fa-rtl [style*='float: right'] { float: left !important; }

/* BEGIN generated: tailwind directional utilities (tools/gen-rtl-utilities.mjs) */
html.fa-rtl .space-x-0 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 0px !important; }
html.fa-rtl .space-x-1 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 0.25rem !important; }
html.fa-rtl .space-x-2 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 0.5rem !important; }
html.fa-rtl .space-x-3 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 0.75rem !important; }
html.fa-rtl .space-x-4 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 1rem !important; }
html.fa-rtl .space-x-5 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 1.25rem !important; }
html.fa-rtl .space-x-6 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 1.5rem !important; }
html.fa-rtl .space-x-7 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 1.75rem !important; }
html.fa-rtl .space-x-8 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 2rem !important; }
html.fa-rtl .space-x-9 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 2.25rem !important; }
html.fa-rtl .space-x-10 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 2.5rem !important; }
html.fa-rtl .space-x-11 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 2.75rem !important; }
html.fa-rtl .space-x-12 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 3rem !important; }
html.fa-rtl .space-x-14 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 3.5rem !important; }
html.fa-rtl .space-x-16 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 4rem !important; }
html.fa-rtl .space-x-0\.5 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 0.125rem !important; }
html.fa-rtl .space-x-1\.5 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 0.375rem !important; }
html.fa-rtl .space-x-2\.5 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 0.625rem !important; }
html.fa-rtl .space-x-3\.5 > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; margin-right: 0.875rem !important; }
/* END generated */
/* ---- Design review round (Opus, v51 dark-mode screenshots) -------------------------------------------------------------- */
/* icon-only toolbar buttons (pin) were squeezed to a 20px sliver by the long Persian neighbour and showed a dark default-button slab */
html.fa-rtl .borderless-icon-btn { flex-shrink: 0; }
html.fa-rtl .ant-btn.borderless-icon-btn:not(:hover) { background: transparent; }
/* notification drawer header row (tabs + "mark all as read") may wrap instead of being clipped by the 400px drawer */
html.fa-rtl .ant-drawer-body > .ant-flex-justify-space-between:first-child { flex-wrap: wrap; row-gap: 8px; }
/* custom columns: a Latin column name inside an RTL ellipsis box lost its FIRST letters ("...yments"); numbers keep their leading digit */
html.fa-rtl .column-header-cell .truncate,
html.fa-rtl .custom-column-cell .truncate { unicode-bidi: plaintext; text-align: right; }
html.fa-rtl .custom-column-number-input { direction: ltr; text-align: right !important; }
/* stat-card hover tooltips are tables with duration text: give them room instead of 4 wrapped lines */
html.fa-rtl .ant-tooltip:has(.ant-tooltip-inner table) { max-width: 420px; }
html.fa-rtl .ant-tooltip-inner td { white-space: nowrap; }
/* finance nav rail: 11px / 45%-opacity labels were hard to read; keep them readable without growing the 64px rail */
html.fa-rtl .nav-rail-item-wrapper [role="button"] > span[style*="pre-line"] { font-size: 11.5px !important; line-height: 1.35 !important; }
html.dark.fa-rtl .nav-rail-item-wrapper [role="button"] > span[style*="pre-line"][style*="rgba(255, 255, 255, 0.45)"] { color: rgba(255, 255, 255, 0.65) !important; }
/* insights tables: header row looked like a data row (weight 400, no background) */
html.fa-rtl .insights-overview-table .ant-table-thead th { font-weight: 600 !important; }
/* readability floor for Persian: only the tiniest inline sizes (10px) go up one step; 11px and text-xs stay as in English (they looked too large at 12-13px) */
html.fa-rtl [style*="font-size: 10px"]:not(.anticon), html.fa-rtl .text-[10px] { font-size: 11px !important; }

