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;
}
/* EasyPOS invoice numeric UX: user types quantities manually, no browser spinner arrows. */
input.no-spin::-webkit-outer-spin-button,
input.no-spin::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input.no-spin[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.invoice-qty-input {
    min-width: 120px;
    font-size: 1rem;
    font-weight: 600;
    padding-left: .5rem;
    padding-right: .5rem;
}

.invoice-wide-number {
    min-width: 120px;
}

.invoice-product-select {
    min-width: 340px;
}

/* Biz365 responsive UI helpers */
*, *::before, *::after {
    box-sizing: border-box;
}

img, svg, canvas, video {
    max-width: 100%;
    height: auto;
}

.table-responsive,
.responsive-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }

    .content {
        padding-top: .85rem;
    }

    h1 {
        font-size: 1.45rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3, h4 {
        font-size: 1.1rem;
    }

    .content .card,
    .content .shadow-sm,
    .content .border.rounded,
    .content .border.rounded-3 {
        max-width: 100%;
    }

    .content .row {
        --bs-gutter-x: .75rem;
        --bs-gutter-y: .75rem;
    }

    .content .btn,
    .content button,
    .content .form-control,
    .content .form-select,
    .content input,
    .content select,
    .content textarea {
        max-width: 100%;
    }

    .content .btn-group,
    .content .btn-toolbar {
        flex-wrap: wrap;
        gap: .35rem;
    }

    .content table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .content table th,
    .content table td {
        white-space: nowrap;
        vertical-align: middle;
    }

    .content .table {
        margin-bottom: 0;
    }

    .modal-dialog {
        max-width: calc(100vw - 1rem);
        margin: .5rem auto;
    }

    .modal-content {
        max-height: calc(100dvh - 1rem);
        overflow-y: auto;
    }

    .invoice-product-select {
        min-width: 240px;
    }

    .invoice-qty-input,
    .invoice-wide-number {
        min-width: 100px;
    }

    .d-flex.gap-2,
    .d-flex.gap-3,
    .d-flex.justify-content-between,
    .d-flex.align-items-center.justify-content-between {
        flex-wrap: wrap;
    }
}

@media (max-width: 576px) {
    .content .card-body,
    .content .card-header,
    .content .card-footer {
        padding: .75rem;
    }

    .content .btn {
        white-space: normal;
    }

    .content .form-label {
        margin-bottom: .25rem;
        font-size: .9rem;
    }
}

/* Compact invoice entry rows after 01-06 mobile/form-space update */
.invoice-qty-input {
    min-width: 78px;
}

.invoice-unit-box {
    min-width: 122px;
}

.invoice-wide-number {
    min-width: 105px;
}

@media (max-width: 768px) {
    .invoice-qty-input {
        min-width: 82px;
    }

    .invoice-unit-box {
        min-width: 130px;
    }
}

.biz365-image-preview {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #d0d7de;
    background: #fff;
}

.biz365-list-thumb {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #d0d7de;
    background: #fff;
}

.biz365-detail-image {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #d0d7de;
    background: #fff;
}

.biz365-code-group .btn {
    min-width: 42px;
}

.biz365-image-viewer {
    min-height: 142px;
}

.biz365-image-form-preview {
    width: 128px;
    height: 128px;
    max-width: 100%;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #d0d7de;
    background: #fff;
}

.biz365-image-paste {
    min-height: 142px;
    cursor: text;
}

.biz365-image-paste:focus {
    outline: 2px solid rgba(13, 110, 253, 0.25);
    border-color: #86b7fe !important;
}

