/* Vazirmatn — bundled in wwwroot/fonts (SIL OFL; github.com/rastikerdar/vazirmatn) */
@font-face {
    font-family: Vazirmatn;
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/vazirmatn/Vazirmatn-Regular.woff2") format("woff2");
}

@font-face {
    font-family: Vazirmatn;
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/fonts/vazirmatn/Vazirmatn-Bold.woff2") format("woff2");
}

:root {
    --table-row-stripe: #e3effa;
    --table-row-reception-started-alt: #6ec5e8;
    --table-row-reception-done-alt: #7edc7e;
    --table-row-footer: #eaf3fb;
}

html, body {
    margin: 0;
    font-family: Vazirmatn, Tahoma, sans-serif;
    max-width: 100%;
    overflow-x: clip;
}

.cat-page.report-page,
.pat-page {
    width: 100%;
    max-width: min(900px, 100%);
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .pat-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .pat-toolbar > div,
    .pat-toolbar > button {
        width: 100%;
        box-sizing: border-box;
    }

    .pat-toolbar input {
        width: 100%;
        box-sizing: border-box;
    }

    .pat-toolbar .cat-btn {
        width: 100%;
        text-align: center;
        padding: 0.5rem 0.85rem;
    }
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #f8fafc 0%, #f3f6fa 50%, #eef2f7 100%);
}

.login-card {
    width: min(380px, 100%);
    padding: 32px 28px 28px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    text-align: right;
    box-shadow: 0 4px 24px rgba(16, 36, 64, 0.06);
}

.login-card h1 {
    margin: 0 0 6px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #102a4a;
}

.login-brand {
    margin: 0 0 22px;
    font-size: 0.88rem;
    color: #64748b;
    font-weight: 600;
}

.login-card label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
}

.login-card input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 14px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 1rem;
    border: 1px solid #d5dee8;
    border-radius: 8px;
    background: #fafbfc;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-card input:focus {
    outline: none;
    border-color: #7aa8d4;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 168, 0.14);
}

.login-card input.login-ltr-input {
    direction: ltr;
    text-align: left;
}

.login-card .login-password-wrap {
    position: relative;
    margin-bottom: 14px;
}

.login-card .login-password-wrap input.login-password-input {
    margin-bottom: 0;
    padding-right: 2.6rem;
    padding-left: 12px;
}

.login-password-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 4px;
    left: auto;
    width: 2.25rem;
    height: 2.25rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    color: #64748b;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.login-password-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    display: block;
}

.login-password-toggle .login-pw-icon-hide {
    display: none;
}

.login-password-toggle[aria-pressed="true"] .login-pw-icon-show {
    display: none;
}

.login-password-toggle[aria-pressed="true"] .login-pw-icon-hide {
    display: block;
}

.login-password-toggle:hover {
    color: #1e4d7b;
    background: #f1f5f9;
}

.login-password-toggle:focus-visible {
    outline: 2px solid #7aa8d4;
    outline-offset: 1px;
}

.login-card button[type="submit"] {
    width: 100%;
    margin-top: 4px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border: 0;
    border-radius: 8px;
    background: #2563a8;
    color: #fff;
    box-shadow: 0 1px 2px rgba(16, 42, 74, 0.12);
    transition: background 0.15s ease;
}

.login-card button[type="submit"]:hover:not(:disabled) {
    background: #1e4d7b;
}

.login-card button[type="submit"]:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.login-error {
    margin: 0 0 14px;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

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;
}

/* Zebra striping — tables in app content and shared modals */
main table tbody tr:nth-child(odd),
.psm-results table tbody tr:nth-child(odd),
.search-results table tbody tr:nth-child(odd) {
    background-color: #fff;
}

main table tbody tr:nth-child(even),
.psm-results table tbody tr:nth-child(even),
.search-results table tbody tr:nth-child(even) {
    background-color: var(--table-row-stripe);
}

main table tbody tr.row-waiting:nth-child(odd) {
    background-color: #fff;
}

main table tbody tr.row-waiting:nth-child(even) {
    background-color: var(--table-row-stripe);
}

main table tbody tr.row-started:nth-child(odd) {
    background-color: #87ceeb;
}

main table tbody tr.row-started:nth-child(even) {
    background-color: var(--table-row-reception-started-alt);
}

main table tbody tr.row-done:nth-child(odd) {
    background-color: #90ee90;
}

main table tbody tr.row-done:nth-child(even) {
    background-color: var(--table-row-reception-done-alt);
}

main table tfoot tr {
    background-color: var(--table-row-footer);
}

