/* Vazirmatn — professional Persian UI font (self-hosted for WebView) */
@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/persian/vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/persian/vazirmatn/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/persian/vazirmatn/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/persian/vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Legacy aliases → Vazirmatn (keeps old declarations working) */
@font-face {
    font-family: 'Shabnam';
    src: url('fonts/persian/vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Shabnam';
    src: url('fonts/persian/vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('fonts/persian/vazirmatn/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

html.farsi,
body.farsi {
    font-family: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.65;
    letter-spacing: 0;
    word-spacing: 0;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.farsi {
    font-weight: 400;
}

.farsi h4,
.farsi .h4,
.farsi h5,
.farsi .h5,
.farsi h6,
.farsi .h6 {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
}

.farsi .leaflet-popup-content {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 13px;
    line-height: 1.6;
}

.dt-rtl {
    direction: rtl;
}

.dt-ltr {
    direction: ltr !important;
}

.farsi .ui-widget input,
.farsi .ui-widget select,
.farsi .ui-widget textarea,
.farsi .ui-widget button,
.farsi input,
.farsi select,
.farsi textarea,
.farsi button,
.farsi .form-control,
.farsi .btn {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

.persian-dp,
.persian-dp2 {
    color: #444444;
    border: 1px solid #e8e8e8;
    -webkit-inline-box: none;
    background: #f5f5f5 url("images/calendar.svg") right no-repeat;
    background-size: 14px 14px;
}

.leaflet-popup-content-wrapper {

    direction: rtl;
    text-align: right;
}

.farsi #bottom_panel,
.farsi .bottom-panel-peek,
.farsi .datalist-item {
    direction: rtl;
    text-align: right;
}

.farsi .bottom-panel-title-group {
    align-items: flex-end;
}

.farsi #bottom_panel_datalist_object_name,
.farsi .bottom-panel-subtitle,
.farsi .datalist-item-name,
.farsi .datalist-item-value {
    text-align: right;
}

.datalist-item-value {
    direction: rtl;
    text-align: right;
}

.ui-jqgrid tr.jqgrow td {
    height: 40px !important;
    padding-top: 5px;
}

.object-list-item .name {
    margin-bottom: 5px;
    font-weight: bold;
}

.farsi .datalist-item-value {
    direction: rtl;
    font-size: 13px;
    font-weight: 800;
}

.data-item-text {
    direction: rtl;

}

.ui-pnotify-text {
    direction: rtl;
    text-align: initial;
}

.leaflet-popup-content a {
    direction: ltr !important;
}

.object-list-item .status {

    color: #444444 !important;
}

#side_panel.ui-tabs .ui-tabs-nav li a {
    font-size: 11px !important;
    font-weight: 600;

}

.input-group .clear {
    right: unset !important;
    left: 10px !important;
    transform: translateY(-50%);
}

#page_object_search,
#page_markers_panel_search,
#page_event_search,
#page_routes_panel_search,
#page_zones_panel_search {
    direction: rtl !important;
}

.datalist-item-name {
    padding-left: 5px;
    padding-right: 5px;
}

#mobile-login {

    direction: rtl;
}

#mobile-login div.input-block input {

    padding-right: 10px;
}

#mobile-login label {

    padding-right: 10px;
}

#modal_language .modal-title {
    text-align: right;
}

.bootbox-body {
    direction: rtl;
}

.farsi .modal .modal-header .close,
.farsi .bootbox-mobile .bootbox-close-button.close,
.farsi #modal_language .modal-header .close {
    float: none !important;
}

.farsi #details_panel_detail_ext_list .col-xs-6 {
    direction: rtl;
    text-align: left;
}

.farsi #details_panel_detail_list .col-xs-6 {
    direction: rtl;
    text-align: left;
}

.farsi .modal {
    direction: rtl;
}

.farsi .page .header .title,
.farsi #page_places .places-section .header .title,
.farsi .modal-header .modal-title {
    text-align: right;
}

