/* Persian / RTL layout + typography overrides.
 * Loaded last when LANGUAGE_CODE is fa (or BIDI) so it wins over Inter-based stacks.
 */

html[lang="fa"],
html[dir="rtl"] {
  --linear-font-sans: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  --dashboard-font-sans: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  --linear-font-mono: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  --dashboard-font-mono: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  --font-mono: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  --font-sans: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
}

html[lang="fa"] body,
html[lang="fa"] .app-shell-body,
html[lang="fa"] .app-header,
html[lang="fa"] .app-header-title,
html[lang="fa"] .app-header-copy,
html[lang="fa"] .app-bottom-nav,
html[lang="fa"] .dashboard-topbar,
html[lang="fa"] .dashboard-sidebar,
html[lang="fa"] .dashboard-container,
html[lang="fa"] .dashboard-bento,
html[lang="fa"] .dashboard-panel,
html[lang="fa"] .dashboard-metric-card,
html[lang="fa"] .device-tile,
html[lang="fa"] .linear-page-shell,
html[lang="fa"] .linear-panel,
html[lang="fa"] .linear-title,
html[lang="fa"] .linear-copy,
html[lang="fa"] .linear-label,
html[lang="fa"] .linear-button,
html[lang="fa"] .linear-input,
html[lang="fa"] .linear-select,
html[lang="fa"] .linear-sidebar-link,
html[lang="fa"] .linear-chip,
html[lang="fa"] button,
html[lang="fa"] input,
html[lang="fa"] select,
html[lang="fa"] textarea,
html[lang="fa"] .present-page,
html[lang="fa"] .present-main,
html[lang="fa"] .metering-page,
html[lang="fa"] .metering-main {
  font-family: var(--dashboard-font-sans) !important;
}

/* Keep numerals LTR but use the same Persian UI font (Vazirmatn) so digits match labels */
html[lang="fa"] .linear-mono,
html[lang="fa"] .dashboard-mono,
html[lang="fa"] .linear-stat-value,
html[lang="fa"] .dashboard-metric-card__value,
html[lang="fa"] .dashboard-odometer,
html[lang="fa"] .dashboard-topbar-ops-value,
html[lang="fa"] .dashboard-topbar-clock,
html[lang="fa"] .linear-pagination-copy,
html[lang="fa"] .linear-table td.linear-mono,
html[lang="fa"] .mc-lcd__lines,
html[lang="fa"] .mc-lcd__value,
html[lang="fa"] .mc-lcd__page,
html[lang="fa"] .mc-bay__tag-code,
html[dir="rtl"] .dashboard-mono,
html[dir="rtl"] .linear-mono {
  font-family: var(--dashboard-font-sans) !important;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
}

html[lang="fa"] .metering-page,
html[lang="fa"] .metering-main,
html[lang="fa"] .mc-lcd__label,
html[lang="fa"] .mc-panel__title,
html[lang="fa"] .mc-power__label,
html[lang="fa"] .chartjs-tooltip,
html[lang="fa"] .chartjs-tooltip * {
  font-family: var(--dashboard-font-sans) !important;
}

html[lang="fa"] .mc-lcd__label {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.25;
  letter-spacing: 0;
}

html[lang="fa"] .mc-lcd__row {
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.95fr);
  align-items: start;
}

html[lang="fa"] .mc-lcd__value,
html[lang="fa"] .mc-lcd__page {
  letter-spacing: 0;
  text-align: end;
}

html[lang="fa"] .mc-lcd__row--stack .mc-lcd__value,
html[lang="fa"] .mc-lcd__datetime-block .mc-lcd__value {
  text-align: start;
}

/* Persian labels: drop Latin-style tracking / uppercase */
html[lang="fa"] .dashboard-sidebar-eyebrow,
html[lang="fa"] .dashboard-sidebar-footer-label,
html[lang="fa"] .dashboard-sidebar-status-label,
html[lang="fa"] .dashboard-section-kicker,
html[lang="fa"] .dashboard-panel-badge,
html[lang="fa"] .linear-kicker,
html[lang="fa"] .linear-sidebar-section,
html[lang="fa"] .linear-sidebar-link-title,
html[lang="fa"] .linear-sidebar-link-copy,
html[lang="fa"] .linear-settings-hub-card__title,
html[lang="fa"] .linear-title,
html[lang="fa"] .app-header-page-badge,
html[lang="fa"] .dashboard-topbar-ops-label,
html[lang="fa"] .present-kicker,
html[lang="fa"] .weather-forecast__kicker,
html[lang="fa"] .weather-forecast__day-name,
html[lang="fa"] .weather-unit {
  letter-spacing: 0 !important;
  text-transform: none !important;
}

