html, body {
    background-color: #f0f2f5;
}

.login-page {
    background-color: #0094ff;
    background: url("../bg-login.jpg");
    background-size: cover;
}


.fullscreen-blur-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #004f8c;
    background-image: url("https://www.transparenttextures.com/patterns/diagmonds-light.png");
    filter: blur(8px);
    z-index: -10; /* Đảm bảo nằm sau MudLayout */
}

.tox.tox-tinymce-aux,
.tox-fullscreen .tox.tox-tinymce-aux {
    z-index: 4000;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuO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IvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
    font-family: Roboto, 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    font-family: Roboto, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

.minw-w {
    width: var(--w);
    min-width: var(--w);
}

code {
    color: #c02d76;
}

.dialog-bg {
    background-color: #f0f2f5;
}

.readonly-bg {
    background-color: #fafafa;
}

.total-bg {
    background-color: #fafafa;
}

.dialog-cudby,
.page-title,
.dialog-title {
    background-color: transparent;
    color: var(--mud-palette-primary);
}

.page-toolbar {
    /*background-color: rgba(245,245,245,1);*/
    background-color: #ECEFF1;
    border-bottom: 1px solid var(--mud-palette-primary);
}

.content-relative {
    min-height: 300px !important;
    position: relative !important;
    background-color: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    transition: none !important;
}

/* Đảm bảo toolbar dính trên cùng */
.dialog-toolbar {
    position: sticky;
    top: 0;
    z-index: 4; /* Đảm bảo nó nằm trên các nội dung khác khi cuộn */
    background-color: #ECEFF1;
    border-bottom: 1px solid var(--mud-palette-primary);
}


.grid-toolbar {
    background-color: rgba(245,245,245,1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.5372549019607843);
}
   

    .mud-list-item-dense .mud-list-item-icon {
        min-width: 35px !important;
    }

.text-center input,
.text-center {
    text-align: center !important;
}

.text-right input,
.text-right {
    text-align: right !important;
}

.font-bold {
    font-weight: 500 !important;
}

.font-italic {
    font-style: italic !important;
}


.mud-alert-message{
    font-size: 0.75rem !important;
}

small {
    font-size: 0.7rem !important;
}

.bg-transparent {
    background-color: transparent !important;
}

.post-title {
    font-size: 1.8rem;
    font-weight: 500;
}

.post-desc {
    line-height: 1.6rem;
    font-size: 0.85rem;
}

.post-content {
    line-height: 1.6rem;
    font-size: 0.85rem;
}

    .post-content p,
    .post-content h1,
    .post-content h2,
    .post-content h3,
    .post-content h4,
    .post-content h5,
    .post-content h6 {
        margin-bottom: 0.8rem;
    }

.other-posts ul {
    list-style-type: circle;
}
    .other-posts ul li {
        margin-bottom: .5rem;
        margin-left: 15px;
    }

.post-content ol,
.post-content ul {
    margin-bottom: 0.8rem;
}

.post-content ul {
    list-style-type: disc; /* Chọn kiểu danh sách chấm tròn */
    padding-left: 20px; /* Khoảng cách từ viền trái */
    margin: 0;
}

    .post-content ul li {
        margin-bottom: 10px; /* Khoảng cách giữa các mục trong danh sách */
    }

/* Định dạng cho các thẻ ol */
.post-content ol {
    list-style-type: decimal; /* Kiểu đánh số cho danh sách có thứ tự */
    padding-left: 20px;
    margin: 0;
}

    .post-content ol li {
        margin-bottom: 10px;
    }

    /* Định dạng cho các danh sách lồng nhau */
    .post-content ul ul, .post-content ol ol, .post-content ul ol, .post-content ol ul {
        padding-left: 30px; /* Lùi vào cho các danh sách con */
    }

.post-content img{
    max-width: 100%;
    height: auto;
}

.panel-info-side .mud-typography-body2 {
    font-weight: 500 !important;
}

.mud-chip.mud-chip-size-small.hmtc {
    border-radius: 2px;
    font-size: 8.75px;
    height: 16px;
    padding: 0px 4px;
}

.mud-chip.mud-chip-size-small.old-system {
    border-radius: 2px;
    font-size: 8.75px;
    height: 16px;
    padding: 0px 4px;
}

/* ==========================================================================
   AppBar responsive 2 dòng (Phương án A) — áp dụng vĩnh viễn
   - Desktop (>= 768px): 1 dòng: [menu][title] ... [🏠 ✉ 👥 💬] | [👤 user]
   - Mobile  (< 768px):  2 dòng: dòng 1 [menu][title]
                                 dòng 2 [🏠][✉][👥][💬][👤] — nhẹ nhàng, trải đều
   ========================================================================== */
.appbar-main {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    gap: 2px;
}

/* Nhóm hành động + user menu (desktop: nằm cuối, đồng bộ icon) */
.appbar-actions {
    display: flex;
    align-items: center;
    order: 1;
    gap: 4px;
}

/* Logo trước tên app — hình tròn, nền trắng */
.appbar-logo {
    height: 34px;
    width: 34px;
    object-fit: cover;
    border-radius: 50%;
    margin-left: 8px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    background-color: #ffffff;
    padding: 2px;
    box-sizing: content-box;
}

/* Brand (logo + tên app) là link về trang chủ — giữ màu chữ của appbar, bỏ gạch chân */
.appbar-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.appbar-brand:hover,
.appbar-brand:focus {
    color: inherit;
    text-decoration: none;
}

/* Logo NavMenu — hình vuông, nền trắng, hiển thị trọn vẹn
   LƯU Ý: khi thay bằng avatar của user (tương lai), đổi:
     object-fit: contain → cover
     padding: 8px      → 0 (hoặc bỏ padding) */
.navmenu-logo-avatar {
    width: 80px !important;
    height: 80px !important;
    flex-shrink: 0;
    border-radius: 0 !important;
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

    .navmenu-logo-avatar .es-image,
    .navmenu-logo-avatar img {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        background-color: #ffffff;
        object-fit: cover !important; /* logo hiện đủ, không bị crop */
        padding: 1px !important; /* khoảng thở quanh logo */
    }

/* Slot đều nhau cho MỌI item (icon có/không badge, user menu) — badge không phá nhịp */
.appbar-actions > * {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 48px;
}

/* Icon button dùng kích thước mặc định của MudBlazor (48x48, icon 24px) */

/* User menu: vạch phân cách, dùng kích thước mặc định MudBlazor */
.appbar-user {
    display: flex;
    align-items: center;
    border-left: 1px solid rgba(128, 128, 128, 0.3);
    margin-left: 6px;
    padding-left: 6px;
    width: auto !important; /* thoát khỏi slot 48px để hiện đủ username */
    flex: 0 0 auto !important;
}

.appbar-user .mud-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.appbar-user .mud-button {
    text-transform: none;
}

/* Mobile: AppBar 2 dòng */
@media (max-width: 767px) {
    /* Appbar 2 dòng (~107px) — đẩy nội dung xuống đúng chiều cao thực
       Ghi đè --mud-appbar-height (64px) trên .mud-layout (ancestor gần nhất
       của .mud-main-content) để padding-top không còn che UserCheckinOrCheckout */
    .mud-layout {
        --mud-appbar-height: 146px;
    }

    .mud-appbar .mud-toolbar-appbar {
        height: auto !important;
        flex-wrap: wrap;
        padding: 2px 24px; /* giữ padding trái/phải như desktop */
    }

    .appbar-main {
        flex: 1 1 auto;
    }

    /* Logo tròn nhỏ hơn trên mobile — giữ nền trắng từ rule chung */
    .appbar-logo {
        height: 28px;
        width: 28px;
        margin-left: 6px;
    }

    /* Dòng 2: thanh hành động phụ — nền tối hơn appbar chính (phân cấp màu),
       FULL WIDTH: margin âm bù padding 24px của toolbar để trải sát mép */
    .appbar-actions {
        flex: 1 1 100%;
        order: 3;
        justify-content: space-evenly;
        gap: 0;
        margin-left: -24px !important;
        margin-right: -24px !important;
        padding: 2px 0 4px;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
        background: rgba(0, 0, 0, 0.16);
        backdrop-filter: blur(2px);
    }

    /* Slot đều nhau trên mobile — vừa icon button mặc định MudBlazor (48px) */
    .appbar-actions > * {
        width: 48px;
    }

    /* Icon mặc định MudBlazor, chỉ giảm nhẹ độ đậm để phân cấp với dòng chính */
    .appbar-actions .mud-icon-root {
        opacity: 0.9;
    }

    /* User menu: gộp vào dòng phụ — hiển thị CẢ icon + label (username) */
    .appbar-user {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: auto !important;
        flex: 0 0 auto !important;
        border-left: none;
        margin-left: 0;
        padding-left: 0;
    }

    .appbar-user .mud-menu {
        display: inline-flex !important;
        visibility: visible !important;
    }

    .appbar-user .mud-button {
        width: auto;
        min-width: auto;
        padding: 0 6px;
        justify-content: center !important;
        background: transparent !important;
        gap: 4px;
    }

    .appbar-user .mud-button .mud-icon-root {
        opacity: 0.9;
    }

    /* Label username hiển thị, chữ nhỏ gọn, giới hạn độ rộng */
    .appbar-user .mud-button-label {
        font-size: 0.68rem !important;
        font-weight: 500;
        width: auto !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 90px;
        opacity: 0.95;
    }

    /* Cân chỉnh icon StartIcon khi label đã hiển thị */
    .appbar-user .mud-button-icon-start {
        margin-right: 4px !important;
        margin-inline-end: 4px !important;
    }

    .appbar-actions .mud-badge {
        margin: 0 !important;
    }
}