.biz365-camera-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.biz365-camera-modal {
    width: min(720px, 100%);
    max-height: calc(100vh - 2rem);
    background: #111827;
    color: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.biz365-camera-header,
.biz365-camera-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.biz365-camera-video {
    display: block;
    width: 100%;
    max-height: calc(100vh - 180px);
    background: #000;
    object-fit: contain;
}

@media (max-width: 576px) {
    .biz365-image-form-preview {
        width: 108px;
        height: 108px;
    }

    .biz365-image-viewer,
    .biz365-image-paste {
        min-height: 120px;
    }

    .biz365-camera-footer {
        flex-direction: column-reverse;
    }

    .biz365-camera-footer .btn {
        width: 100%;
    }
}

.biz365-image-processing {
    min-height: 128px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.biz365-list-thumb-button {
    border: 0;
    background: transparent;
    padding: 0;
    line-height: 0;
    cursor: pointer;
}

.biz365-list-thumb-button:hover .biz365-list-thumb {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.18);
}

.biz365-image-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: rgba(0, 0, 0, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.biz365-image-viewer-modal {
    width: min(720px, 100%);
    max-height: calc(100vh - 2rem);
    background: #111827;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
}

.biz365-image-viewer-header {
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.biz365-image-viewer-body {
    background: #fff;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.biz365-image-viewer-body img {
    width: min(512px, 100%);
    height: auto;
    max-height: calc(100vh - 150px);
    object-fit: contain;
    border-radius: 12px;
}

/* Biz365 report print helper: when browser print is used directly, print only the report area. */
@media print {
    body:has(.biz365-report-print-area) .no-print,
    body:has(.biz365-report-print-area) nav,
    body:has(.biz365-report-print-area) aside,
    body:has(.biz365-report-print-area) .sidebar,
    body:has(.biz365-report-print-area) .top-row,
    body:has(.biz365-report-print-area) .navbar,
    body:has(.biz365-report-print-area) .navbar-toggler,
    body:has(.biz365-report-print-area) .nav-scrollable {
        display: none !important;
    }

    body:has(.biz365-report-print-area) .content,
    body:has(.biz365-report-print-area) main {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .biz365-report-print-area {
        width: 100% !important;
        background: #fff !important;
        color: #111 !important;
    }
}

/* Biz365 Sales Invoice compact modern entry update */
.sales-page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .18rem .55rem;
    border: 1px solid #dbe5f2;
    border-radius: 9px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    gap: .5rem;
    flex-wrap: wrap;
    min-height: 34px;
}

.sales-page-title h4 {
    font-size: .98rem;
    line-height: 1.08;
    font-weight: 700;
}

.sales-page-mode-title {
    color: #0d6efd;
    text-align: right;
    font-size: 1.06rem !important;
    line-height: 1.08;
}

.sales-entry-card,
.sales-summary-card,
.sales-recent-card {
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .06);
}

.sales-card-heading {
    padding-bottom: .2rem;
    border-bottom: 1px solid #edf2f7;
}

.sales-top-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .45rem .65rem;
}

.sales-field {
    min-width: 0;
}

.sales-date-pair-field {
    grid-column: span 2;
}

.sales-date-pair {
    display: flex;
    align-items: end;
    gap: .4rem;
}

.sales-date-box {
    flex: 1 1 0;
    min-width: 0;
}

.sales-clickable-label {
    cursor: pointer;
}

.sales-popup-summary-button {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background-color: #fff;
}

.sales-field .form-label,
.sales-summary-card .form-label,
.sales-payment-row .form-label {
    font-size: .78rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: .12rem;
}

.sales-field .form-control,
.sales-field .form-select,
.sales-summary-card .form-control,
.sales-summary-card .form-select,
.sales-payment-row .form-control,
.sales-payment-row .form-select {
    min-height: 31px;
    padding-top: .22rem;
    padding-bottom: .22rem;
    font-size: .88rem;
}

.sales-payment-command-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .45rem;
    flex-wrap: nowrap;
    min-height: 24px;
}

.sales-payment-caption {
    white-space: nowrap;
    flex: 0 0 auto;
}

.sales-payment-command-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: .45rem;
    flex-wrap: nowrap;
    min-width: 0;
}

.sales-payment-command {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    white-space: nowrap;
    line-height: 1;
}

.sales-payment-command .badge {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    margin-left: 0 !important;
}

@media (max-width: 420px) {
    .sales-payment-command-row {
        gap: .35rem;
    }

    .sales-payment-command-actions {
        gap: .35rem;
    }

    .sales-payment-command {
        font-size: .76rem;
    }

    .sales-payment-command .badge {
        font-size: .68rem;
        padding: .22rem .32rem;
    }
}

.sales-label-row {
    min-height: 22px;
}

.sales-notes-strip {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 34px;
    padding: .25rem .5rem;
    border: 1px dashed #d7e0ea;
    border-radius: 10px;
    background: #fbfdff;
}

.sales-table-toolbar {
    padding: .18rem .45rem;
    border-radius: 9px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.sales-table-toolbar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    line-height: 1;
    padding-top: .18rem;
    padding-bottom: .18rem;
}

.sales-table-toolbar .badge {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    padding-top: .18rem;
    padding-bottom: .18rem;
}

.sales-lines-scroll {
    overflow-x: auto;
    border: 1px solid #e5edf6;
    border-radius: 12px;
}

.sales-invoice-table {
    margin-bottom: 0;
    font-size: .82rem;
}

.sales-invoice-table th {
    background: #f1f5f9;
    color: #334155;
    font-size: .76rem;
    padding: .26rem .3rem;
    vertical-align: middle;
    white-space: nowrap;
}

