﻿*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --hms-ink: #203040;
    --hms-muted: #718096;
    --hms-border: #e5eaf0;
    --hms-canvas: #f8fafc;
    --hms-sidebar-surface: #edf3f8;
    --hms-surface: #ffffff;
    --hms-primary: #4e46c7;
    --hms-primary-soft: #f0efff;
    --hms-sidebar-width: 240px;
    --hms-sidebar-rail: 72px;
    --hms-topbar-height: 68px;
    --hms-page-padding: 20px;
    --hms-page-padding-mobile: 12px;
}

html,
body {
    margin: 0;
    min-height: 100%;
    overflow-x: hidden;
    background: var(--hms-canvas);
    color: var(--hms-ink);
    font-family: 'Sora', 'Inter', sans-serif !important;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.main-wrapper {
    display: flex;
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--hms-sidebar-width);
    flex-direction: column;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When sidebar is collapsed */
.sidebar.collapsed ~ .main-wrapper {
    margin-left: var(--hms-sidebar-rail);
}

/* When sidebar is hidden on mobile */
@media (max-width: 992px) {
    .main-wrapper,
    .sidebar.collapsed ~ .main-wrapper {
        margin-left: 0;
    }
}

.main-content {
    display: flex;
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    padding-top: var(--hms-topbar-height);
    flex-direction: column;
}

.page-body {
    width: 100%;
    max-width: none;
    flex: 1;
    margin: 0;
    padding: 20px var(--hms-page-padding) 0;
    padding-left: 50px !important;
    padding-right: var(--hms-page-padding);
    transition: padding 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When sidebar is collapsed, maintain same padding */
.sidebar.collapsed ~ .main-wrapper .page-body {
    padding-left: var(--hms-page-padding);
    padding-right: var(--hms-page-padding);
}

/* Medium screens - slightly less padding */
@media (max-width: 1200px) {
    .page-body {
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }

    .sidebar.collapsed ~ .main-wrapper .page-body {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Tablet and smaller */
@media (max-width: 992px) {
    .page-body {
        padding: 18px var(--hms-page-padding-mobile) 0;
    }

    .sidebar.collapsed ~ .main-wrapper .page-body {
        padding: 18px var(--hms-page-padding-mobile) 0;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .main-content {
        padding-top: 60px;
    }

    .page-body {
        padding: 14px 10px 0;
    }

    .sidebar.collapsed ~ .main-wrapper .page-body {
        padding: 14px 10px 0;
    }
}

/* Loading progress */
.loading-progress {
    display: none;
}

/* Toast container */
.blazored-toast-container {
    position: fixed !important;
    z-index: 999999 !important;
}







/* =========================================================
   CONSULTATION DRAWER — PRINT
   SINGLE A4 PAGE
   PRE-PRINTED LETTERHEAD
   ========================================================= */
/* =========================================================
   CONSULTATION DRAWER — PRINT
   SINGLE A4 PAGE
   PRE-PRINTED LETTERHEAD
   ========================================================= */
/* =========================================================
   CONSULTATION DRAWER — PRINT
   SINGLE A4 PAGE
   PRE-PRINTED LETTERHEAD
   ========================================================= */

/* =========================================================
   CONSULTATION DRAWER — PRINT
   SINGLE A4 PAGE
   PRE-PRINTED LETTERHEAD
   ========================================================= */

@media print {

    /* =====================================================
       A4 PAGE
       ===================================================== */

    @page {
        size: A4 portrait;
        margin: 0 !important;
    }


    /* =====================================================
       HTML
       ===================================================== */

    html {
        width: 210mm !important;
        height: 297mm !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }


    /* =====================================================
       BODY
       ===================================================== */

    html,
    body {
        width: 210mm !important;
        height: 297mm !important;
        margin: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
        background: #ffffff !important;
        overflow: hidden !important;
    }


        /* =====================================================
       CONSULTATION PRINT MODE
       ===================================================== */

        body.printing-consultation {
            width: 210mm !important;
            height: 297mm !important;
            margin: 0 !important;
            padding: 0 !important;
            min-height: 0 !important;
            background: #ffffff !important;
            overflow: hidden !important;
            -webkit-print-color-adjust: exact !important;
            print-color-adjust: exact !important;
        }


            /* =====================================================
       HIDE EVERYTHING
       ===================================================== */

            body.printing-consultation * {
                visibility: hidden !important;
            }


            /* =====================================================
       SHOW ONLY CONSULTATION PRESCRIPTION
       ===================================================== */

            body.printing-consultation #my-modal-content,
            body.printing-consultation #my-modal-content * {
                visibility: visible !important;
            }


            /* =====================================================
       DRAWER OVERLAY
       ===================================================== */

            body.printing-consultation .cd-overlay {
                position: fixed !important;
                top: 0 !important;
                left: 0 !important;
                width: 210mm !important;
                height: 297mm !important;
                min-height: 0 !important;
                margin: 0 !important;
                padding: 0 !important;
                background: transparent !important;
                overflow: visible !important;
            }


            /* =====================================================
       DRAWER PANEL
       ===================================================== */

            body.printing-consultation .cd-panel {
                position: static !important;
                display: block !important;
                width: 100% !important;
                max-width: none !important;
                height: auto !important;
                max-height: none !important;
                min-height: 0 !important;
                margin: 0 !important;
                padding: 0 !important;
                background: transparent !important;
                border: none !important;
                border-radius: 0 !important;
                box-shadow: none !important;
                overflow: visible !important;
            }


            /* =====================================================
       DRAWER BODY
       ===================================================== */

            body.printing-consultation .cd-body {
                position: static !important;
                display: block !important;
                width: 100% !important;
                height: auto !important;
                max-height: none !important;
                min-height: 0 !important;
                margin: 0 !important;
                padding: 0 !important;
                background: transparent !important;
                overflow: visible !important;
            }


            /* =====================================================
       HIDE DRAWER HEADER / BUTTONS
       ===================================================== */

            body.printing-consultation .cd-header,
            body.printing-consultation .cd-header-actions,
            body.printing-consultation .cd-icon-btn,
            body.printing-consultation .cd-close-btn,
            body.printing-consultation .summary-actions,
            body.printing-consultation .summary-action-btn,
            body.printing-consultation .no-print {
                display: none !important;
            }


            /* =====================================================
       SUMMARY WRAPPERS
       ===================================================== */

            body.printing-consultation .summary-layout,
            body.printing-consultation .summary-preview {
                position: static !important;
                display: block !important;
                width: 100% !important;
                max-width: none !important;
                height: auto !important;
                min-height: 0 !important;
                margin: 0 !important;
                padding: 0 !important;
                background: transparent !important;
                overflow: visible !important;
            }


            /* =====================================================
       ACTUAL PRINT TARGET

       A4 WIDTH : 210mm

       LEFT     : 10mm
       RIGHT    : 10mm
       TOP      : 40mm

       AVAILABLE WIDTH = 190mm

       Using left + right instead of fixed width prevents
       right-side clipping.
       ===================================================== */

            body.printing-consultation #my-modal-content {
                position: fixed !important;
                top: 40mm !important;
                left: 10mm !important;
                right: 10mm !important;
                width: auto !important;
                max-width: none !important;
                min-width: 0 !important;
                height: auto !important;
                min-height: 0 !important;
                margin: 0 !important;
                padding: 0 !important;
                background: #ffffff !important;
                border: none !important;
                border-radius: 0 !important;
                box-shadow: none !important;
                box-sizing: border-box !important;
                overflow: visible !important;
                font-family: Arial, Helvetica, sans-serif !important;
                font-size: 13px !important;
                line-height: 1.35 !important;
            }


                /* =====================================================
       RX PRESCRIPTION PAGE
       ===================================================== */

                /* =====================================================
   RX PRESCRIPTION PAGE
   IMPORTANT:
   #my-modal-content ITSELF is rx-tpl-page
   ===================================================== */

                body.printing-consultation
                #my-modal-content.rx-tpl-page {
                    position: fixed !important;
                    top: 40mm !important;
                    left: 10mm !important;
                    right: 10mm !important;
                    width: auto !important;
                    max-width: none !important;
                    min-width: 0 !important;
                    height: auto !important;
                    min-height: 0 !important;
                    margin: 0 !important;
                    padding: 0 !important;
                    background: #ffffff !important;
                    border: none !important;
                    border-radius: 0 !important;
                    box-shadow: none !important;
                    box-sizing: border-box !important;
                    overflow: visible !important;
                    font-family: Arial, Helvetica, sans-serif !important;
                    font-size: 13px !important;
                    line-height: 1.35 !important;
                    color: #222 !important;
                }

                /* =====================================================
       PREVENT CONTENT OVERFLOW
       ===================================================== */

                body.printing-consultation
                #my-modal-content > * {
                    max-width: 100% !important;
                    min-width: 0 !important;
                    box-sizing: border-box !important;
                }


                body.printing-consultation
                #my-modal-content .rx-tpl-header,
                body.printing-consultation
                #my-modal-content .rx-tpl-info-strip,
                body.printing-consultation
                #my-modal-content .rx-tpl-section,
                body.printing-consultation
                #my-modal-content .rx-tpl-two-col,
                body.printing-consultation
                #my-modal-content .rx-tpl-footer-row {
                    width: 100% !important;
                    max-width: 100% !important;
                    min-width: 0 !important;
                    box-sizing: border-box !important;
                }


                /* =====================================================
       PATIENT INFORMATION STRIP
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-info-strip {
                    display: flex !important;
                    flex-wrap: nowrap !important;
                    align-items: center !important;
                    width: 100% !important;
                    max-width: 100% !important;
                    min-width: 0 !important;
                    margin: 0 0 4mm 0 !important;
                    padding: 8px 10px !important;
                    box-sizing: border-box !important;
                    gap: 10px !important;
                    overflow: hidden !important;
                }


                /* =====================================================
       INFORMATION CHIP
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-info-chip {
                    flex: 1 1 0 !important;
                    min-width: 0 !important;
                    max-width: 100% !important;
                    width: auto !important;
                    display: flex !important;
                    align-items: center !important;
                    gap: 6px !important;
                    box-sizing: border-box !important;
                    overflow: hidden !important;
                }


                    /* =====================================================
       DATE / TIME
       ===================================================== */

                    body.printing-consultation
                    #my-modal-content
                    .rx-tpl-info-chip:last-child {
                        flex: 1.35 1 0 !important;
                        min-width: 0 !important;
                    }


                    /* =====================================================
       INFORMATION ICON
       ===================================================== */

                    body.printing-consultation
                    #my-modal-content
                    .rx-tpl-info-chip > i {
                        flex: 0 0 auto !important;
                        width: 14px !important;
                        font-size: 13px !important;
                        line-height: 1 !important;
                    }


                    /* =====================================================
       INFORMATION TEXT
       ===================================================== */

                    body.printing-consultation
                    #my-modal-content
                    .rx-tpl-info-chip > div {
                        flex: 1 1 auto !important;
                        min-width: 0 !important;
                        max-width: 100% !important;
                        width: auto !important;
                        overflow: hidden !important;
                    }


                /* =====================================================
       INFORMATION LABEL
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-info-label {
                    display: block !important;
                    font-size: 8px !important;
                    font-weight: 600 !important;
                    line-height: 1.1 !important;
                    white-space: nowrap !important;
                    overflow: hidden !important;
                    text-overflow: ellipsis !important;
                    margin-bottom: 1px !important;
                }


                /* =====================================================
       INFORMATION VALUE
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-info-value {
                    display: block !important;
                    font-size: 10px !important;
                    font-weight: 600 !important;
                    line-height: 1.2 !important;
                    white-space: nowrap !important;
                    overflow: hidden !important;
                    text-overflow: ellipsis !important;
                }


                /* =====================================================
       GENERAL SECTIONS
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-section {
                    width: 100% !important;
                    max-width: 100% !important;
                    min-width: 0 !important;
                    margin-bottom: 3mm !important;
                    box-sizing: border-box !important;
                    page-break-inside: auto !important;
                    break-inside: auto !important;
                }


                /* =====================================================
       NO-BREAK SECTIONS
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-section-nobreak {
                    page-break-inside: avoid !important;
                    break-inside: avoid !important;
                }


                /* =====================================================
       SECTION TITLES
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-block-title {
                    font-size: 12px !important;
                    font-weight: 700 !important;
                    line-height: 1.2 !important;
                    margin-top: 0 !important;
                    margin-bottom: 1.5mm !important;
                    max-width: 100% !important;
                }


                /* =====================================================
       SYMPTOMS / EXAMINATION / DIAGNOSIS
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-inline-block {
                    display: block !important;
                    width: 100% !important;
                    max-width: 100% !important;
                    min-width: 0 !important;
                    margin-bottom: 1.2mm !important;
                    white-space: normal !important;
                    word-break: break-word !important;
                    overflow-wrap: anywhere !important;
                    word-wrap: break-word !important;
                    line-height: 1.35 !important;
                    box-sizing: border-box !important;
                }


                /* =====================================================
       LABEL
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-label {
                    font-weight: 600 !important;
                }


                /* =====================================================
       SECTION TEXT
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-section p {
                    width: 100% !important;
                    max-width: 100% !important;
                    min-width: 0 !important;
                    white-space: normal !important;
                    word-break: break-word !important;
                    overflow-wrap: anywhere !important;
                    word-wrap: break-word !important;
                    line-height: 1.35 !important;
                    margin-top: 0 !important;
                    margin-bottom: 1mm !important;
                    box-sizing: border-box !important;
                }


                /* =====================================================
       TWO COLUMN AREA
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-two-col {
                    width: 100% !important;
                    max-width: 100% !important;
                    min-width: 0 !important;
                    box-sizing: border-box !important;
                    overflow: visible !important;
                }


                    body.printing-consultation
                    #my-modal-content
                    .rx-tpl-two-col > * {
                        min-width: 0 !important;
                        max-width: 100% !important;
                        box-sizing: border-box !important;
                    }


                /* =====================================================
       ADVICE / INVESTIGATION
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-numbered-list {
                    width: 100% !important;
                    max-width: 100% !important;
                    min-width: 0 !important;
                    margin-top: 0 !important;
                    margin-bottom: 0 !important;
                    padding-left: 18px !important;
                    box-sizing: border-box !important;
                }


                    /* =====================================================
       LIST ITEMS
       ===================================================== */

                    body.printing-consultation
                    #my-modal-content
                    .rx-tpl-numbered-list li {
                        width: 100% !important;
                        max-width: 100% !important;
                        min-width: 0 !important;
                        margin-bottom: 0.7mm !important;
                        white-space: normal !important;
                        word-break: break-word !important;
                        overflow-wrap: anywhere !important;
                        word-wrap: break-word !important;
                        line-height: 1.35 !important;
                        box-sizing: border-box !important;
                    }


                /* =====================================================
       MEDICATION TABLE
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-med-table {
                    display: table !important;
                    width: 100% !important;
                    max-width: 100% !important;
                    min-width: 0 !important;
                    table-layout: fixed !important;
                    border-collapse: collapse !important;
                    margin: 0 !important;
                    padding: 0 !important;
                    box-sizing: border-box !important;
                    font-size: 10.5px !important;
                    line-height: 1.2 !important;
                }


                    /* =====================================================
       TABLE HEADERS
       ===================================================== */

                    body.printing-consultation
                    #my-modal-content
                    .rx-tpl-med-table th {
                        box-sizing: border-box !important;
                        min-width: 0 !important;
                        max-width: 100% !important;
                        text-align: center !important;
                        vertical-align: middle !important;
                        white-space: normal !important;
                        word-break: break-word !important;
                        overflow-wrap: anywhere !important;
                        font-weight: 700 !important;
                        padding: 4px 4px !important;
                    }


                    /* =====================================================
       TABLE CELLS
       ===================================================== */

                    body.printing-consultation
                    #my-modal-content
                    .rx-tpl-med-table td {
                        box-sizing: border-box !important;
                        min-width: 0 !important;
                        max-width: 100% !important;
                        vertical-align: middle !important;
                        white-space: normal !important;
                        word-break: break-word !important;
                        overflow-wrap: anywhere !important;
                        word-wrap: break-word !important;
                        padding: 3.5px 4px !important;
                    }


                        /* =====================================================
       S.NO.
       ===================================================== */

                        body.printing-consultation
                        #my-modal-content
                        .rx-tpl-med-table th:nth-child(1),
                        body.printing-consultation
                        #my-modal-content
                        .rx-tpl-med-table td:nth-child(1) {
                            width: 5% !important;
                            text-align: center !important;
                            vertical-align: middle !important;
                        }


                    /* =====================================================
       MEDICINE
       ===================================================== */

                    body.printing-consultation
                    #my-modal-content
                    .rx-tpl-med-table th:nth-child(2) {
                        width: 27% !important;
                        text-align: center !important;
                    }


                    body.printing-consultation
                    #my-modal-content
                    .rx-tpl-med-table td:nth-child(2) {
                        width: 27% !important;
                        text-align: left !important;
                    }


                    /* =====================================================
       DOSE
       ===================================================== */

                    body.printing-consultation
                    #my-modal-content
                    .rx-tpl-med-table th:nth-child(3),
                    body.printing-consultation
                    #my-modal-content
                    .rx-tpl-med-table td:nth-child(3) {
                        width: 13% !important;
                        text-align: center !important;
                    }


                    /* =====================================================
       FREQUENCY
       ===================================================== */

                    body.printing-consultation
                    #my-modal-content
                    .rx-tpl-med-table th:nth-child(4),
                    body.printing-consultation
                    #my-modal-content
                    .rx-tpl-med-table td:nth-child(4) {
                        width: 15% !important;
                        text-align: center !important;
                    }


                    /* =====================================================
       DURATION
       ===================================================== */

                    body.printing-consultation
                    #my-modal-content
                    .rx-tpl-med-table th:nth-child(5),
                    body.printing-consultation
                    #my-modal-content
                    .rx-tpl-med-table td:nth-child(5) {
                        width: 13% !important;
                        text-align: center !important;
                    }


                    /* =====================================================
       NOTES
       ===================================================== */

                    body.printing-consultation
                    #my-modal-content
                    .rx-tpl-med-table th:nth-child(6),
                    body.printing-consultation
                    #my-modal-content
                    .rx-tpl-med-table td:nth-child(6) {
                        width: 27% !important;
                        text-align: center !important;
                    }


                /* =====================================================
       MEDICINE NAME
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-med-name {
                    max-width: 100% !important;
                    text-align: left !important;
                    white-space: normal !important;
                    word-break: break-word !important;
                    overflow-wrap: anywhere !important;
                }


                /* =====================================================
       TABLE ROWS
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-med-table tr {
                    page-break-inside: avoid !important;
                    break-inside: avoid !important;
                }


                /* =====================================================
       TABLE HEADER REPEAT
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-med-table thead {
                    display: table-header-group !important;
                }


                /* =====================================================
       ADDITIONAL NOTES
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-notes {
                    width: 100% !important;
                    max-width: 100% !important;
                    min-width: 0 !important;
                    box-sizing: border-box !important;
                    padding: 2.5mm !important;
                    margin: 0 !important;
                    white-space: normal !important;
                    word-break: break-word !important;
                    overflow-wrap: anywhere !important;
                    word-wrap: break-word !important;
                    line-height: 1.35 !important;
                    font-size: 10px !important;
                }


                /* =====================================================
       FOOTER ROW
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-footer-row {
                    width: 100% !important;
                    max-width: 100% !important;
                    min-width: 0 !important;
                    page-break-inside: avoid !important;
                    break-inside: avoid !important;
                    margin-top: 2.5mm !important;
                    box-sizing: border-box !important;
                }


                /* =====================================================
       DIGITAL FOOTER
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-bottom-bar {
                    display: none !important;
                }


                /* =====================================================
       IMAGES
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                img {
                    max-width: 100% !important;
                    height: auto !important;
                }


                /* =====================================================
       CORNER ACCENT
       ===================================================== */

                body.printing-consultation
                #my-modal-content
                .rx-tpl-corner {
                    display: block !important;
                }
}