body {
    overflow-x: hidden;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR DRAWER SCROLL FIX
   MudBlazor drawer uses flex column - must set min-height:0
   so flex children can shrink and overflow-y:auto can work
   ══════════════════════════════════════════════════════════ */

/* 1. Constrain the drawer to viewport height */
.mud-drawer.premium-drawer-responsive {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    /* Flexbox: allow this flex child to shrink */
    min-height: 0 !important;
    flex-shrink: 1 !important;
}

/* 2. Make drawer-content fill drawer and scroll */
.mud-drawer.premium-drawer-responsive>.mud-drawer-content {
    /* Must fill the parent height */
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    /* KEY: removes default min-height:auto */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior-y: contain;
}

/* 3. MudNavMenu inside must not force parent to grow and has padding at bottom */
.mud-drawer.premium-drawer-responsive .mud-nav-menu {
    flex-shrink: 0;
    min-height: 0;
    padding-bottom: 80px !important;
}

/* Hide close button on desktop */
.mobile-drawer-close-btn {
    display: none !important;
}

@media (max-width: 959.98px) {

    /* Show close button on mobile/tablet */
    .mobile-drawer-close-btn {
        display: inline-flex !important;
        color: var(--mud-palette-text-primary) !important;
    }

    /* Fix for responsive drawer not closing completely on mobile/tablet due to custom width overrides */
    .mud-drawer.premium-drawer-responsive.mud-drawer--closed,
    .mud-drawer.premium-drawer-responsive.mud-drawer-closed {
        transform: translateX(-100%) !important;
    }
}

/* Responsive Right Drawer (PremiumDrawer) */
.mud-drawer.premium-right-drawer-responsive {
    max-width: 100vw !important;
}

@media (max-width: 600px) {
    .mud-drawer.premium-right-drawer-responsive {
        width: 100% !important;
        border-radius: 0 !important;
    }
}

/* Hide checkboxes and fix highlights inside MudSelect & MudAutocomplete popover menus */
.staff-autocomplete-popover .mud-checkbox,
.staff-autocomplete-popover .mud-list-item-icon,
.staff-autocomplete-popover .mud-icon-root,
.no-checkbox-popover .mud-checkbox,
.no-checkbox-popover .mud-list-item-icon,
.no-checkbox-popover .mud-icon-root {
    display: none !important;
}

.staff-autocomplete-popover .mud-list-item,
.no-checkbox-popover .mud-list-item {
    padding-left: 16px !important;
    background-color: transparent !important;
    color: var(--mud-palette-text-primary) !important;
}

.staff-autocomplete-popover .mud-list-item *,
.staff-autocomplete-popover .mud-typography,
.staff-autocomplete-popover .mud-list-item-text,
.staff-autocomplete-popover .mud-selected-item,
.staff-autocomplete-popover .mud-selected,
.staff-autocomplete-popover .mud-list-item-focus,
.staff-autocomplete-popover .mud-list-item.mud-selected,
.staff-autocomplete-popover .mud-primary-text,
.no-checkbox-popover .mud-list-item *,
.no-checkbox-popover .mud-typography,
.no-checkbox-popover .mud-list-item-text,
.no-checkbox-popover .mud-selected-item,
.no-checkbox-popover .mud-selected,
.no-checkbox-popover .mud-list-item-focus,
.no-checkbox-popover .mud-list-item.mud-selected,
.no-checkbox-popover .mud-primary-text {
    color: var(--mud-palette-text-primary) !important;
    background-color: transparent !important;
}

.staff-autocomplete-popover .mud-list-item:hover,
.staff-autocomplete-popover .mud-list-item:hover *,
.no-checkbox-popover .mud-list-item:hover,
.no-checkbox-popover .mud-list-item:hover * {
    background-color: var(--mud-palette-action-default-hover) !important;
    color: var(--mud-palette-text-primary) !important;
}

/* ── The SELECTED item of the filter-bar selects ─────────────────────────
   MudSelect's popover content is rendered through MudPopoverProvider so it sits
   OUTSIDE the component's DOM tree ⇒ scoped CSS (*.razor.css) cannot reach it, so it
   must live in this global file.

   Previously each page wrote its own <style> inside .razor and Users.razor even mistyped
   the popover-controlling class (type-select-popoverr — 8 dead selectors), so this group
   of rules effectively only worked for 1 selector. The real controlling classes:
   Users = type-select-popover, Posts = category-select-popover. */
.type-select-popover .mud-selected,
.type-select-popover .mud-selected-item,
.type-select-popover .mud-list-item.mud-selected,
.type-select-popover .mud-list-item.mud-selected-item,
.type-select-popover .mud-selected:hover,
.type-select-popover .mud-selected-item:hover,
.type-select-popover .mud-list-item.mud-selected:hover,
.type-select-popover .mud-list-item.mud-selected-item:hover,
.type-select-popover .mud-list-item.mud-selected .mud-list-item-text,
.type-select-popover .mud-list-item.mud-selected-item .mud-list-item-text,
.category-select-popover .mud-selected,
.category-select-popover .mud-selected-item,
.category-select-popover .mud-list-item.mud-selected,
.category-select-popover .mud-list-item.mud-selected-item,
.category-select-popover .mud-selected:hover,
.category-select-popover .mud-selected-item:hover,
.category-select-popover .mud-list-item.mud-selected:hover,
.category-select-popover .mud-list-item.mud-selected-item:hover,
.category-select-popover .mud-list-item.mud-selected .mud-list-item-text,
.category-select-popover .mud-list-item.mud-selected-item .mud-list-item-text {
    background-color: #f1f5fb !important;
    color: #2563eb !important;
}

/* The selected item is marked by the page with its own class (Posts: category-selected-item). */
.category-select-popover .category-selected-item,
.category-select-popover .category-selected-item:hover,
.category-select-popover .category-selected-item .mud-list-item-text {
    background-color: #f1f5fb !important;
    color: #2563eb !important;
}

/* ── Flat button on the filter bar ───────────────────────────────────────────────
   A shared recipe for the "Reset" button (7 list pages) and the "Reload" button
   (Invoices). Previously each place repeated an identical inline Style ⇒ consolidated into 1 class
   so the look can be changed in ONE place. !important is required because MudButton sets
   the background/box-shadow of Variant.Filled itself. */
.erp-btn-reset {
    text-transform: none !important;
    font-size: 0.875rem !important;
    white-space: nowrap !important;
    background-color: var(--mud-palette-surface) !important;
    box-shadow: none !important;
    font-weight: normal !important;
}

.required-mark {
    color: #ef4444;
}

.input-label {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    min-height: 20px;
    align-items: center;
    margin-bottom: 6px;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
}

.aligned-field {
    width: 100%;
    min-width: 0;
}

/* The height is dictated by the central contract (App.razor.css) — only width is kept here. */
.aligned-field .mud-input-control-input-container,
.aligned-field .mud-input.mud-input-outlined {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
}

.aligned-field .mud-input.mud-input-outlined,
.aligned-field .mud-select-input,
.aligned-field .mud-input-adornment {
    align-items: center !important;
}

.aligned-field .mud-input {
    margin-bottom: 10px !important;
}

.aligned-field .mud-select-input,
.aligned-field .mud-input-slot {
    box-sizing: border-box;
}

.aligned-field .mud-input-adornment {
    height: 100% !important;
    margin-top: 0 !important;
}

.aligned-field input.mud-input-slot {
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: block !important;
    flex: 1 1 auto !important;
    box-sizing: border-box;
}

.popup-date-range.mud-picker .mud-input-control,
.popup-date-range .mud-input-control {
    margin-top: 0 !important;
}

.item-title-clickable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease-in-out;
    color: #2486f7;
}