.sales-invoice-table td {
    padding: .18rem .24rem;
    vertical-align: middle;
}

.sales-invoice-table .form-control,
.sales-invoice-table .form-select,
.sales-invoice-table .btn {
    font-size: .8rem;
}

.sales-invoice-table .form-control,
.sales-invoice-table .form-select {
    min-height: 27px;
    padding-top: .18rem;
    padding-bottom: .18rem;
}

.sales-invoice-table .invoice-product-select {
    min-width: 210px;
}

.sales-invoice-table .invoice-qty-input {
    min-width: 62px;
}

.sales-invoice-table .invoice-unit-box {
    min-width: 72px;
}

.sales-invoice-table .invoice-wide-number {
    min-width: 70px;
}

.sales-invoice-table .sales-line-sku-lot-button {
    width: 74px;
    padding-left: .25rem;
    padding-right: .25rem;
    white-space: nowrap;
}

.sales-invoice-table .small {
    font-size: .72rem;
}

.sales-summary-card .card-body {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 14px;
}

.sales-message-box {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .22);
}

.sales-message-text {
    white-space: pre-line;
    font-size: .98rem;
}

@media (max-width: 1200px) {
    .sales-top-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .sales-top-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .sales-notes-strip {
        flex-wrap: wrap;
    }
}

@media (max-width: 576px) {
    .sales-page-title,
    .purchase-page-title {
        align-items: flex-start;
        flex-direction: column;
        gap: .15rem;
    }

    .sales-page-mode-title,
    .purchase-page-mode-title {
        text-align: left;
    }
}

/* Biz365 Purchase Invoice compact modern entry update */
.purchase-page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .35rem .65rem;
    border: 1px solid #dbe5f2;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    gap: .75rem;
    flex-wrap: wrap;
}

.purchase-page-mode-title {
    color: #0d6efd;
    text-align: right;
}

.purchase-entry-card,
.purchase-summary-card,
.purchase-recent-card {
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .06);
}

.purchase-card-heading {
    padding-bottom: .2rem;
    border-bottom: 1px solid #edf2f7;
}

.purchase-top-grid {
    display: grid;
    grid-template-columns: minmax(170px, .85fr) minmax(170px, .85fr) minmax(175px, .9fr) minmax(175px, .9fr) minmax(118px, .55fr) minmax(118px, .55fr);
    gap: .45rem .65rem;
    align-items: end;
}

.purchase-supplier-field {
    grid-column: span 2;
}

.purchase-date-field {
    max-width: 145px;
}

.purchase-supplier-invoice-field {
    min-width: 170px;
}

.purchase-supplier-balance-field {
    min-width: 205px;
}

.purchase-field {
    min-width: 0;
}

.purchase-field .form-label,
.purchase-summary-card .form-label,
.purchase-payment-row .form-label {
    font-size: .78rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: .12rem;
}

.purchase-field .form-control,
.purchase-field .form-select,
.purchase-summary-card .form-control,
.purchase-summary-card .form-select,
.purchase-payment-row .form-control,
.purchase-payment-row .form-select {
    min-height: 31px;
    padding-top: .22rem;
    padding-bottom: .22rem;
    font-size: .88rem;
}

.purchase-label-row {
    min-height: 22px;
}

.purchase-notes-strip {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 34px;
    padding: .25rem .5rem;
    border: 1px dashed #d7e0ea;
    border-radius: 10px;
    background: #fbfdff;
}

.purchase-table-toolbar {
    padding: .25rem .5rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.purchase-lines-scroll {
    overflow-x: auto;
    border: 1px solid #e5edf6;
    border-radius: 12px;
}

.purchase-invoice-table {
    margin-bottom: 0;
    font-size: .82rem;
}

.purchase-invoice-table th {
    background: #f1f5f9;
    color: #334155;
    font-size: .76rem;
    padding: .26rem .3rem;
    vertical-align: middle;
    white-space: nowrap;
}

.purchase-invoice-table td {
    padding: .18rem .24rem;
    vertical-align: middle;
}

.purchase-invoice-table .form-control,
.purchase-invoice-table .form-select,
.purchase-invoice-table .btn {
    font-size: .8rem;
}

.purchase-invoice-table .form-control,
.purchase-invoice-table .form-select {
    min-height: 27px;
    padding-top: .18rem;
    padding-bottom: .18rem;
}

.purchase-invoice-table .invoice-product-select {
    min-width: 210px;
}

.purchase-invoice-table .invoice-qty-input {
    min-width: 62px;
}

.purchase-invoice-table .invoice-unit-box {
    min-width: 72px;
}

.purchase-invoice-table .invoice-wide-number {
    min-width: 70px;
}

.purchase-invoice-table .purchase-line-detail-button {
    width: 78px;
    padding-left: .25rem;
    padding-right: .25rem;
    white-space: nowrap;
}

.purchase-invoice-table .small {
    font-size: .72rem;
}

.purchase-summary-card .card-body {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 14px;
}

.purchase-message-box {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .22);
}

