﻿@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
@import url('https://fonts.googleapis.com/css2?family=Audiowide&family=Faster+One&display=swap');
:root {
    --animate-duration: 0.3s;
}
:root {
    --datagrid-height: calc( 100vh - var(--navbar-height) - var(--top-toolbar-height) - var(--chipset-container-height) - var(--table-toolbar-height) - var(--top-switch-height) - var(--table-pagination-height) - var(--component-gap) );
}
body {
    margin: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 1) 100%), linear-gradient(90deg, #8d5acd48, #84d2ff54) !important;
    font-family: 'Roboto','Helvetica','Arial','sans-serif' !important;
    --mud-default-borderradius: 8px;
}
/* Ngăn cuộn vượt quá màn hình */
html, body {
    overscroll-behavior: none;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch; /* Tăng hiệu ứng cuộn mượt mà trên iOS */
    scroll-behavior: smooth; /* Tạo cuộn mượt trên Windows và Android */
   
}
/* Viewer.js */
.viewer-backdrop {
    background-color: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
}
.viewer-container {
    z-index: 9999 !important;
}

.auto-table-height .mud-table-container {
    min-height: var(--datagrid-height) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch; /* Tối ưu cho iOS */
    scroll-behavior: smooth; /* Tạo cuộn mượt */
}

/* ══════════════════════════════════════════════════════════════════════════
   Chuyển từ <style> inline trong Bills.razor. Global (không scoped) vì:
   - .mt-2/.my-2/#hlpPaymentPoints còn được dùng ở nhiều trang khác (RevenueReportDetail,
     OtherIncome, OtherExpenses, FinancialDetail, FinancialReport, DlgCustomerHistory...).
   - #top-toolbar/.mud-chip/.mud-drawer là phần tử do MudBlazor tự render, không mang
     scope-attribute của Bills.razor.css nên không thể để trong file .razor.css (sẽ chết).
   - html:has(.bills-page) nằm ngoài cây component Blazor, không scope được.
   ══════════════════════════════════════════════════════════════════════════ */
.mt-2, .my-2 {
    margin-top: 1px !important;
}
#hlpPaymentPoints {
    color: red;
    font-weight: bold;
    font-size: 10px;
}
.mud-drawer:not(.mud-drawer--open) {
    transform: translateX(100%) !important; /* nếu Anchor.End */
    transform: translateY(-100%) !important; /* nếu Anchor.Top */
}
/* Chuyển từ <style> inline trong UserPermission.razor — .mud-treeview-item-label là phần tử do
   MudBlazor tự render (root của MudTreeViewItem), không mang scope-attribute nên không scoped được
   trong .razor.css (cùng lý do #top-toolbar ở trên). Trang này có 2 cây quyền riêng (mobile + desktop,
   không chung 1 wrapper) nên ::deep theo 1 class cha cũng không phủ được cả 2 — để global cho chắc.
   Duy nhất UserPermission.razor dùng MudTreeView trong toàn app nên không ảnh hưởng trang khác. */
.mud-treeview-item-label {
    font-weight: bold !important;
    font-size: small !important;
}
/*
.mud-chip.mud-chip-size-small {
    padding-right: 3px !important;
} */

/* Toolbar Bills: giữ 1 hàng; nút không wrap chữ; chip KHÔNG co (để đo tràn chính xác -> tự xuống hàng riêng) */
#top-toolbar {
    height: auto !important;
    min-height: 48px;
    flex-wrap: nowrap;
    align-items: center;
}
#top-toolbar .mud-button-root {
    white-space: nowrap;
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
}
#top-toolbar .mud-chipset { flex-wrap: nowrap; margin-bottom: 0 !important; }
#top-toolbar .mud-chip { margin: 2px 3px !important; flex: 0 0 auto; }

/* Trang Bills cao cố định = màn hình (bảng tự cuộn nội bộ qua --datagrid-height).
   Anchor popover của MudBlazor (absolute, cấp #app) làm document dư ~8px -> thanh
   cuộn cha thừa. Chặn cuộn ở cấp shell, CHỈ khi đang ở trang Bills (dùng :has()),
   không ảnh hưởng trang khác; bảng/drawer/dialog vẫn hoạt động bình thường.
   Chỉ áp dụng desktop (>=992px); mobile giữ nguyên cuộn. */
