:root {
    --nvocc-table-header-bg: #0077b6;
    --nvocc-selected-row-bg: #1E88E5;
    --nvocc-tab-toolbar-bg: #ffffff;
    --nav-menu-font-size: 12px;
}

.image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.full-image {
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
}

.panel-content img {
    max-width: 100vw;
    height: auto;
    margin-left: 30px;
}

.mud-nav-group {
    position: relative;
    z-index: 10;
    /* Cao hơn các phần tử khác */
}

.footer-container {
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 5;
    /* Thấp hơn để không che phủ */
}

.custom-button {
    padding: 80px 8px;
    /* Giảm padding */
    min-width: 30px;
    /* Thu nhỏ chiều rộng */
    height: 30px;
    /* Thu nhỏ chiều cao */
    font-size: 12px;
    /* Giảm kích thước chữ */
}

.selected {
    background-color: var(--nvocc-selected-row-bg) !important;
}

.selected>td {
    color: white !important;
}

.selected>td .mud-input {
    color: white !important;
}

.labelCustomColor label {
    /*font-weight: bold;*/
    color: #0078d4 !important;
}

.mud-table thead {
    background-color: var(--nvocc-table-header-bg) !important;
}

.mud-table th {
    background-color: var(--nvocc-table-header-bg) !important;
    color: white !important;
}

.mud-table1 {
    width: 100%;
    table-layout: auto;
}


.button-align {
    margin-top: 120px;
}

.mud-table-customtext {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.class-dialog-custom {
    backdrop-filter: blur(10px);
    transition: none !important;
    animation: none !important;
}

/* Customer Create/Edit/Duplicate: dialog rộng tối đa */
.class-dialog-customer-wide .mud-dialog-surface {
    max-width: 95vw !important;
    width: 95vw !important;
}

.table-shipment-bg {
    padding: 8px !important;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.08);
    background-color: #fff !important;
}

.table-shipment-bg .mud-table-cell {
    padding: 4px 8px !important;
    font-size: 13px !important;
    height: 32px !important;
    white-space: nowrap;
}