.purchase-message-text {
    white-space: pre-line;
    font-size: .98rem;
}

@media (max-width: 1200px) {
    .purchase-top-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .purchase-supplier-field {
        grid-column: span 2;
    }

    .purchase-date-field,
    .purchase-supplier-invoice-field,
    .purchase-supplier-balance-field {
        max-width: none;
    }
}

@media (max-width: 768px) {
    .purchase-top-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .purchase-supplier-field {
        grid-column: span 1;
    }

    .purchase-notes-strip {
        flex-wrap: wrap;
    }
}

/* Biz365 invoice action buttons: equal desktop/mobile width and fixed order */
.invoice-action-buttons {
    display: flex;
    align-items: stretch;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .35rem;
}

.invoice-action-buttons .invoice-action-button {
    flex: 0 1 220px;
    min-width: 220px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

.invoice-action-buttons .invoice-action-button .badge {
    flex: 0 0 auto;
}

.purchase-action-buttons .invoice-action-button {
    flex-basis: 285px;
    min-width: 285px;
}

@media (max-width: 768px) {
    .invoice-action-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: .4rem;
    }

    .invoice-action-buttons .invoice-action-button {
        width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }
}

/* Biz365 global dark scrollbars */
html,
body,
body * {
    scrollbar-width: auto;
    scrollbar-color: #334155 #e5e7eb;
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #e5e7eb;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 999px;
    border: 2px solid #e5e7eb;
}

::-webkit-scrollbar-thumb:hover {
    background: #1f2937;
}


.modal-backdrop-lite {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.45);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.session-warning-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.25rem;
    max-width: 420px;
    width: 100%;
}


@media (max-width: 768px) {
    .sales-date-pair-field {
        grid-column: span 1;
    }
}


/* Biz365 sales invoice small equal History / Rate buttons */
.sales-invoice-table .sales-line-mini-action-button {
    width: 42px;
    height: 27px;
    min-width: 42px;
    padding: 0 .25rem;
    font-size: .72rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Biz365 compact sales line remove icon */
.sales-line-remove-icon {
    min-width: 28px;
    height: 26px;
    line-height: 1;
    font-size: 18px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


/* Biz365 role-aware icon menu page */
.icon-menu-left-link {
    border-bottom: 1px solid rgba(148, 163, 184, .18);
    margin-bottom: .35rem;
    padding-bottom: .35rem;
}

.icon-menu-left-link .compact-nav-link {
    font-weight: 700;
    background: linear-gradient(135deg, rgba(13, 110, 253, .12), rgba(20, 184, 166, .12));
    border: 1px solid rgba(13, 110, 253, .18);
    border-radius: .55rem;
}

.icon-menu-page {
    padding: .25rem .35rem 1.25rem;
}

.icon-menu-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border: 1px solid #dbe7f6;
    border-radius: 1rem;
    background: linear-gradient(135deg, #f8fbff 0%, #eef7ff 48%, #f0fdfa 100%);
    padding: 1rem 1.1rem;
    margin-bottom: .75rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

.icon-menu-hero h3 {
    font-weight: 800;
    letter-spacing: -.02em;
}

.icon-menu-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem .75rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #dbe7f6;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.icon-menu-hero-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.icon-menu-section {
    margin-bottom: 1.05rem;
}

.icon-menu-section-title {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 .45rem;
    color: #0f172a;
}

.icon-menu-section-icon {
    width: 2rem;
    height: 2rem;
    border-radius: .65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 5px 15px rgba(15, 23, 42, .05);
}

.icon-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
    gap: .55rem;
}

.icon-menu-card {
    min-height: 112px;
    border: 1px solid #e2e8f0;
    border-radius: .95rem;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .28rem;
    padding: .75rem .55rem;
    text-align: center;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .045);
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.icon-menu-card:hover,
.icon-menu-card.active {
    color: #0d6efd;
    border-color: rgba(13, 110, 253, .35);
    box-shadow: 0 14px 32px rgba(13, 110, 253, .12);
    transform: translateY(-2px);
}

.icon-menu-card-icon {
    width: 2.65rem;
    height: 2.65rem;
    border-radius: .9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    background: linear-gradient(135deg, #eff6ff, #f0fdfa);
    border: 1px solid #dbeafe;
}

.icon-menu-card-title {
    font-weight: 700;
    font-size: .86rem;
    line-height: 1.12;
}

.icon-menu-card-path {
    max-width: 100%;
    font-size: .67rem;
    line-height: 1.1;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .icon-menu-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: .8rem;
    }

    .icon-menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .icon-menu-card {
        min-height: 105px;
        padding: .65rem .45rem;
    }
}

/* Biz365 global popup messages: converts simple Bootstrap success/warning/error alerts into user-friendly popups. */
.biz365-inline-alert-hidden {
    display: none !important;
}

#biz365-popup-alert-host {
    position: fixed;
    top: 76px;
    right: 20px;
    z-index: 2147483600;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(430px, calc(100vw - 32px));
    pointer-events: none;
}

