/* Fazasazeh ERPNext - Vazirmatn font + RTL fixes */
/* All fonts served locally - no external requests */

/* Vazirmatn v33.003 (SIL OFL, fonts/Vazirmatn-OFL.txt): one complete file per weight, each with
   Persian, Latin and digits. Until 2026-10-04 the three files here were Google-Fonts unicode SUBSETS
   (latin / latin-ext / arabic) declared as weights 400 / 500 / 700 without unicode-range: normal text
   got the latin-ext subset (no Persian, no digits) and fell back to the system font, only bold text
   was really Vazirmatn, and digits never were — mixed fonts on every form. */
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/assets/jalali_shamsi_datepicker/fonts/Vazirmatn-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/assets/jalali_shamsi_datepicker/fonts/Vazirmatn-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/assets/jalali_shamsi_datepicker/fonts/Vazirmatn-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 700 900; font-display: swap;
  src: url('/assets/jalali_shamsi_datepicker/fonts/Vazirmatn-Bold.woff2') format('woff2'); }

/* Override all font-family declarations globally */
:root {
  --font-stack: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  --font-family-sans-serif: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

*:not(.icon):not([data-icon]):not(.octicon):not(.fa):not(.fas):not(.far):not(.fab):not(.material-icons) {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* Fix ALL chevrons/arrows for RTL - mirror horizontally */
[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before,
html[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
  transform: scaleX(-1);
}

/* Global: flip ALL directional icons and chevrons in RTL */
[dir="rtl"] .icon-right,
[dir="rtl"] .icon-left,
[dir="rtl"] .icon-small-right,
[dir="rtl"] .icon-small-left,
[dir="rtl"] .collapse-indicator,
[dir="rtl"] .desk-sidebar .sidebar-toggle .icon,
[dir="rtl"] .sidebar-menu .icon-small-right,
[dir="rtl"] .sidebar-menu .icon-small-left,
[dir="rtl"] .next-btn .icon,
[dir="rtl"] .prev-btn .icon,
[dir="rtl"] .tree-node .tree-toggle,
[dir="rtl"] .frappe-control[data-fieldtype="Link"] .link-btn .icon,
[dir="rtl"] .awesomplete .icon,
[dir="rtl"] .page-item .page-link .icon,
[dir="rtl"] .chevron-right,
[dir="rtl"] .icon[data-icon="right"],
[dir="rtl"] .icon[data-icon="left"],
[dir="rtl"] .icon[data-icon="arrow-right"],
[dir="rtl"] .icon[data-icon="arrow-left"],
[dir="rtl"] .icon[data-icon="chevron-right"],
[dir="rtl"] .icon[data-icon="chevron-left"],
[dir="rtl"] use[href="#icon-right"],
[dir="rtl"] use[href="#icon-left"],
[dir="rtl"] use[href="#icon-arrow-right"],
[dir="rtl"] use[href="#icon-arrow-left"],
[dir="rtl"] use[href="#icon-chevron-right"],
[dir="rtl"] use[href="#icon-chevron-left"] {
  transform: scaleX(-1) !important;
}

/* Fix the > character used as separator/indicator */
[dir="rtl"] .user-settings .sidebar-section .section-link::after,
[dir="rtl"] .sidebar-section .section-link::after,
[dir="rtl"] .like-disabled-input .link-btn,
[dir="rtl"] .frappe-list .list-row .level-right .list-row--col .indicator-pill::after {
  transform: scaleX(-1) !important;
}

/* Fix breadcrumb separator */
[dir="rtl"] .breadcrumb-item + .breadcrumb-item {
  padding-right: 0.5rem;
  padding-left: 0;
}

[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
  content: "\2039" !important;
  padding-left: 0.5rem;
  padding-right: 0;
}

/* Ensure proper line-height for Persian text */
body[dir="rtl"],
html[dir="rtl"] body {
  line-height: 1.8;
}

/* Fix number inputs to show LTR */
[dir="rtl"] input[type="number"],
[dir="rtl"] input[data-fieldtype="Currency"],
[dir="rtl"] input[data-fieldtype="Float"],
[dir="rtl"] input[data-fieldtype="Int"],
[dir="rtl"] input[data-fieldtype="Percent"] {
  direction: ltr;
  text-align: right;
}

/* Remove Frappe branding in footer if present */
.website-footer .frappe-brand,
.frappe-footer-link,
a[href*="frappeframework.com"],
a[href*="frappe.io/support"],
a[href*="discuss.frappe.io"] {
  display: none !important;
}

/* =============================================
   FAZASAZEH BRAND COLORS
   Primary: #003399 (navy blue)
   Secondary: #0F1C72 (dark navy)
   Accent: #F2A10A (gold/orange)
   Dark BG: #0C0F46
   ============================================= */

:root,
[data-theme="light"],
[data-theme="dark"] {
  --primary: #003399 !important;
  --primary-color: #003399 !important;
  --primary-dark: #0F1C72 !important;
  --primary-light: #F4F7FE !important;
  --accent: #F2A10A !important;
  --btn-primary: #003399 !important;
  --border-primary: #003399 !important;
  --brand-color: #003399 !important;
  /* Fix indicator pill text colors - force white on dark backgrounds */
  --text-on-blue: #ffffff !important;
  --text-on-dark-blue: #ffffff !important;
  --text-on-green: #ffffff !important;
  --text-on-red: #ffffff !important;
  --text-on-orange: #ffffff !important;
  --text-on-purple: #ffffff !important;
  --text-on-pink: #ffffff !important;
  --text-on-cyan: #ffffff !important;
  --text-on-darkgrey: #ffffff !important;
  --text-on-dark-gray: #ffffff !important;
  /* Make pill backgrounds darker so white text is readable */
  --bg-blue: #003399 !important;
  --bg-green: #0d6832 !important;
  --bg-red: #c0392b !important;
  --bg-orange: #d35400 !important;
  --bg-purple: #6c3483 !important;
}

/* Navbar */
.navbar {
  background-color: #003399 !important;
  border-bottom: 3px solid #F2A10A !important;
}

/* Logo in navbar/sidebar header */
.navbar .navbar-brand img,
.navbar-brand img,
header .navbar-brand img,
.header-logo img,
.sidebar-header .header-logo img,
.sidebar-header .sidebar-item-icon img,
#brand-logo,
.navbar-home img,
.desktop-navbar img {
  background-color: #ffffff !important;
  border-radius: 6px !important;
  padding: 4px !important;
  max-height: 38px !important;
  min-height: 30px !important;
  width: auto !important;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Fix sidebar-item-icon and header-logo-container background */
.sidebar-header .sidebar-item-icon,
.header-logo-container,
.sidebar-header .header-logo-container {
  background-color: #ffffff !important;
  border-radius: 8px !important;
}

/* Login page logo */
.page-card-head .app-logo,
.for-login .app-logo,
.for-forgot .app-logo {
  background-color: #ffffff !important;
  border-radius: 8px !important;
  padding: 8px !important;
  max-height: 90px !important;
}

.navbar .navbar-brand,
.navbar .nav-link,
.navbar .navbar-nav .nav-link,
.navbar .notifications-icon,
.navbar .navbar-brand img + span {
  color: #ffffff !important;
}

.navbar .nav-link:hover,
.navbar .navbar-nav .nav-link:hover {
  color: #F2A10A !important;
}

/* Sidebar */
.desk-sidebar .standard-sidebar-section .sidebar-label {
  color: #003399 !important;
}

.desk-sidebar .standard-sidebar-item.selected,
.desk-sidebar .standard-sidebar-item:hover {
  background-color: #F4F7FE !important;
  border-right: 3px solid #003399 !important;
}

/* Primary buttons - force white text everywhere */
.btn-primary,
.btn-primary-dark,
.btn-primary-light,
button.btn-primary,
a.btn-primary,
.page-actions .btn-primary,
.modal-footer .btn-primary,
.form-group .btn-primary,
.btn-primary[type="submit"],
.btn-primary[type="button"] {
  background-color: #003399 !important;
  border-color: #003399 !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:visited {
  background-color: #0F1C72 !important;
  border-color: #0F1C72 !important;
  color: #fff !important;
}

.btn-primary *,
.btn-primary a,
.btn-primary span,
.btn-primary svg,
.btn-primary .btn-text,
.btn-primary-dark *,
.btn-primary-dark span {
  color: #fff !important;
  --icon-stroke: #fff !important;
}

/* Links */
a {
  color: #003399;
}

a:hover {
  color: #0F1C72;
}

/* Page indicators and badges */
.indicator-pill.green,
.indicator-pill.blue {
  background-color: #003399 !important;
}

/* Login page branding */
.page-card .page-card-head {
  background-color: #003399 !important;
  text-align: center !important;
}

.page-card-head h4 {
  color: #003399 !important;
  font-weight: 700 !important;
}

.page-card-head .app-logo {
  max-height: 80px !important;
  margin-bottom: 10px !important;
}

.for-login .btn-primary,
.for-login .btn-primary-dark,
.for-forgot .btn-primary,
.for-login-with-email-link .btn-primary {
  background-color: #003399 !important;
  border-color: #003399 !important;
  font-weight: 600 !important;
  font-size: 15px !important;
}

.for-login .btn-primary:hover,
.for-forgot .btn-primary:hover {
  background-color: #0F1C72 !important;
}

/* Login page RTL fixes */
[dir="rtl"] .login-content,
[dir="rtl"] .page-card {
  text-align: right !important;
}

[dir="rtl"] .form-control {
  text-align: right !important;
  padding-right: 40px !important;
  padding-left: 12px !important;
}

[dir="rtl"] .field-icon {
  left: auto !important;
  right: 12px !important;
}

[dir="rtl"] .toggle-password {
  left: 12px !important;
  right: auto !important;
}

[dir="rtl"] .forgot-password-message {
  text-align: left !important;
}

/* Language picker (login page top bar) - shown by Frappe only when Website Settings
   show_language_picker is on (scripts/login_page_setup.py); forcing it visible left an empty box */

#language-switcher select {
  background-color: rgba(255,255,255,0.15) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255,255,255,0.4) !important;
  border-radius: 6px !important;
  padding: 4px 10px !important;
  font-size: 13px !important;
  min-width: 120px !important;
}

#language-switcher select option {
  color: #333 !important;
  background-color: #fff !important;
}

/* Login top bar: no «Home» link (it led to an empty website home) and no menu toggle */
body[data-path="login"] .navbar .navbar-brand,
body[data-path="login"] .navbar .navbar-toggler {
  display: none !important;
}

/* Login footer - hide Frappe branding */
body[data-path="login"] .website-footer,
body[data-path="login"] footer,
body[data-path="login"] .frappe-footer-link {
  display: none !important;
}

/* ── Login page: split screen, Fazasazeh project photo + form (2026-10-30) ──────────────
   Photo: fazasazeh.ir, «پایانه اتوبوس اصفهان» (upper part, above the caption banner), branding/login-bg.webp.
   Photo on the left, form on the right (both languages); one column under 992 px.
   The language picker sits under the form (moved there by login_language_default.js). */
body[data-path="login"] {
  background: #f4f6fb !important;
}

body[data-path="login"]::before {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 55%;
  background:
    linear-gradient(180deg, rgba(0, 51, 153, 0) 45%, rgba(0, 51, 153, 0.55) 100%),
    url("/assets/jalali_shamsi_datepicker/images/login-bg.webp") center top / cover no-repeat;
  border-right: 4px solid #F2A10A;
  z-index: 0;
}

body[data-path="login"] .navbar {
  display: none !important;
}

body[data-path="login"] #language-switcher {
  width: 170px;
  margin: 20px auto 0;
}

