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;
}


/* ========================================================
   RESPONSIVE HEADER & LOGO STYLING
   Tối ưu kích thước header và logo cân đối, chuyên nghiệp
   trên Desktop/Laptop, Tablet và Mobile
   ======================================================== */

.tenant-header-logo {
    object-fit: contain;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    display: inline-block;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease-in-out;
}

.tenant-login-logo {
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.tenant-header-title {
    line-height: 1.25;
    letter-spacing: -0.01em;
}

/* Laptop & Desktop (Screen width >= 960px) */
@media (min-width: 960px) {
    .tenant-header-logo {
        height: 42px !important;
        max-height: 42px !important;
        max-width: 140px !important;
        width: auto !important;
        padding: 3px 6px !important;
    }

    .tenant-header-title {
        font-size: 1.15rem !important;
    }

    .tenant-header-subtitle {
        font-size: 0.78rem !important;
    }

    .tenant-login-logo {
        max-height: 80px !important;
        max-width: 220px !important;
        width: auto !important;
        height: auto !important;
    }

    .tenant-appbar .mud-toolbar-appbar {
        height: 64px !important;
        min-height: 64px !important;
        padding-top: 4px;
        padding-bottom: 4px;
    }
}

/* Tablet (Screen width từ 600px đến 959.98px) */
@media (min-width: 600px) and (max-width: 959.98px) {
    .tenant-header-logo {
        height: 38px !important;
        max-height: 38px !important;
        max-width: 120px !important;
        width: auto !important;
        padding: 2px 5px !important;
    }

    .tenant-header-title {
        font-size: 1.05rem !important;
    }

    .tenant-header-subtitle {
        font-size: 0.75rem !important;
    }

    .tenant-login-logo {
        max-height: 70px !important;
        max-width: 200px !important;
        width: auto !important;
        height: auto !important;
    }

    .tenant-appbar .mud-toolbar-appbar {
        height: 60px !important;
        min-height: 60px !important;
        padding-top: 2px;
        padding-bottom: 2px;
    }
}

/* Điện thoại di động (Screen width < 600px) */
@media (max-width: 599.98px) {
    .tenant-header-logo {
        height: 32px !important;
        max-height: 32px !important;
        max-width: 90px !important;
        width: auto !important;
        padding: 2px 4px !important;
        border-radius: 4px !important;
    }

    .tenant-header-title {
        font-size: 0.95rem !important;
        max-width: 175px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tenant-header-subtitle {
        font-size: 0.7rem !important;
    }

    .tenant-login-logo {
        max-height: 60px !important;
        max-width: 160px !important;
        width: auto !important;
        height: auto !important;
    }

    .tenant-appbar .mud-toolbar-appbar {
        height: 56px !important;
        min-height: 56px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

/* ========================================================
   DOCTOR PORTAL - SLATE EMR LAYOUT (PHƯƠNG ÁN 1)
   ======================================================== */

.doctor-unified-header {
    background-color: var(--mud-palette-appbar-background) !important;
    color: var(--mud-palette-appbar-text) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    height: 60px !important;
    min-height: 60px !important;
    z-index: 1200;
}

.mud-theme-dark .doctor-unified-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.doctor-unified-header .mud-toolbar {
    height: 60px !important;
    min-height: 60px !important;
    padding-left: 12px;
    padding-right: 12px;
}

/* Department & Room Badge on Header */
.doctor-dept-room-badge {
    background-color: rgba(2, 132, 199, 0.06);
    border: 1px solid rgba(2, 132, 199, 0.25);
    border-radius: 8px;
    padding: 3px 10px;
    line-height: 1.25;
    transition: all 0.2s ease-in-out;
}

.doctor-dept-room-badge:hover {
    background-color: rgba(2, 132, 199, 0.12);
    border-color: rgba(2, 132, 199, 0.45);
}

.doctor-dept-room-badge .dept-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: #0284c7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.doctor-dept-room-badge .room-name {
    font-size: 0.70rem;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.doctor-dept-room-badge .badge-icon {
    font-size: 0.85rem !important;
    width: 14px;
    height: 14px;
    opacity: 0.85;
}

.mud-theme-dark .doctor-dept-room-badge {
    background-color: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.25);
}

.mud-theme-dark .doctor-dept-room-badge:hover {
    background-color: rgba(56, 189, 248, 0.16);
    border-color: rgba(56, 189, 248, 0.5);
}

.mud-theme-dark .doctor-dept-room-badge .dept-name {
    color: #38bdf8;
}

.mud-theme-dark .doctor-dept-room-badge .room-name {
    color: #94a3b8;
}

/* ========================================================
   PATIENT CONTEXT BADGE ON HEADER (PHƯƠNG ÁN 3 - PREMIUM SLATE DARK)
   ======================================================== */

.doctor-patient-context-badge {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    color: #f8fafc !important;
    border: 1.5px solid rgba(56, 189, 248, 0.6) !important;
    border-radius: 12px !important;
    padding: 3px 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 0 10px rgba(56, 189, 248, 0.15) !important;
    transition: all 0.2s ease-in-out !important;
}

.doctor-patient-context-badge:hover {
    border-color: #38bdf8 !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), 0 0 14px rgba(56, 189, 248, 0.35) !important;
}

.doctor-patient-context-badge .patient-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
    font-weight: 800;
    background-color: rgba(56, 189, 248, 0.18) !important;
    color: #38bdf8 !important;
    border: 1.5px solid rgba(56, 189, 248, 0.45) !important;
    border-radius: 8px;
    flex-shrink: 0;
}

.text-truncate {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* 1. TÊN BỆNH NHÂN: TRẮNG TINH KHIẾT, FONT TO 15.5px, CHỮ IN HOA ĐẬM NÉT */
.doctor-patient-context-badge .patient-name {
    color: #ffffff !important;
    font-size: 0.98rem !important; /* ~15.7px */
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.02em !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-block !important;
    max-width: 280px;
}

@media (max-width: 600px) {
    .doctor-patient-context-badge {
        padding: 3px 8px !important;
        max-width: calc(100vw - 110px) !important;
    }
    .doctor-patient-context-badge .patient-name {
        font-size: 0.88rem !important;
        max-width: 190px !important;
    }
}

/* 2. NĂM SINH & TUỔI: PILL VÀNG GOLD CHỮ ĐEN CỰC KỲ DỄ ĐỌC & NỔI BẬT */
.doctor-patient-context-badge .patient-year-badge {
    background-color: #f59e0b !important;
    color: #0f172a !important;
    border: 1px solid #fbbf24 !important;
    border-radius: 6px !important;
    padding: 1px 7px !important;
    font-size: 0.78rem !important; /* ~12.5px */
    font-weight: 800 !important;
    line-height: 1.2 !important;
}

/* 3. MÃ BỆNH NHÂN: CHỮ CYAN SÁNG VIỀN NEON MONOSPACE TO RÕ */
.doctor-patient-context-badge .patient-code-badge {
    background-color: rgba(6, 182, 212, 0.18) !important;
    color: #67e8f9 !important;
    border: 1px solid rgba(6, 182, 212, 0.55) !important;
    border-radius: 5px !important;
    padding: 1px 7px !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-size: 0.82rem !important; /* ~13px */
    font-weight: 800 !important;
    line-height: 1.2 !important;
}

.doctor-patient-context-badge .patient-code-badge strong {
    color: #ffffff !important;
}

/* Tag BHYT */
.doctor-patient-context-badge .patient-bhyt-tag {
    background: rgba(34, 197, 94, 0.25) !important;
    color: #86efac !important;
    border: 1px solid rgba(34, 197, 94, 0.5) !important;
    border-radius: 4px !important;
    padding: 1px 5px !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
}

.doctor-patient-context-badge .patient-meta {
    color: #94a3b8 !important;
    font-size: 0.74rem !important;
    line-height: 1.2 !important;
}

.doctor-patient-context-badge .bed-highlight {
    color: #fde047 !important;
    font-weight: 800 !important;
}

.doctor-patient-context-badge .patient-action-divider {
    border-left: 1px solid #334155 !important;
}

.doctor-patient-context-badge .close-patient-btn {
    color: #94a3b8 !important;
}

.doctor-patient-context-badge .close-patient-btn:hover {
    color: #f43f5e !important;
    background-color: rgba(244, 63, 94, 0.15) !important;
}

/* ========================================================
   PATIENT CONTEXT BADGE ON HEADER - DARK MODE INVERSION
   Ở Dark mode: Nghịch đảo màu thành nền sáng (Trắng / Slate nhạt) với chữ đậm nổi bật
   ======================================================== */
.mud-theme-dark .doctor-patient-context-badge,
.doctor-patient-context-badge.dark-inverted {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%) !important;
    color: #0f172a !important;
    border: 1.5px solid rgba(56, 189, 248, 0.8) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 12px rgba(56, 189, 248, 0.25) !important;
}

.mud-theme-dark .doctor-patient-context-badge:hover,
.doctor-patient-context-badge.dark-inverted:hover {
    border-color: #0284c7 !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 16px rgba(56, 189, 248, 0.4) !important;
}

.mud-theme-dark .doctor-patient-context-badge .patient-avatar,
.doctor-patient-context-badge.dark-inverted .patient-avatar {
    background-color: rgba(2, 132, 199, 0.12) !important;
    color: #0284c7 !important;
    border: 1.5px solid rgba(2, 132, 199, 0.35) !important;
}

.mud-theme-dark .doctor-patient-context-badge .patient-name,
.doctor-patient-context-badge.dark-inverted .patient-name {
    color: #0f172a !important;
}

.mud-theme-dark .doctor-patient-context-badge .patient-year-badge,
.doctor-patient-context-badge.dark-inverted .patient-year-badge {
    background-color: #f59e0b !important;
    color: #0f172a !important;
    border: 1px solid #d97706 !important;
}

.mud-theme-dark .doctor-patient-context-badge .patient-code-badge,
.doctor-patient-context-badge.dark-inverted .patient-code-badge {
    background-color: rgba(2, 132, 199, 0.08) !important;
    color: #0284c7 !important;
    border: 1px solid rgba(2, 132, 199, 0.3) !important;
}

.mud-theme-dark .doctor-patient-context-badge .patient-code-badge strong,
.doctor-patient-context-badge.dark-inverted .patient-code-badge strong {
    color: #0f172a !important;
}

.mud-theme-dark .doctor-patient-context-badge .patient-bhyt-tag,
.doctor-patient-context-badge.dark-inverted .patient-bhyt-tag {
    background: rgba(22, 163, 74, 0.15) !important;
    color: #15803d !important;
    border: 1px solid rgba(22, 163, 74, 0.4) !important;
}

.mud-theme-dark .doctor-patient-context-badge .patient-meta,
.doctor-patient-context-badge.dark-inverted .patient-meta {
    color: #475569 !important;
}

.mud-theme-dark .doctor-patient-context-badge .bed-highlight,
.doctor-patient-context-badge.dark-inverted .bed-highlight {
    color: #b45309 !important;
}

.mud-theme-dark .doctor-patient-context-badge .patient-action-divider,
.doctor-patient-context-badge.dark-inverted .patient-action-divider {
    border-left: 1px solid #cbd5e1 !important;
}

.mud-theme-dark .doctor-patient-context-badge .close-patient-btn,
.doctor-patient-context-badge.dark-inverted .close-patient-btn {
    color: #64748b !important;
}

.mud-theme-dark .doctor-patient-context-badge .close-patient-btn:hover,
.doctor-patient-context-badge.dark-inverted .close-patient-btn:hover {
    color: #f43f5e !important;
    background-color: rgba(244, 63, 94, 0.15) !important;
}

.mud-theme-dark .doctor-patient-context-badge .mud-button-filled-primary,
.doctor-patient-context-badge.dark-inverted .mud-button-filled-primary {
    background-color: #0284c7 !important;
    color: #ffffff !important;
}

.mud-theme-dark .doctor-patient-context-badge .mud-button-filled-primary:hover,
.doctor-patient-context-badge.dark-inverted .mud-button-filled-primary:hover {
    background-color: #0369a1 !important;
}

/* Sidebar Drawer - Slate Navy Theme */
.doctor-slate-drawer {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
    top: 0 !important;
    height: 100vh !important;
    max-height: 100vh !important;
    z-index: 1350 !important;
    overflow: hidden !important;
}

.doctor-slate-drawer .mud-drawer-content {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    max-height: 100% !important;
    background-color: #0f172a !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Ensure Main Content is not covered by fixed header */
.doctor-unified-header ~ .mud-main-content {
    padding-top: 68px !important;
}

/* Sidebar Brand Header */
.doctor-sidebar-brand {
    background-color: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    box-sizing: border-box !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    width: 100% !important;
}

.doctor-drawer-collapsed .doctor-sidebar-brand {
    justify-content: center !important;
    padding: 0 !important;
}

.doctor-sidebar-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doctor-drawer-collapsed .doctor-sidebar-logo-wrapper {
    width: 100%;
    height: 100%;
    margin: 0 auto;
}

.doctor-sidebar-logo {
    max-height: 36px;
    max-width: 36px;
    width: auto;
    height: auto;
    object-fit: contain;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    display: block;
    margin: 0 auto;
}

.doctor-brand-title {
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.doctor-brand-badge {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    line-height: 1.2;
    flex-shrink: 0;
}

.doctor-brand-subtitle {
    color: #94a3b8;
    font-size: 0.7rem;
    line-height: 1.2;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar Navigation Items */
.doctor-nav-section-title {
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 14px 4px 14px;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Nav Menu Scroll & Overflow handling (No scrollbar visible, smooth mouse wheel) */
.doctor-slate-drawer .mud-navmenu,
.doctor-sidebar-nav {
    flex: 1 1 0px !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE & Edge */
}

.doctor-slate-drawer .mud-navmenu::-webkit-scrollbar,
.doctor-sidebar-nav::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Tooltip root handling inside drawer */
.doctor-slate-drawer .mud-nav-menu > .mud-tooltip-root,
.doctor-slate-drawer .doctor-patient-subnav > .mud-tooltip-root {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.doctor-drawer-collapsed .doctor-sidebar-brand .mud-tooltip-root {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box;
}

.doctor-drawer-expanded .doctor-sidebar-brand .mud-tooltip-root {
    display: inline-flex !important;
    width: auto !important;
    height: auto !important;
    box-sizing: border-box;
}

.doctor-sidebar-footer .mud-tooltip-root {
    display: inline-flex !important;
    width: auto !important;
    box-sizing: border-box;
}

.doctor-slate-drawer .mud-nav-link {
    color: #cbd5e1 !important;
    border-radius: 8px;
    margin: 2px 0 !important;
    padding: 8px 12px;
    font-size: 0.825rem;
    width: 100% !important;
    box-sizing: border-box !important;
    transition: all 0.15s ease-in-out;
}

.doctor-slate-drawer .mud-nav-link .mud-nav-link-icon {
    color: #94a3b8 !important;
}

.doctor-slate-drawer .mud-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.07) !important;
    color: #ffffff !important;
}

.doctor-slate-drawer .mud-nav-link:hover .mud-nav-link-icon {
    color: #38bdf8 !important;
}

.doctor-slate-drawer .mud-nav-link.active:not(.mud-nav-link-disabled) {
    background-color: #0284c7 !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.doctor-slate-drawer .mud-nav-link.active .mud-nav-link-icon {
    color: #ffffff !important;
}

/* Mini Sidebar Mode Styling (Collapsed state showing only icons) */
.doctor-slate-drawer.doctor-drawer-collapsed .mud-nav-link,
.doctor-slate-drawer.mud-drawer-mini:not(.mud-drawer--open) .mud-nav-link,
.doctor-slate-drawer.mud-drawer-mini.mud-drawer--closed .mud-nav-link {
    margin: 3px auto !important;
    padding: 0 !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    box-sizing: border-box !important;
    justify-content: center !important;
    align-items: center !important;
    display: flex !important;
}

.doctor-slate-drawer.doctor-drawer-collapsed .mud-nav-link .mud-nav-link-icon,
.doctor-slate-drawer.mud-drawer-mini:not(.mud-drawer--open) .mud-nav-link .mud-nav-link-icon,
.doctor-slate-drawer.mud-drawer-mini.mud-drawer--closed .mud-nav-link .mud-nav-link-icon {
    margin: 0 !important;
    font-size: 1.25rem !important;
}

.doctor-slate-drawer.doctor-drawer-collapsed .mud-nav-link .mud-nav-link-text,
.doctor-slate-drawer.mud-drawer-mini:not(.mud-drawer--open) .mud-nav-link .mud-nav-link-text,
.doctor-slate-drawer.mud-drawer-mini.mud-drawer--closed .mud-nav-link .mud-nav-link-text {
    display: none !important;
}

.doctor-slate-drawer.doctor-drawer-collapsed .doctor-patient-subnav .mud-nav-link,
.doctor-slate-drawer.mud-drawer-mini:not(.mud-drawer--open) .doctor-patient-subnav .mud-nav-link,
.doctor-slate-drawer.mud-drawer-mini.mud-drawer--closed .doctor-patient-subnav .mud-nav-link {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Dividers inside drawer */
.doctor-slate-drawer .mud-divider {
    box-sizing: border-box !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.doctor-slate-drawer.doctor-drawer-collapsed .mud-divider,
.doctor-slate-drawer.mud-drawer-mini:not(.mud-drawer--open) .mud-divider,
.doctor-slate-drawer.mud-drawer-mini.mud-drawer--closed .mud-divider {
    width: 36px !important;
    max-width: 36px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Sidebar Mini Patient Card (Expanded) */
.doctor-sidebar-patient-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 10px;
    margin: 4px 0 8px 0;
    box-sizing: border-box;
    width: 100%;
    transition: all 0.2s ease;
}

.doctor-sidebar-patient-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(56, 189, 248, 0.35);
}

.sidebar-patient-icon-box {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.doctor-sidebar-patient-card:hover .sidebar-patient-icon-box {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
}

.doctor-sidebar-patient-card .sidebar-patient-name {
    color: #38bdf8;
    font-size: 0.825rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doctor-sidebar-patient-card .sidebar-patient-bed {
    color: #cbd5e1;
    font-size: 0.72rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.doctor-sidebar-patient-card .sidebar-patient-bed strong {
    color: #fde047;
}

.patient-card-close-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.patient-card-close-wrapper .mud-tooltip-root {
    display: inline-flex !important;
    width: auto !important;
}

.doctor-sidebar-patient-card .patient-card-close-btn {
    color: #94a3b8 !important;
    padding: 4px !important;
    transition: color 0.15s, background-color 0.15s;
}

.doctor-sidebar-patient-card .patient-card-close-btn:hover {
    color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.15) !important;
}

/* Collapsed Active Patient Button */
.doctor-patient-collapsed-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 3px 0;
}

.doctor-patient-collapsed-wrapper .mud-tooltip-root {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 auto !important;
}

.doctor-patient-collapsed-btn {
    width: 44px;
    height: 44px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.15);
    border: 1.5px solid #38bdf8;
    color: #38bdf8;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.doctor-patient-collapsed-btn:hover {
    background: rgba(56, 189, 248, 0.28);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
    color: #ffffff;
    transform: scale(1.05);
}

/* Sub-links under Active Patient */
.doctor-patient-subnav .mud-nav-link {
    padding-left: 24px !important;
    font-size: 0.8rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.doctor-patient-subnav .mud-nav-link.subnav-active {
    background-color: #0284c7 !important;
    color: #ffffff !important;
    font-weight: 600;
}

.doctor-patient-subnav .mud-nav-link.subnav-active .mud-nav-link-icon {
    color: #ffffff !important;
}

/* Ẩn thanh tab header của patient-detail để tăng diện tích làm việc và tránh trùng lặp với Left Menu */
.patient-detail-tabs.hide-tab-header > .mud-tabs-tabbar,
.hide-tab-header > .mud-tabs-tabbar {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
}

.patient-detail-tabs > .mud-tabs-panels {
    padding: 0 !important;
    background: transparent !important;
}

/* Sidebar Footer (Doctor Profile & Logout) */
.doctor-sidebar-footer {
    background-color: rgba(11, 19, 41, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 12px;
    flex-shrink: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.doctor-footer-name {
    color: #f8fafc;
    font-size: 0.8rem;
    line-height: 1.2;
}

.doctor-footer-dept {
    color: #94a3b8;
    font-size: 0.7rem;
    line-height: 1.2;
}

.online-indicator {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    background-color: #22c55e;
    border-radius: 50%;
    border: 2px solid #0f172a;
}

/* ========================================================
   TỜ ĐIỀU TRỊ & Y LỆNH: BẢNG THEO DÕI VÀ BỐ CỤC CHUYÊN NGHIỆP
   ======================================================== */
.treatment-sheets-table.mud-table,
.treatment-sheets-table .mud-table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.treatment-sheets-table .mud-table-root {
    table-layout: fixed !important;
    width: 100% !important;
    min-width: 980px;
}

.treatment-sheets-table .mud-table-root th,
.treatment-sheets-table .mud-table-root td {
    vertical-align: top !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    padding: 10px 12px !important;
}

.vital-signs-badge {
    display: inline-block;
    max-width: 100%;
    background-color: var(--mud-palette-background-grey);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.78rem;
    line-height: 1.45;
    white-space: normal !important;
    word-break: break-word !important;
    box-sizing: border-box;
}

.vital-signs-icon {
    font-size: 0.95rem !important;
    color: var(--mud-palette-error);
    vertical-align: -2px;
    margin-right: 4px;
    display: inline-block;
}

.vital-signs-content {
    color: var(--mud-palette-text-secondary);
    font-weight: 500;
    white-space: normal !important;
    word-break: break-word !important;
}

/* Giao diện thẻ Phiếu điều trị trên Mobile */
.treatment-sheet-mobile-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.treatment-sheet-mobile-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
}

.vital-signs-mobile-strip .badge-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #ffffff;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    font-size: 0.76rem;
}

/* Tùy chỉnh hiển thị thông tin bệnh nhân trên bảng */
.patient-info-cell {
    display: block !important;
    width: 100% !important;
}

.patient-info-cell::before {
    display: none !important;
}

/* Định dạng thông tin Vào khoa / Ra khoa */
.department-info-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.dept-info-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.dept-info-label {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    white-space: nowrap;
}

.dept-info-label.text-muted {
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
}

.dept-info-value {
    flex: 1 1 auto;
    word-break: break-word;
}

.disease-primary-text {
    color: #8b3a2b; /* Đỏ nâu */
    font-weight: 500;
}

/* Responsive trên mobile cho MudTable dạng cards */
@media (max-width: 959.98px) {
    /* Ẩn cột 'Giường' riêng biệt trên mobile vì đã hiển thị cùng dòng với BHYT */
    .mud-table-cell[data-label="Giường"],
    .patient-bed-desktop-cell {
        display: none !important;
    }

    /* Khi MudTable chuyển sang dạng card mobile, ẩn text label cột 'Vào khoa' và 'Ra khoa' */
    .mud-table-cell[data-label="Vào khoa"],
    .mud-table-cell[data-label="Ra khoa"] {
        display: block !important;
        padding-left: 16px !important;
    }

    .mud-table-cell[data-label="Vào khoa"]::before,
    .mud-table-cell[data-label="Ra khoa"]::before {
        display: none !important;
    }

    .department-info-container {
        gap: 6px;
    }

    .dept-info-row {
        flex-direction: row !important;
        align-items: baseline !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    /* Riêng dòng Ngày vào khoa / Ngày ra khoa giữ trên cùng 1 dòng */
    .dept-info-row.dept-info-date-row {
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .dept-info-label {
        font-size: 0.82rem;
    }

    .dept-info-value {
        font-size: 0.85rem;
    }
}