@media (min-width: 992px) {
    /* Chặn cuộn cha (anchor popover MudBlazor absolute cấp #app), chỉ khi ở Bills. */
    html:has(.bills-page),
    body:has(.bills-page) {
        overflow: hidden;
    }

    /* Responsive thật bằng flex (giống NewBill): bills-page cao = màn hình, flex column;
       card bảng tự fill phần còn lại -> đệm đáy = padding 5px của container, KHỚP 2 bên
       và CỐ ĐỊNH ở mọi độ phân giải (không phụ thuộc số ma --datagrid-height).
       Override min-height !important của app.css để bảng co theo card. */
    .bills-page {
        height: calc(100dvh - var(--navbar-height, 69px) - 16px);
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    .bills-page > .bills-table-shell {
        flex: 1 1 auto;
        min-height: 0;
        margin-bottom: 5px;
    }

    .bills-page .mud-height-full,
    .bills-page .auto-table-height {
        height: 100%;
        min-height: 0;
    }

    .bills-page .auto-table-height .mud-table {
        height: 100%;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .bills-page .auto-table-height .mud-table > .mud-toolbar {
        flex: 0 0 auto;
    }
}
.note-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px; 
    word-break: break-word;
}
.table-loading-content {
    height: calc( 100vh - var(--navbar-height) - var(--top-toolbar-height) - var(--chipset-container-height) - var(--table-toolbar-height) - var(--top-switch-height) - var(--table-pagination-height) - var(--component-gap) ) !important;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    display: flex;
}
.mud-table-dense * .mud-table-row .mud-table-cell:last-child {
    padding-inline-end: 8px !important;
}
.main-content {
    min-height: calc( 100vh - var(--navbar-height) - var(--top-toolbar-height) - var(--chipset-container-height)- var(--table-toolbar-height) - var(--top-switch-height) - var(--table-pagination-height) - var(--component-gap) ) !important;
    overflow: auto;
    position: relative;
    /* KHÔNG dùng -webkit-overflow-scrolling:touch — bug WebKit đã biết: thuộc tính này biến
       .main-content thành containing block cho MỌI phần tử position:fixed bên trong nó (mọi
       .sheet/.flt-sheet của @Body), khiến z-index nội bộ (--z-sheet:41) hết so được với
       BottomNavigation_Mobile (z-index:26, đứng NGOÀI .main-content trong MainLayout.razor) —
       trên iOS thật, cả khối .main-content bị vẽ dưới BottomNav nên mọi sheet bị che. Thuộc tính
       này cũng đã lỗi thời (chỉ cần cho iOS <13, giờ momentum-scroll là mặc định). */
    scroll-behavior: smooth; /* Tạo cuộn mượt */
}
.dialog-backdrop {
    backdrop-filter: blur(20px);
}
.mud-drawer {
    overflow: visible !important;
}
.mud-table .mud-table-pagination .mud-table-pagination-toolbar {
    padding-top: 6px;
    padding-top: 6px;
    padding-right: 16px;
    padding-inline-end: 16px;
    padding-inline-start: unset;
    min-height: 35px;
}
.mud-dialog .mud-dialog-title {
    padding: 10px 24px !important;
}

.list-group-item {
    padding: 0.1rem .2rem !important;
}
.table-bill-inf td {
    padding-top: 1px;
    padding-bottom: 2px;
}
    div > ::after {
    color: red !important;
}
.top-nav {
    background: rgba(89,74,226,1);
    border-bottom: solid #ff8900;
    /*  min-height: 54px;*/
}

.top-nav-mobie {
    background: rgba(89,74,226,1);
}

@media (min-width: 1400px) {
    .navbar-expand-xxl .top-nav-mobie.offcanvas.w-100 {
        width: auto !important;
        max-width: 100%;
        min-width: 0;
        flex: 1 1 auto;
    }

    .navbar-expand-xxl .top-nav-mobie .offcanvas-body,
    .navbar-expand-xxl .top-nav-mobie .navbar-nav {
        min-width: 0;
    }
}

.logo {
    height: 20px;
    opacity: 0.8;
    /* margin-bottom: 10px;*/
}

.user-icon {
    height: 20px;
    /* margin-bottom: 10px;*/
}

.logo-text {
    font-family: 'Audiowide', sans-serif;
    color: lavenderblush; /*rgb(255 255 255 / 0.68);*/
    font-size: 26px;
}

.logo-text-primary {
    font-family: 'Audiowide', sans-serif;
    color: rgba(89,74,226,1);
    font-size: 2.5rem;
}

.logo-text-u {
    font-family: 'Audiowide', sans-serif;
    color: white !important;
    font-weight: 800;
    font-size: 2.5rem;
}

.logo-text-slogan {
    font-family: 'Roboto', sans-serif;
    color: rgba(89,74,226,1);
    font-size: .68rem;
}

.badge {
    font-size: .9em !important;
}

.nav-link {
    color: white !important;
    background-color: rgb(255 255 255 / 6%) !important;
    border-radius: 10px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    font-size: .86rem !important;
    font-weight: 500 !important;
}

    .nav-link:hover {
        color: white !important;
        background-color: rgb(255 255 255 / 30%) !important;
    }

.nav-item {
    margin-right: .5rem !important;
    margin-top: .2rem !important;
    margin-bottom: .2rem !important;
}

.nav-link.active {
    color: white !important;
    background-color: rgb(255 255 255 / 30%) !important;
}

.navbar-toggler {
    border: none !important;
}

a, .btn-link {
    color: #0366d6;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    color: red !important;
    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;
    }

.loading-state {
    top: 40%;
    left: 50%;
    position: absolute;
}

.text-purple {
    color: #ff4081;
}

.floating-button {
    position: fixed !important;
    bottom: 75px;
    right: 60px;
}

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

#mud-snackbar-container {
    margin-top: 35px !important;
}

.mud-list-item-gutters {
    border-bottom: 1px !important;
    border-bottom-style: dotted !important;
    border-bottom-color: #dee2e6 !important;
}