.item-title-clickable:hover {
    color: var(--mud-palette-primary);
    text-decoration: underline;
}

.custom-toolbar-container {
    display: flex !important;
    align-items: center !important;
    /* The filter row is RIGHT-aligned: the search box stretches to fill the empty space
       (.premium-table-search below) so every dropdown and the "Reset" button always hug the right edge,
       matching the Orders page layout. */
    justify-content: flex-end !important;
    gap: 8px !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
}

/* The shared search box (PremiumTableSearch) is the ONLY flexible flex item:
   it used to declare width: 320px inline so the filter row could not be right-aligned. */
.premium-table-search {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

/* ══════════════════════════════════════════════════════════
   PREVENT LAYOUT SHIFT & FOOTER JUMPING ON DATA LOAD
   Stabilizes table height so footer does not bounce when switching pages
   ══════════════════════════════════════════════════════════ */
.premium-table,
.mud-table.premium-table {
    min-height: 480px;
    display: flex !important;
    flex-direction: column !important;
}

.premium-table .mud-table-container,
.mud-table.premium-table .mud-table-container {
    flex: 1 1 auto;
    min-height: 380px;
}

.segment-filter-group {
    border: 1px solid #d0d7de !important;
    height: var(--erp-control-height, 40px);
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    background-color: #ffffff !important;
    border-radius: 6px !important;
    overflow: hidden !important;
}

.segment-filter-group .mud-input-control {
    margin: 0 !important;
    height: 100% !important;
}

.segment-filter-group .mud-input-control-input-container {
    height: 100% !important;
}

.segment-filter-group .segment-select {
    border-right: 1px solid #e0e0e0;
    border-radius: 0 !important;
    height: 100% !important;
}

.segment-filter-group .segment-select .mud-input-outlined fieldset {
    border: none !important;
}

.segment-filter-group .segment-select .mud-input {
    height: 100% !important;
    margin-top: 0 !important;
}

.segment-filter-group .type-select {
    flex: 1 1 auto !important;
    min-width: 160px !important;
    width: auto !important;
}

.segment-filter-group .type-select .mud-input,
.segment-filter-group .type-select .mud-input-control,
.segment-filter-group .type-select .mud-input-control-input-container {
    width: 100% !important;
}

.segment-filter-group .segment-select .mud-input-slot {
    height: 100% !important;
    align-items: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.segment-filter-group .segment-select .mud-input,
.segment-filter-group .segment-select .mud-input-control,
.segment-filter-group .segment-select .mud-input-control-input-container {
    min-width: 0 !important;
}

.segment-filter-group .segment-select .mud-input-adornment-end {
    flex: 0 0 auto !important;
}

.segment-filter-group .category-select .mud-input-slot {
    width: auto !important;
    max-width: none !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.segment-filter-group .status-select {
    width: 160px !important;
    flex: 0 0 auto !important;
}

.custom-table-pager {
    width: 100%;
    min-height: 64px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    padding: 0 16px;
    border-top: 1px solid #eeeeee;
    background: #ffffff;
}

.pager-summary {
    color: #4b5563;
    font-size: 13px;
    white-space: nowrap;
}

.pager-page-size,
.pager-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4b5563;
    font-size: 13px;
    white-space: nowrap;
}

.pager-page-size {
    grid-column: 2;
    justify-self: center;
}

.pager-navigation {
    grid-column: 3;
    justify-self: end;
}

.page-size-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.page-size-select {
    width: 55px;
    height: var(--erp-control-height, 40px);
    padding: 0 20px 0 8px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background-color: #ffffff;
    color: #374151;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.page-size-select-icon {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

.page-size-select:focus {
    border-color: #2196f3;
}

.pager-arrow {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
}

.pager-arrow:hover:not(:disabled) {
    background: #f3f4f6;
    color: #2196f3;
}

.pager-arrow:disabled {
    color: #e5e7eb;
    cursor: default;
}

.current-page {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #2196f3;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 700px) {
    .custom-table-pager {
        grid-template-columns: 1fr auto;
        gap: 12px;
        padding: 12px;
    }

    .pager-summary {
        grid-column: 1 / -1;
    }

    .pager-page-size {
        grid-column: 1;
        justify-self: start;
    }

    .pager-navigation {
        grid-column: 2;
        justify-self: end;
    }
}

.thumbnail-container {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.thumbnail-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center;
    border-radius: inherit;
}

.thumbnail-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    flex-shrink: 0;
}

.thumbnail-icon {
    width: 24px !important;
    height: 24px !important;
    color: #9ca3af !important;
    font-size: 24px !important;
}

/* ══════════════════════════════════════════════════════════════════
   Account menu (the account dropdown in the header — Layouts/MainLayout.razor)
   Reuses design-system tokens/colors: text #212B36, label #637381, primary #2486f7, danger #E53935
   ══════════════════════════════════════════════════════════════════ */

.account-menu-activator {
    cursor: pointer;
}

.appbar-brand-title {
    display: inline-flex;
    align-items: center;
    font-size: 18px;
    font-weight: 700;
    color: #0F172A;
    cursor: pointer;
    user-select: none;
    letter-spacing: -0.2px;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.appbar-brand-title:hover {
    background-color: #F1F5F9;
}

.appbar-brand-icon {
    font-size: 22px !important;
    color: #0F172A !important;
}

.mud-theme-dark .appbar-brand-title {
    color: #F8FAFC !important;
}

.mud-theme-dark .appbar-brand-title:hover {
    background-color: #334155 !important;
}

.mud-theme-dark .appbar-brand-icon {
    color: #F8FAFC !important;
}

/* ══════════════════════════════════════════════════════════
   TABBAR COLLAPSED STATE (MATCHING INET REFERENCE DESIGN)
   ══════════════════════════════════════════════════════════ */
.tabbar-drawer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 6px;
    border: 1.5px solid #CBD5E1;
    background-color: #FFFFFF;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s ease;
    color: inherit;
}

.tabbar-drawer-btn:hover {
    background-color: #F1F5F9;
    border-color: #94A3B8;
}

.mud-theme-dark .tabbar-drawer-btn {
    border-color: #475569;
    background-color: #1E293B;
    color: #FFFFFF;
}

.mud-theme-dark .tabbar-drawer-btn:hover {
    background-color: #334155;
    border-color: #64748B;
}

/* Tabbar brand logo (when collapsed) */
.tabbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    margin-right: 2px;
}

.tabbar-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    background: linear-gradient(135deg, #0284C7 0%, #10B981 100%);
    color: #FFFFFF;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2);
    transition: transform 0.15s ease;
}

.tabbar-logo-badge:hover {
    transform: scale(1.02);
}

/* Header search button pill on the left */
.header-search-pill {
    display: flex;
    align-items: center;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    height: 38px;
    padding: 0 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    gap: 10px;
    width: 420px;
    min-width: 300px;
    max-width: 520px;
}

.header-search-pill:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* Header search using employee page component (PremiumTableSearch) */
.header-premium-search {
    width: 420px;
    min-width: 300px;
    max-width: 520px;
    flex: 0 0 auto !important;
    cursor: pointer;
}

.header-premium-search .mud-input-control {
    margin: 0 !important;
}

.header-premium-search .mud-input.mud-input-outlined {
    border-radius: 8px !important;
    height: 40px !important;
    cursor: pointer !important;
}

.header-premium-search input {
    cursor: pointer !important;
    user-select: none;
}

/* Light mode for header-premium-search */
.tabbar-light .header-premium-search .mud-input.mud-input-outlined {
    background-color: #FFFFFF !important;
    color: #000000 !important;
}

.tabbar-light .header-premium-search .mud-input-outlined-border {
    border-color: #CBD5E1 !important;
}

.tabbar-light .header-premium-search:hover .mud-input-outlined-border {
    border-color: #94A3B8 !important;
}

.tabbar-light .header-premium-search .mud-icon-root,
.tabbar-light .header-premium-search .mud-input-adornment {
    color: #000000 !important;
}

.tabbar-light .header-premium-search input {
    color: #000000 !important;
}

.tabbar-light .header-premium-search input::placeholder {
    color: #64748B !important;
}

/* Dark mode for header-premium-search */
.tabbar-dark .header-premium-search .mud-input.mud-input-outlined {
    background-color: #0B1320 !important;
    border-radius: 8px !important;
    color: #FFFFFF !important;
}

.tabbar-dark .header-premium-search .mud-input-outlined-border {
    border-color: #24344E !important;
}

.tabbar-dark .header-premium-search:hover .mud-input-outlined-border {
    border-color: #38BDF8 !important;
}

.tabbar-dark .header-premium-search .mud-icon-root,
.tabbar-dark .header-premium-search .mud-input-adornment {
    color: #FFFFFF !important;
}

.tabbar-dark .header-premium-search input {
    color: #FFFFFF !important;
}

.tabbar-dark .header-premium-search input::placeholder {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* ══════════════════════════════════════════════════════════
   TABBAR COLOR THEMES (DARK / LIGHT)
   ══════════════════════════════════════════════════════════ */
/* LIGHT MODE: White background, all text pure BLACK */
.tabbar-light {
    background-color: #FFFFFF !important;
    border-bottom: 1px solid #E2E8F0 !important;
    color: #000000 !important;
}

.tabbar-light,
.tabbar-light span:not(.tabbar-logo-bold),
.tabbar-light div:not(.tabbar-logo-badge),
.tabbar-light p,
.tabbar-light .mud-typography {
    color: #000000 !important;
}

.tabbar-light .header-search-pill {
    background-color: #F8FAFC !important;
    border: 1px solid #CBD5E1 !important;
}

.tabbar-light .header-search-pill:hover {
    background-color: #F1F5F9 !important;
    border-color: #94A3B8 !important;
}

.tabbar-light .header-search-text {
    color: #000000 !important;
    font-weight: 500;
}

.tabbar-light .header-search-icon {
    color: #000000 !important;
}

.tabbar-light .header-search-kbd {
    background-color: #FFFFFF !important;
    border: 1px solid #CBD5E1 !important;
    color: #000000 !important;
}

.tabbar-light .header-icon-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 6px !important;
    background-color: #b0b0b0 !important;
    color: #0B1320 !important;
    border: 1.5px solid transparent !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

.tabbar-light .header-icon-btn:hover {
    background-color: #b0b0b0 !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 1px #38bdf8 !important;
    color: #0B1320 !important;
}

.tabbar-light .tabbar-drawer-btn {
    border-color: #CBD5E1 !important;
    background-color: #FFFFFF !important;
    color: #000000 !important;
}

.tabbar-light .tabbar-drawer-btn:hover {
    background-color: #F1F5F9 !important;
    border-color: #94A3B8 !important;
}

.tabbar-light .tabbar-drawer-btn .mud-icon-root,
.tabbar-light .tabbar-drawer-icon {
    color: #000000 !important;
}

.tabbar-light .header-icon-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 6px !important;
    background-color: transparent !important;
    border: 1.5px solid transparent !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.tabbar-light .header-icon-btn:hover {
    background-color: #F1F5F9 !important;
    border-color: #CBD5E1 !important;
}

.tabbar-light .header-icon-btn .mud-icon-root {
    color: #64748B !important;
    font-size: 22px !important;
}

.tabbar-light .header-icon-btn:hover .mud-icon-root {
    color: #0F172A !important;
}

.tabbar-light .header-avatar-box {
    width: 36px !important;
    height: 36px !important;
    border: 1.5px solid transparent !important;
    border-radius: 6px !important;
    background-color: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.tabbar-light .header-avatar-box:hover {
    background-color: #F1F5F9 !important;
    border-color: #CBD5E1 !important;
}

.tabbar-light .header-avatar-icon {
    color: #64748B !important;
    font-size: 24px !important;
}

.tabbar-light .header-avatar-box:hover .header-avatar-icon {
    color: #0F172A !important;
}

.tabbar-light .header-v-divider {
    background-color: #E2E8F0 !important;
}

/* DARK MODE: Current dark background, all text pure WHITE */
.tabbar-dark {
    background-color: #0B1320 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #FFFFFF !important;
}

.tabbar-dark,
.tabbar-dark span:not(.tabbar-logo-bold),
.tabbar-dark div:not(.tabbar-logo-badge),
.tabbar-dark p,
.tabbar-dark .mud-typography {
    color: #FFFFFF !important;
}

.tabbar-dark .header-search-pill {
    background-color: #0B1320 !important;
    border: 1px solid #24344E !important;
}

.tabbar-dark .header-search-pill:hover {
    background-color: #141E33 !important;
    border-color: #38BDF8 !important;
}

.tabbar-dark .header-search-text {
    color: #FFFFFF !important;
    font-weight: 500;
}

.tabbar-dark .header-search-icon {
    color: #FFFFFF !important;
}

.tabbar-dark .header-search-kbd {
    background-color: #1E293B !important;
    border: 1px solid #475569 !important;
    color: #FFFFFF !important;
}

.tabbar-dark .header-icon-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 6px !important;
    background-color: #141E33 !important;
    color: #b0b0b0 !important;
    border: 1.5px solid #1E2D4A !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

.tabbar-dark .header-icon-btn:hover {
    background-color: #1A2744 !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 1px #38bdf8 !important;
    color: #FFFFFF !important;
}

.tabbar-dark .header-icon-btn .mud-icon-root {
    color: #b0b0b0 !important;
    font-size: 22px !important;
}

.tabbar-dark .header-icon-btn:hover .mud-icon-root {
    color: #FFFFFF !important;
}

.tabbar-dark .tabbar-drawer-btn {
    border-color: #475569 !important;
    background-color: #1E293B !important;
    color: #FFFFFF !important;
}

.tabbar-dark .tabbar-drawer-btn:hover {
    background-color: #334155 !important;
    border-color: #64748B !important;
}

.tabbar-dark .tabbar-drawer-btn .mud-icon-root,
.tabbar-dark .tabbar-drawer-icon {
    color: #FFFFFF !important;
}

.tabbar-dark .header-avatar-box {
    width: 36px !important;
    height: 36px !important;
    border: 1.5px solid #1E2D4A !important;
    border-radius: 6px !important;
    background-color: #141E33 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.tabbar-dark .header-avatar-box:hover {
    background-color: #1A2744 !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 1px #38bdf8 !important;
}

.tabbar-dark .header-avatar-icon {
    color: #b0b0b0 !important;
    font-size: 24px !important;
}

.tabbar-dark .header-avatar-box:hover .header-avatar-icon {
    color: #FFFFFF !important;
}

.tabbar-dark .header-v-divider {
    background-color: #334155 !important;
}

/* User avatar trigger in header (square with rounded borders) */
.header-avatar-box {
    width: 36px;
    height: 36px;
    border: 1.5px solid transparent;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.header-avatar-box:hover {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 1px #38bdf8 !important;
}

.header-avatar-icon {
    font-size: 24px !important;
}

/* Popover Shell */
.header-popover-panel .mud-popover-paper {
    border-radius: 8px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
    overflow: hidden !important;
}

/* Notification Popover */
.notification-dropdown {
    width: 280px;
    background: #FFFFFF;
}

.notification-header {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    color: #0F172A;
}

.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    text-align: center;
}

.notification-empty-text {
    font-size: 13px;
    color: #64748B;
    margin-top: 8px;
}

/* User Dropdown Panel (Matching Image 2) */
.user-dropdown-panel {
    width: 280px;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    padding-bottom: 6px;
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 12px 16px;
}

.user-dropdown-avatar {
    width: 52px;
    height: 52px;
    background: #CBD5E1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-dropdown-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-dropdown-name {
    font-size: 14px;
    font-weight: 700;
    color: #0F172A;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.user-dropdown-role {
    font-size: 12px;
    color: #64748B;
    margin-top: 2px;
    line-height: 1.3;
}

.user-dropdown-email {
    font-size: 12px;
    color: #475569;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.user-dropdown-menu-list {
    display: flex;
    flex-direction: column;
    padding: 4px 0;
}

.user-dropdown-item {
    padding: 9px 16px;
    font-size: 13.5px;
    color: #1E293B;
    cursor: pointer;
    transition: background-color 0.12s ease;
    user-select: none;
    display: flex;
    align-items: center;
}

.user-dropdown-item:hover {
    background-color: #F8FAFC;
    color: #0F172A;
}

a.user-dropdown-item {
    text-decoration: none !important;
    color: inherit;
}

.user-dropdown-settings {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px 16px;
}

.user-dropdown-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setting-label {
    font-size: 13.5px;
    color: #1E293B;
    font-weight: 500;
}

.segmented-control {
    display: flex;
    background: #F1F5F9;
    border-radius: 6px;
    padding: 2px;
    border: 1px solid #E2E8F0;
    gap: 2px;
}

.segmented-btn {
    border: none;
    background: transparent;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    transition: all 0.12s ease;
}

.segmented-btn:hover {
    color: #0F172A;
}

.segmented-btn.active {
    background: #FFFFFF;
    color: #0F172A;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-dropdown-logout-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 500;
    color: #1E293B;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
    user-select: none;
}

.user-dropdown-logout-row:hover {
    background-color: #FEF2F2;
    color: #DC2626;
}

/* ══════════════════════════════════════════════════════════
   DARK MODE: USER DROPDOWN & NOTIFICATION POPOVER (#0B1320)
   ══════════════════════════════════════════════════════════ */
.header-popover-panel--dark,
.header-popover-panel--dark.mud-popover-paper,
.header-popover-panel--dark .mud-popover-paper,
.app-theme-dark .header-popover-panel,
.app-theme-dark .header-popover-panel.mud-popover-paper,
.app-theme-dark .header-popover-panel .mud-popover-paper {
    background-color: #0B1320 !important;
    background: #0B1320 !important;
    border: none !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5) !important;
}

.header-popover-panel--dark .user-dropdown-panel,
.app-theme-dark .user-dropdown-panel {
    background-color: #0B1320 !important;
    background: #0B1320 !important;
    color: #FFFFFF !important;
}

.header-popover-panel--dark .user-dropdown-header,
.app-theme-dark .user-dropdown-header {
    background-color: transparent !important;
}

.header-popover-panel--dark .user-dropdown-avatar,
.app-theme-dark .user-dropdown-avatar {
    background-color: #141E33 !important;
    border: 1px solid #1E2D4A !important;
}

.header-popover-panel--dark .user-dropdown-avatar .mud-icon-root,
.app-theme-dark .user-dropdown-avatar .mud-icon-root {
    color: #38BDF8 !important;
}

.header-popover-panel--dark .user-dropdown-name,
.app-theme-dark .user-dropdown-name {
    color: #FFFFFF !important;
    font-weight: 700 !important;
}

.header-popover-panel--dark .user-dropdown-role,
.app-theme-dark .user-dropdown-role {
    color: #38BDF8 !important;
    font-weight: 500 !important;
}

.header-popover-panel--dark .user-dropdown-email,
.app-theme-dark .user-dropdown-email {
    color: rgba(255, 255, 255, 0.8) !important;
}

.header-popover-panel--dark .user-dropdown-item,
.app-theme-dark .user-dropdown-item {
    color: #FFFFFF !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
}

.header-popover-panel--dark .user-dropdown-item:hover,
.app-theme-dark .user-dropdown-item:hover {
    background-color: #141E33 !important;
    color: #38BDF8 !important;
}

.header-popover-panel--dark .setting-label,
.app-theme-dark .setting-label {
    color: #FFFFFF !important;
}

.header-popover-panel--dark .segmented-control,
.app-theme-dark .segmented-control {
    background-color: #141E33 !important;
    background: #141E33 !important;
    border: 1px solid #24344E !important;
}

.header-popover-panel--dark .segmented-btn,
.app-theme-dark .segmented-btn {
    color: rgba(255, 255, 255, 0.7) !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    transition: all 0.15s ease !important;
}

.header-popover-panel--dark .segmented-btn:hover,
.app-theme-dark .segmented-btn:hover {
    color: #FFFFFF !important;
}

.header-popover-panel--dark .segmented-btn.active,
.app-theme-dark .segmented-btn.active {
    background-color: #0B1320 !important;
    background: #0B1320 !important;
    color: #38BDF8 !important;
    border: 1px solid #38BDF8 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) !important;
}

.header-popover-panel--dark .user-dropdown-logout-row,
.app-theme-dark .user-dropdown-logout-row {
    color: #EF4444 !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
}

.header-popover-panel--dark .user-dropdown-logout-row:hover,
.app-theme-dark .user-dropdown-logout-row:hover {
    background-color: rgba(239, 68, 68, 0.12) !important;
    color: #F87171 !important;
}

.header-popover-panel--dark .mud-divider,
.app-theme-dark .user-dropdown-panel .mud-divider,
.app-theme-dark .notification-dropdown .mud-divider {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Notification dropdown in dark mode */
.header-popover-panel--dark .notification-dropdown,
.app-theme-dark .notification-dropdown {
    background-color: #0B1320 !important;
    background: #0B1320 !important;
    color: #FFFFFF !important;
}

.header-popover-panel--dark .notification-header,
.app-theme-dark .notification-header {
    color: #FFFFFF !important;
}

.header-popover-panel--dark .notification-empty-text,
.app-theme-dark .notification-empty-text {
    color: rgba(255, 255, 255, 0.8) !important;
}

.header-popover-panel--dark .notification-empty .mud-icon-root,
.app-theme-dark .notification-empty .mud-icon-root {
    color: #64748B !important;
}

/* ══════════════════════════════════════════════════════════
   DARK MODE: TABLES, CARDS & MAIN CONTENT (Matching Screenshot)
   ══════════════════════════════════════════════════════════ */
.app-theme-dark .mud-main-content {
    background-color: #070C15 !important;
    color: #E2E8F0 !important;
}

/* MudPaper, Cards, & Panels in Dark Mode */
.app-theme-dark .mud-paper:not(.mud-popover):not(.mini-flyout-card):not(.user-dropdown-panel):not(.login-loading-content) {
    background-color: #10192A !important;
    border: 1px solid #1E2D4A !important;
    color: #E2E8F0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

/* Table container in Dark Mode */
.app-theme-dark .mud-table,
.app-theme-dark .premium-table {
    background-color: #10192A !important;
    color: #E2E8F0 !important;
}

.app-theme-dark .mud-table-head {
    background-color: #0B1320 !important;
}

.app-theme-dark .mud-table-head th,
.app-theme-dark .mud-table-head .mud-table-cell {
    background-color: #0B1320 !important;
    color: #FFFFFF !important;
    font-weight: 600 !important;
    border-bottom: 1px solid #1E2D4A !important;
}

.app-theme-dark .mud-table-head .mud-table-sort-label {
    color: #FFFFFF !important;
}

.app-theme-dark .mud-table-body td,
.app-theme-dark .mud-table-body .mud-table-cell {
    background-color: #10192A !important;
    color: #FFFFFF !important;
    border-bottom: 1px solid #18243A !important;
}

.app-theme-dark .mud-table-cell,
.app-theme-dark .mud-table-cell p,
.app-theme-dark .mud-table-cell span:not(.category-cell-name):not(.brand-cell-name) {
    color: #FFFFFF !important;
}

.app-theme-dark .mud-table-row:hover td,
.app-theme-dark .mud-table-body tr:hover td {
    background-color: #162238 !important;
}

/* Three dots action icon & buttons in Dark Mode */
.app-theme-dark .mud-table-cell .mud-icon-button,
.app-theme-dark .mud-menu .mud-icon-button,
.app-theme-dark .premium-table .mud-icon-button,
.app-theme-dark .mud-icon-button-root {
    color: #FFFFFF !important;
}

.app-theme-dark .mud-table-cell .mud-icon-button:hover,
.app-theme-dark .mud-menu .mud-icon-button:hover {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: #FFFFFF !important;
}

/* Chip components in Dark Mode */
.app-theme-dark .mud-chip,
.app-theme-dark .mud-chip-content,
.app-theme-dark .mud-chip span {
    color: #FFFFFF !important;
}

.app-theme-dark .mud-chip.mud-chip-outlined {
    border-color: rgba(255, 255, 255, 0.25) !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Status chips like "Đang hoạt động" in dark mode */
.app-theme-dark .mud-chip.mud-chip-color-success,
.app-theme-dark .mud-chip.mud-chip-filled.mud-chip-color-success,
.app-theme-dark .mud-chip.mud-chip-outlined.mud-chip-color-success,
.app-theme-dark .tp-status-pill,
.app-theme-dark .tp-status-pill--active {
    background-color: #141e33 !important;
    color: #FFFFFF !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.app-theme-dark .mud-chip.mud-chip-color-success .mud-chip-content,
.app-theme-dark .mud-chip.mud-chip-color-success span,
.app-theme-dark .mud-chip.mud-chip-color-success .mud-icon-root,
.app-theme-dark .tp-status-pill,
.app-theme-dark .tp-status-pill--active {
    color: #FFFFFF !important;
}

/* Page Header matching sidebar background #0B1320 */
.app-theme-dark .page-header {
    background-color: #0B1320 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    color: #FFFFFF !important;
}

.app-theme-dark .page-header .mud-typography,
.app-theme-dark .page-header h5,
.app-theme-dark .page-header h6,
.app-theme-dark .page-header span {
    color: #FFFFFF !important;
}

/* ══════════════════════════════════════════════════════════
   DIALOGS & POPUPS: LIGHT MODE (Pure White Background)
   ══════════════════════════════════════════════════════════ */
.mud-dialog,
.app-theme-light .mud-dialog,
.app-theme-light .popup-dialog,
.app-theme-light .support-center-dialog,
.app-theme-light.mud-dialog {
    background-color: #FFFFFF !important;
    background: #FFFFFF !important;
    border: none !important;
    outline: none !important;
    color: #0F172A !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

.mud-dialog .mud-dialog-title,
.app-theme-light .mud-dialog-title,
.app-theme-light .popup-dialog__title {
    color: #0F172A !important;
    font-weight: 600 !important;
}

.mud-dialog .mud-dialog-content,
.app-theme-light .mud-dialog-content,
.app-theme-light .popup-dialog__message,
.app-theme-light .popup-dialog__caption {
    color: #334155 !important;
}

.app-theme-light .support-center__row {
    background-color: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    color: #1E293B !important;
}

.app-theme-light .support-center__row:hover {
    background-color: #F1F5F9 !important;
    border-color: #94A3B8 !important;
}

.app-theme-light .support-center__label {
    color: #64748B !important;
}

.app-theme-light .support-center__value {
    color: #0F172A !important;
}

.app-theme-light .support-center__intro {
    color: #475569 !important;
}

/* ══════════════════════════════════════════════════════════
   DIALOGS & POPUPS: DARK MODE (Matching Sidebar/Header #0B1320)
   ══════════════════════════════════════════════════════════ */
.app-theme-dark .mud-dialog,
.app-theme-dark .popup-dialog,
.app-theme-dark .support-center-dialog,
.app-theme-dark.mud-dialog {
    background-color: #0B1320 !important;
    background: #0B1320 !important;
    border: none !important;
    outline: none !important;
    color: #FFFFFF !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4) !important;
}

.app-theme-dark .mud-dialog-title,
.app-theme-dark .popup-dialog__title {
    color: #FFFFFF !important;
    font-weight: 600 !important;
}

.app-theme-dark .mud-dialog-content,
.app-theme-dark .popup-dialog__message,
.app-theme-dark .popup-dialog__caption {
    color: rgba(255, 255, 255, 0.85) !important;
}

.app-theme-dark .support-center__row {
    background-color: #141E33 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #FFFFFF !important;
}

.app-theme-dark .support-center__row:hover {
    background-color: #1E2D4A !important;
    border-color: #38BDF8 !important;
}

.app-theme-dark .support-center__label,
.app-theme-dark .support-center__value,
.app-theme-dark .support-center__intro {
    color: #FFFFFF !important;
}

/* ══════════════════════════════════════════════════════════
   CREATE & EDIT PAGES: MIN-WIDTH 1000px (Matching ProductUnitCreate)
   ══════════════════════════════════════════════════════════ */
.erp-create-edit-page {
    width: 100%;
    min-width: min(100%, 1000px) !important;
    max-width: 1400px !important;
    margin: 0 auto;
}

.erp-create-edit-page-wide {
    width: 100%;
    min-width: min(100%, 1000px) !important;
    max-width: 1600px !important;
    margin: 0 auto;
}

/* Paging component according to theme mode */
.app-theme-dark .custom-table-pager {
    background-color: #10192A !important;
    border-top: 1px solid #1E2D4A !important;
    color: #FFFFFF !important;
}

.app-theme-dark .pager-summary,
.app-theme-dark .pager-page-size,
.app-theme-dark .pager-navigation {
    color: #FFFFFF !important;
}

.app-theme-dark .page-size-select {
    background-color: #0B1320 !important;
    border: 1px solid #1E2D4A !important;
    color: #FFFFFF !important;
}

.app-theme-dark .page-size-select:focus {
    border-color: #38BDF8 !important;
}

.app-theme-dark .page-size-select-icon {
    color: #FFFFFF !important;
}

.app-theme-dark .pager-arrow {
    color: #FFFFFF !important;
}

.app-theme-dark .pager-arrow:hover:not(:disabled) {
    background: #1E2D4A !important;
    color: #38BDF8 !important;
}

.app-theme-dark .pager-arrow:disabled {
    color: #475569 !important;
}

.app-theme-dark .current-page {
    background: #38BDF8 !important;
    color: #0B1320 !important;
}

.app-theme-dark .mud-table-pagination,
.app-theme-dark .mud-pagination {
    background-color: #10192A !important;
    color: #FFFFFF !important;
    border-top: 1px solid #1E2D4A !important;
}

.app-theme-dark .mud-table-pagination .mud-button-root,
.app-theme-dark .mud-pagination .mud-button-root {
    color: #FFFFFF !important;
}

.app-theme-dark .mud-table-pagination .mud-button-root:hover,
.app-theme-dark .mud-pagination .mud-button-root:hover {
    color: #FFFFFF !important;
    background-color: #1E2D4A !important;
}

/* Table Toolbar & Search inside Table (Fix white border in "Tất cả sản phẩm" & other tables) */
.app-theme-dark .custom-toolbar-container,
.app-theme-dark .premium-table-toolbar,
.app-theme-dark .mud-table-toolbar {
    background-color: #10192A !important;
    border-bottom: 1px solid #1E2D4A !important;
}

.app-theme-dark .premium-table-search .mud-input-control,
.app-theme-dark .premium-table-search .mud-input-control-input-container {
    background: transparent !important;
}

.app-theme-dark .premium-table-search .mud-input.mud-input-outlined {
    background-color: #141E33 !important;
    border-radius: 8px !important;
    color: #FFFFFF !important;
}

.app-theme-dark .premium-table-search .mud-input-outlined-border,
.app-theme-dark .premium-table-search fieldset {
    border: 1px solid #24344E !important;
    outline: none !important;
}

.app-theme-dark .premium-table-search:hover .mud-input-outlined-border,
.app-theme-dark .premium-table-search:hover fieldset,
.app-theme-dark .premium-table-search:focus-within .mud-input-outlined-border,
.app-theme-dark .premium-table-search:focus-within fieldset {
    border-color: #38BDF8 !important;
}

.app-theme-dark .premium-table-search .mud-icon-root {
    color: #FFFFFF !important;
}

.app-theme-dark .premium-table-search input {
    color: #FFFFFF !important;
    background: transparent !important;
}

.app-theme-dark .premium-table-search input::placeholder {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* ══════════════════════════════════════════════════════════
   DARK MODE GENERAL FORM TOKENS: ALL TEXT & PLACEHOLDERS WHITE
   ══════════════════════════════════════════════════════════ */
.app-theme-dark input,
.app-theme-dark textarea,
.app-theme-dark select,
.app-theme-dark .mud-input-slot,
.app-theme-dark .mud-select-input,
.app-theme-dark .tp-field-value,
.app-theme-dark .variant-tag-native-input,
.app-theme-dark .invoice-search-wrapper input {
    color: #FFFFFF !important;
}

.app-theme-dark input::placeholder,
.app-theme-dark textarea::placeholder,
.app-theme-dark .mud-input-slot::placeholder,
.app-theme-dark .variant-tag-native-input::placeholder,
.app-theme-dark .invoice-search-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.85) !important;
    opacity: 1 !important;
}

.app-theme-dark label,
.app-theme-dark .mud-input-label,
.app-theme-dark .mud-input-label-outlined,
.app-theme-dark .tp-field-label,
.app-theme-dark .input-label,
.app-theme-dark .form-group-title,
.app-theme-dark .tp-card-title,
.app-theme-dark .ro-title,
.app-theme-dark .ro-label,
.app-theme-dark h1,
.app-theme-dark h2,
.app-theme-dark h3,
.app-theme-dark h4,
.app-theme-dark h5,
.app-theme-dark h6,
.app-theme-dark .mud-typography-h5,
.app-theme-dark .mud-typography-h6,
.app-theme-dark .mud-typography-subtitle1,
.app-theme-dark .mud-typography-subtitle2,
.app-theme-dark .mud-typography-body1,
.app-theme-dark .mud-typography-body2,
.app-theme-dark .text-secondary,
.app-theme-dark p,
.app-theme-dark span:not(.category-cell-name):not(.brand-cell-name):not(.ro-link) {
    color: #FFFFFF !important;
}

/* General Outlined Inputs & Textarea in Dark Mode (No white border, bg #141E33, border #24344E) */
.app-theme-dark .mud-input.mud-input-outlined {
    background-color: #141E33 !important;
    color: #FFFFFF !important;
    border-radius: 6px !important;
}

.app-theme-dark .mud-input.mud-input-outlined .mud-input-outlined-border,
.app-theme-dark .mud-input.mud-input-outlined fieldset {
    border: 1px solid #24344E !important;
    outline: none !important;
}

.app-theme-dark .mud-input.mud-input-outlined:hover .mud-input-outlined-border,
.app-theme-dark .mud-input.mud-input-outlined:hover fieldset,
.app-theme-dark .mud-input.mud-input-outlined:focus-within .mud-input-outlined-border,
.app-theme-dark .mud-input.mud-input-outlined:focus-within fieldset {
    border-color: #38BDF8 !important;
}

.app-theme-dark .mud-input-label-outlined.mud-input-label-inputcontrol {
    background-color: #10192A !important;
    color: #FFFFFF !important;
    padding: 0 4px !important;
}

.app-theme-dark textarea.mud-input-root,
.app-theme-dark .mud-input-control textarea {
    background: transparent !important;
    color: #FFFFFF !important;
}

/* ══════════════════════════════════════════════════════════
   SELECT COMPONENT & DROPDOWNS (Cấu hình ứng dụng, Filters, Form selects)
   ══════════════════════════════════════════════════════════ */
.app-theme-dark .segment-filter-group {
    background-color: #141E33 !important;
    border: 1px solid #24344E !important;
}

.app-theme-dark .segment-filter-group .mud-select .mud-input {
    color: #FFFFFF !important;
}

.app-theme-dark .segment-filter-group .segment-select {
    border-right: 1px solid #24344E !important;
}

.app-theme-dark .segment-filter-group .mud-input-adornment-icon,
.app-theme-dark .mud-select .mud-input-adornment-icon,
.app-theme-dark .mud-select .mud-icon-root {
    color: #FFFFFF !important;
}

.app-theme-dark .mud-select .mud-input.mud-input-outlined {
    background-color: #141E33 !important;
    color: #FFFFFF !important;
}

.app-theme-dark .mud-select .mud-input-outlined-border {
    border-color: #24344E !important;
}

.app-theme-dark .mud-select:hover .mud-input-outlined-border,
.app-theme-dark .mud-select:focus-within .mud-input-outlined-border {
    border-color: #38BDF8 !important;
}

/* Dropdown popover paper & list */
.app-theme-dark .mud-popover-paper,
.mud-popover-open .mud-popover-paper,
.category-select-popover {
    background-color: #10192A !important;
    border: 1px solid #1E2D4A !important;
    color: #FFFFFF !important;
}

.app-theme-dark .mud-list,
.mud-popover-paper .mud-list {
    background-color: #10192A !important;
    color: #FFFFFF !important;
}

.app-theme-dark .mud-list-item,
.mud-popover-paper .mud-list-item {
    color: #FFFFFF !important;
}

.app-theme-dark .mud-list-item:hover,
.mud-popover-paper .mud-list-item:hover {
    background-color: #162238 !important;
    color: #FFFFFF !important;
}

.app-theme-dark .mud-selected-item,
.mud-popover-paper .mud-selected-item,
.category-selected-item {
    background-color: #1E2D4A !important;
    color: #38BDF8 !important;
    font-weight: 600 !important;
}

/* ══════════════════════════════════════════════════════════
   SPECIFIC COMPONENTS REQUESTED:
   - Thêm hình (Media Dropzone, Upload Frame)
   - Input Tags (VariantTagInput)
   - Danh sách sản phẩm trong đơn hàng
   - Thông tin thanh toán (invoice-order-summary)
   - Mã đơn trong chi tiết (invoice-navbar)
   - Khu vực nguy hiểm (invoice-danger-zone)
   - Thông tin doanh nghiệp (tp-page, tp-card)
   - Cấu hình ứng dụng (ro-card)
   ══════════════════════════════════════════════════════════ */

/* Thêm hình / Image upload */
.app-theme-dark .product-media-dropzone {
    background-color: #141E33 !important;
    border: 1px dashed #24344E !important;
}

.app-theme-dark .product-media-dropzone:hover,
.app-theme-dark .product-media-dropzone.is-dragging {
    background-color: #162238 !important;
    border-color: #38BDF8 !important;
}

.app-theme-dark .product-media-dropzone-content {
    color: #FFFFFF !important;
}

.app-theme-dark .product-media-helper {
    color: rgba(255, 255, 255, 0.7) !important;
}

.app-theme-dark .product-media-link,
.app-theme-dark .product-media-upload-link {
    color: #38BDF8 !important;
}

.app-theme-dark .media-preview-card {
    background-color: #10192A !important;
    border: 1px solid #1E2D4A !important;
}

/* Input tags */
.app-theme-dark .variant-tag-input {
    background: #141E33 !important;
    border: 1px solid #24344E !important;
}

.app-theme-dark .variant-tag-input:focus-within {
    border-color: #38BDF8 !important;
    box-shadow: 0 0 0 1px #38BDF8 !important;
}

.app-theme-dark .variant-value-chip {
    background: #1E2D4A !important;
    color: #FFFFFF !important;
}

.app-theme-dark .variant-value-remove {
    color: #38BDF8 !important;
}

.app-theme-dark .variant-tag-native-input {
    color: #FFFFFF !important;
}

.app-theme-dark .variant-tag-native-input::placeholder {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Danh sách sản phẩm trong đơn hàng (InvoiceCreate / InvoiceDetail) */
.app-theme-dark .invoice-product-dropdown {
    background-color: #10192A !important;
    border: 1px solid #1E2D4A !important;
    color: #FFFFFF !important;
}

.app-theme-dark .invoice-search-wrapper input {
    color: #FFFFFF !important;
}

.app-theme-dark .invoice-search-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Component thông tin thanh toán */
.app-theme-dark .invoice-order-summary {
    background-color: #10192A !important;
    border: 1px solid #1E2D4A !important;
}

.app-theme-dark .invoice-order-summary .text-secondary {
    color: #FFFFFF !important;
}

.app-theme-dark .invoice-order-summary .mud-typography-body2 {
    color: #FFFFFF !important;
}

/* Component mã đơn trong chi tiết */
.app-theme-dark .invoice-navbar {
    background-color: #0B1320 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.app-theme-dark .invoice-nav-code {
    color: #38BDF8 !important;
}

.app-theme-dark .invoice-copy-code {
    color: #FFFFFF !important;
}

/* Khu vực nguy hiểm */
.app-theme-dark .invoice-danger-zone {
    background-color: rgba(239, 68, 68, 0.08) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.app-theme-dark .invoice-danger-zone-text .mud-typography-subtitle2 {
    color: #EF4444 !important;
}

.app-theme-dark .invoice-danger-zone-text .tp-field-label {
    color: #FFFFFF !important;
}

/* Thông tin doanh nghiệp (Tenant Profile) */
.app-theme-dark .tp-page {
    background-color: #070C15 !important;
}

.app-theme-dark .tp-card,
.app-theme-dark .tp-card .mud-paper {
    background-color: #10192A !important;
    border: 1px solid #1E2D4A !important;
}

.app-theme-dark .tp-field .mud-input.mud-input-outlined {
    background-color: #141E33 !important;
}

.app-theme-dark .tp-field .mud-input.mud-input-outlined .mud-input-outlined-border {
    border: 1px solid #24344E !important;
}

.app-theme-dark .tp-field .mud-input.mud-input-outlined:focus-within .mud-input-outlined-border {
    border-color: #38BDF8 !important;
}

.app-theme-dark .tp-field .mud-input-control-input-container > .mud-input > input.mud-input-root,
.app-theme-dark .tp-field .mud-input-slot {
    color: #FFFFFF !important;
}

.app-theme-dark .tp-upload-frame {
    background-color: #141E33 !important;
    border: 1px dashed #24344E !important;
}

.app-theme-dark .tp-upload-frame:hover {
    border-color: #38BDF8 !important;
    background-color: #162238 !important;
}

.app-theme-dark .tp-secondary-btn {
    border: 1px solid #1E2D4A !important;
    background-color: #141E33 !important;
    color: #FFFFFF !important;
}

.app-theme-dark .tp-secondary-btn:hover {
    background-color: #1E2D4A !important;
    color: #FFFFFF !important;
    border-color: #38BDF8 !important;
}

/* Cấu hình ứng dụng (Radio Option Group) */
.app-theme-dark .ro-card {
    background-color: #10192A !important;
    border: 1px solid #1E2D4A !important;
}

.app-theme-dark .ro-title {
    color: #FFFFFF !important;
}

.app-theme-dark .ro-label {
    color: #FFFFFF !important;
}

.app-theme-dark .ro-desc {
    color: #FFFFFF !important;
}

.app-theme-dark .ro-option:hover {
    background-color: #162238 !important;
}

.app-theme-dark .ro-option--selected {
    border-left-color: #38BDF8 !important;
    background-color: #16243E !important;
}

/* Blue link matching screenshot "Xem toàn bộ 10 gói..." */
.app-theme-dark a.link-accent,
.app-theme-dark .mud-link {
    color: #38BDF8 !important;
}

/* ══════════════════════════════════════════════════════════
   POPUP & DIALOG INNER CARDS / BOXES: REMOVE ALL BORDERS
   ══════════════════════════════════════════════════════════ */
.mud-dialog .ro-card,
.popup-dialog .ro-card,
.popup-dialog-shell .ro-card,
.mud-dialog .printer-config-card,
.popup-dialog .printer-config-card,
.printer-config-card {
    border: none !important;
    box-shadow: none !important;
    background-color: #F8FAFC !important;
    margin-bottom: 0 !important;
}

.mud-dialog .mud-dialog-content .mud-paper,
.popup-dialog .mud-paper,
.popup-dialog__body .mud-paper,
.popup-dialog-shell .mud-paper,
.mud-dialog .mud-paper-outlined,
.popup-dialog .mud-paper-outlined,
.popup-dialog-shell .mud-paper-outlined {
    border: none !important;
    box-shadow: none !important;
}

.mud-dialog .mud-alert,
.popup-dialog .mud-alert,
.popup-dialog-shell .mud-alert,
.mud-dialog .mud-alert-outlined,
.popup-dialog .mud-alert-outlined,
.popup-dialog-shell .mud-alert-outlined {
    border: none !important;
    box-shadow: none !important;
}

.printer-card-title {
    color: #0F172A;
}

/* Dark mode overrides for popup inner cards / boxes */
.app-theme-dark .mud-dialog .ro-card,
.app-theme-dark .popup-dialog .ro-card,
.app-theme-dark .popup-dialog-shell .ro-card,
.mud-theme-dark .mud-dialog .ro-card,
.mud-theme-dark .popup-dialog .ro-card,
.mud-theme-dark .popup-dialog-shell .ro-card,
.app-theme-dark .printer-config-card,
.mud-theme-dark .printer-config-card {
    background-color: #141E33 !important;
    border: none !important;
    box-shadow: none !important;
    color: #FFFFFF !important;
}

.app-theme-dark .printer-card-title,
.mud-theme-dark .printer-card-title {
    color: #FFFFFF !important;
}

.app-theme-dark .mud-dialog .printer-config-card .mud-typography,
.mud-theme-dark .mud-dialog .printer-config-card .mud-typography {
    color: #FFFFFF !important;
}

/* ══════════════════════════════════════════════════════════
   ROLE PERMISSION TREE: DARK & LIGHT MODE STYLES
   ══════════════════════════════════════════════════════════ */
.app-theme-dark .role-perm-master-card {
    background-color: #111C2E !important;
    border-color: #1E2D4A !important;
}

.app-theme-dark .role-perm-shield-icon {
    background-color: rgba(56, 189, 248, 0.15) !important;
    color: #38BDF8 !important;
}

.app-theme-dark .role-perm-title {
    color: #FFFFFF !important;
}

.app-theme-dark .role-perm-caption,
.app-theme-dark .role-perm-subtext {
    color: #94A3B8 !important;
}

.app-theme-dark .role-perm-switch-label {
    color: #FFFFFF !important;
}

.app-theme-dark .role-perm-toolbar {
    border-color: #1E2D4A !important;
}

.app-theme-dark .role-search-input .mud-input.mud-input-outlined {
    background-color: #0B1320 !important;
    border-color: #1E2D4A !important;
    color: #FFFFFF !important;
}

.app-theme-dark .role-search-input input {
    color: #FFFFFF !important;
}

.app-theme-dark .role-search-input input::placeholder {
    color: #94A3B8 !important;
}

.app-theme-dark .role-perm-module-card {
    background-color: #111C2E !important;
    border-color: #1E2D4A !important;
}

.app-theme-dark .role-perm-module-header:hover {
    background-color: #17243B !important;
}

.app-theme-dark .role-perm-module-icon {
    background-color: rgba(56, 189, 248, 0.15) !important;
    color: #38BDF8 !important;
}

.app-theme-dark .role-perm-module-name {
    color: #FFFFFF !important;
}

.app-theme-dark .role-perm-actions-list {
    background-color: #0B1320 !important;
    border-color: #1E2D4A !important;
}

.app-theme-dark .role-perm-action-row {
    background-color: #111C2E !important;
    border-color: #1E2D4A !important;
}

.app-theme-dark .role-perm-action-row:hover {
    background-color: #17243B !important;
    border-color: #2D4166 !important;
}

.app-theme-dark .role-perm-action-row.is-action-granted {
    border-color: rgba(56, 189, 248, 0.4) !important;
    background-color: rgba(56, 189, 248, 0.08) !important;
}

.app-theme-dark .role-perm-action-name {
    color: #FFFFFF !important;
}

.app-theme-dark .role-perm-action-code {
    color: #94A3B8 !important;
}

/* Light mode overrides */
.app-theme-light .role-perm-master-card {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
}

.app-theme-light .role-perm-title {
    color: #0F172A !important;
}

.app-theme-light .role-perm-caption,
.app-theme-light .role-perm-subtext {
    color: #64748B !important;
}

.app-theme-light .role-perm-switch-label {
    color: #334155 !important;
}

.app-theme-light .role-perm-module-card {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
}

.app-theme-light .role-perm-module-header:hover {
    background-color: #F8FAFC !important;
}

.app-theme-light .role-perm-module-name {
    color: #0F172A !important;
}

.app-theme-light .role-perm-actions-list {
    background-color: #F8FAFC !important;
    border-color: #F1F5F9 !important;
}

.app-theme-light .role-perm-action-row {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
}

.app-theme-light .role-perm-action-row:hover {
    background-color: #F1F5F9 !important;
    border-color: #CBD5E1 !important;
}

.app-theme-light .role-perm-action-name {
    color: #1E293B !important;
}

.app-theme-light .role-perm-action-code {
    color: #64748B !important;
}

/* ══════════════════════════════════════════════════════════════════
   INVOICE SETTINGS & RULES TABLE STYLING
   ══════════════════════════════════════════════════════════════════ */
.invoice-pipeline-box {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
}

.invoice-pipeline-title {
    color: #64748B;
    letter-spacing: 0.5px;
}

.invoice-rules-table-container {
    border: 1px solid #E4E7EB;
}

.invoice-rules-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-rules-head-row {
    background: #F8FAFC;
    border-bottom: 2px solid #E4E7EB;
}

.invoice-rules-th {
    padding: 10px 14px;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    text-align: left;
}

.invoice-rules-th-role {
    width: 180px;
}

.invoice-rules-th-status {
    width: 220px;
}

.invoice-rules-th-del {
    width: 60px;
    text-align: center;
}

.invoice-rules-row {
    border-bottom: 1px solid #F1F5F9;
}

.invoice-rules-td {
    padding: 10px 14px;
    vertical-align: middle;
}

.invoice-rules-td-center {
    text-align: center;
}

.invoice-preview-label {
    color: #475569;
}

.invoice-preview-paper {
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
}

.invoice-preview-iframe {
    width: 100%;
    height: 680px;
    border: none;
    background: #F8FAFC;
    display: block;
}

/* Dark mode for Invoice Settings components */
.app-theme-dark .invoice-pipeline-box {
    background-color: #0B1320 !important;
    border: 1px solid #1E2D4A !important;
}

.app-theme-dark .invoice-pipeline-title {
    color: #FFFFFF !important;
}

.app-theme-dark .invoice-pipeline-box .mud-icon-root {
    color: #FFFFFF !important;
}

.app-theme-dark .invoice-rules-table-container {
    background-color: #10192A !important;
    border: 1px solid #1E2D4A !important;
}

.app-theme-dark .invoice-rules-table {
    background-color: #10192A !important;
    color: #FFFFFF !important;
}

.app-theme-dark .invoice-rules-head-row {
    background: #0B1320 !important;
    border-bottom: 2px solid #1E2D4A !important;
}

.app-theme-dark .invoice-rules-th {
    color: #FFFFFF !important;
    background-color: #0B1320 !important;
}

.app-theme-dark .invoice-rules-row {
    background-color: #10192A !important;
    border-bottom: 1px solid #1E2D4A !important;
}

.app-theme-dark .invoice-rules-row:hover {
    background-color: #162238 !important;
}

.app-theme-dark .invoice-rules-td {
    color: #FFFFFF !important;
}

.app-theme-dark .invoice-rules-table .mud-input.mud-input-outlined {
    background-color: #0B1320 !important;
    border-radius: 6px !important;
    color: #FFFFFF !important;
}

.app-theme-dark .invoice-rules-table .mud-input-outlined-border {
    border-color: #24344E !important;
}

.app-theme-dark .invoice-rules-table input,
.app-theme-dark .invoice-rules-table .mud-input-slot,
.app-theme-dark .invoice-rules-table .mud-select-input {
    color: #FFFFFF !important;
}

.app-theme-dark .invoice-preview-label {
    color: #FFFFFF !important;
}

.app-theme-dark .invoice-paper-select .mud-input.mud-input-outlined {
    background-color: #0B1320 !important;
    border-radius: 6px !important;
    color: #FFFFFF !important;
}

.app-theme-dark .invoice-paper-select .mud-input-outlined-border {
    border-color: #24344E !important;
}

.app-theme-dark .invoice-paper-select input,
.app-theme-dark .invoice-paper-select .mud-input-slot,
.app-theme-dark .invoice-paper-select .mud-select-input {
    color: #FFFFFF !important;
}

.app-theme-dark .invoice-preview-paper {
    border-color: #1E2D4A !important;
    background-color: #0B1320 !important;
}

/* Badges for "Khuyên dùng", "Mặc định" in dark mode */
.app-theme-dark .ro-badge {
    background-color: #141e33 !important;
    color: #FFFFFF !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}





