html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* RTL placeholder alignment for MudBlazor and native inputs. */
input::placeholder,
textarea::placeholder,
.mud-input-slot::placeholder,
.mud-input input::placeholder,
.mud-input textarea::placeholder {
    text-align: right !important;
    direction: rtl !important;
}

/* RTL field support – applies globally to any form using .rtl-field / .rtl-form */
.rtl-field {
    direction: rtl !important;
}

/* Force English (Western) digits globally */
*, *::before, *::after {
    font-variant-numeric: tabular-nums lining-nums;
}

.rtl-field .mud-input-label,
.rtl-field .mud-input-label-top {
    right: 0 !important;
    left: auto !important;
    text-align: right !important;
    direction: rtl !important;
    transform-origin: top right !important;
}

.rtl-field .mud-input,
.rtl-field .mud-input-slot,
.rtl-field .mud-select-input {
    direction: rtl !important;
    text-align: right !important;
}

/* ورودی‌های صرفاً عددی (موبایل، قیمت، شماره ساز و...) باید هنگام تایپ چپ‌به‌راست باشند */
.rtl-field input[type="tel"],
.rtl-field input[type="number"],
.rtl-field input[inputmode="numeric"],
.rtl-field input[inputmode="decimal"] {
    direction: ltr !important;
    text-align: left !important;
}

/* RTL Fix for MudBlazor Outlined Inputs */
.mud-rtl .mud-input-label-outlined,
[dir="rtl"] .mud-input-label-outlined {
    right: 12px !important;
    left: auto !important;
    transform-origin: top right !important;
}

/* نشاندن لیبل روی خط کادر اینپوت (هم‌ترازی عمودی لیبل با بوردر) */
.mud-rtl .mud-input-label-outlined.mud-input-label-inputcontrol,
[dir="rtl"] .mud-input-label-outlined.mud-input-label-inputcontrol {
    transform: translate(0, -7px) scale(0.75) !important;
    background-color: var(--mud-palette-surface, #ffffff) !important;
    padding: 0 6px !important;
    z-index: 2 !important;
    border-radius: 4px !important;
}

/* تنظیم حاشیه راست داخل فیلدست */
.mud-rtl .mud-input-outlined .mud-input-outlined-border fieldset,
[dir="rtl"] .mud-input-outlined .mud-input-outlined-border fieldset {
    padding-right: 8px !important;
}

/* واحد پولی سمت چپ ارقام */
.order-currency {
    font-size: 0.85em;
    opacity: 0.7;
}

/* باکس تخفیف در sidebar خلاصه */
.order-summary-discount-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.order-summary-discount-wrap .order-summary-discount-field {
    flex: 1;
}

/* دکمه بستن مدال‌ها در سمت چپ (چیدمان راست‌به‌چپ) — کلاس فعلی MudBlazor 9.8 برابر mud-button-close است */
.mud-dialog .mud-dialog-title .mud-button-close {
    right: unset !important;
    left: 8px !important;
    top: 8px !important;
    position: absolute;
}

/* کاهش فاصله چک‌باکس با متن در دراپ‌داون‌های چند انتخابی (MudSelect MultiSelection) */
.mud-select-item .mud-list-item-gutters {
    padding-inline-start: 4px !important;
    padding-inline-end: 8px !important;
}

.mud-select-item .mud-checkbox {
    margin-inline-end: 2px !important;
    margin-inline-start: 0 !important;
}

.mud-select-item {
    min-height: 36px !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
}

/* صفحه‌بندی جداول: چیدمان راست‌به‌چپ — از راست: تعداد در صفحه، اطلاعات، فلش‌ها */
.mud-table-pagination-toolbar {
    direction: rtl !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px 20px !important;
    /* Clear the fixed global \"new order\" FAB (56px + 24px offset, bottom-right) */
    padding-inline-start: 88px !important;
    scroll-margin-bottom: 96px;
}
.mud-table-pagination-toolbar .mud-table-pagination-spacer {
    display: none !important;
}
.mud-table-pagination-display {
    direction: rtl !important;
    flex-direction: row-reverse !important;
    align-items: center !important;
}
.mud-table-page-number-information,
.mud-table-pagination-information {
    direction: rtl !important;
    unicode-bidi: plaintext !important;
    white-space: nowrap !important;
}
.mud-table-pagination-actions {
    direction: rtl !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    margin: 0 !important;
}
.mud-table-pagination-caption {
    padding-left: 8px !important;
    padding-right: 8px !important;
}

/* شمارنده تعداد مشترک (FaQuantityField): دکمه‌های گرد مدرن + فیلد وسط */
.fa-qty__label {
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 4px;
}
.fa-qty__row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.fa-qty__btn {
    border-radius: 12px !important;
    min-width: 40px;
    min-height: 40px;
    box-shadow: 0 1px 4px rgba(18, 38, 63, 0.16);
}
.fa-qty--dense .fa-qty__btn {
    min-width: 32px;
    min-height: 32px;
}
.fa-qty__input {
    max-width: 110px;
    text-align: center;
}
.fa-qty__input input {
    text-align: center !important;
}
.fa-qty__hint {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 2px;
}

/* UX polish: sticky dialog footers + consistent dialog title */
.mud-dialog .mud-dialog-actions {
    position: sticky;
    bottom: 0;
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-table-lines);
    z-index: 2;
    padding: 12px 24px !important;
}
.mud-dialog .mud-dialog-title {
    border-bottom: 1px solid var(--mud-palette-table-lines);
}
/* Mobile tables: tighter cards */
@@media (max-width: 600px) {
    .mud-table.mud-table-responsive .mud-table-row {
        border: 1px solid var(--mud-palette-table-lines);
        border-radius: 12px;
        margin-bottom: 12px;
    }
}