.mud-chip.mud-chip-size-large {
    border-radius: 25px !important;
    height: 49px !important;
}

.mud-button-filled-size-large {
    padding: 11px 22px !important;
    font-size: 1rem !important;
}

.mud-table-dense * .mud-table-row .mud-table-cell {
    font-weight: bold !important;
}

.mud-table-root .mud-table-head .mud-table-cell {
    font-weight: bold !important;
}

.mud-dialog-width-full {
    width: calc(100% - 20px) !important;
}

.textbox-radius {
    --mud-default-borderradius: 19px !important;
}

.mud-toolbar-dense {
    --mud-internal-toolbar-height: 39px !important;
}

.mud-dialog {
    margin-left: 0.5rem !important;
    margin-right: 0.5rem !important
}
    .mud-dialog .mud-dialog-actions {
        padding: 8px 18px !important;
    }
    .mud-dialog .mud-dialog-content {
        padding: 8px 15px !important;
    }
    /* Khi bọc <MudDialog> trong <EditForm>, MudBlazor chèn 1 <form> (display:block) giữa
       .mud-dialog (flex column, max-height) và title/content/actions -> phá chuỗi flex khiến
       .mud-dialog-content KHÔNG co lại để cuộn: form nở hết chiều cao nội dung, tràn khỏi dialog
       (mobile có overflow:hidden nên cắt mất) -> nút Lưu/actions bị đẩy ra ngoài màn hình, không
       bấm được (bug DlgPromotion "Tạo chương trình khuyến mãi"). Cho <form> kế thừa layout flex
       column của .mud-dialog để content cuộn được và actions luôn ghim đáy. Chỉ khớp dialog có
       EditForm (dialog thường không có <form> con nên không ảnh hưởng). */
    .mud-dialog > form {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }
        .mud-input.mud-disabled {
        color: rgb(0 0 0 / 60%) !important;
    }

.mud-link.mud-link-disabled {
    opacity: 0.6 !important;
}

.mud-chip.mud-disabled {
    opacity: 0.6 !important;
}

.mud-xl-table.mud-table-dense .mud-table-cell {
    padding: 2px 8px;
}

h1:focus {
    outline: none;
}
.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;
}
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZ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AyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after {
    content: "An error has occurred."
}
.progress-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh; /* Căn giữa theo chiều dọc */
    flex-direction: column;
}
.progress {
    width: 120px; /* Chiều rộng của thanh tiến trình */
    height: 20px;
    background-color: #fff !important;
    border: solid 2px rgba(89,74,226,1);
    align-items: center;
    position: relative; /* Để cho .loading-progress-text có thể căn giữa */
   
}

.progress-bar {
    width: var(--blazor-load-percentage, 0%);
    background-color: rgba(89, 74, 226, 1) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: absolute; /* Để .loading-progress-text có thể căn giữa */
    top: 0;
    left: 0;
}

.loading-progress-text {
    font-size: 10px !important;
    color: rgb(255 255 255 / 6%) !important;
    position: absolute;
    top: 50%; /* Căn giữa theo chiều dọc */
    left: 50%; /* Căn giữa theo chiều ngang */
    transform: translate(-50%, -50%);
}
.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "0%");
    color: white !important;
}
.progress-text {
    font-size: 9px;
    margin-bottom: 6px;
    color: darkslateblue;
    font-weight: 600;
}
.row {
    --bs-gutter-x: 0;
    margin: 0px !important;
}
.dot-container {
    display: flex;
    align-items: center; /* Canh giữa theo chiều dọc */
}
.dot-green {
    width: 8px;
    height: 8px;
    background-color: rgb(0 200 83); /* Màu xanh lá cây */
    border-radius: 50%; /* Để tạo hình tròn */
    margin-right: 3px; /* Khoảng cách giữa dấu chấm và văn bản */
}
.dot-yellow {
    width: 7px;
    height: 7px;
    background-color: rgb(255 152 0); /* Màu vàng */
    border-radius: 50%; /* Để tạo hình tròn */
    margin-right: 3px; /* Khoảng cách giữa dấu chấm và văn bản */
}
.text-glow {
    color: #ff5722;
    text-align: center;
    animation: glowSpread 2s ease-out infinite;
}
@keyframes glowSpread {
    0% {
        transform: scale(0.5);
        opacity: 0.5;
        text-shadow: 0 0 20px rgba(255, 87, 34, 0.3), 0 0 40px rgba(255, 87, 34, 0.3), 0 0 60px rgba(255, 87, 34, 0.3);
    }

    50% {
        transform: scale(1);
        opacity: 1;
        text-shadow: 0 0 40px rgba(255, 87, 34, 1), 0 0 60px rgba(255, 87, 34, 0.8), 0 0 80px rgba(255, 87, 34, 0.6);
    }

    100% {
        transform: scale(0.5);
        opacity: 0.5;
        text-shadow: 0 0 20px rgba(255, 87, 34, 0.3), 0 0 40px rgba(255, 87, 34, 0.3), 0 0 60px rgba(255, 87, 34, 0.3);
    }
}