.farsi .mobile-report-section-title {
    text-align: right !important;
}

.farsi .mobile-report-hero-title {
    text-align: right !important;
}

.farsi .mobile-report-hero-subtitle {
    text-align: right !important;
}

.farsi select {
    direction: rtl;
}

.farsi .mobile-report-section-heading {
    text-align: right !important;
}

.farsi .mobile-report-section-heading h4 {
    text-align: right !important;
}

.farsi .custom-label {
    text-align: right !important;
}

.farsi .select2-container--default .select2-selection--single .select2-selection__arrow {

    left: 1px !important;
    right: 0px !important;

}

.farsi #page_history .select2-container--default .select2-selection--single .select2-selection__rendered,
#page_object_control .select2-container--default .select2-selection--single .select2-selection__rendered,
#page_settings .select2-container--default .select2-selection--single .select2-selection__rendered {

    text-align: right !important;
}

.farsi .select2-container--default .select2-results__option--highlighted[aria-selected] {
    text-align: right !important;
}

.farsi .mobile-report-section-heading {
    text-align: right !important;
    justify-content: right !important;
}

.farsi .mobile-report-empty {
    direction: rtl;
    text-align: right;
}

.farsi .mobile-report-card {
    direction: rtl;
    text-align: right;
}

.farsi #page_menu .menu-panel-header {

     text-align: right !important;

}

.farsi #page_menu ul.menu {

    direction: rtl !important;
}

h4 {
    text-align: right !important;
}

.farsi .modal-footer {
    text-align: left !important;
}

.farsi .bootbox-mobile .modal-footer {
    text-align: initial !important;
}

.leaflet-container a.leaflet-popup-close-button {
    left: 5px !important;

}

.farsi .mobile-report-date-grid .input-group,
.farsi #page_history .scroll>.row.vertical-align .input-group {
    direction: ltr;
}

.farsi .mobile-report-date-grid .input-group .form-control,
.farsi #page_history .scroll>.row.vertical-align .input-group .form-control {
    text-align: right;
    border-radius: 14px 0 0 14px;
}

.farsi .mobile-report-date-grid .input-group-addon,
.farsi #page_history .scroll>.row.vertical-align .input-group-addon {
    border-radius: 0 14px 14px 0;
    border-left: 0;
    border-right: 1px solid #dbe3ec;
}

.farsi #page_history .form-group .row>[class*="col-xs-"]:first-child,
.farsi #page_object_control .form-group .row>[class*="col-xs-"]:first-child,
.farsi #page_settings .form-group .row>[class*="col-xs-"]:first-child,
.farsi .mobile-report-label {
    text-align: right;
}

.farsi #page_dashboard_custom,
.farsi #page_objects,
.farsi .page {
    direction: rtl;
}

.farsi .page .header .title,
.farsi .page .mobile-page-lead,
.farsi .page h4,
.farsi .places-section-title {
    text-align: right;
}

.farsi #page_objects .fleet-object-identity,
.farsi #page_objects .fleet-object-name,
.farsi #page_objects .fleet-object-address,
.farsi #page_objects .fleet-object-status-sub,
.farsi #page_objects .fleet-summary-title {
    text-align: right;
}

.farsi #page_objects .fleet-object-plate {
    transform-origin: right center;
}

.farsi #page_objects .fleet-object-accent {
    right: 0;
    left: auto;
    border-radius: 999px 0 0 999px;
}

.farsi #page_dashboard_custom .header .title,
.farsi .mobile-dashboard-brand-name,
.farsi .mobile-dashboard-brand-tagline,
.farsi .mobile-dashboard-selection-summary,
.farsi .mobile-dashboard-empty,
.farsi .mobile-dashboard-limit-notice,
.farsi .mobile-dashboard-object-name,
.farsi .mobile-dashboard-event-title,
.farsi .mobile-dashboard-event-value,
.farsi .mobile-dashboard-metric-label,
.farsi .mobile-dashboard-metric-value,
.farsi .mobile-dashboard-status-chip-label,
.farsi .mobile-dashboard-status-chip-value,
.farsi .mobile-dashboard-gauge-label,
.farsi .mobile-dashboard-glance-item {
    text-align: right;
}