body[data-path="login"] #language-switcher select {
  background-color: #ffffff !important;
  color: #003399 !important;
  border: 1px solid #d6deef !important;
  text-align: center;
  text-align-last: center;
}

body[data-path="login"] #page-login {
  position: relative;
  z-index: 1;
  margin-left: 55%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

body[data-path="login"] #page-login .page-content-wrapper {
  width: 100%;
}

body[data-path="login"] .page-card-head .app-logo {
  width: 88px !important;
  height: auto !important;
  padding: 8px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 6px 20px rgba(0, 26, 77, 0.10);
}

body[data-path="login"] .page-card-head h4 {
  color: #003399 !important;
  font-weight: 700 !important;
  font-size: 1.4rem !important;
  margin-top: 18px !important;
}

body[data-path="login"] .page-card {
  max-width: 400px !important;
  border: 0 !important;
  border-top: 4px solid #F2A10A !important;
  border-radius: 14px !important;
  box-shadow: 0 14px 40px rgba(0, 26, 77, 0.12) !important;
  padding: 28px 20px 24px !important;
}

body[data-path="login"] .page-card .form-control {
  border-radius: 10px !important;
}

body[data-path="login"] .page-card .btn-primary {
  height: 44px;
  border-radius: 10px !important;
  font-weight: 600 !important;
  background-color: #003399 !important;
  border-color: #003399 !important;
}