.table-shipment-bg .mud-table-head .mud-table-cell {
    padding: 6px 8px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

.table-shipment-bg .mud-input-control {
    margin-top: 0 !important;
}

.table-shipment-bg .mud-input > input {
    padding: 4px 6px !important;
    font-size: 13px !important;
}

.bkav-invoice-grid .mud-table-body tr.bkav-selected-row > td,
.bkav-invoice-grid .mud-table-body tr.bkav-selected-row:hover > td {
    background-color: var(--nvocc-selected-row-bg) !important;
    color: #ffffff !important;
}

.bkav-invoice-grid .mud-table-body tr.bkav-selected-row .mud-icon-root,
.bkav-invoice-grid .mud-table-body tr.bkav-selected-row .mud-typography,
.bkav-invoice-grid .mud-table-body tr.bkav-selected-row .mud-link,
.bkav-invoice-grid .mud-table-body tr.bkav-selected-row .mud-input,
.bkav-invoice-grid .mud-table-body tr.bkav-selected-row .mud-input-slot {
    color: #ffffff !important;
}

.bkav-invoice-grid .mud-table-container {
    overflow-x: auto;
}

.bkav-invoice-grid .mud-table-root {
    table-layout: auto !important;
    width: max-content !important;
}

.bkav-invoice-grid .mud-table-head .mud-table-cell,
.bkav-invoice-grid .mud-table-body .mud-table-cell {
    white-space: nowrap;
    padding-left: 6px !important;
    padding-right: 6px !important;
}

.bkav-invoice-grid .mud-table-head .mud-input-control {
    min-width: 0 !important;
}

.bkav-invoice-grid .bkav-col-clip {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bkav-invoice-grid .bkav-line-table {
    width: max-content !important;
    table-layout: auto !important;
}

.bkav-invoice-grid .bkav-line-table th,
.bkav-invoice-grid .bkav-line-table td {
    width: auto !important;
    white-space: nowrap;
    padding: 4px 8px !important;
}

.bkav-invoice-grid .bkav-line-clip {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Global DataGrid format (apply for screens opened from NavMenu) */
.mud-data-grid {
    padding: 8px !important;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.08);
    background-color: #fff !important;
}

.mud-data-grid .mud-table-cell {
    padding: 4px 8px !important;
    font-size: 13px !important;
    height: 32px !important;
    white-space: nowrap;
}

.mud-data-grid .mud-table-head .mud-table-cell {
    padding: 6px 8px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

.mud-data-grid .mud-input-control {
    margin-top: 0 !important;
}

.mud-data-grid .mud-input > input {
    padding: 4px 6px !important;
    font-size: 13px !important;
}

/*
  FixedHeader + FilterMode="ColumnFilterRow" bug (affects every MudDataGrid in the app):
  MudBlazor sticks EVERY header-area cell at "top: 0" regardless of which of the two header
  rows (column titles vs. filter inputs) it belongs to. Both rows then stick at the exact
  same offset and overlap once scrolled; since the filter row comes later in the DOM it
  paints over the title row, so the column names appear to vanish on scroll.

  This can't be fixed per-page via a component's own scoped .razor.css: pages built purely
  from MudBlazor components (no raw HTML elements of their own, e.g. PricingOceanFreightRate
  and AirFreightRate) never get Blazor's CSS-isolation scope attribute stamped on any DOM
  node, so an isolated stylesheet's rules can never match anything on such a page - the fix
  has to live in this global stylesheet instead.

  ".mud-data-grid" is MudDataGrid's own root class (present on every grid, everywhere), so
  this applies app-wide. Only the title row (row 1) is kept sticky; the filter row (row 2)
  is left un-stuck (scrolls away with the body) instead of guessing a pixel offset for it -
  it only needs to be usable once at the top, not permanently visible.
*/
.mud-data-grid .mud-table-head tr:first-child .mud-table-cell {
    position: sticky !important;
    top: 0 !important;
    z-index: 4 !important;
}

.mud-data-grid .mud-table-head tr:nth-child(2) .mud-table-cell {
    position: static !important;
}

.mud-table-foot tr {
    background-color: #118AB2 !important;
}

.footer-cell {
    background-color: #118AB2 !important;
    color: white !important;
}

.filter-header-cell {
    background-color: white !important;
    color: black !important;
}

.no-wrap {
    white-space: nowrap;
}

/* MudDataGrid Stock: cột rộng theo nội dung, ô không xuống dòng (cuộn ngang) */
.stock-grid-autofit .mud-table-root {
    table-layout: auto !important;
    width: max-content;
}

.stock-grid-autofit .mud-table-root td,
.stock-grid-autofit .mud-table-root th {
    white-space: nowrap;
}

.text-right input,
.text-right textarea {
    text-align: right !important;
}

.custom-right-align {
    text-align: right !important;
}

.custom-label .mud-input-label {
    color: blue !important;
}

.label-right label {
    text-align: right;
    color: blue !important;
}

.no-wrap-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nondisplay {
    display: none;
}

.custom-credit thead tr {
    background-color: #2E8B57 ! important;
}

.custom-credit th {
    background-color: #2E8B57 !important;
    color: white !important;
}

.table-hbl-bg {
    --nvo-grid-bg: #FFF3E0;
    background-color: #FFF3E0 !important;
}

.mud-tabs-toolbar {
    background-color: var(--nvocc-tab-toolbar-bg) !important;
}

/* Thanh tab sửa MBL / HBL: mỗi tab một màu. MudBlazor bọc từng tab trong tooltip nên phải đếm lớp bọc, không đếm .mud-tab. */
.mud-tabs.hbl-edit-tabs > .mud-tabs-toolbar {
    background-color: #f4f6f8 !important;
    border: 1px solid #e3eef5;
    border-radius: 8px 8px 0 0;
    padding: 6px 6px 0;
}

.mud-tabs.hbl-edit-tabs .mud-tabs-toolbar-wrapper > .mud-tooltip-root,
.mud-tabs.hbl-edit-tabs .mud-tabs-toolbar-wrapper > .d-inline-block {
    margin: 0 3px;
    border-radius: 8px 8px 0 0;
}

.mud-tabs.hbl-edit-tabs .mud-tab {
    border-radius: 8px 8px 0 0;
    text-transform: none;
}

.mud-tabs.hbl-edit-tabs .mud-tabs-toolbar-wrapper > :nth-child(6n+1) .mud-tab { background-color: #b9d4ff !important; }
.mud-tabs.hbl-edit-tabs .mud-tabs-toolbar-wrapper > :nth-child(6n+2) .mud-tab { background-color: #b7ebc9 !important; }
.mud-tabs.hbl-edit-tabs .mud-tabs-toolbar-wrapper > :nth-child(6n+3) .mud-tab { background-color: #ffd7a8 !important; }
.mud-tabs.hbl-edit-tabs .mud-tabs-toolbar-wrapper > :nth-child(6n+4) .mud-tab { background-color: #e0c8ff !important; }
.mud-tabs.hbl-edit-tabs .mud-tabs-toolbar-wrapper > :nth-child(6n+5) .mud-tab { background-color: #b6ecee !important; }
.mud-tabs.hbl-edit-tabs .mud-tabs-toolbar-wrapper > :nth-child(6n+6) .mud-tab { background-color: #ffc2cc !important; }
.mud-tabs.hbl-edit-tabs .mud-tab.mud-tab-active {
    font-weight: 700;
    box-shadow: inset 0 -3px 0 #0b5f7a;
}

/* Form sửa HBL / MBL: mỗi khối một màu, không bị nền trắng của MudPaper che */
.hbl-section.hbl-s1, .mbl-section.mbl-s1 { background: #d6e8ff !important; border-color: #8eb7e8 !important; border-left: 5px solid #2f6fad !important; }
.hbl-section.hbl-s2, .mbl-section.mbl-s2 { background: #d4f5df !important; border-color: #8dcf9f !important; border-left: 5px solid #2e8b57 !important; }
.hbl-section.hbl-s3, .mbl-section.mbl-s3 { background: #ffe6c2 !important; border-color: #e8c48a !important; border-left: 5px solid #d4890a !important; }
.hbl-section.hbl-s4, .mbl-section.mbl-s4 { background: #e6d9ff !important; border-color: #c4b0e8 !important; border-left: 5px solid #7a4fbf !important; }
.hbl-section.hbl-s5 { background: #d2f3f4 !important; border-color: #8fd4d6 !important; border-left: 5px solid #1a8a8e !important; }
.hbl-section.hbl-s6, .mbl-section.mbl-s5 { background: #ffd6e2 !important; border-color: #e8a8ba !important; border-left: 5px solid #c44b6e !important; }
.hbl-section.hbl-s7 { background: #ece8e1 !important; border-color: #cfc8bc !important; border-left: 5px solid #8a8175 !important; }

.custom-tab .mud-tabs-toolbar {
    font-size: 0.75rem;
    min-height: 36px;
    min-width: 100px !important;
    font-weight: 400 !important;
    text-transform: none !important;
    background-color: var(--nvocc-tab-toolbar-bg) !important;
}

/* Thanh tab động (MainLayout / DynamicTabs): chữ thường, không in đậm */
.custom-tab .mud-tab {
    padding: 4px 8px;
    font-weight: 400 !important;
    text-transform: none !important;
}

.custom-tab .mud-tab .mud-button-label,
.custom-tab .mud-tab .mud-typography {
    font-weight: 400 !important;
    text-transform: none !important;
}

.close-tab-icon {
    color: #b71c1c;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.button-no-grow {
    max-height: 5vh !important;
    align-items: center;
    display: flex;
}

@media (max-width: 768px) {
    .datagrid-responsive {
        max-height: calc(100vh - 15vh);
        overflow-y: auto;
    }
}

.custom-disable {
    background-color: #f5f5f5;
    color: gray;
    opacity: 0.7;
}

.custom-disable:hover {
    background-color: #e0e0e0;
}

/* LenhCapContRong: dòng đang được select (xanh) / đã export (đỏ) */
.selected-row-lcr {
    /* Navy blue for selected rows */
    background-color: #0D47A1 !important;
}

.selected-row-lcr>td {
    color: white !important;
}

.exported-row-lcr {
    background-color: #D32F2F !important;
}

.exported-row-lcr>td {
    color: white !important;
}

.mud-input-control>.mud-input-control-input-container>.mud-input-label-inputcontrol {
    font-size: var(--mud-input-label-size, 1rem) !important;

}

.mud-input {
    font-size: var(--mud-input-root-size, 1rem) !important;
}

.mud-table-cell {
    font-size: var(--mud-input-table-cell-size, 1rem) !important;
}

.mud-table-container {
    scrollbar-width: auto;
    scrollbar-color: #888 #f1f1f1;
}

.table-shipment-bg {
    padding: 8px !important;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.08);
    background-color: #fff !important;
}

/* Sidebar NavMenu: cỡ chữ và kiểu chữ chỉ trong menu (1.9). Không đặt kiểu chữ = font hiện tại của phần mềm. */
.nav-menu-full-height {
    font-family: var(--nav-menu-font-family, inherit) !important;
}

.nav-menu-full-height .mud-typography-overline,
.nav-menu-full-height .mud-nav-link-text,
.nav-menu-full-height .mud-nav-menu .mud-button-text,
.nav-menu-full-height .mud-nav-group,
.nav-menu-full-height .mud-nav-link {
    font-weight: 400 !important;
    font-size: var(--nav-menu-font-size, 12px) !important;
    font-family: var(--nav-menu-font-family, inherit) !important;
}

/* Logo công ty đầu menu trái (NavMenu.razor), tên miền ở dưới */
.nav-menu-full-height .nav-company-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 12px 6px;
}
.nav-menu-full-height .nav-company-logo img {
    max-width: 100%;
    max-height: 64px;
    object-fit: contain;
}
.nav-menu-full-height .nav-company-domain {
    font-size: var(--nav-menu-font-size, 12px);
    font-family: var(--nav-menu-font-family, inherit);
    opacity: .8;
    text-align: center;
    word-break: break-all;
}

.nav-menu-full-height .nav-section,
.nav-menu-full-height .nav-subsection,
.nav-menu-full-height .nav-search input {
    font-family: var(--nav-menu-font-family, inherit) !important;
}

@media (max-width: 768px) {
    .mud-icon-button {
        font-size: .4500rem;
    }

    .gap-3 {
        gap: 0.4500rem !important;
    }

    .mud-switch-label-medium {
        font-size: 0.4500rem !important;
    }

    .mud-input-control>.mud-input-control-input-container>.mud-input-label-inputcontrol {
        font-size: var(--mud-input-label-size, .5000rem) !important;
    }

    .mud-input {
        font-size: var(--mud-input-root-size, .5000rem) !important;
    }

    .mud-table-cell {
        font-size: var(--mud-input-table-cell-size, .5000rem) !important;
    }

    .mud-icon-size-small {
        font-size: .4500rem;
    }

    mud-checkbox-input {
        font-size: .4500rem;
    }

    .mud-typography-body1 {
        font-size: .4500rem;
        font-weight: 600;
        color: #333333;
    }

    .mud-switch-label-medium {
        font-size: .4500rem;
    }

    .mud-button-icon-size-small>*:first-child {
        font-size: 10px;
        /* hoặc kích thước bạn mong muốn */
    }

    .mud-button-filled-size-small {
        font-size: .4500rem;
        /* tuỳ chỉnh kích thước bạn muốn */
        padding: 1px 11px;
    }

    .mud-button {
        min-width: 50px;
    }

    .mud-button-text-size-small {
        padding: 4px 5px;
        font-size: .5125rem;
    }

    .mud-table-customtext,
    .no-wrap-cell {
        max-width: 50px;
        font-size: 9px;
    }

    .mud-table th,
    .mud-table td {
        font-size: 9px !important;
        padding: 2px !important;
    }

    .mud-tab {
        font-size: 0.6rem;
    }

    .mud-nav-group {
        font-size: 10px;
    }

    .button-align {
        margin-top: 30px;
    }

    .datagrid-responsive {
        max-height: calc(100vh - 25vh);
        overflow-y: auto;
    }

    .mud-table-container {
        overflow-x: auto;
    }

    .full-image,
    .panel-content img {
        max-width: 100%;
        height: auto;
        margin-left: 0;
    }

    .footer-container {
        font-size: 10px;
        padding: 4px;
    }

    .mud-tabs-toolbar {
        flex-wrap: wrap;
    }

    .close-tab-icon {
        font-size: 0.7rem;
    }

    .table-responsive {
        overflow-x: auto;
        display: block;
        width: 100%;
    }

    .no-wrap-cell {
        white-space: nowrap;
    }
}

/* HBL edit dialog: nhóm checkbox dạng lưới (5 hoặc 6 cột) */
.hbl-flags-group {
    margin: 6px 0 10px 0;
}

.hbl-flags-5cols {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px 14px;
}

.hbl-flags-6cols {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px 12px;
    align-items: start;
}

.hbl-profit-row {
    flex-wrap: nowrap !important;
    white-space: nowrap;
}

.hbl-profit-row .mud-radio-group {
    flex: 0 0 auto;
}

.hbl-profit-value {
    min-width: 120px;
}

/* MBL edit dialog: nhóm 4 checkbox một hàng */
.mbl-flags-4cols {
    display: grid;
    /* Co theo nội dung để gom 4 checkbox sát nhau */
    grid-template-columns: repeat(4, max-content);
    justify-content: start;
    align-items: start;
    column-gap: 18px;
    row-gap: 10px;
}

/* Tránh label checkbox xuống dòng (vd: "Received & Spent Agent") */
.mbl-flags-4cols .mud-checkbox-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Combo khách hàng + nút "+" thêm nhanh (Components/Shared/CustomerQuickAdd) */
.customer-combo {
    display: flex;
    align-items: center;
    gap: 2px;
    width: 100%;
}

.customer-combo > :first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.customer-combo .customer-quick-add {
    flex: 0 0 auto;
}

/* ===== Tab con (trong từng màn: Shipment, ĐNTT, Phiếu thu / chi, Chứng từ kế toán...) — nền màu nhạt xoay vòng ===== */
/* Thanh tab lớn trên cùng (MudDynamicTabs, class custom-tab) đã tô màu riêng nên không áp dụng. */
.mud-tabs:not(.custom-tab) .mud-tab { border-radius: 8px 8px 0 0; margin: 0 2px; transition: background-color .15s, box-shadow .15s; }
.mud-tabs:not(.custom-tab) .mud-tab:nth-child(6n+1 of .mud-tab) { background-color: #e8f1ff; }
.mud-tabs:not(.custom-tab) .mud-tab:nth-child(6n+2 of .mud-tab) { background-color: #e9f7ef; }
.mud-tabs:not(.custom-tab) .mud-tab:nth-child(6n+3 of .mud-tab) { background-color: #fff4e5; }
.mud-tabs:not(.custom-tab) .mud-tab:nth-child(6n+4 of .mud-tab) { background-color: #f3e8ff; }
.mud-tabs:not(.custom-tab) .mud-tab:nth-child(6n+5 of .mud-tab) { background-color: #e6f7f8; }
.mud-tabs:not(.custom-tab) .mud-tab:nth-child(6n+6 of .mud-tab) { background-color: #fdecef; }
.mud-tabs:not(.custom-tab) .mud-tab:hover { filter: brightness(.97); }
.mud-tabs:not(.custom-tab) .mud-tab.mud-tab-active { font-weight: 700; box-shadow: inset 0 -3px 0 var(--mud-palette-primary); filter: saturate(1.6); }

/* Danh sách xổ xuống rộng theo dữ liệu (min / max-width do wwwroot/js/popover-autowidth.js gán) */
.mud-popover.mud-popover-relative-width {
    width: max-content !important;
}

/* Lưới: cột rộng theo chữ đang hiện, cuộn ngang nếu bảng dài hơn màn hình */
.mud-data-grid .mud-table-container,
.mud-table-root .mud-table-container {
    overflow-x: auto;
}
.nvo-grid-fit table.mud-table {
    width: max-content !important;
    min-width: 100%;
    table-layout: auto !important;
}
.nvo-grid-fit .mud-table-cell {
    white-space: nowrap;
    width: auto !important;
}
/* Job / MBL / HBL: cột co theo dữ liệu, không chia đều phần trống */
.shipment-col-fit.nvo-grid-fit table.mud-table,
.shipment-col-fit table.mud-table {
    width: max-content !important;
    min-width: max-content !important;
    table-layout: auto !important;
}
.shipment-col-fit col {
    width: auto !important;
    min-width: 0 !important;
}
.shipment-col-fit .mud-table-cell {
    width: max-content !important;
    min-width: max-content !important;
    max-width: max-content !important;
    white-space: nowrap;
    padding-left: 6px !important;
    padding-right: 6px !important;
}
.shipment-col-fit .mud-table-cell.nvo-eye-col {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 88px !important;
}
/* DNTT: cột co theo chữ đang hiện, không chia đều phần trống của lưới */
.dntt-compact.nvo-grid-fit table.mud-table,
.dntt-compact table.mud-table {
    width: max-content !important;
    min-width: max-content !important;
    table-layout: auto !important;
}
.dntt-compact col {
    width: auto !important;
    min-width: 0 !important;
}
.dntt-compact .mud-table-cell {
    width: max-content !important;
    min-width: max-content !important;
    max-width: max-content !important;
    white-space: nowrap;
}
.dntt-compact .mud-table-cell .mud-input-control,
.dntt-compact .mud-table-cell .mud-input {
    min-width: 0 !important;
    width: auto !important;
}
/* Con mắt: mở đúng form sửa, chỉ xem. Kéo lên xuống được; không sửa ô, không bấm lưu. Tab vẫn bấm để xem hết. */
.mud-dialog.nvo-view-only .mud-dialog-content {
    pointer-events: auto;
    overflow-y: auto;
    max-height: calc(100vh - 132px);
}
.mud-dialog.nvo-view-only .mud-dialog-content .mud-input-control,
.mud-dialog.nvo-view-only .mud-dialog-content input,
.mud-dialog.nvo-view-only .mud-dialog-content textarea,
.mud-dialog.nvo-view-only .mud-dialog-content select,
.mud-dialog.nvo-view-only .mud-dialog-content .mud-input,
.mud-dialog.nvo-view-only .mud-dialog-content .mud-button-filled,
.mud-dialog.nvo-view-only .mud-dialog-content .mud-icon-button {
    pointer-events: none;
}
.mud-dialog.nvo-view-only .mud-dialog-content .mud-tabs,
.mud-dialog.nvo-view-only .mud-dialog-content .mud-tab,
.mud-dialog.nvo-view-only .mud-dialog-content .mud-table-container,
.mud-dialog.nvo-view-only .mud-dialog-content .nvo-row-scroll {
    pointer-events: auto;
}
.nvo-row-scroll {
    max-height: calc(100vh - 180px);
    overflow: auto;
}
/* Cột con mắt dính bên trái khi kéo ngang lưới */
.nvo-grid-fit th.nvo-eye-col,
.nvo-grid-fit td.nvo-eye-col {
    position: sticky;
    left: 0;
    z-index: 3;
    /* Cùng màu nền lưới (HBL cam nhạt…), không trắng riêng; lưới không đặt màu thì theo nền MudBlazor */
    background: var(--nvo-grid-bg, var(--mud-palette-surface, #fff));
}
.nvo-grid-fit th.nvo-eye-col { z-index: 4; }
.mud-dialog.nvo-view-only .mud-dialog-actions .mud-button-filled {
    display: none !important;
}
.nvo-view-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 12px;
    font-weight: 700;
    vertical-align: middle;
}
.nvo-grid-pages {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 6px 10px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 13px;
    color: #334155;
}
.nvo-grid-pages button {
    width: 32px;
    height: 28px;
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    color: #0f4c81;
}
.nvo-grid-pages button:disabled { opacity: .35; cursor: default; }
.nvo-grid-pages select {
    height: 28px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    padding: 0 6px;
}

/* Mọi lưới: bỏ icon phễu lọc (nút lọc trên tiêu đề cột, phễu chọn toán tử và phễu xóa lọc ở hàng lọc). Ô nhập lọc vẫn giữ. */
.mud-data-grid .column-header .filter-button,
.mud-data-grid .filter-header-cell .mud-menu,
.mud-data-grid .filter-header-cell .mud-icon-button {
    display: none !important;
}


/* Dòng phí Debit / Credit thiếu thông tin bắt buộc (Services/ChargeLineCheck) */
.charge-row-missing:not(.selected):not(.custom-disable) > td { background-color: #fff3f2 !important; }
.charge-row-missing > td:first-child { box-shadow: inset 3px 0 0 #e53935; }


/* Đánh số tiêu đề cột theo thứ tự đang hiện (GridLayoutColumn NumberHeaders): "1. Job No", "2. …" — cột chức năng không đánh số */
.mud-table-head tr:first-child { counter-reset: nvo-col; }
.mud-table-head th.nvo-num-col { counter-increment: nvo-col; }
.mud-table-head th.nvo-num-col .column-header > :first-child::before { content: counter(nvo-col) ". "; color: #64748b; font-weight: 600; margin-right: 2px; }


/* Cây Job → MBL → HBL kiểu Explorer (NvoHierarchyColumn): mũi tên ▸ nhích qua lại, thư mục đóng / mở, số dòng con */
.nvo-hier-col { padding: 0 1px !important; width: 1%; white-space: nowrap; }
.nvo-tree-head { font-size: 10.5px; color: var(--mud-palette-text-secondary); }
.nvo-tree-btn { display: inline-flex; align-items: center; gap: 0; border: 0; background: transparent; cursor: pointer; padding: 1px 2px; border-radius: 5px; line-height: 1; }
.nvo-tree-btn:hover:not([disabled]) { background: var(--mud-palette-primary-hover); }
.nvo-tree-btn[disabled] { cursor: default; opacity: .45; }
.nvo-tree-btn .nvo-tree-chev { font-size: 15px; width: 15px; height: 15px; color: var(--mud-palette-primary); }
.nvo-tree-btn:not([disabled]):not(.open) .nvo-tree-chev { animation: nvo-hier-nudge 1.2s ease-in-out infinite; }
.nvo-tree-btn:hover .nvo-tree-chev { animation-play-state: paused; }
.nvo-tree-btn .nvo-tree-folder { font-size: 16px; width: 16px; height: 16px; color: #f5a623; }
.nvo-tree-btn.empty .nvo-tree-folder { color: #c9ced6; }
.nvo-tree-count { min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: var(--mud-palette-primary); color: #fff; font-size: 9.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-left: 1px; }
.nvo-tree-btn.empty .nvo-tree-count { background: #c9ced6; }
.nvo-tree-child { margin-left: 18px; padding-left: 10px; border-left: 2px dashed #b0bec5; }
@keyframes nvo-hier-nudge {
    0%, 100% { transform: translateX(-1px); opacity: 1; }
    50% { transform: translateX(3px); opacity: .55; }
}
@media (prefers-reduced-motion: reduce) {
    .nvo-tree-btn .nvo-tree-chev { animation: none !important; }
}


/* Ô được trỏ tới từ danh sách "còn thiếu" (nvoFocusField) */
.nvo-field-flash { border-radius: 8px; animation: nvo-field-flash 0.8s ease-in-out 3; }
@keyframes nvo-field-flash {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 124, 0, 0); }
    50% { box-shadow: 0 0 0 3px rgba(245, 124, 0, .75); background: rgba(255, 183, 77, .15); }
}

/* Kéo chuột trái để cuộn mọi lưới (MyJS.js): con trỏ nắm + không bôi đen chữ khi đang kéo */
html.nvo-dragging, html.nvo-dragging * { cursor: grabbing !important; user-select: none !important; }

/* Mũi tên nhấp nháy khi lưới còn dòng / cột chưa hiện (js/scroll-hint.js) */
.nvo-scroll-hint {
    position: fixed;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #90caf9;
    background: rgba(13, 71, 161, .88);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    line-height: 28px;
    text-align: center;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(13, 71, 161, .35);
    animation: nvo-scroll-hint-blink 1.1s ease-in-out infinite;
}
.nvo-scroll-hint:hover { animation-play-state: paused; opacity: 1; background: #0d47a1; }
.nvo-scroll-hint-down { animation-name: nvo-scroll-hint-blink-down; }
.nvo-scroll-hint-right { animation-name: nvo-scroll-hint-blink-right; }
@keyframes nvo-scroll-hint-blink-down {
    0%, 100% { opacity: .95; transform: translateY(0); }
    50% { opacity: .35; transform: translateY(4px); }
}
@keyframes nvo-scroll-hint-blink-right {
    0%, 100% { opacity: .95; transform: translateX(0); }
    50% { opacity: .35; transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
    .nvo-scroll-hint { animation: none; opacity: .85; }
}
@media print {
    .nvo-scroll-hint { display: none !important; }
}

/* Tìm trong lưới giống Excel (js/grid-find.js) */
.nvo-find-bar {
    position: fixed;
    top: 72px;
    right: 24px;
    z-index: 1700;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #fff;
    border: 1px solid #b0bec5;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .18);
    font-size: 13px;
    color: #263238;
}
.nvo-find-bar .nvo-find-icon { font-size: 17px; color: #1565c0; }
.nvo-find-bar input[type=text] {
    width: 220px;
    height: 28px;
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    padding: 0 8px;
    outline: none;
    font-size: 13px;
}
.nvo-find-bar input[type=text]:focus { border-color: #1565c0; box-shadow: 0 0 0 2px rgba(21, 101, 192, .15); }
.nvo-find-bar.nvo-find-none input[type=text] { background: #ffebee; border-color: #e57373; }
.nvo-find-bar .nvo-find-count { min-width: 54px; text-align: center; color: #546e7a; font-variant-numeric: tabular-nums; }
.nvo-find-bar button {
    width: 28px;
    height: 28px;
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    color: #1f3a5f;
    font-weight: 700;
}
.nvo-find-bar button:hover { background: #e3f2fd; }
.nvo-find-bar label { display: flex; align-items: center; gap: 3px; cursor: pointer; color: #455a64; user-select: none; }
.nvo-find-lens {
    position: fixed;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid #90caf9;
    background: rgba(255, 255, 255, .95);
    color: #1565c0;
    font-size: 16px;
    line-height: 22px;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .15);
}
.nvo-find-lens:hover { background: #e3f2fd; }
td.nvo-find-cell { box-shadow: inset 0 0 0 1px #ffb300; }
td.nvo-find-current-cell { box-shadow: inset 0 0 0 2px #2e7d32 !important; background: #e8f5e9 !important; }
::highlight(nvo-find) { background-color: #ffe082; color: #000; }
::highlight(nvo-find-current) { background-color: #66bb6a; color: #000; }
@media print {
    .nvo-find-bar, .nvo-find-lens { display: none !important; }
}

/* Tìm kiểu Excel trên toàn bộ dữ liệu của lưới (Components/Shared/GridFindBar.razor) */
.nvo-gfind {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 34px;
    padding: 0 6px 0 8px;
    border: 1px solid #b0bec5;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
}
.nvo-gfind:focus-within { border-color: #1565c0; box-shadow: 0 0 0 2px rgba(21, 101, 192, .15); }
.nvo-gfind.nvo-gfind-none { background: #ffebee; border-color: #e57373; }
.nvo-gfind-icon { color: #1565c0; }
.nvo-gfind-input { width: 190px; border: none; outline: none; background: transparent; font: inherit; color: #0f172a; }
.nvo-gfind-count { min-width: 56px; text-align: center; color: #546e7a; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nvo-gfind-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 4px;
    border: 1px solid #cfd8dc;
    border-radius: 5px;
    background: #fff;
    color: #1565c0;
    cursor: pointer;
    font: inherit;
    white-space: nowrap;
}
.nvo-gfind-btn:hover:not(:disabled) { background: #e3f2fd; }
.nvo-gfind-btn:disabled { opacity: .4; cursor: default; }
.nvo-gfind-all { padding: 0 8px; }
.nvo-gfind-opt { display: inline-flex; align-items: center; gap: 2px; margin: 0 2px; color: #455a64; cursor: pointer; user-select: none; white-space: nowrap; }
.nvo-gfind-row { display: grid; grid-template-columns: 110px 120px minmax(160px, 320px); gap: 10px; font-size: 13px; }
.nvo-gfind-row-key { font-weight: 600; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nvo-gfind-row-col { color: #607d8b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nvo-gfind-row-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nvo-gfind-row-cur .nvo-gfind-row-key { color: #2e7d32; }

/* Lọc kiểu Excel (Components/Shared/AdvancedSearch.razor) gắn trong thanh công cụ của mọi lưới: thanh cao theo nội dung, trải hết chiều ngang */
.mud-table-toolbar:has(> .adv-search),
.mud-toolbar:has(> .adv-search) { height: auto !important; min-height: 0 !important; flex-wrap: wrap; padding-top: 4px; padding-bottom: 2px; }
/* thanh lọc bị ẩn (lưới trong hộp thoại / tab con) → bỏ dải toolbar trống */
.mud-table-toolbar:not(:has(*)) { display: none !important; }
.mud-toolbar > .adv-search { flex: 1 1 100%; min-width: 0; margin: 0 0 4px; }