.farsi #page_dashboard_custom .mobile-dashboard-brand-header {
    direction: rtl;
}

.farsi .mobile-dashboard-brand,
.farsi .mobile-dashboard-brand-actions,
.farsi .mobile-dashboard-status-pill,
.farsi .mobile-dashboard-hero-updated,
.farsi .mobile-dashboard-map-btn,
.farsi .mobile-dashboard-event-card,
.farsi .mobile-dashboard-glance {
    direction: rtl;
}

.farsi .mobile-dashboard-card {
    direction: rtl;
    text-align: right;
}

.farsi .mobile-dashboard-carousel {
    direction: ltr;
}

.farsi .mobile-dashboard-track {
    direction: ltr;
}

.farsi .mobile-dashboard-slide-nav {
    direction: ltr;
}

.farsi .mobile-dashboard-picker,
.farsi .mobile-dashboard-picker-row,
.farsi .mobile-dashboard-picker-toolbar,
.farsi .mobile-dashboard-picker-meta {
    direction: rtl;
}

.farsi .mobile-dashboard-picker-row {
    justify-content: flex-start;
}

.farsi .mobile-dashboard-picker-search {
    text-align: right;
}

.farsi .mobile-dashboard-picker-row input {
    margin: 0;
}

.farsi .mobile-dashboard-event-content {
    text-align: right;
}

.farsi .mobile-dashboard-metric {
    text-align: center;
}

.farsi .mobile-dashboard-object-copy {
    align-items: flex-start;
    text-align: right;
}

.farsi .mobile-dashboard-icon-dot {
    left: auto;
    right: 10px;
}

.farsi .mobile-form-section-title,
.farsi .mobile-map-header-title,
.farsi .event-card-title,
.farsi .event-card-meta,
.farsi .bottom-panel-peek-meta {
    text-align: right;
}

.farsi .event-card-chevron::before {
    transform: rotate(45deg);
}

.farsi #page_menu.is-open {
    animation-name: mobileMenuInRtl;
}

@keyframes mobileMenuInRtl {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: none; }
}

/*#################################################*/
/* FARSI TYPOGRAPHY SCALE + WEBVIEW OPTIMIZATION
/*#################################################*/

.farsi {
    --fs-xs: 11px;
    --fs-sm: 12px;
    --fs-md: 14px;
    --fs-base: 15px;
    --fs-lg: 16px;
    --fs-xl: 18px;
    --fs-2xl: 22px;
    --lh-tight: 1.45;
    --lh-base: 1.65;
}

.farsi,
.farsi * {
    font-family: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
}

.farsi .far,
.farsi .fas,
.farsi .fal,
.farsi .fab,
.farsi .svg-inline--fa {
    font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "Font Awesome 5 Brands", FontAwesome !important;
}

.farsi .page .header .title,
.farsi .mobile-map-header-title,
.farsi .mobile-dashboard-brand-name,
.farsi .menu-panel-title,
.farsi #bottom_panel_datalist_object_name {
    font-size: var(--fs-lg);
    font-weight: 700;
    line-height: var(--lh-tight);
}

.farsi .mobile-page-lead,
.farsi .menu-panel-subtitle,
.farsi .bottom-panel-subtitle,
.farsi .mobile-report-label,
.farsi .fleet-summary-metric-label,
.farsi .fleet-summary-metric-pct {
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: var(--lh-base);
}

.farsi .form-group,
.farsi .mobile-form-section,
.farsi .mobile-report-section,
.farsi .list-group-item,
.farsi .event-card-title,
.farsi .fleet-object-name {
    font-size: var(--fs-md);
    font-weight: 600;
    line-height: var(--lh-base);
}