body[data-path="login"] .page-card .btn-primary:hover {
  background-color: #002a80 !important;
}

@media (max-width: 991.98px) {
  body[data-path="login"]::before {
    width: 100%;
    border-right: 0;
    background:
      linear-gradient(180deg, rgba(0, 20, 60, 0.55) 0%, rgba(0, 51, 153, 0.85) 100%),
      url("/assets/jalali_shamsi_datepicker/images/login-bg.webp") center top / cover no-repeat;
  }
  body[data-path="login"] #page-login {
    margin-left: 0;
  }
  body[data-path="login"] .page-card-head h4 {
    color: #ffffff !important;
  }
}

/* Workspace module cards */
.widget.shortcut-widget-box:hover {
  border-color: #003399 !important;
}

/* Form header breadcrumb active */
.breadcrumb-item.active {
  color: #003399 !important;
}

/* Selected/active items */
.list-row-checkbox:checked,
.frappe-checkbox:checked {
  accent-color: #003399 !important;
}

/* Progress bars */
.progress-bar {
  background-color: #003399 !important;
}

/* Frappe desk header title */
.title-text {
  color: #003399 !important;
}

/* Like button active */
.liked-by .like-action.active .icon use {
  stroke: #F2A10A !important;
}

/* Number card widgets */
.number-widget-box .widget-head .widget-title {
  color: #003399 !important;
}