/* Avoid RTL bidi reordering of Latin kickers (e.g. "7-DAY OUTLOOK" → "DAY OUTLOOK-7") */
html[dir="rtl"] .weather-forecast__kicker {
  unicode-bidi: isolate;
  direction: rtl;
}

/* -------------------------------------------------------------------------- */
/* Shell / sidebar                                                              */
/* -------------------------------------------------------------------------- */

html[dir="rtl"] .dashboard-sidebar {
  inset-inline-end: 0;
  inset-inline-start: auto;
  border-inline-start: 1px solid color-mix(in srgb, var(--dashboard-border-soft, #E6E9F2) 80%, transparent);
  border-left: none;
  border-right: none;
  box-shadow: 4px 0 24px var(--dashboard-shadow-sm, rgba(21, 36, 71, 0.1));
}

html[dir="rtl"] .dashboard-sidebar[data-state="closed"] {
  transform: translateX(-100%);
}

html[dir="rtl"] .dashboard-sidebar[data-state="open"] {
  transform: translateX(0);
}

html[dir="rtl"] .dashboard-sidebar-link.is-active {
  border-inline-start: 3px solid var(--dashboard-blue, #204098);
  border-left: none;
  border-right: none;
}

html[dir="rtl"] .dashboard-sidebar-header,
html[dir="rtl"] .dashboard-sidebar-user-card,
html[dir="rtl"] .dashboard-sidebar-link,
html[dir="rtl"] .dashboard-sidebar-link-body {
  text-align: start;
}

html[dir="rtl"] .dashboard-sidebar-link {
  flex-direction: row;
}

/* -------------------------------------------------------------------------- */
/* Keep designed grid maps; restore RTL only for content                       */
/* -------------------------------------------------------------------------- */

html[dir="rtl"] .dashboard-bento,
html[dir="rtl"] .dashboard-metric-card__body,
html[dir="rtl"] .device-tile-main,
html[dir="rtl"] .dashboard-record-panel {
  direction: ltr;
}

html[dir="rtl"] .dashboard-bento > *,
html[dir="rtl"] .dashboard-metric-card__body > *,
html[dir="rtl"] .device-tile-main > *,
html[dir="rtl"] .dashboard-record-panel > *,
html[dir="rtl"] .dashboard-panel,
html[dir="rtl"] .dashboard-metric-card,
html[dir="rtl"] .device-tile,
html[dir="rtl"] .dashboard-status-card,
html[dir="rtl"] .dashboard-alarm-card {
  direction: rtl;
  text-align: start;
}

/* -------------------------------------------------------------------------- */
/* Topbar / chips / menus                                                       */
/* -------------------------------------------------------------------------- */

html[dir="rtl"] .app-header-shell,
html[dir="rtl"] .dashboard-topbar-shell,
html[dir="rtl"] .dashboard-topbar--ops .dashboard-topbar-shell {
  /* Natural RTL: brand on the right, actions on the left */
  direction: rtl;
}

/* Keep brand/toolbar as normal flex rows inside the RTL shell —
   nested direction flips caused misaligned logo/title/actions. */
html[dir="rtl"] .app-header-brand,
html[dir="rtl"] .app-header-copy,
html[dir="rtl"] .app-header-toolbar,
html[dir="rtl"] .dashboard-topbar-brand,
html[dir="rtl"] .dashboard-topbar-main-actions {
  direction: inherit;
  text-align: start;
}

html[dir="rtl"] .app-header-title-row {
  flex-direction: row;
  min-width: 0;
}

html[dir="rtl"] .dashboard-topbar-menu:not(.dashboard-topbar-notification-menu),
html[dir="rtl"] .app-header-menu,
html[dir="rtl"] .chart-export-menu {
  inset-inline-end: 0;
  inset-inline-start: auto;
  right: auto;
  left: auto;
}

/* Notification bell dropdown + accordion — force RTL layout when Persian */
html[dir="rtl"] .app-header-notification-portal,
html[dir="rtl"] .app-header-notification-menu,
html[dir="rtl"] .dashboard-topbar-notification-menu,
html[dir="rtl"] .dashboard-notification-panel,
html[lang="fa"] .app-header-notification-portal,
html[lang="fa"] .app-header-notification-menu,
html[lang="fa"] .dashboard-topbar-notification-menu,
html[lang="fa"] .dashboard-notification-panel {
  direction: rtl;
  text-align: start;
}

html[dir="rtl"] .dashboard-notification-header,
html[dir="rtl"] .dashboard-notification-footer,
html[dir="rtl"] .dashboard-notification-item-trigger,
html[dir="rtl"] .dashboard-notification-item-body,
html[dir="rtl"] .dashboard-notification-item-tags,
html[dir="rtl"] .dashboard-notification-item-leading,
html[dir="rtl"] .dashboard-notification-empty,
html[lang="fa"] .dashboard-notification-header,
html[lang="fa"] .dashboard-notification-footer,
html[lang="fa"] .dashboard-notification-item-trigger,
html[lang="fa"] .dashboard-notification-item-body,
html[lang="fa"] .dashboard-notification-item-tags,
html[lang="fa"] .dashboard-notification-item-leading,
html[lang="fa"] .dashboard-notification-empty {
  direction: rtl;
  text-align: start;
}

html[dir="rtl"] .dashboard-notification-title,
html[dir="rtl"] .dashboard-notification-subtitle,
html[dir="rtl"] .dashboard-notification-header-link,
html[dir="rtl"] .dashboard-notification-footer-link,
html[dir="rtl"] .dashboard-notification-empty-text,
html[dir="rtl"] .dashboard-notification-item-link,
html[lang="fa"] .dashboard-notification-title,
html[lang="fa"] .dashboard-notification-subtitle,
html[lang="fa"] .dashboard-notification-header-link,
html[lang="fa"] .dashboard-notification-footer-link,
html[lang="fa"] .dashboard-notification-empty-text,
html[lang="fa"] .dashboard-notification-item-link {
  text-align: start;
}

html[dir="rtl"] .dashboard-notification-item-title,
html[dir="rtl"] .dashboard-notification-item-message,
html[dir="rtl"] .dashboard-notification-item-detail,
html[dir="rtl"] .dashboard-notification-item-meta,
html[lang="fa"] .dashboard-notification-item-title,
html[lang="fa"] .dashboard-notification-item-message,
html[lang="fa"] .dashboard-notification-item-detail,
html[lang="fa"] .dashboard-notification-item-meta {
  unicode-bidi: plaintext;
  text-align: start;
}

html[dir="rtl"] .dashboard-topbar-ops {
  direction: rtl;
  justify-content: flex-start;
}

html[dir="rtl"] .dashboard-panel-header,
html[dir="rtl"] .dashboard-metric-card__header,
html[dir="rtl"] .dashboard-metric-card__head,
html[dir="rtl"] .device-tile header,
html[dir="rtl"] .dashboard-notification-item-head {
  direction: rtl;
}

html[dir="rtl"] .dashboard-panel-header__titles,
html[lang="fa"] .dashboard-panel-header__titles {
  align-items: stretch;
  text-align: start;
}

html[dir="rtl"] .dashboard-panel-header__titles .dashboard-section-kicker,
html[dir="rtl"] .dashboard-panel-header__titles .dashboard-panel-title,
html[dir="rtl"] .dashboard-panel-header__titles .dashboard-panel-subtitle,
html[lang="fa"] .dashboard-panel-header__titles .dashboard-section-kicker,
html[lang="fa"] .dashboard-panel-header__titles .dashboard-panel-title,
html[lang="fa"] .dashboard-panel-header__titles .dashboard-panel-subtitle {
  text-align: start;
  unicode-bidi: plaintext;
}

html[lang="fa"] .dashboard-panel-header .dashboard-section-kicker,
html[lang="fa"] .dashboard-panel--energy .dashboard-section-kicker {
  letter-spacing: 0 !important;
  line-height: 1.45;
}

html[dir="rtl"] .dashboard-notification-item-time {
  direction: ltr;
  unicode-bidi: isolate;
}

html[dir="rtl"] .dashboard-topbar-notification-badge {
  inset-inline-end: -0.15rem;
  inset-inline-start: auto;
  right: auto;
  left: auto;
}

html[dir="rtl"] .dashboard-topbar-ops-chip,
html[dir="rtl"] .dashboard-breakdown-chip,
html[dir="rtl"] .dashboard-compare-chip,
html[dir="rtl"] .dashboard-panel-badge,
html[dir="rtl"] .linear-chip {
  direction: rtl;
  text-align: start;
}

html[lang="fa"] .dashboard-topbar-ops-label,
html[lang="fa"] .dashboard-topbar-ops-chip--time .dashboard-topbar-date {
  letter-spacing: 0 !important;
  text-transform: none !important;
}

html[lang="fa"] .dashboard-topbar-ops-chip {
  min-width: 0;
  max-width: 100%;
}

html[lang="fa"] .dashboard-topbar-ops-chip--time.dashboard-topbar-datetime {
  min-width: 0;
}

html[dir="rtl"] .dashboard-connection-status,
html[dir="rtl"] .dashboard-topbar-ops-chip--stream {
  flex-direction: row;
}

html[dir="rtl"] .dashboard-topbar-ops-value,
html[dir="rtl"] .dashboard-topbar-clock,
html[dir="rtl"] .dashboard-mono {
  direction: ltr;
  unicode-bidi: isolate;
}

/* -------------------------------------------------------------------------- */
/* Cards / tiles / notifications — logical edges                               */
/* -------------------------------------------------------------------------- */

html[dir="rtl"] .device-tile,
html[dir="rtl"] .dashboard-status-card,
html[dir="rtl"] .dashboard-alarm-card,
html[dir="rtl"] .dashboard-ai-brief,
html[dir="rtl"] .dashboard-notification-item {
  text-align: start;
}

html[dir="rtl"] .dashboard-notification-item,
html[dir="rtl"] .dashboard-ai-brief,
html[dir="rtl"] .dashboard-alarm-card--critical,
html[dir="rtl"] .dashboard-alarm-card--warning,
html[dir="rtl"] .dashboard-alarm-card--info {
  border-left: none;
  border-right: none;
  border-inline-start-width: 3px;
  border-inline-start-style: solid;
  padding-inline-start: 0.85rem;
  padding-left: 0;
  padding-right: 0;
}

html[dir="rtl"] .dashboard-alarm-card--critical,
html[dir="rtl"] .dashboard-notification-item[data-severity="critical"] {
  border-inline-start-color: #e11d48;
}

html[dir="rtl"] .dashboard-alarm-card--warning,
html[dir="rtl"] .dashboard-notification-item[data-severity="warning"] {
  border-inline-start-color: #FF7F50;
}

html[dir="rtl"] .dashboard-alarm-card--info,
html[dir="rtl"] .dashboard-notification-item[data-severity="info"] {
  border-inline-start-color: var(--primary, #204098);
}

/* Switches / toggles: mirror thumb travel in RTL */
html[dir="rtl"] .linear-toggle-track .linear-toggle-thumb,
html[dir="rtl"] .dashboard-plc-switch-thumb,
html[dir="rtl"] [data-switch-thumb] {
  left: auto;
  right: 2px;
  inset-inline-start: auto;
  inset-inline-end: 2px;
}

html[dir="rtl"] .linear-toggle.is-on .linear-toggle-thumb,
html[dir="rtl"] .dashboard-plc-switch.is-on .dashboard-plc-switch-thumb,
html[dir="rtl"] [data-switch].is-on [data-switch-thumb] {
  transform: translateX(-1.25rem);
}

/* -------------------------------------------------------------------------- */
/* Settings / linear shell                                                      */
/* -------------------------------------------------------------------------- */

html[dir="rtl"] .linear-settings-layout,
html[dir="rtl"] .linear-page-grid--sidebar,
html[dir="rtl"] .linear-form-stack,
html[dir="rtl"] .linear-field,
html[dir="rtl"] .linear-table,
html[dir="rtl"] .linear-sidebar-nav {
  direction: rtl;
  text-align: start;
}

html[dir="rtl"] .linear-settings-hub-card__chevron,
html[dir="rtl"] .linear-sidebar-link-icon svg {
  transform: scaleX(-1);
}

html[dir="rtl"] .linear-input,
html[dir="rtl"] .linear-select,
html[dir="rtl"] .linear-textarea {
  text-align: start;
}

html[dir="rtl"] .linear-actions {
  justify-content: flex-start;
}

/* -------------------------------------------------------------------------- */
/* Bottom nav / mobile                                                          */
/* -------------------------------------------------------------------------- */

html[dir="rtl"] .app-bottom-nav,
html[dir="rtl"] .app-bottom-nav__glass {
  direction: rtl;
}

html[dir="rtl"] body.app-mobile-shell .app-header-toolbar,
html[dir="rtl"] body.app-mobile-shell .dashboard-topbar-main-actions {
  margin-inline: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  justify-content: flex-end;
  justify-self: end;
}

/* -------------------------------------------------------------------------- */
/* Charts / metering / present                                                  */
/* -------------------------------------------------------------------------- */

html[dir="rtl"] .chart-export-btn--menu {
  flex-direction: row-reverse;
}

html[dir="rtl"] .metering-page,
html[dir="rtl"] .metering-main,
html[dir="rtl"] .present-page,
html[dir="rtl"] .present-main {
  direction: rtl;
  text-align: start;
  font-family: var(--dashboard-font-sans);
}

/* Weather cards: text on the right (start); sparkline on the left (end); never mirror icons */
html[dir="rtl"] .dashboard-panel--weather .weather-card,
html[dir="rtl"] .weather-card {
  text-align: start;
  padding-inline-start: 1rem;
  padding-inline-end: 5.85rem;
}

html[dir="rtl"] .dashboard-panel--weather .weather-card-sparkline,
html[dir="rtl"] .weather-card-sparkline {
  /* Physical left = inline-end in RTL; keep time series LTR inside the svg */
  left: 0.75rem;
  right: auto;
  inset-inline-end: auto;
  inset-inline-start: auto;
  direction: ltr;
  transform: none;
}

/* Chart.js inherits CSS direction — keep time series left→right even in RTL UI */
html[dir="rtl"] .dashboard-metric-card__chart,
html[dir="rtl"] .dashboard-metric-card__chart canvas,
html[dir="rtl"] .chart-container,
html[dir="rtl"] .chart-container canvas,
html[dir="rtl"] #power-chart-container,
html[dir="rtl"] #power-chart-container canvas,
html[dir="rtl"] .dashboard-panel--chart .chart-wrap,
html[dir="rtl"] .dashboard-panel--chart canvas,
html[dir="rtl"] .dashboard-inline-live-power-chart-wrap,
html[dir="rtl"] .dashboard-inline-live-power-chart-wrap canvas,
html[dir="rtl"] .dashboard-insight-metric-sparkline,
html[dir="rtl"] .dashboard-insight-metric-sparkline canvas,
html[dir="rtl"] .device-tile-spark,
html[dir="rtl"] .device-tile-spark canvas,
html[dir="rtl"] .weather-card-sparkline,
html[dir="rtl"] .weather-card-sparkline svg,
html[dir="rtl"] [id$="-chart"],
html[dir="rtl"] canvas[id*="chart"] {
  direction: ltr !important;
  unicode-bidi: isolate;
}

html[dir="rtl"] .weather-icon,
html[dir="rtl"] .weather-icon svg,
html[dir="rtl"] .weather-card-sparkline svg {
  transform: none !important;
}

html[dir="rtl"] .weather-value {
  /* Keep digits LTR but pin the value group to the RTL start (right) */
  direction: ltr;
  unicode-bidi: isolate;
  justify-content: flex-end;
  width: 100%;
}

html[dir="rtl"] .weather-unit {
  direction: ltr;
  unicode-bidi: isolate;
}

html[dir="rtl"] .metering-page .dashboard-mono,
html[dir="rtl"] .present-page .dashboard-mono,
html[dir="rtl"] .present-main .dashboard-mono,
html[dir="rtl"] .present-odometer__display,
html[dir="rtl"] .mc-lcd__value,
html[dir="rtl"] .mc-lcd__page {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Datepicker already has some RTL; reinforce text direction */
html[dir="rtl"] .suniar-datepicker-popup,
html[dir="rtl"] .suniar-datepicker-range {
  direction: rtl;
}

/* -------------------------------------------------------------------------- */
/* Device modals (inverter / meter / substation) — Vazirmatn + no Latin casing */
/* -------------------------------------------------------------------------- */

html[lang="fa"] .dashboard-device-modal,
html[lang="fa"] .dashboard-device-modal-panel,
html[lang="fa"] .device-modal-header__title,
html[lang="fa"] .device-modal-header__kicker,
html[lang="fa"] .device-modal-header__copy,
html[lang="fa"] .device-modal-header__meta,
html[lang="fa"] .device-modal-tab,
html[lang="fa"] .device-modal-tab span,
html[lang="fa"] .device-modal-kpi__label,
html[lang="fa"] .device-modal-extra__title,
html[lang="fa"] .device-modal-extra__subtitle,
html[lang="fa"] .device-modal-extra__kicker,
html[lang="fa"] .device-modal-extra-highlight__label,
html[lang="fa"] .device-modal-extra-group__title p,
html[lang="fa"] .device-modal-extra__mppt-hint,
html[lang="fa"] .device-modal-strings__subtitle,
html[lang="fa"] .device-modal-strings-chart__hint,
html[lang="fa"] .device-modal-strings__chip,
html[lang="fa"] .inverter-string-card__kicker,
html[lang="fa"] .inverter-string-state,
html[lang="fa"] .device-modal-smart__kicker,
html[lang="fa"] .device-modal-smart__title,
html[lang="fa"] .device-modal-smart__subtitle,
html[lang="fa"] .device-modal-smart-card__headline,
html[lang="fa"] .device-modal-smart-card__detail,
html[lang="fa"] .device-modal-smart-summary__label,
html[lang="fa"] .dashboard-device-modal-section-title,
html[lang="fa"] .dashboard-device-modal-detail__label,
html[lang="fa"] .inverter-threshold-card__title,
html[lang="fa"] .inverter-threshold-empty,
html[lang="fa"] .inverter-string-card__title,
html[lang="fa"] .dashboard-substation-modal-gauge-label,
html[lang="fa"] .dashboard-modal-loading-text {
  font-family: var(--dashboard-font-sans) !important;
}

html[lang="fa"] .device-modal-header__kicker,
html[lang="fa"] .device-modal-kpi__label,
html[lang="fa"] .device-modal-phase-chip p,
html[lang="fa"] .device-modal-smart__kicker,
html[lang="fa"] .device-modal-smart-summary__label,
html[lang="fa"] .dashboard-device-modal-section-title,
html[lang="fa"] .dashboard-device-modal-detail__label,
html[lang="fa"] .device-modal-extra__kicker,
html[lang="fa"] .device-modal-strings__kicker,
html[lang="fa"] .device-modal-strings-chart__title,
html[lang="fa"] .device-modal-strings-listhead__title,
html[lang="fa"] .device-modal-strings-flow__node,
html[lang="fa"] .inverter-string-card__kicker,
html[lang="fa"] .inverter-string-state,
html[lang="fa"] .dashboard-substation-modal-gauge-label,
html[lang="fa"] .dashboard-device-modal-panel .uppercase,
html[lang="fa"] .dashboard-device-modal-panel .tracking-wide {
  letter-spacing: 0 !important;
  text-transform: none !important;
}

html[dir="rtl"] .dashboard-device-modal-detail {
  direction: rtl;
}

html[dir="rtl"] .dashboard-device-modal-detail__value {
  text-align: start;
}

html[dir="rtl"] .device-modal-header__meta,
html[dir="rtl"] .device-modal-tab-list,
html[dir="rtl"] .device-modal-kpi-strip {
  direction: rtl;
}

/* Keep numeric / code values LTR with the same Persian UI font */
html[lang="fa"] .dashboard-device-modal-detail__value,
html[lang="fa"] .device-modal-kpi__value,
html[lang="fa"] .device-modal-phase-chip strong,
html[lang="fa"] .device-modal-extra-stat strong,
html[lang="fa"] .device-modal-extra-card__key,
html[lang="fa"] .inverter-threshold-metric-card__live,
html[lang="fa"] .inverter-threshold-metric-card__bounds,
html[lang="fa"] .inverter-string-metrics dd,
html[lang="fa"] .inverter-string-card__index,
html[lang="fa"] .inverter-string-gauge__value,
html[lang="fa"] .device-modal-strings__activity-value,
html[lang="fa"] .dashboard-substation-modal-gauge-value,
html[lang="fa"] .dashboard-device-modal-panel .dashboard-mono {
  font-family: var(--dashboard-font-sans) !important;
  direction: ltr;
  unicode-bidi: isolate;
}
