/* Shared direction/font rules. Never infer a company's language from the browser. */
@font-face {
    font-family: "Hesabdar Amiri";
    src: url("../fonts/Amiri-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Hesabdar Amiri";
    src: url("../fonts/Amiri-Bold.ttf") format("truetype");
    font-weight: 700 950;
    font-style: normal;
    font-display: swap;
}
:root {
    --hd-ui-font: XW_Zar_Bd_0, "Hesabdar Amiri", Tahoma, Arial, sans-serif;
}
html[lang^="en"] {
    /* Use the installed family. Self-hosting requires a separate webfont licence. */
    --hd-ui-font: "Century Gothic", CenturyGothic, "Segoe UI", Arial, sans-serif;
    --bs-font-sans-serif: var(--hd-ui-font);
    --bs-body-font-family: var(--hd-ui-font);
}
html[lang^="ps"] {
    --hd-ui-font: "Hesabdar Amiri", Tahoma, Arial, sans-serif;
}
html body,
html body input,
html body select,
html body textarea,
html body button,
html body .training-center,
html body .calculation-dashboard,
html body .pro-dashboard,
html body .hd-dashboard,
html body .hd-finance-dashboard {
    font-family: var(--hd-ui-font) !important;
}
/* Legacy page styles set their own font on containers and text. Override these
   for English, while preserving icon glyphs and monospace technical content. */
html[lang^="en"] body :where(
    a, abbr, address, article, aside, b, blockquote, button, caption, dd, details,
    div, dl, dt, em, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6,
    header, input, label, legend, li, main, nav, ol, optgroup, option, p, section,
    select, small, span, strong, summary, table, tbody, td, textarea, th, thead,
    time, ul, svg text, svg tspan
):not(:where(
    i, i *,
    [class^="ki-"], [class*=" ki-"], [class^="ki-"] *, [class*=" ki-"] *,
    .fa, .fas, .far, .fal, .fab, .fad, .fak,
    [class^="fa-"], [class*=" fa-"],
    [class^="iconsminds-"], [class*=" iconsminds-"],
    [class^="simple-icon-"], [class*=" simple-icon-"],
    .material-icons, .material-icons *,
    [class^="material-symbols-"], [class*=" material-symbols-"],
    pre, pre *, code, code *, kbd, kbd *, samp, samp *
)) {
    font-family: var(--hd-ui-font) !important;
}
html body {
    text-align: start;
}
html[dir="ltr"] body {
    text-align: left;
}
html[dir="rtl"] body {
    text-align: right;
}
html .text-start { text-align: start !important; }
html .text-end { text-align: end !important; }
html .float-start { float: inline-start !important; }
html .float-end { float: inline-end !important; }
input[type="email"],
input[type="tel"],
input[type="url"],
[data-hd-direction="ltr"] {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: left;
}
[dir="auto"], bdi { unicode-bidi: isolate; }
html[dir="rtl"] .form-select {
    background-position: left .75rem center;
    padding-right: .75rem;
    padding-left: 2.25rem;
}
html[dir="rtl"] .input-group > :first-child:not(.dropdown-menu) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: .475rem;
    border-bottom-right-radius: .475rem;
}
html[dir="rtl"] .input-group > :last-child:not(.dropdown-menu) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: .475rem;
    border-bottom-left-radius: .475rem;
}
html[dir="rtl"] .form-check .form-check-input {
    float: right;
    margin-left: 0;
    margin-right: -1.5em;
}
html[dir="rtl"] .form-check {
    padding-left: 0;
    padding-right: 1.5em;
}
html[dir="ltr"] .hd-page-context__back-icon,
html[dir="ltr"] .hd-page-context__separator {
    transform: scaleX(-1);
}
.hd-language-form { display: inline-flex; align-items: center; gap: .4rem; }
.hd-language-form .form-select { min-width: 100px; width: auto; }
html .pc-table th, html .pc-table td { text-align: start; }
html .dataTables_wrapper .dataTables_filter { text-align: end; }
html .dataTables_wrapper .dataTables_length { text-align: start; }
html[dir="rtl"] .dataTables_wrapper .dataTables_filter { float: left; }
html[dir="rtl"] .dataTables_wrapper .dataTables_length { float: right; }
html[dir="rtl"] .dataTables_wrapper .dataTables_paginate { float: left; }
html[dir="rtl"] .dataTables_wrapper .dataTables_info { float: right; }
html[dir="rtl"] .dataTables_wrapper .dataTables_filter input {
    margin-left: 0;
    margin-right: .5em;
}
html .swal2-popup { direction: inherit; font-family: var(--hd-ui-font); }
@media (max-width: 767.98px) {
    html .dataTables_wrapper .dataTables_filter,
    html .dataTables_wrapper .dataTables_length,
    html .dataTables_wrapper .dataTables_info,
    html .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: start;
    }
}
@media print {
    .hd-language-form { display: none !important; }
    html body { direction: inherit; }
}