/* =============================================
   MODULE ICONS - force ALL to brand navy
   Using max specificity to override inline styles
   ============================================= */

/* Force ALL workspace/module icon backgrounds to brand navy */
[style*="background-color"].icon-module-icon,
[style*="background-color"].workspace-icon,
[style*="background-color"].shortcut-icon,
[style*="background-color"].widget-icon,
div[style*="background-color: var(--gray"],
div[style*="background-color: var(--blue"],
div[style*="background-color: var(--green"],
div[style*="background-color: var(--orange"],
div[style*="background-color: var(--red"],
div[style*="background-color: var(--yellow"],
div[style*="background-color: var(--purple"],
div[style*="background-color: var(--pink"],
div[style*="background-color: var(--cyan"],
.desk-page .widget .widget-head [style*="background"],
.shortcut-widget-box [style*="background-color"],
.onboarding-widget-box [style*="background-color"] {
  background-color: #003399 !important;
}

/* SVG icons inside module cards - white */
.desk-page .widget svg.icon,
.shortcut-widget-box svg.icon,
.widget-icon svg.icon,
.shortcut-icon svg.icon,
.desk-page .widget .widget-head svg {
  --icon-stroke: #ffffff !important;
  stroke: #ffffff !important;
  color: #ffffff !important;
}

/* Hover state */
.widget.shortcut-widget-box:hover [style*="background-color"],
.widget.shortcut-widget-box:hover .shortcut-icon,
.widget.shortcut-widget-box:hover .widget-icon {
  background-color: #0F1C72 !important;
}

/* Sidebar icons */
.desk-sidebar .sidebar-menu svg.icon {
  --icon-stroke: #003399 !important;
  color: #003399 !important;
}

/* Nuclear fix: ANY element with dark navy background gets white text */
[style*="background-color: rgb(0, 51, 153)"],
[style*="background-color:#003399"],
[style*="background-color: #003399"],
[style*="background: rgb(0, 51, 153)"],
.btn-primary,
.btn-primary-dark,
.btn-primary-light,
.btn-primary *,
.btn-primary-dark *,
.btn-primary-light *,
.btn[style*="background"],
.indicator-pill.blue,
.indicator-pill.darkblue,
.badge-primary,
.bg-primary,
.like-disabled-input.btn-primary-dark,
.frappe-control .btn-primary,
.page-actions .btn-primary,
.btn-primary .icon,
.btn-primary svg {
  color: #ffffff !important;
  --icon-stroke: #ffffff !important;
}

/* ===== ERP16 (2026-10-27): comment box row, attachment cards, timestamps ===== */
.comment-input-wrapper .faza-comment-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	margin-right: 32px; /* under the editor: the avatar (32px) sits to its right */
	margin-top: 6px;
}
.comment-input-wrapper .faza-comment-actions .btn-comment {
	margin: 0 !important;
}
.comment-input-wrapper .faza-comment-actions .btn-comment.hidden {
	display: inline-block !important;
	visibility: hidden;
}
.comment-input-wrapper .faza-comment-actions .faza-comment-attach {
	margin: 0;
}
.timeline-message-box .faza-attach-cards {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 8px;
}
.timeline-message-box .faza-attach-card {
	display: flex;
	flex-direction: column;
	width: 180px;
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius-md);
	background: var(--bg-color);
	text-decoration: none !important;
	color: var(--text-color);
	overflow: hidden;
}
.timeline-message-box .faza-attach-card:hover {
	border-color: var(--primary);
}
.timeline-message-box .faza-attach-thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 130px;
	background: var(--control-bg);
	overflow: hidden;
}
.timeline-message-box .faza-attach-thumb img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}
.timeline-message-box .faza-attach-ext {
	font-weight: 700;
	font-size: 18px;
	color: var(--text-muted);
	letter-spacing: 1px;
}
.timeline-message-box .faza-attach-name {
	padding: 5px 8px;
	font-size: var(--text-sm);
	direction: ltr;
	text-align: right;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.frappe-timestamp.faza-abs {
	cursor: default;
}