/* Status messages stay visible when user scrolls to buttons lower on the page */
main .cat-alert,
main .alert[role="alert"],
.visit-board > .alert[role="alert"] {
    position: sticky;
    top: 6rem;
    z-index: 35;
    margin-top: 0.65rem;
    margin-bottom: 0.65rem;
    box-shadow: 0 2px 10px rgba(16, 42, 74, 0.14);
}

/* پنل پزشک: پیام بالای فرم نباید sticky باشد (روی نوار ابزار و کارت بیمار می‌افتاد) */
.doctor-page .alert[role="alert"] {
    position: static;
    z-index: auto;
    box-shadow: none;
}

/* گردش مالی: grips are injected by vpGridResize.js (not scoped) */
table.vp-grid thead th {
    position: relative;
    overflow: visible;
}
table.vp-grid .vp-col-resize {
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: 12px;
    cursor: col-resize;
    z-index: 10;
    touch-action: none;
}
table.vp-grid .vp-col-resize:hover {
    background: rgba(255, 255, 255, 0.15);
}
table.vp-grid .vp-col-resize::after {
    content: "";
    position: absolute;
    top: 20%;
    bottom: 20%;
    inset-inline-start: 4px;
    width: 1px;
    background: rgba(255, 255, 255, 0.5);
}
table.mo-report-grid thead th.mo-col-drag-header {
    cursor: grab;
}

table.mo-report-grid.mo-col-dragging thead th.mo-col-drag-header {
    cursor: grabbing;
}

body.mo-col-dragging {
    cursor: grabbing !important;
}

body.vp-col-resizing {
    cursor: col-resize !important;
    user-select: none;
}

.clinic-mode-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}
.clinic-mode-row label {
    flex: 1 1 12rem;
}
.clinic-mode-row select {
    min-width: 8rem;
    font-family: inherit;
}
.field-required::after {
    content: " *";
    color: #b00020;
    font-weight: 700;
}

/* Sortable report column headers */
.report-th-sortable {
    padding: 0;
    vertical-align: middle;
}
.report-th-sort-btn {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem;
    width: 100%;
    padding: 0.45rem;
    color: inherit;
    font: inherit;
    text-align: right;
}
.report-th-sort-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}
.report-th-sortable.is-active .report-th-sort-btn {
    font-weight: 700;
}
.report-sort-arrow {
    font-size: 0.65rem;
    opacity: 0.9;
    line-height: 1;
}

/* Async work — overlay when page/modal sets mo-page-is-busy / mo-modal-is-busy */
.mo-page-is-busy,
.mo-modal-is-busy {
    position: relative;
    min-height: 6rem;
}

.mo-busy-wait[hidden] {
    display: none !important;
}

.mo-busy-wait {
    position: absolute;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(243, 245, 248, 0.72);
    backdrop-filter: blur(1px);
    border-radius: inherit;
    pointer-events: all;
}

.mo-busy-wait-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 1rem;
    background: #fff;
    border: 1px solid #c5d0dc;
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(16, 42, 74, 0.12);
    color: #102a4a;
    font-size: 0.92rem;
    font-weight: 600;
}

.mo-busy-wait--viewport {
    position: fixed;
    inset: 0;
    z-index: 2500;
    background: rgba(16, 42, 74, 0.42);
    backdrop-filter: blur(4px);
    border-radius: 0;
}

.mo-busy-wait-card--progress {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    min-width: min(22rem, calc(100vw - 2.5rem));
    padding: 1.1rem 1.25rem 1rem;
    font-size: 1rem;
}

.mo-busy-wait-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.mo-busy-wait-progress-step {
    margin: 0;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e4d7b;
}

.mo-busy-wait-progress-track {
    height: 0.5rem;
    border-radius: 999px;
    background: #dce4ee;
    overflow: hidden;
}

.mo-busy-wait-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1e4d7b, #2d6ba8);
    transition: width 0.25s ease;
}

.mo-busy-wait-spinner {
    width: 1.35rem;
    height: 1.35rem;
    border: 2px solid #c5d0dc;
    border-top-color: #1e4d7b;
    border-radius: 50%;
    animation: mo-busy-spin 0.75s linear infinite;
    flex-shrink: 0;
}

@keyframes mo-busy-spin {
    to {
        transform: rotate(360deg);
    }
}

.mo-auth-wait {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 12rem;
    margin: 2rem auto;
    max-width: 520px;
}

.login-card {
    position: relative;
}

.login-card .mo-busy-wait {
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
}