/* =========================================================================
   Persained CSS — Persian (Farsi) localization for Perfex CRM
   Applies the Vazir font, RTL refinements and Persian digit styling.
   Loaded only when the Persian language is active.
   ========================================================================= */

/* Vazir font face */
@font-face {
    font-family: 'Vazir';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../../../../assets/fonts/Vazir-Regular-FD.woff2') format('woff2'),
         url('../../../../assets/fonts/Vazir-Regular-FD.woff') format('woff');
}

/* -------------------------------------------------------------------------
   Base font family — apply Vazir across the whole application surface
   ------------------------------------------------------------------------- */
body,
body.admin,
body.customers,
body.login_admin,
body.staff_login {
    font-family: 'Vazir', Tahoma, 'Segoe UI', sans-serif !important;
}

/* Ensure all UI controls inherit Vazir so Persian glyphs render properly */
body input,
body select,
body textarea,
body button,
body .btn,
body .form-control,
body .modal,
body .navbar,
body .dropdown-menu,
body .popover,
body .tab-content,
body table,
body .datatable,
body .dataTables_wrapper,
body .daterangepicker,
body .datetimepicker,
body .timepicker,
body .select2-container,
body .bootstrap-select .dropdown-menu,
body .summernote,
body .note-editor,
body .editor,
body .toast,
body .alert,
body .card,
body .panel,
body .pagination,
body .breadcrumb,
body .nav-tabs,
body .nav-pills {
    font-family: 'Vazir', Tahoma, 'Segoe UI', sans-serif;
}

/* Ensure inherited font not overridden inside widgets */
.widget,
.widget-title,
.widget-content {
    font-family: 'Vazir', Tahoma, 'Segoe UI', sans-serif;
}

/* -------------------------------------------------------------------------
   RTL refinements
   ------------------------------------------------------------------------- */
/* Numbers align nicely and read LTR even inside RTL layout */
body .table td,
body .table th,
body .form-control,
body input[type='text'],
body input[type='number'],
body textarea {
    text-align: right;
    direction: rtl;
}

/* Money/amount cells: keep digits LTR so amounts are legible (123تومان) */
body .amount,
body .total-col,
body .dataTables_wrapper td.amount,
body .invoice-total,
body .project-total,
body .bold.total,
body .text-success.amount,
body .text-danger.amount {
    direction: ltr;
    unicode-bidi: embed;
    text-align: right;
}

/* DataTables controls keep LTR for sorting icons */
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    direction: ltr;
}

/* Datepicker popup in RTL */
.datetimepicker,
.daterangepicker,
.datepicker-inline {
    direction: rtl;
}

/* Badge/label text centering */
.label, .badge {
    display: inline-block;
}

/* -------------------------------------------------------------------------
   Persian (Jalali) date picker popup styling
   (see assets/js/persian-datepicker.js)
   ------------------------------------------------------------------------- */
.persianPicker {
    font-family: 'Vazir', Tahoma, sans-serif;
    z-index: 100050 !important;
    direction: rtl;
    background: #fff;
    border: 1px solid #c5cbd2;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    width: 264px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}
.persianPicker .pp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 6px;
    background: #3a3f51;
    color: #fff;
}
.persianPicker .pp-title {
    font-size: 13px;
    font-weight: 600;
}
.persianPicker .pp-nav {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    padding: 0 8px;
    cursor: pointer;
    opacity: .85;
}
.persianPicker .pp-nav:hover { opacity: 1; }
.persianPicker .pp-grid table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 13px;
    margin: 6px 0;
}
.persianPicker .pp-grid th {
    color: #6c757d;
    font-weight: 500;
    padding: 4px 0;
    font-size: 12px;
}
.persianPicker .pp-grid td {
    padding: 1px;
}
.persianPicker .pp-grid td:empty { padding: 0; }
.persianPicker .pp-day {
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 5px 0;
    border-radius: 6px;
    color: #333;
    font-size: 13px;
}
.persianPicker .pp-day:hover { background: #eef1f5; }
.persianPicker .pp-day.is-selected {
    background: #2d6cdf;
    color: #fff;
    font-weight: 600;
}
.persianPicker .pp-grid tbody td { text-align: center; }


/* -------------------------------------------------------------------------
   Persian refinement: force Persian digits inside specific numeric displays
   (The JS `persian.js` handles dynamic digit conversion; these are fallbacks)
   ------------------------------------------------------------------------- */
body .price,
body .subtotal,
body .tax,
body .discount,
body .final-price {
    font-feature-settings: normal;
    -webkit-font-feature-settings: normal;
}