.farsi .fleet-object-imei,
.farsi .fleet-object-address,
.farsi .event-card-meta,
.farsi .datalist-item-name,
.farsi .mobile-details-label {
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: 1.55;
}

.farsi .datalist-item-value,
.farsi .mobile-details-value,
.farsi .fleet-object-speed strong,
.farsi .fleet-summary-total-value {
    font-weight: 700;
}

.farsi .fleet-summary-total-value {
    font-size: 40px;
    line-height: 1.1;
}

.farsi .page .header .title,
.farsi button,
.farsi .button,
.farsi .fleet-status-tab,
.farsi .fleet-object-action,
.farsi .mobile-page-actionbar .button {
    font-weight: 600;
}

/* Avoid artificial faux-bold above 700 (no Black face shipped) */
.farsi .page .header .title,
.farsi #bottom_panel_datalist_object_name,
.farsi .fleet-object-name,
.farsi .event-card-title,
.farsi .mobile-dashboard-brand-name,
.farsi .datalist-item-value,
.farsi .mobile-form-section-title,
.farsi .fleet-filter-btn,
.farsi .fleet-status-tab,
.farsi .button.button-confirm {
    font-weight: 700 !important;
}

/* iOS WebView: prevent input zoom (font-size < 16px causes zoom) */
.farsi input.form-control,
.farsi select.form-control,
.farsi textarea.form-control,
.farsi .form-control,
.farsi .select2-container--default .select2-selection--single,
.farsi .select2-container--default .select2-selection--multiple,
.farsi .select2-search__field {
    font-size: 16px !important;
    line-height: 1.5;
}

.farsi .select2-container--default .select2-selection--single .select2-selection__rendered {
    font-size: 15px;
    line-height: 42px;
}

/* WebView touch & text sizing */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.farsi,
body[data-app="android"],
body[data-app="ios"] {
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
}

body[data-app="android"] .page > .content-block > .scroll,
body[data-app="ios"] .page > .content-block > .scroll,
body[data-app="android"] .datalist,
body[data-app="ios"] .datalist {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Safer tap targets in WebView */
body[data-app="android"] .mobile-page-icon-button,
body[data-app="ios"] .mobile-page-icon-button,
body[data-app="android"] .close-page-button,
body[data-app="ios"] .close-page-button,
body[data-app="android"] .mobile-map-header-btn,
body[data-app="ios"] .mobile-map-header-btn,
body[data-app="android"] .mobile-dashboard-icon-button,
body[data-app="ios"] .mobile-dashboard-icon-button {
    min-width: 44px;
    min-height: 44px;
}

/* Numbers / IMEI stay readable LTR */
.farsi .fleet-object-imei,
.farsi .event-card-imei,
.farsi .dt-ltr,
.farsi [dir="ltr"] {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.farsi {
    font-synthesis: none;
}

@media (max-width: 360px) {
    body.farsi {
        font-size: 14px;
    }
    .farsi .fleet-summary-total-value {
        font-size: 34px;
    }
}

.farsi .leaflet-tooltip.map-object-tooltip,
.farsi .map-object-tooltip {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    direction: rtl;
}

.farsi .map-object-label-speed {
    direction: ltr;
    unicode-bidi: embed;
}

.farsi .bottom-panel-peek-imei {
    text-align: right;
}

.farsi .history-navbar,
.farsi .history-navbar-shell,
.farsi .history-navbar-actions {
    direction: rtl;
}

.farsi .history-navbar-button {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

.farsi #page_history .input-group .form-control{
 
	border-radius: 0 14px 14px 0 !important;
}

.farsi  #page_history .input-group-addon{

	border-radius: 14px 0 0 14px !important;

}

.farsi .mobile-bottom-nav {
	direction: rtl;
}

.farsi .mobile-bottom-nav-badge {
	left: auto;
	right: 50%;
	transform: translateX(-6px);
}