:root,
html.vs-light {
    --vs-bg: #f4f7fc;
    --vs-surface: #ffffff;
    --vs-primary: #1e88e5;
    --vs-primary-dark: #1565c0;
    --vs-primary-soft: rgba(30, 136, 229, 0.12);
    --vs-accent: #546e7a;
    --vs-text: #1a237e;
    --vs-muted: #546e7a;
    --vs-border: #e3eaf3;
    --vs-shadow: 0 8px 28px rgba(21, 101, 192, 0.08);
    --vs-table-head: #f8fafc;
    --vs-input-bg: #ffffff;
    --vs-login-card: rgba(255, 255, 255, 0.96);
    --vs-login-shell: radial-gradient(circle at 18% 18%, rgba(30, 136, 229, 0.22), transparent 42%),
        radial-gradient(circle at 82% 12%, rgba(21, 101, 192, 0.14), transparent 38%),
        linear-gradient(165deg, #f4f7fc 0%, #e8f1fb 48%, #dceaf8 100%);
    --vs-font: "Vazirmatn FD", "Vazirmatn", Tahoma, sans-serif;
    --vs-fs: 0.9375rem;
    --vs-fs-sm: 0.875rem;
    --vs-fs-xs: 0.8125rem;
    --vs-table-select-width: 13.5rem;
}

html.vs-dark {
    --vs-bg: #0b1220;
    --vs-surface: #111827;
    --vs-primary: #64b5f6;
    --vs-primary-dark: #90caf9;
    --vs-primary-soft: rgba(100, 181, 246, 0.16);
    --vs-accent: #90a4ae;
    --vs-text: #e2e8f0;
    --vs-muted: #94a3b8;
    --vs-border: #1e293b;
    --vs-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
    --vs-table-head: #0f172a;
    --vs-input-bg: #0f172a;
    --vs-login-card: rgba(17, 24, 39, 0.96);
    --vs-login-shell: radial-gradient(circle at 18% 18%, rgba(100, 181, 246, 0.18), transparent 42%),
        radial-gradient(circle at 82% 12%, rgba(30, 136, 229, 0.12), transparent 38%),
        linear-gradient(165deg, #0b1220 0%, #0f172a 48%, #111827 100%);
    color-scheme: dark;
}

html, body {
    font-family: var(--vs-font);
    font-size: 15px;
    background: var(--vs-bg);
    color: var(--vs-text);
    margin: 0;
    min-height: 100%;
    direction: rtl;
    text-align: right;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

*,
*::before,
*::after {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    user-select: none !important;
}

/* Editable fields still need caret/selection for typing */
input:not(:disabled):not([readonly]),
textarea:not(:disabled):not([readonly]),
[contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    user-select: text !important;
}

.mud-typography,
.mud-input,
.mud-button-root,
.mud-table,
.mud-nav-link,
.mud-input-label,
.mud-picker,
.mud-list-item,
.mud-chip,
input, textarea, select, button {
    font-family: var(--vs-font) !important;
}

/* Align MudAlert message with form/body text size */
.mud-alert .mud-alert-message {
    font-family: var(--vs-font) !important;
    font-size: var(--vs-fs) !important;
    line-height: 1.5 !important;
}

/* —— Shell —— */
.vs-appbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.vs-appbar-title {
    font-weight: 600 !important;
    font-size: 1.05rem !important;
    letter-spacing: -0.01em;
}

.vs-appbar-user {
    opacity: 0.92;
    font-size: var(--vs-fs-sm) !important;
}

.mud-layout {
    background: var(--vs-bg) !important;
    min-height: 100vh;
}

.vs-drawer {
    border-left: 1px solid var(--vs-border) !important;
    border-right: none !important;
    background: var(--vs-surface) !important;
    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow-x: hidden !important;
}

.vs-drawer .mud-drawer-content,
.vs-nav-menu {
    overflow-x: hidden !important;
    max-width: 100%;
    box-sizing: border-box;
}

.vs-drawer-brand {
    padding: 0.85rem 1rem 0.65rem;
    border-bottom: 1px solid var(--vs-border);
    margin-bottom: 0.25rem;
}

.vs-drawer-brand-text {
    color: var(--vs-primary-dark) !important;
    font-weight: 700 !important;
    font-size: var(--vs-fs-sm) !important;
}

.vs-main {
    background: var(--vs-bg);
    min-height: calc(100vh - 48px);
}

/*
 * Mud utility pa-4 wipes MudBlazor's AppBar offset. Dense AppBar
 * paints at 3/4 of --mud-appbar-height; add the same gap used under
 * .page-title so space above the title matches space below it.
 */
.mud-main-content.vs-main {
    padding-top: calc(var(--mud-appbar-height, 64px) * 0.75 + var(--vs-page-gap, 0.85rem)) !important;
}

.mud-nav-link {
    border-radius: 10px !important;
    margin: 0.1rem 0.35rem !important;
    padding-inline: 0.55rem !important;
    font-size: var(--vs-fs-sm) !important;
    min-height: 36px !important;
    max-width: calc(100% - 0.7rem);
    overflow: hidden !important;
    box-sizing: border-box;
}

.mud-nav-link .mud-nav-link-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mud-nav-link.active {
    background: var(--vs-primary-soft) !important;
    color: var(--vs-primary-dark) !important;
}

.mud-nav-group {
    margin-bottom: 0.25rem;
    max-width: 100%;
    overflow: hidden;
}

.mud-nav-group .mud-nav-group-button {
    font-weight: 600 !important;
    color: var(--vs-muted) !important;
    font-size: var(--vs-fs-xs) !important;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mud-nav-group .mud-collapse-wrapper,
.mud-nav-group .mud-nav-group-button {
    box-sizing: border-box;
}

/* —— Surfaces —— */
.mud-paper {
    border: 1px solid var(--vs-border) !important;
    box-shadow: var(--vs-shadow) !important;
    background: var(--vs-surface) !important;
}

/* —— Tables —— */
.mud-table,
.mud-simple-table {
    font-size: var(--vs-fs-sm) !important;
}

.mud-table-container,
.mud-simple-table {
    overflow-x: auto;
}

/* Clickable rows: pointer (OnRowClick / SelectOnRowClick / RowHref) */
.mud-table-row-clickable,
.mud-table .mud-table-body .mud-table-row.mud-table-row-clickable,
.mud-table .mud-table-body .mud-table-row:has(a.mud-table-row-link),
.mud-table .mud-table-body .mud-table-row:has(.mud-checkbox),
.vs-pick-list-item {
    cursor: pointer !important;
}

/* Hover background only for clickable rows — non-clickable tables stay flat */
.mud-table-hover .mud-table-body .mud-table-row:hover,
.mud-table-hover .mud-table-container table tbody tr:hover,
.mud-simple-table.mud-table-hover tbody tr:hover {
    background-color: transparent !important;
}

.mud-table-hover .mud-table-body .mud-table-row.mud-table-row-clickable:hover,
.mud-table-hover .mud-table-body .mud-table-row:has(a.mud-table-row-link):hover,
.mud-table-hover .mud-table-body .mud-table-row:has(.mud-checkbox):hover {
    background-color: var(--mud-palette-table-hover) !important;
}

/* Row actions kebab menu */
.vs-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.vs-row-actions-menu .mud-button-root,
.vs-row-actions .mud-icon-button {
    color: var(--vs-muted) !important;
}

.vs-row-actions-menu .mud-button-root:hover,
.vs-row-actions .mud-icon-button:hover {
    color: var(--vs-primary) !important;
    background: var(--vs-primary-soft) !important;
}

/* Counts/info cells that must not look or act like row actions */
.mud-table .vs-no-row-action,
.mud-table .vs-no-row-action:hover {
    cursor: default !important;
    color: inherit !important;
    background: transparent !important;
}

.mud-menu-item .mud-menu-item-icon,
.mud-popover .mud-menu-item .mud-icon-root {
    margin-inline-end: 0.5rem;
    margin-inline-start: 0;
}

.mud-popover .mud-list {
    direction: rtl;
    text-align: right;
    min-width: var(--vs-table-select-width, 13.5rem);
    max-width: none;
}

/*
 * Select/menu scroll: Mud list already has overflow-y:auto + max-height:inherit.
 * Setting only overflow-x:hidden on .mud-popover forces overflow-y:auto too (CSS),
 * which stacks a second vertical scrollbar. Keep scroll on the list only.
 */
.mud-popover {
    overflow-x: hidden !important;
    overflow-y: hidden !important;
}

.mud-popover .mud-list,
.mud-popover .mud-select-list,
.mud-popover .mud-menu-list {
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

.mud-popover .mud-list-item,
.mud-popover .mud-menu-item {
    overflow: hidden;
    max-width: 100%;
}

.mud-popover .mud-list-item .mud-list-item-text,
.mud-popover .mud-list-item .mud-typography,
.mud-popover .mud-menu-item .mud-menu-item-content {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

@media (max-width: 960px) {
    .mud-sm-table .mud-table-body .mud-table-row.mud-table-row-clickable,
    .mud-xs-table .mud-table-body .mud-table-row.mud-table-row-clickable,
    .mud-md-table .mud-table-body .mud-table-row.mud-table-row-clickable {
        cursor: pointer !important;
    }
}

/* Desktop / wide: classic centered table */
@media (min-width: 961px) {
    .mud-table thead .mud-table-cell,
    .mud-simple-table thead th,
    .mud-simple-table th {
        background: var(--vs-table-head) !important;
        color: var(--vs-muted) !important;
        font-weight: 600 !important;
        border-bottom: 1px solid var(--vs-border) !important;
        text-align: center !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
        font-size: var(--vs-fs-xs) !important;
    }

    .mud-table .mud-table-cell,
    .mud-simple-table td {
        border-bottom-color: var(--vs-border) !important;
        text-align: center !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
        font-size: var(--vs-fs-sm) !important;
    }

    /* Keep selects/inputs centered under their column headers */
    .mud-table .mud-table-body .mud-table-cell .mud-input-control {
        width: min(100%, var(--vs-table-select-width)) !important;
        max-width: var(--vs-table-select-width) !important;
        margin-inline: auto !important;
        display: block !important;
    }
}

/*
 * Mobile cards:
 * MudBlazor Breakpoint.Sm adds .mud-sm-table always; stacked layout CSS
 * is media-scoped to max-width 960px. Mirror that here for xs/sm/md.
 */
@media (max-width: 960px) {
    .mud-xs-table .mud-table-container,
    .mud-sm-table .mud-table-container,
    .mud-md-table .mud-table-container {
        overflow-x: hidden !important;
    }

    .mud-xs-table .mud-table-head,
    .mud-xs-table .mud-table-head .mud-table-row,
    .mud-xs-table .mud-table-foot,
    .mud-xs-table .mud-table-foot .mud-table-row,
    .mud-xs-table colgroup,
    .mud-sm-table .mud-table-head,
    .mud-sm-table .mud-table-head .mud-table-row,
    .mud-sm-table .mud-table-foot,
    .mud-sm-table .mud-table-foot .mud-table-row,
    .mud-sm-table colgroup,
    .mud-md-table .mud-table-head,
    .mud-md-table .mud-table-head .mud-table-row,
    .mud-md-table .mud-table-foot,
    .mud-md-table .mud-table-foot .mud-table-row,
    .mud-md-table colgroup {
        display: none !important;
    }

    .mud-xs-table .mud-table-body,
    .mud-sm-table .mud-table-body,
    .mud-md-table .mud-table-body {
        border-top: none !important;
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
        padding: 0.15rem 0 0.35rem;
    }

    .mud-xs-table .mud-table-body .mud-table-row,
    .mud-sm-table .mud-table-body .mud-table-row,
    .mud-md-table .mud-table-body .mud-table-row {
        display: block !important;
        margin: 0 !important;
        border: 1px solid var(--vs-border) !important;
        border-radius: 12px !important;
        background: var(--vs-surface) !important;
        box-shadow: var(--vs-shadow);
        overflow: hidden;
    }

    .mud-xs-table .mud-table-body .mud-table-cell,
    .mud-sm-table .mud-table-body .mud-table-cell,
    .mud-md-table .mud-table-body .mud-table-cell {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0.75rem !important;
        direction: rtl !important;
        text-align: right !important;
        white-space: normal !important;
        border: none !important;
        border-bottom: 1px solid var(--vs-border) !important;
        padding: 0.55rem 0.85rem !important;
        min-height: 40px;
        color: var(--vs-text) !important;
        font-size: var(--vs-fs-sm) !important;
    }

    .mud-xs-table .mud-table-body .mud-table-row .mud-table-cell:last-child,
    .mud-sm-table .mud-table-body .mud-table-row .mud-table-cell:last-child,
    .mud-md-table .mud-table-body .mud-table-row .mud-table-cell:last-child {
        border-bottom: none !important;
    }

    .mud-xs-table .mud-table-body .mud-table-cell:before,
    .mud-sm-table .mud-table-body .mud-table-cell:before,
    .mud-md-table .mud-table-body .mud-table-cell:before {
        content: attr(data-label) !important;
        color: var(--vs-muted) !important;
        font-weight: 600 !important;
        font-size: var(--vs-fs-xs) !important;
        flex: 0 0 auto;
        max-width: 42%;
        padding: 0 !important;
        margin: 0 !important;
        text-align: right !important;
    }

    .mud-xs-table .mud-table-body .mud-table-cell:not([data-label]):before,
    .mud-xs-table .mud-table-body .mud-table-cell[data-label=""]:before,
    .mud-sm-table .mud-table-body .mud-table-cell:not([data-label]):before,
    .mud-sm-table .mud-table-body .mud-table-cell[data-label=""]:before,
    .mud-md-table .mud-table-body .mud-table-cell:not([data-label]):before,
    .mud-md-table .mud-table-body .mud-table-cell[data-label=""]:before {
        content: none !important;
        display: none !important;
    }

    .mud-xs-table .mud-table-body .mud-table-cell:not([data-label]),
    .mud-xs-table .mud-table-body .mud-table-cell[data-label=""],
    .mud-sm-table .mud-table-body .mud-table-cell:not([data-label]),
    .mud-sm-table .mud-table-body .mud-table-cell[data-label=""],
    .mud-md-table .mud-table-body .mud-table-cell:not([data-label]),
    .mud-md-table .mud-table-body .mud-table-cell[data-label=""] {
        justify-content: flex-start !important;
    }

    .mud-xs-table .mud-table-body .mud-table-cell .mud-input-control,
    .mud-sm-table .mud-table-body .mud-table-cell .mud-input-control,
    .mud-md-table .mud-table-body .mud-table-cell .mud-input-control {
        width: min(100%, 220px);
        max-width: 100%;
    }

    .mud-xs-table .mud-table-pagination,
    .mud-sm-table .mud-table-pagination,
    .mud-md-table .mud-table-pagination {
        direction: rtl;
    }
}

/* —— Compact inputs / buttons / pickers —— */
.mud-input-control {
    margin-top: 2px !important;
}

.mud-input-label,
.mud-input-control .mud-input-label,
label.mud-input-label {
    font-size: var(--vs-fs-xs) !important;
}

/* Read-only derived fields (e.g. admission vehicle kind): no click, not-allowed cursor */
.vs-readonly-kind,
.vs-readonly-kind .mud-input-control-input-container,
.vs-readonly-kind .mud-input,
.vs-readonly-kind input,
.vs-readonly-kind .mud-input-slot {
    cursor: not-allowed !important;
}

.vs-readonly-kind .mud-input,
.vs-readonly-kind input,
.vs-readonly-kind .mud-input-slot {
    pointer-events: none !important;
}

/*
 * Required asterisk (*): MudBlazor draws it via ::after on the label/legend.
 * Default label overflow:hidden + our RTL notch shrink clips it — keep visible
 * and tint it with the error color so required fields are obvious.
 */
.mud-input-control.mud-input-required > .mud-input-control-input-container > .mud-input-label {
    overflow: visible !important;
    max-width: calc(100% - 8px) !important;
}

.mud-input-control.mud-input-required > .mud-input-control-input-container > .mud-input-label::after,
.mud-input-control.mud-input-required > .mud-input-control-input-container .mud-input-outlined-border > legend::after {
    content: "*" !important;
    color: var(--mud-palette-error, #e53935) !important;
    margin-inline-start: 0.2em;
    font-weight: 700;
    padding-inline-start: 1px;
}

.mud-input-control.mud-input-required .mud-input-outlined-border > legend {
    padding-inline-end: 10px !important;
}

/*
 * Outlined floating label (RTL):
 * Keep MudBlazor's animated absolute label (so focus/blur both animate).
 * Nudge the shrunk position so text sits centered in the right-side notch.
 * Legend stays invisible and only cuts the border gap on the right.
 */
.mud-input.mud-input-outlined .mud-input-outlined-border {
    justify-content: flex-start !important;
}

.mud-input.mud-input-outlined.mud-shrink > .mud-input-outlined-border legend,
.mud-input.mud-input-outlined:focus-within > .mud-input-outlined-border legend,
.mud-input.mud-input-outlined:has(input:not(:placeholder-shown)) > .mud-input-outlined-border legend,
.mud-input.mud-input-outlined:has(textarea:not(:placeholder-shown)) > .mud-input-outlined-border legend,
.mud-input.mud-input-outlined:has(:-webkit-autofill) > .mud-input-outlined-border legend {
    /* keep notch on the right; slightly balanced padding for the gap */
    margin: 0 !important;
    margin-inline-start: 12px !important;
    margin-inline-end: auto !important;
    padding: 0 8px !important;
    flex: 0 0 auto !important;
    width: auto !important;
}


/* Same 200ms curve MudBlazor uses — ensure focus path is not overridden */
.mud-input-label.mud-input-label-animated {
    transition:
        color 200ms cubic-bezier(0, 0, 0.2, 1),
        transform 200ms cubic-bezier(0, 0, 0.2, 1),
        max-width 200ms cubic-bezier(0, 0, 0.2, 1) !important;
}

/*
 * Default Mud RTL shrink is translate(-14px,-6px) scale(0.75) which sits
 * too far toward the outer edge of the notch; shift left so text is centered in the gap.
 *
 * Also pin the label up whenever the field has a value via :not(:placeholder-shown).
 * That avoids the blur flash where Blazor briefly drops mud-shrink before re-applying it.
 */
.mud-application-layout-rtl .mud-shrink ~ label.mud-input-label.mud-input-label-outlined,
.mud-application-layout-rtl .mud-input:focus-within ~ label.mud-input-label.mud-input-label-outlined,
.mud-application-layout-rtl .mud-input:has(input:not(:placeholder-shown)) ~ label.mud-input-label.mud-input-label-outlined,
.mud-application-layout-rtl .mud-input:has(textarea:not(:placeholder-shown)) ~ label.mud-input-label.mud-input-label-outlined,
.mud-application-layout-rtl .mud-input:has(:-webkit-autofill) ~ label.mud-input-label.mud-input-label-outlined {
    transform: translate(-22px, -6px) scale(0.75) !important;
    transform-origin: top right !important;
}

/* Filled fields: never animate transform (blocks any residual down/up hop on blur) */
.mud-application-layout-rtl .mud-input:has(input:not(:placeholder-shown)) ~ label.mud-input-label-animated,
.mud-application-layout-rtl .mud-input:has(textarea:not(:placeholder-shown)) ~ label.mud-input-label-animated,
.mud-application-layout-rtl .mud-shrink:not(:focus-within) ~ label.mud-input-label-animated {
    transition:
        color 200ms cubic-bezier(0, 0, 0.2, 1),
        max-width 200ms cubic-bezier(0, 0, 0.2, 1) !important;
}

.mud-input-helper-text,
.mud-input-error,
.mud-input-control .mud-input-helper-text {
    font-family: var(--vs-font) !important;
    font-size: var(--vs-fs-xs) !important;
    text-align: right !important;
    direction: rtl;
}

/*
 * Keep sibling inputs aligned when one shows an error/helper line:
 * reserve space under the field and place the message absolutely.
 */
.mud-input-control:not(.mud-input-control-boolean-input):not(:has(textarea)) {
    position: relative;
    padding-bottom: 1.2rem !important;
    margin-bottom: 0.15rem !important;
}

.mud-input-control:not(.mud-input-control-boolean-input):not(:has(textarea)) > .mud-input-control-input-container {
    margin-bottom: 0 !important;
}

.mud-input-control:not(:has(textarea)) .mud-input-helper-text {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    margin: 0 !important;
    line-height: 1.25 !important;
    min-height: 1.15rem;
}

/* Date mask must stay LTR so ____/__/__ is not visually reversed in RTL */
.vs-date-picker .mud-input input,
.vs-date-picker .mud-input-slot,
.mud-input-control.vs-date-picker input,
.mud-picker-input input {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: isolate;
}

/* Fully numeric / code fields: type and display LTR */
.mud-input-control.mud-input-number-control .mud-input > input,
.mud-input-control.mud-input-number-control .mud-input-slot,
.vs-ltr-input .mud-input > input,
.vs-ltr-input .mud-input-slot,
.vs-ltr-input input.mud-input-root {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: isolate;
}

/*
 * Unify single-line outlined input height to dense (match compact description fields).
 * Multiline description/textarea keeps its own sizing.
 */
.mud-input.mud-input-outlined:not(:has(textarea)) {
    min-height: 40px !important;
}

.mud-input.mud-input-outlined:not(:has(textarea)) > input.mud-input-root,
.mud-input.mud-input-outlined:not(:has(textarea)) .mud-input-slot,
.mud-input.mud-input-outlined:not(:has(textarea)) .mud-select-input {
    padding-top: 8.5px !important;
    padding-bottom: 8.5px !important;
    min-height: 1.35em !important;
    height: 40px !important;
    box-sizing: border-box !important;
}

.mud-input.mud-input-outlined:not(:has(textarea)) .mud-input-adornment {
    height: 40px !important;
    margin: 0 !important;
}

.mud-input-control:has(textarea).vs-desc-field,
.mud-input-control:has(textarea) {
    padding-bottom: 0.25rem !important;
}

/* Soft open/close for menus / popovers (override MudBlazor's 0ms close) */
.mud-popover {
    transform-origin: top center;
    transition:
        opacity 200ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 220ms cubic-bezier(0.22, 1, 0.36, 1) !important;
    transform: scale(0.92) translateY(-6px);
}

.mud-popover.mud-popover-open {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.mud-popover:not(.mud-popover-open) {
    transition-duration: 160ms !important;
    transition-delay: 0ms !important;
    opacity: 0;
    transform: scale(0.94) translateY(-4px);
}

.vs-row-actions-menu + .mud-popover,
.mud-popover:has(.mud-menu-list) {
    border-radius: 10px !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
}

/*
 * Filter toolbars (MudStack Row → d-flex in MudBlazor 9):
 * drop the form error gutter so AlignItems.Center lines buttons
 * up with the outlined field, not the reserved helper space.
 */
.mud-paper > .d-flex.flex-row.align-center,
.mud-paper > .mud-stack.mud-stack-row,
.vs-toolbar {
    align-items: center !important;
}

/* Include nested pickers/selects (not only direct children) so buttons line up with the field box */
.mud-paper > .d-flex.flex-row.align-center .mud-input-control:not(:has(textarea)),
.mud-paper > .mud-stack.mud-stack-row .mud-input-control:not(:has(textarea)),
.vs-toolbar .mud-input-control:not(:has(textarea)) {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

.mud-paper > .d-flex.flex-row.align-center .mud-input-control:not(:has(textarea)) .mud-input-helper-text,
.mud-paper > .mud-stack.mud-stack-row .mud-input-control:not(:has(textarea)) .mud-input-helper-text,
.vs-toolbar .mud-input-control:not(:has(textarea)) .mud-input-helper-text {
    position: static;
    min-height: 0;
}

.mud-paper > .d-flex.flex-row.align-center > .mud-button-root,
.mud-paper > .mud-stack.mud-stack-row > .mud-button-root,
.vs-toolbar > .mud-button-root {
    align-self: center !important;
    height: 40px !important;
    min-height: 40px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.mud-input.mud-input-outlined .mud-input-outlined-border {
    border-color: var(--vs-border) !important;
}

.mud-input:focus-within.mud-input-outlined .mud-input-outlined-border,
.mud-input-outlined:focus-within .mud-input-outlined-border {
    border-color: var(--vs-primary) !important;
}

.mud-input > input,
.mud-input textarea,
.mud-select .mud-select-input,
.mud-input-slot {
    text-align: right !important;
    direction: rtl !important;
    font-size: var(--vs-fs-sm) !important;
    min-height: 1.6em !important;
}

.mud-input.mud-input-outlined {
    font-size: var(--vs-fs-sm) !important;
    background-color: var(--vs-input-bg) !important;
    border-radius: 4px;
}

.mud-tabs .mud-tabs-panels,
.mud-tabpanels {
    background: transparent !important;
}

.vs-result-cell {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    width: max-content;
    max-width: 100%;
}

.vs-result-cell .vs-table-select {
    flex: 0 0 var(--vs-table-select-width);
    width: var(--vs-table-select-width);
    max-width: 100%;
}

.vs-reject-row {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    width: max-content;
    max-width: 100%;
}

.vs-reject-row .vs-reject-reason {
    flex: 0 1 180px;
    width: 180px;
    max-width: 100%;
    min-width: 0;
}

.vs-reject-row .mud-button-root {
    flex: 0 0 auto;
    align-self: center;
    height: 40px !important;
    min-height: 40px !important;
    margin-top: 0 !important;
}

/* Unify select / input / list-item density */
.mud-input-control.mud-select,
.mud-select {
    font-size: var(--vs-fs-sm) !important;
}

.mud-popover .mud-list-item,
.mud-list-item {
    min-height: 36px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    font-size: var(--vs-fs-sm) !important;
}

.mud-popover .mud-list-item .mud-list-item-text,
.mud-popover .mud-typography {
    font-size: var(--vs-fs-sm) !important;
    line-height: 1.35 !important;
}

/* Compact admission pick list (replaces MultiSelection tables) */
.vs-pick-list-wrap {
    width: 100%;
}

.vs-pick-list-label {
    font-size: var(--vs-fs-sm);
    color: var(--vs-muted);
    margin-bottom: 0.35rem;
    text-align: right;
}

.vs-pick-list-label-required::after {
    content: "*";
    color: var(--mud-palette-error, #e53935);
    margin-inline-start: 0.2em;
    font-weight: 700;
}

.vs-pick-list {
    border: 1px solid var(--vs-border);
    border-radius: 10px;
    background: var(--vs-input-bg);
    max-height: 220px;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.vs-pick-list-empty {
    padding: 0.65rem 0.75rem;
    color: var(--vs-muted);
    font-size: var(--vs-fs-sm);
    text-align: right;
}

.vs-pick-list-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 36px;
    margin: 0;
    padding: 0.2rem 0.65rem;
    border: 0;
    border-bottom: 1px solid var(--vs-border);
    background: transparent;
    color: var(--vs-text);
    font-family: var(--vs-font);
    font-size: var(--vs-fs-sm);
    text-align: right;
    direction: rtl;
    cursor: pointer;
    box-sizing: border-box;
}

.vs-pick-list-item:last-child {
    border-bottom: 0;
}

.vs-pick-list-item:hover {
    background: var(--vs-primary-soft);
}

.vs-pick-list-item.is-selected {
    background: var(--vs-primary-soft);
}

.vs-pick-list-check {
    display: inline-flex;
    color: var(--vs-primary);
    flex: 0 0 auto;
}

.vs-pick-list-num,
.vs-pick-list-plate {
    flex: 0 1 auto;
    white-space: nowrap;
}

.vs-pick-list-plate {
    color: var(--vs-muted);
}

.vs-pick-list-stage {
    margin-inline-start: auto;
    flex: 0 0 auto;
}

.vs-pick-list-stage .stage-chip {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
}

.mud-input.mud-input-text {
    padding-top: 10px !important;
    padding-bottom: 6px !important;
}

.mud-button-root {
    font-size: var(--vs-fs-sm) !important;
    text-transform: none !important;
    min-height: 36px !important;
}

/*
 * Disabled controls: not-allowed cursor only on the control itself.
 * Native/Mud disabled blocks the action; suppress ripple/press so
 * there is no symbolic click. Do NOT set cursor on parents (:has)
 * — that made empty layout space show not-allowed.
 */
.mud-disabled,
.mud-button-root:disabled,
.mud-button-root[disabled],
.mud-button-root.mud-disabled,
.mud-icon-button:disabled,
.mud-icon-button[disabled],
.mud-icon-button.mud-disabled,
.mud-fab:disabled,
.mud-fab.mud-disabled,
.mud-nav-link.mud-disabled,
button:disabled,
button[disabled],
input:disabled,
textarea:disabled,
select:disabled,
.mud-input-control.mud-disabled,
.mud-input-control:has(input:disabled),
.mud-input-control:has(textarea:disabled),
.mud-select.mud-disabled,
.mud-picker.mud-disabled,
.mud-checkbox.mud-disabled,
.mud-checkbox:has(input:disabled),
.mud-checkbox.mud-disabled *,
.mud-checkbox:has(input:disabled) *,
.vs-not-allowed,
.vs-not-allowed * {
    cursor: not-allowed !important;
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Buttons still receive hover for cursor, but ignore press feedback */
.mud-button-root:disabled,
.mud-button-root[disabled],
.mud-button-root.mud-disabled,
.mud-icon-button:disabled,
.mud-icon-button[disabled],
.mud-icon-button.mud-disabled,
.mud-fab:disabled,
.mud-fab.mud-disabled,
button:disabled,
button[disabled] {
    pointer-events: auto !important;
}

.mud-disabled:active,
.mud-disabled:focus,
.mud-disabled:focus-visible,
.mud-button-root:disabled:active,
.mud-button-root:disabled:focus,
.mud-button-root[disabled]:active,
.mud-button-root[disabled]:focus,
.mud-button-root.mud-disabled:active,
.mud-button-root.mud-disabled:focus,
button:disabled:active,
button[disabled]:active {
    background-image: none !important;
    transform: none !important;
    filter: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.mud-disabled .mud-ripple,
.mud-button-root:disabled .mud-ripple,
.mud-button-root[disabled] .mud-ripple,
.mud-button-root.mud-disabled .mud-ripple,
.mud-icon-button.mud-disabled .mud-ripple,
button:disabled .mud-ripple,
.mud-button-root:disabled .mud-button-label,
.mud-button-root.mud-disabled .mud-button-label {
    pointer-events: none !important;
}

.mud-disabled .mud-ripple,
.mud-button-root:disabled .mud-ripple,
.mud-button-root[disabled] .mud-ripple,
.mud-button-root.mud-disabled .mud-ripple,
.mud-icon-button.mud-disabled .mud-ripple,
button:disabled .mud-ripple {
    display: none !important;
    animation: none !important;
}

/* Disabled inputs/selects: no interaction at all */
input:disabled,
textarea:disabled,
select:disabled,
.mud-input-control.mud-disabled,
.mud-input-control:has(input:disabled),
.mud-input-control:has(textarea:disabled),
.mud-select.mud-disabled,
.mud-picker.mud-disabled,
.mud-nav-link.mud-disabled {
    pointer-events: none !important;
}

#components-reconnect-modal,
#components-reconnect-modal button {
    font-family: var(--vs-font) !important;
    direction: rtl;
    text-align: center;
}

#components-reconnect-modal {
    font-size: var(--vs-fs) !important;
    outline: none !important;
}

#components-reconnect-modal:focus,
#components-reconnect-modal:focus-visible {
    outline: none !important;
}

.mud-button-filled,
.mud-button-outlined,
.mud-button-text {
    padding-inline: 0.85rem !important;
}

.mud-icon-button {
    padding: 6px !important;
}

/*
 * Numeric spin buttons: global .mud-icon-button padding makes them too tall
 * and the down chevron spills below the outlined input. Keep them compact
 * and clipped inside the field.
 */
.mud-input-control.mud-input-number-control .mud-input {
    overflow: hidden;
}

.mud-input-control.mud-input-number-control .mud-input-numeric-spin {
    top: 2px !important;
    bottom: 2px !important;
    max-height: calc(100% - 4px);
    overflow: hidden;
    justify-content: center !important;
    gap: 0;
    z-index: 1;
}

/* Keep spin buttons on the RIGHT even in RTL (MudBlazor moves them left by default) */
.mud-application-layout-rtl .mud-input-control.mud-input-number-control .mud-input-numeric-spin {
    left: auto !important;
    right: 0 !important;
}

.mud-application-layout-rtl .mud-input-control.mud-input-number-control .mud-input > input,
.mud-application-layout-rtl .mud-input-control.mud-input-number-control .mud-input-slot {
    padding-inline-end: 28px !important;
    padding-inline-start: 12px !important;
}

.mud-input-control.mud-input-number-control .mud-input-numeric-spin .mud-button-root,
.mud-input-control.mud-input-number-control .mud-input-numeric-spin .mud-icon-button {
    padding: 0 !important;
    min-height: 0 !important;
    height: 16px !important;
    width: 22px !important;
    line-height: 1 !important;
}

.mud-input-control.mud-input-number-control .mud-input-numeric-spin .mud-icon-root,
.mud-input-control.mud-input-number-control .mud-input-numeric-spin .mud-svg-icon {
    font-size: 1rem !important;
    width: 1rem !important;
    height: 1rem !important;
}

.mud-input-adornment-start {
    margin-left: 0 !important;
    margin-right: 6px !important;
}

.mud-input-adornment-end {
    margin-right: 0 !important;
    margin-left: 6px !important;
}

/* Date picker / calendar — no blue year toolbar */
.mud-picker-toolbar,
.mud-picker .mud-picker-toolbar,
.mud-popover .mud-picker-toolbar {
    display: none !important;
}

.mud-picker,
.mud-picker-content,
.mud-picker-calendar-header,
.mud-picker-calendar-header-transition,
.mud-day,
.mud-picker-year,
.mud-picker-month {
    font-family: var(--vs-font) !important;
    font-size: var(--vs-fs-sm) !important;
}

.mud-picker-calendar-header-day,
.mud-picker-calendar-header-year,
.mud-picker-calendar-header .mud-button-root {
    font-size: var(--vs-fs-sm) !important;
}

.mud-picker .mud-button-year,
.mud-picker .mud-typography {
    font-size: var(--vs-fs-sm) !important;
}

/* Calendar popup RTL; weekday letters (ش ی د …) stay aligned over day numbers */
.mud-picker,
.mud-picker-content,
.mud-picker-calendar-container,
.mud-picker-calendar-header,
.mud-picker-calendar-header-switch,
.mud-picker-calendar-header-day,
.mud-picker-calendar,
.mud-picker-month-container,
.mud-picker-year-container {
    direction: rtl !important;
}

.mud-picker-calendar-header-day,
.mud-picker-calendar {
    display: grid !important;
    grid-template-columns: repeat(7, 40px) !important;
    justify-content: center !important;
    justify-items: center !important;
    width: 280px !important;
    max-width: 100%;
    box-sizing: border-box !important;
}

.mud-picker-calendar-header-day {
    max-height: none !important;
    margin-bottom: 4px;
}

.mud-picker-calendar-header-day .mud-day-label,
.mud-picker-calendar .mud-day {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 36px !important;
    margin: 0 2px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: var(--vs-fs-xs) !important;
    line-height: 1 !important;
}

.mud-picker-calendar-header-transition {
    font-size: 0.9rem !important;
}

/* —— Login / AccessDenied —— */
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    direction: rtl;
    background: var(--vs-login-shell);
    padding: 1.5rem;
}

.login-card {
    width: min(400px, 100%);
    background: var(--vs-login-card);
    border: 1px solid var(--vs-border);
    border-radius: 16px;
    padding: 1.65rem;
    box-shadow: var(--vs-shadow);
    text-align: right;
    direction: rtl;
}

.login-label {
    display: block;
    font-size: var(--vs-fs-xs);
    font-weight: 600;
    color: var(--vs-muted);
    margin-bottom: 0.3rem;
    text-align: right;
}

.login-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--vs-border);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    font-family: var(--vs-font);
    font-size: var(--vs-fs-sm);
    color: var(--vs-text);
    background: var(--vs-input-bg);
    text-align: left;
    direction: ltr;
    unicode-bidi: isolate;
}

.login-input:focus {
    outline: 2px solid rgba(30, 136, 229, 0.4);
    border-color: var(--vs-primary);
}

.login-btn {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    background: var(--vs-primary);
    color: #fff;
    font-family: var(--vs-font);
    font-size: var(--vs-fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background 160ms ease;
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.login-btn:hover:not(:disabled) {
    background: var(--vs-primary-dark);
}

.login-error {
    margin: 0.85rem 0 0;
    color: #c62828;
    font-size: var(--vs-fs-sm);
    font-weight: 600;
    text-align: right;
}

.brand-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--vs-primary-dark);
    margin: 0 0 0.3rem;
    text-align: right;
}

.brand-sub {
    color: var(--vs-muted);
    margin: 0 0 1.15rem;
    font-size: var(--vs-fs-sm);
    text-align: right;
}

.vs-status-detail {
    margin-bottom: 1.15rem;
}

.vs-trace-id {
    display: inline-block;
    direction: ltr;
    unicode-bidi: isolate;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    word-break: break-all;
    color: var(--vs-text);
    background: var(--vs-primary-soft);
    border-radius: 6px;
    padding: 0.15rem 0.4rem;
}

/* Wide enough for longest option («در انتظار بازدید») + chevron */
.vs-table-select {
    width: var(--vs-table-select-width) !important;
    min-width: var(--vs-table-select-width) !important;
    max-width: 100%;
}

.vs-table-select .mud-input,
.vs-table-select .mud-select-input,
.vs-table-select input.mud-select-input {
    white-space: nowrap !important;
}

/* Select popover: match field width; never clip option text */
.mud-popover:has(.mud-select-list) {
    min-width: var(--vs-table-select-width) !important;
    width: max(var(--vs-table-select-width), max-content) !important;
}

.mud-popover .mud-select-list .mud-list-item,
.mud-popover .mud-select-list .mud-list-item .mud-list-item-text,
.mud-popover .mud-select-list .mud-list-item .mud-typography {
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: nowrap !important;
    max-width: none !important;
}

/* Table inputs: drop reserved helper padding so the field box centers with row text */
.mud-table .mud-table-body .mud-table-cell .mud-input-control:not(:has(textarea)),
.vs-table-select.mud-input-control:not(:has(textarea)) {
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    vertical-align: middle;
}

.mud-table .mud-table-body .mud-table-cell .mud-input-control:not(:has(textarea)) .mud-input-helper-text,
.vs-table-select.mud-input-control:not(:has(textarea)) .mud-input-helper-text {
    position: static;
    min-height: 0;
}

.mud-table .mud-table-body .mud-table-cell {
    vertical-align: middle !important;
}

.page-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 var(--vs-page-gap, 0.85rem);
    color: var(--vs-text);
    letter-spacing: -0.01em;
}

/*
 * Blazor FocusOnNavigate focuses h1 after each route change and leaves a black
 * outline until the user clicks elsewhere. Hide mouse/programmatic rings; keep
 * keyboard :focus-visible for accessibility.
 */
:focus:not(:focus-visible) {
    outline: none !important;
}

.page-title:focus,
.page-title:focus-visible,
h1:focus,
h1:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.stage-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    color: #fff;
    font-size: var(--vs-fs-xs);
    font-weight: 600;
    white-space: nowrap;
}

.proxy-warn {
    background: #fff8e8;
    color: #8a6d1d;
    border: 1px solid #f0e0a8;
    border-radius: 8px;
    padding: 0.3rem 0.55rem;
    font-size: var(--vs-fs-xs);
}

.mud-table-row.vs-proxy-warn-row,
.mud-table-row.vs-proxy-warn-row > .mud-table-cell {
    background: #fff8e1 !important;
}

.workflow-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.workflow-item {
    border: 1px solid var(--vs-border);
    border-radius: 10px;
    padding: 0.45rem 0.75rem;
    background: #eceff1;
    color: #455a64;
    text-align: center;
    font-size: var(--vs-fs-xs);
    line-height: 1.35;
}

.workflow-item.done,
.workflow-item.active {
    border-color: transparent;
    background: var(--wf-bg, var(--vs-primary)) !important;
    color: #fff !important;
    font-weight: 600;
}

.mud-main-content {
    max-width: 100%;
    overflow-x: hidden;
}

.mud-snackbar-content-message {
    font-size: var(--vs-fs-sm) !important;
    font-family: var(--vs-font) !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em;
}

/* Snackbar: bottom-center, 10px from edge — no hover pause/restore */
.mud-snackbar-container.mud-snackbar-location-bottom-center,
.mud-snackbar-location-bottom-center {
    bottom: 10px !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    transform: translateX(-50%) !important;
    pointer-events: none !important;
}

@keyframes vs-snackbar-in {
    from {
        opacity: 0;
        transform: translateY(22px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes vs-snackbar-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
}

.mud-snackbar {
    pointer-events: none !important; /* body ignores hover so hide timer is not paused */
    border-radius: 14px !important;
    min-width: min(420px, calc(100vw - 32px)) !important;
    max-width: min(520px, calc(100vw - 24px)) !important;
    padding: 0.55rem 1rem !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 10px 28px rgba(15, 23, 42, 0.14),
        0 2px 8px rgba(15, 23, 42, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
}

/* Only the close (X) action is clickable */
.mud-snackbar .mud-snackbar-content-action,
.mud-snackbar .mud-snackbar-content-action button,
.mud-snackbar .mud-snackbar-content-action .mud-button-root,
.mud-snackbar .mud-snackbar-content-action .mud-icon-button {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.mud-snackbar .mud-snackbar-content {
    align-items: center !important;
}

.mud-snackbar .mud-snackbar-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    margin-inline-end: 0.15rem;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

.mud-snackbar .mud-snackbar-icon .mud-icon-root {
    font-size: 1.45rem !important;
}

@keyframes vs-snack-icon-success {
    0% { transform: scale(0.55) rotate(-12deg); opacity: 0; }
    55% { transform: scale(1.18) rotate(4deg); opacity: 1; }
    75% { transform: scale(0.94) rotate(-2deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes vs-snack-icon-error {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-3px) rotate(-6deg); }
    40% { transform: translateX(3px) rotate(6deg); }
    60% { transform: translateX(-2px) rotate(-3deg); }
    80% { transform: translateX(2px) rotate(3deg); }
}

@keyframes vs-snack-icon-warning {
    0%, 100% { transform: translateY(0) scale(1); }
    35% { transform: translateY(-3px) scale(1.08); }
    70% { transform: translateY(1px) scale(0.96); }
}

@keyframes vs-snack-icon-info {
    0% { transform: scale(0.7); opacity: 0.4; }
    50% { transform: scale(1.12); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.mud-snackbar.mud-alert-filled-success .mud-snackbar-icon {
    animation: vs-snack-icon-success 650ms cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

.mud-snackbar.mud-alert-filled-error .mud-snackbar-icon {
    animation: vs-snack-icon-error 520ms ease-in-out both;
}

.mud-snackbar.mud-alert-filled-warning .mud-snackbar-icon {
    animation: vs-snack-icon-warning 700ms ease-in-out both;
}

.mud-snackbar.mud-alert-filled-info .mud-snackbar-icon,
.mud-snackbar.mud-alert-filled-normal .mud-snackbar-icon {
    animation: vs-snack-icon-info 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mud-snackbar.mud-alert-filled-success {
    background: linear-gradient(135deg, #1faa74 0%, #2bb88a 55%, #3ccf9a 100%) !important;
    color: #f4fff9 !important;
}

.mud-snackbar.mud-alert-filled-error {
    background: linear-gradient(135deg, #e35d6a 0%, #ef6b78 55%, #f4848f 100%) !important;
    color: #fff7f8 !important;
}

.mud-snackbar.mud-alert-filled-warning {
    background: linear-gradient(135deg, #e6a23c 0%, #f0b429 55%, #f7c948 100%) !important;
    color: #3b2f12 !important;
}

.mud-snackbar.mud-alert-filled-info,
.mud-snackbar.mud-alert-filled-normal {
    background: linear-gradient(135deg, #3b82c4 0%, #4f94d4 55%, #6aade8 100%) !important;
    color: #f3f9ff !important;
}

html.vs-dark .mud-snackbar.mud-alert-filled-success {
    background: linear-gradient(135deg, #147a55 0%, #1b9470 100%) !important;
}

html.vs-dark .mud-snackbar.mud-alert-filled-error {
    background: linear-gradient(135deg, #b83d4a 0%, #d45563 100%) !important;
}

html.vs-dark .mud-snackbar.mud-alert-filled-warning {
    background: linear-gradient(135deg, #c48722 0%, #d9a12e 100%) !important;
    color: #1f1808 !important;
}

html.vs-dark .mud-snackbar.mud-alert-filled-info,
html.vs-dark .mud-snackbar.mud-alert-filled-normal {
    background: linear-gradient(135deg, #2a6aa3 0%, #3d82bd 100%) !important;
}

/*
 * Override MudBlazor's opacity-only keyframes (inline animation name is dynamic).
 * Showing: animation + non-zero opacity → slide up.
 * Hiding: animation + opacity 0 → reverse slide.
 */
.mud-snackbar[style*="animation"]:not([style*="opacity: 0;"]):not([style*="opacity:0;"]) {
    animation: vs-snackbar-in 450ms cubic-bezier(0.22, 1, 0.36, 1) both !important;
}

.mud-snackbar[style*="opacity: 0;"][style*="animation"],
.mud-snackbar[style*="opacity:0;"][style*="animation"] {
    animation: vs-snackbar-out 1500ms cubic-bezier(0.4, 0, 0.2, 1) both !important;
}

/* —— File upload zone —— */
.vs-upload {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
}

.vs-upload-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1.35rem 1rem 1.15rem;
    border: 1.5px dashed color-mix(in srgb, var(--vs-primary) 45%, var(--vs-border));
    border-radius: 14px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--vs-primary) 6%, var(--vs-surface)) 0%, var(--vs-surface) 100%);
    cursor: pointer;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
    text-align: center;
}

.vs-upload-drop:hover {
    border-color: var(--vs-primary);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--vs-primary) 14%, transparent);
}

.vs-upload-drop-icon {
    color: var(--vs-primary);
    opacity: 0.9;
    line-height: 0;
}

.vs-upload-drop-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--vs-text);
}

.vs-upload-drop-hint {
    font-size: var(--vs-fs-xs);
    color: var(--vs-muted);
    max-width: 36rem;
    line-height: 1.5;
}

.vs-upload-drop-btn {
    margin-top: 0.35rem;
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: var(--vs-primary-soft);
    color: var(--vs-primary-dark);
    font-size: var(--vs-fs-xs);
    font-weight: 600;
}

.vs-upload-native {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.vs-upload-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 0.75rem;
}

.vs-upload-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: var(--vs-surface);
    border: 1px solid var(--vs-border);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.vs-upload-thumb {
    width: 100%;
    height: 112px;
    background: color-mix(in srgb, var(--vs-primary) 7%, var(--vs-table-head));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.vs-upload-thumb img,
.vs-upload-thumb video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #0f172a08;
}

.vs-upload-file-icon {
    font-size: 2.4rem !important;
    color: var(--vs-primary);
    opacity: 0.85;
}

.vs-upload-meta {
    padding: 0.45rem 0.55rem 0.55rem;
    min-height: 3.1rem;
    text-align: left;
    direction: ltr;
}

.vs-upload-name {
    font-size: var(--vs-fs-xs);
    font-weight: 600;
    color: var(--vs-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.vs-upload-size {
    font-size: 0.72rem;
    color: var(--vs-muted);
    margin-top: 0.1rem;
    text-align: left;
}

.vs-upload-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
}

.vs-upload-footer .vs-upload-desc {
    flex: 1 1 220px;
    min-width: 0;
}

/* Drop helper gutter so the button centers on the outlined box */
.vs-upload-footer .mud-input-control:not(:has(textarea)) {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

.vs-upload-footer .mud-input-control:not(:has(textarea)) .mud-input-helper-text {
    position: static;
    min-height: 0;
}

.vs-upload-footer .vs-upload-submit,
.vs-upload-footer .mud-button-root {
    flex: 0 0 auto;
    align-self: center !important;
    height: 40px !important;
    min-height: 40px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.vs-upload-remove {
    position: absolute;
    top: 6px;
    inset-inline-start: 6px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    backdrop-filter: blur(4px);
    transition: background 150ms ease;
}

.vs-upload-remove:hover {
    background: rgba(220, 60, 70, 0.92);
}

@media (max-width: 960px) {
    .page-title {
        font-size: 1rem;
    }

    .mud-main-content.vs-main {
        padding-inline: 0.75rem !important;
        padding-bottom: 0.75rem !important;
        padding-top: calc(var(--mud-appbar-height, 64px) * 0.75 + var(--vs-page-gap, 0.85rem)) !important;
    }

    .login-card {
        padding: 1.15rem;
    }

    /* Filter / action toolbars stack cleanly on tablet & phone (not invoice line rows) */
    .mud-paper > .mud-stack.mud-stack-row:not(.vs-invoice-line-row) {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.65rem !important;
    }

    .mud-paper > .mud-stack.mud-stack-row:not(.vs-invoice-line-row) > * {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .mud-paper > .mud-stack.mud-stack-row:not(.vs-invoice-line-row) .mud-button-root {
        width: 100%;
        justify-content: center;
    }

    .vs-appbar-title {
        font-size: 0.92rem !important;
        max-width: 46vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .vs-appbar-user {
        display: none !important;
    }
}

@media (max-width: 600px) {
    .mud-simple-table {
        font-size: var(--vs-fs-xs) !important;
    }

    .workflow-grid {
        grid-template-columns: 1fr 1fr;
    }

    .mud-xs-table .mud-table-body .mud-table-cell,
    .mud-sm-table .mud-table-body .mud-table-cell,
    .mud-md-table .mud-table-body .mud-table-cell {
        padding: 0.5rem 0.75rem !important;
    }
}

/* —— Theme toggle —— */
.vs-theme-toggle {
    --tt-w: 52px;
    --tt-h: 28px;
    border: 0;
    padding: 0;
    margin-inline: 0.35rem;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.vs-theme-toggle-track {
    width: var(--tt-w);
    height: var(--tt-h);
    border-radius: 999px;
    position: relative;
    display: block;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
    transition: background 320ms ease, border-color 320ms ease;
}

.vs-theme-toggle.is-dark .vs-theme-toggle-track {
    background: rgba(100, 181, 246, 0.22);
    border-color: rgba(100, 181, 246, 0.35);
}

.vs-theme-toggle-thumb {
    position: absolute;
    top: 2px;
    inset-inline-start: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    color: #1565c0;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), background 280ms ease, color 280ms ease;
}

.vs-theme-toggle.is-dark .vs-theme-toggle-thumb {
    /* RTL: thumb starts at inline-start (right) and slides left */
    transform: translateX(calc(-1 * (var(--tt-w) - 26px)));
    background: #0f172a;
    color: #90caf9;
}

.vs-theme-toggle .mud-icon-root {
    font-size: 14px !important;
}

.vs-empty-theme-slot {
    position: fixed;
    top: 0.85rem;
    inset-inline-start: 0.85rem;
    z-index: 20;
}

.vs-empty-theme-slot .vs-theme-toggle-track {
    background: var(--vs-primary-soft);
    border-color: var(--vs-border);
}

.vs-empty-theme-slot .vs-theme-toggle-thumb {
    background: var(--vs-surface);
    color: var(--vs-primary);
}

html.vs-dark .proxy-warn {
    background: #3d2e0a;
    color: #f0d78c;
    border-color: #6b5420;
}

html.vs-dark .login-error {
    color: #ef9a9a;
}

html.vs-theme-animating,
html.vs-theme-animating body,
html.vs-theme-animating .vs-main,
html.vs-theme-animating .mud-paper,
html.vs-theme-animating .login-shell,
html.vs-theme-animating .login-card {
    transition: background-color 480ms ease, color 420ms ease, border-color 420ms ease, box-shadow 420ms ease !important;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

::view-transition-old(root) {
    z-index: 1;
}

::view-transition-new(root) {
    z-index: 2;
}

/* Invoice line row: one baseline, no stretched tall fields */
.vs-invoice-line-row.mud-stack-row,
.vs-invoice-line-row {
    align-items: center !important;
}

.vs-invoice-line-row > .mud-select,
.vs-invoice-line-row > .mud-input-control {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.vs-invoice-line-row > .mud-select .mud-input-control,
.vs-invoice-line-row .mud-input-control:not(:has(textarea)) {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.vs-invoice-line-row .mud-input-helper-text {
    position: absolute !important;
    inset-inline: 0;
    bottom: -1.05rem;
    min-height: 0;
    margin: 0 !important;
}

.vs-invoice-line-row > .vs-invoice-amount {
    flex: 0 0 180px !important;
    width: 180px !important;
    min-width: 180px !important;
}

.vs-invoice-line-row > .vs-invoice-desc {
    flex: 1 1 180px !important;
    min-width: 160px !important;
    width: auto !important;
}

.vs-invoice-line-row > .mud-button-root {
    flex: 0 0 auto !important;
    align-self: center !important;
    margin-top: 0 !important;
    width: auto !important;
}

/* Invoice footer: actions vertically centered with totals box */
.vs-invoice-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.85rem;
}

.vs-invoice-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

/* Invoice live totals */
.vs-invoice-totals {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: min(100%, 16rem);
    max-width: 28rem;
    margin-inline-start: auto;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: color-mix(in srgb, var(--vs-primary) 6%, var(--vs-surface));
    border: 1px solid var(--vs-border);
}

@media (max-width: 960px) {
    .vs-invoice-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .vs-invoice-actions {
        width: 100%;
        align-items: stretch;
    }

    .vs-invoice-actions .mud-stack {
        width: 100%;
    }

    .vs-invoice-actions .mud-button-root {
        width: 100%;
        justify-content: center;
    }

    .vs-invoice-totals {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-inline: 0 !important;
        box-sizing: border-box;
    }
}

.vs-invoice-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: var(--vs-fs-sm);
    color: var(--vs-muted);
}

.vs-invoice-total-row strong {
    color: var(--vs-text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.vs-invoice-total-final {
    margin-top: 0.15rem;
    padding-top: 0.55rem;
    border-top: 1px dashed var(--vs-border);
    color: var(--vs-text);
    font-size: 0.95rem;
}

.vs-invoice-total-final strong {
    color: var(--vs-primary-dark);
    font-size: 1.05rem;
}

/* —— Iranian license plate field (match Mud outlined inputs) —— */
.ir-plate-field {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 2px 0 2.25px;
    position: relative;
    z-index: 0;
    font-family: var(--vs-font);
}

.ir-plate-field.ir-plate-field-inline {
    width: 100%;
    margin-top: 0;
}

.ir-plate-field.ir-plate-field-inline .ir-plate {
    width: 100%;
    display: grid !important;
    /* Stretch like sibling Mud outlined fields in the same grid column */
    grid-template-columns: 2.5rem minmax(2.8rem, 1.05fr) 2.6rem minmax(3.6rem, 1.35fr) 3.4rem;
}

.ir-plate-field .ir-plate {
    display: inline-grid !important;
    grid-template-columns: 2.35rem 3.1rem 2.5rem 4.1rem 3.35rem;
    grid-template-rows: 40px;
    align-items: stretch;
    justify-content: start;
    width: max-content;
    max-width: 100%;
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
    border-radius: var(--mud-default-borderradius, 10px);
    overflow: hidden;
    background: var(--vs-input-bg, #fff);
    /* Idle: same 1px as Mud outlined. Focus uses outline so size never jumps. */
    border: 1px solid var(--vs-border, #e3eaf3) !important;
    outline: 1px solid transparent;
    outline-offset: -1px;
    box-shadow: none !important;
    font-family: var(--vs-font);
    direction: ltr !important;
    unicode-bidi: isolate;
    transition: outline-color 0.15s ease, border-color 0.15s ease;
}

.mud-application-layout-rtl .ir-plate-field .ir-plate,
.mud-rtl .ir-plate-field .ir-plate {
    direction: ltr !important;
}

/* Match Mud focus color/weight without changing width/height */
.ir-plate-field .ir-plate:focus-within {
    border-color: var(--mud-palette-primary, var(--vs-primary, #1e88e5)) !important;
    outline-color: var(--mud-palette-primary, var(--vs-primary, #1e88e5));
}

.ir-plate-field .ir-plate-blue {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 0.22rem 0.1rem 0.16rem;
    background: #0a3b8c;
    color: #fff;
    pointer-events: none;
    box-sizing: border-box;
}

.ir-plate-field .ir-plate-flag {
    display: block;
    width: 1.35rem;
    height: auto;
    aspect-ratio: 28 / 16;
    object-fit: cover;
    object-position: center;
    border-radius: 1px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
    background: #fff;
}

.ir-plate-field .ir-plate-ir {
    font-size: 0.32rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.05;
    text-align: center;
    font-family: Tahoma, Arial, sans-serif;
}

.ir-plate-field .ir-plate-cell {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    margin: 0;
    padding: 0;
    background: var(--vs-input-bg, #fff);
    border-left: 1px solid var(--vs-border, #e3eaf3);
    cursor: text;
    min-width: 0;
    position: relative;
    box-sizing: border-box;
}

.ir-plate-field .ir-plate-cell-letter {
    cursor: pointer;
    overflow: hidden;
    align-items: center;
    justify-content: center;
}

.ir-plate-field .ir-plate-cell-region {
    border-left: 1.5px solid var(--vs-text, #1a237e);
    padding: 0;
    gap: 0;
    justify-content: stretch;
    align-items: stretch;
}

/* "ایران" overlays the top; the region input fills the whole cell so any click types */
.ir-plate-field .ir-plate-iran {
    position: absolute;
    top: 2px;
    left: 0;
    right: 0;
    z-index: 1;
    display: block;
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--vs-text, #1a237e);
    line-height: 1;
    text-align: center;
    pointer-events: none;
    user-select: none;
    margin: 0;
}

.ir-plate-field .ir-plate-input {
    display: block !important;
    box-sizing: border-box;
    width: 100% !important;
    flex: 1 1 auto;
    align-self: stretch;
    min-height: 100%;
    height: 100% !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--vs-text, #1a237e) !important;
    font-weight: 400;
    font-family: var(--vs-font) !important;
    font-size: var(--vs-fs) !important;
    line-height: 1.2 !important;
    text-align: center;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    -moz-appearance: textfield;
    appearance: none;
    direction: ltr;
    unicode-bidi: isolate;
    position: relative;
    z-index: 2;
    pointer-events: auto;
    cursor: text;
}

/* Letter cell: wrapper + MudSelect must fill the cell (Mud .mud-select is position:relative) */
.ir-plate-field .ir-plate-cell-letter > .mud-select {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 2;
}

.ir-plate-field .ir-plate-letter-select {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 2;
    overflow: hidden;
}

.ir-plate-field .ir-plate-letter-select.mud-input-control,
.ir-plate-field .ir-plate-letter-select .mud-input-control,
.ir-plate-field .ir-plate-letter-select .mud-input-control-input-container,
.ir-plate-field .ir-plate-letter-select .mud-input {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    padding-bottom: 0 !important;
    background: transparent !important;
}

.ir-plate-field .ir-plate-letter-select .mud-input-underline,
.ir-plate-field .ir-plate-letter-select .mud-input-outlined-border,
.ir-plate-field .ir-plate-letter-select .mud-input-helper-text,
.ir-plate-field .ir-plate-letter-select .mud-input-control-helper-container,
.ir-plate-field .ir-plate-letter-select label {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ir-plate-field .ir-plate-letter-select .mud-input-adornment {
    display: none !important;
}

.ir-plate-field .ir-plate-letter-select .mud-select-input,
.ir-plate-field .ir-plate-letter-select input {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    text-align: center !important;
    direction: ltr !important;
    line-height: 38px !important;
    font-family: var(--vs-font) !important;
    font-size: var(--vs-fs) !important;
    font-weight: 400 !important;
    color: var(--vs-text, #1a237e) !important;
    cursor: pointer !important;
}

.ir-plate-field .ir-plate-input-region,
.ir-plate-field .ir-plate-cell-region .ir-plate-input {
    position: absolute !important;
    inset: 0 !important;
    z-index: 2;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    flex: none !important;
    font-size: var(--vs-fs-sm) !important;
    /* Leave room under the ایران overlay so digits sit in the lower half */
    padding: 0.85rem 0.1rem 0.1rem !important;
    box-sizing: border-box !important;
}

.ir-plate-field .ir-plate-input::placeholder {
    color: var(--vs-muted, #546e7a) !important;
    font-weight: 400;
    opacity: 0.55;
}

.ir-plate-field .ir-plate-letter.ir-plate-letter-empty {
    color: transparent !important;
}

.ir-plate-field .ir-plate-ph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--vs-fs);
    font-weight: 400;
    color: var(--vs-muted, #546e7a);
    opacity: 0.55;
    pointer-events: none;
    z-index: 1;
    line-height: 1;
}

.ir-plate-field .ir-plate-cell:focus-within .ir-plate-ph {
    opacity: 0.3;
}

.ir-plate-field .ir-plate-input::-webkit-outer-spin-button,
.ir-plate-field .ir-plate-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ir-plate-field-invalid .ir-plate {
    border-color: var(--mud-palette-error, #e53935) !important;
    outline-color: transparent;
}

.ir-plate-field-invalid .ir-plate:focus-within {
    border-color: var(--mud-palette-error, #e53935) !important;
    outline-color: var(--mud-palette-error, #e53935);
}

/* Letter picker: center every glyph (س / ص are wider and looked left-biased) */
.mud-popover.ir-plate-letter-popover,
.mud-popover:has(.ir-plate-letter-list) {
    min-width: 3.25rem !important;
}

.ir-plate-letter-list.mud-list,
.mud-popover .ir-plate-letter-list {
    padding: 0.15rem 0 !important;
    min-width: 3.25rem !important;
}

.mud-popover .ir-plate-letter-list .mud-list-item {
    min-height: 2rem !important;
    padding: 0.15rem 0 !important;
    margin: 0 !important;
    justify-content: center !important;
}

.mud-popover .ir-plate-letter-list .mud-list-item .mud-list-item-content,
.mud-popover .ir-plate-letter-list .mud-list-item .mud-list-item-text,
.mud-popover .ir-plate-letter-list .mud-list-item .mud-typography {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    direction: ltr !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    padding-inline: 0 !important;
}

.mud-popover .ir-plate-letter-list .mud-list-item .mud-list-item-icon,
.mud-popover .ir-plate-letter-list .mud-list-item .mud-ripple {
    display: none !important;
}

.ir-plate-letter-option {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    min-width: 1.5rem;
    text-align: center;
    direction: ltr;
    unicode-bidi: isolate;
    font-family: var(--vs-font) !important;
    font-size: var(--vs-fs) !important;
    line-height: 1 !important;
    margin: 0 auto;
}

.ir-plate-error {
    margin-top: 0.2rem;
    font-size: var(--vs-fs-xs);
    font-weight: 400;
    color: var(--mud-palette-error, #e53935);
    line-height: 1.3;
}

html.vs-dark .ir-plate-field .ir-plate {
    border-color: var(--vs-border);
    background: var(--vs-input-bg);
}

html.vs-dark .ir-plate-field .ir-plate-cell {
    background: var(--vs-input-bg);
    border-left-color: var(--vs-border);
}

html.vs-dark .ir-plate-field .ir-plate-cell-region {
    border-left-color: var(--vs-text);
}

html.vs-dark .ir-plate-field .ir-plate-input,
html.vs-dark .ir-plate-field .ir-plate-letter,
html.vs-dark .ir-plate-field .ir-plate-iran {
    color: var(--vs-text) !important;
}

html.vs-dark .ir-plate-field .ir-plate-input::placeholder,
html.vs-dark .ir-plate-field .ir-plate-ph {
    color: var(--vs-muted) !important;
}

@media (max-width: 600px) {
    .ir-plate-field {
        width: 100%;
    }

    .ir-plate-field .ir-plate {
        width: 100%;
        display: grid !important;
        grid-template-columns: 2.2rem minmax(2.6rem, 1fr) 2.2rem minmax(3.4rem, 1.3fr) 3rem;
        height: 40px;
        grid-template-rows: 40px;
    }
}

@media print {
    .mud-drawer, .mud-appbar, .no-print, .vs-theme-toggle, .vs-empty-theme-slot { display: none !important; }
}