.biz365-popup-alert {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 30px;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 14px 14px 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-left-width: 5px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22);
    pointer-events: auto;
    animation: biz365PopupIn 0.18s ease-out;
}

.biz365-popup-alert-closing {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.biz365-popup-alert-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
}

.biz365-popup-alert-title {
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 4px;
}

.biz365-popup-alert-body {
    color: #334155;
    font-size: 0.925rem;
    line-height: 1.35;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.biz365-popup-alert-close {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.biz365-popup-alert-close:hover {
    color: #0f172a;
}

.biz365-popup-alert-danger {
    border-left-color: #dc2626;
}

.biz365-popup-alert-danger .biz365-popup-alert-icon {
    background: #fee2e2;
    color: #b91c1c;
}

.biz365-popup-alert-success {
    border-left-color: #16a34a;
}

.biz365-popup-alert-success .biz365-popup-alert-icon {
    background: #dcfce7;
    color: #15803d;
}

.biz365-popup-alert-warning {
    border-left-color: #d97706;
}

.biz365-popup-alert-warning .biz365-popup-alert-icon {
    background: #fef3c7;
    color: #b45309;
}

.biz365-popup-alert-info {
    border-left-color: #2563eb;
}

.biz365-popup-alert-info .biz365-popup-alert-icon {
    background: #dbeafe;
    color: #1d4ed8;
}

@keyframes biz365PopupIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 576px) {
    #biz365-popup-alert-host {
        top: 68px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}

/* Doctor add/edit popup: keep header/footer visible and scroll the long form body on small screens. */
.biz365-doctor-entry-modal .modal-body {
    overflow-y: auto;
}

@media (max-height: 760px) {
    .biz365-doctor-entry-modal .modal-body {
        max-height: calc(100vh - 170px) !important;
    }
}

/* HIMS/UI Update 071C: add vertical scrolling to every popup/modal.
   Keeps popup headers and footers visible while the content area scrolls. */
.modal.show,
.modal.d-block,
.modal[style*="display:block"],
.modal[style*="display: block"] {
    overflow-x: hidden;
    overflow-y: auto;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.modal .modal-dialog {
    max-height: calc(100dvh - 1.5rem);
}

.modal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 1.5rem);
    overflow: hidden;
}

.modal .modal-content > form,
.modal .modal-content > .edit-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: inherit;
}

.modal .modal-header,
.modal .modal-footer {
    flex: 0 0 auto;
}

.modal .modal-body,
.modal .modal-content > form > .modal-body,
.modal .modal-content > .edit-form > .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

.modal-dialog-scrollable .modal-content {
    max-height: calc(100dvh - 1.5rem);
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
}

.biz365-camera-modal,
.biz365-image-viewer-modal,
.session-warning-card,
.biz365-popup-alert {
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

.biz365-image-viewer-body {
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.biz365-popup-alert-body {
    max-height: min(50dvh, 360px);
    overflow-y: auto;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

body.test-list-column-resizing,
body.test-list-column-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

/* BizAICloud Update 125 / 125.1 — live mobile/phone digit counter */
.bizaicloud-mobile-label-with-count {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 0.5rem;
    width: 100%;
}

.bizaicloud-mobile-digit-count {
    display: inline-block;
    margin-left: auto;
    font-size: 0.75rem;
    line-height: 1.2;
    font-weight: 600;
    color: var(--bs-secondary-color, #6c757d);
    white-space: nowrap;
    flex: 0 0 auto;
    pointer-events: none;
}

.bizaicloud-mobile-count-overlay-host {
    position: relative;
}

.bizaicloud-mobile-digit-count-overlay {
    position: absolute;
    z-index: 3;
    margin: 0;
    padding: 0.05rem 0.25rem;
    border-radius: 0.2rem;
    background: var(--bs-body-bg, #fff);
    line-height: 1.05;
}

