.modal {
            display: none;
            /* Force modals to always appear above footer and other UI */
            z-index: 2000 !important;
            position: fixed !important;
            top: 0 !important;
            left: 0 !important;
            right: 0 !important;
            width: 100% !important;
            height: 100% !important;
        }
.modal.active {
            display: flex !important;
            /* Force modal to be visible */
            visibility: visible !important;
            opacity: 1 !important;
            background-color: rgba(0, 0, 0, 0.5) !important;
            z-index: 9999 !important;
        }
.modal .bg-white {
            height: 100% !important;
            max-width: 448px !important; /* Same as app-container max-w-md */
        }
.modal .bg-white {
            max-height: 100% !important;
            min-height: 100% !important;
            /* Ensure modal content is visible */
            background-color: white !important;
            border: none !important;
            box-shadow: none !important;
            border-radius: 0 !important;
            /* Force modal content to be visible */
            position: relative !important;
            z-index: 10000 !important;
            /* Center modal horizontally */
            margin: 0 auto !important;
            /* Ensure modal content is properly positioned */
            overflow: hidden !important;
        }
.modal input, .modal select, .modal textarea {
            font-size: 16px; /* Prevent zoom on iOS */
        }
.modal .flex-1 {
            overflow-y: auto !important;
            overflow-x: hidden !important;
        }
.modal form {
            padding: 1rem !important;
        }

#app-container {
            border-radius: 0 !important;
            display: flex;
            flex-direction: column;
            height: 100vh;
            max-height: 100vh;
        }
        .header {
            flex-shrink: 0;
            z-index: 30;
        }
        .main-container {
            flex: 1;
            overflow: hidden; /* Prevent main container scroll */
            scroll-behavior: smooth;
            min-height: 0;
            padding-bottom: 0;
            height: 100%;
        }
        .footer {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            max-width: 448px;
            margin: 0 auto;
            background-color: #ffffff;
            z-index: 1000;
            border-top: 1px solid #e5e7eb;
            min-height: 64px;
        }
        .section {
            display: none;
            height: 100%;
        }
        .section.active {
            display: flex;
            height: 100%;
        }
        .nav-item {
            color: #6b7280;
            transition: all 0.2s ease;
        }
        .nav-item.active {
            background-color: var(--primary-color);
            color: white;
            border-radius: 8px;
        }
        .nav-item:hover:not(.active) {
            background-color: #f9fafb;
            color: #374151;
        }
        .nav-item.active:hover {
            background-color: var(--primary-color-dark);
        }
        .status-badge {
            font-size: 0.75rem;
            padding: 0.25rem 0.5rem;
            border-radius: 0.375rem;
            font-weight: 500;
        }
        .modal {
            display: none;
            /* Force modals to always appear above footer and other UI */
            z-index: 2000 !important;
            position: fixed !important;
            top: 0 !important;
            left: 0 !important;
            right: 0 !important;
            width: 100% !important;
            height: 100% !important;
        }
        
        /* ==================== MENU SECTION STYLING ==================== */
        
        /* Main container layout */
        #menu-section {
            height: calc(100vh - 200px);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        
        /* Header container - Fixed height */
        #menu-section > div:first-child {
            flex-shrink: 0;
            padding: 1.5rem;
        }
        
        /* Content container - Scrollable */
        #menu-section > div:last-child {
            flex: 1;
            min-height: 0;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        
        /* Active state */
        #menu-section.active {
            display: flex !important;
        }
        
        /* ==================== HEADER SECTION ==================== */
        
        /* Header spacing */
        #menu-section .mb-4 {
            margin-bottom: 1.5rem;
        }
        
        /* Responsive stats layout */
        @media (max-width: 480px) {
            #menu-section .flex.gap-4 {
                gap: 0.5rem;
                font-size: 0.75rem;
            }
            
            #menu-section .flex.gap-4 > span {
                font-size: 0.75rem;
            }
        }
        
        /* Responsive filter layout */
        @media (max-width: 480px) {
            #menu-section .flex.items-center.gap-3 {
                gap: 0.5rem;
            }
            
            #select-all-toggle {
                padding: 0.5rem;
                font-size: 0.75rem;
            }
            
            #category-filter,
            #status-filter {
                padding: 0.5rem;
                font-size: 0.75rem;
            }
        }
        
        /* Stats container */
        #menu-section .flex.gap-4 {
            gap: 0.5rem;
            flex-wrap: nowrap;
            overflow-x: auto;
            scrollbar-width: none;
            -ms-overflow-style: none;
        }
        
        #menu-section .flex.gap-4::-webkit-scrollbar {
            display: none;
        }
        
        /* Stats items */
        #menu-section .flex.gap-4 > span {
            white-space: nowrap;
            font-size: 0.875rem;
        }
        
        /* ==================== FILTER SECTION ==================== */
        
        /* Filter container */
        #menu-section .mb-3 {
            margin-bottom: 1rem;
        }
        
        /* Filter row */
        #menu-section .flex.items-center.gap-3 {
            gap: 0.75rem;
            align-items: center;
            flex-wrap: nowrap;
            overflow-x: auto;
            scrollbar-width: none;
            -ms-overflow-style: none;
        }
        
        #menu-section .flex.items-center.gap-3::-webkit-scrollbar {
            display: none;
        }
        
        /* Select all button */
        #select-all-toggle {
            padding: 0.5rem 0.75rem;
            border-radius: 0.5rem;
            font-weight: 500;
            transition: all 0.2s ease;
            flex-shrink: 0;
        }
        
        /* Filter dropdowns */
        #category-filter,
        #status-filter {
            padding: 0.5rem 0.75rem;
            border-radius: 0.5rem;
            border: 1px solid #d1d5db;
            font-size: 0.875rem;
            transition: all 0.2s ease;
            min-width: 0;
        }
        
        /* ==================== MENU ITEMS CONTAINER ==================== */
        
        /* Menu items list */
        #menu-items-list {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            padding: 0 1.5rem;
            scrollbar-width: thin;
            scrollbar-color: #cbd5e0 #f7fafc;
        }

        /* ==================== SCROLL FIX FOR OTHER LISTS ==================== */
        /* Make section inner containers flex columns to allow list areas to grow and scroll */
        #orders-section > .p-4,
        #customers-section > .p-4,
        #promotions-section > .p-4,
        #notifications-section > .p-4,
        #points-section > .p-4 {
            display: flex;
            flex-direction: column;
            min-height: 0;
            height: 100%;
            scrollbar-width: thin;
            scrollbar-color: #cbd5e0 #f7fafc;
        }

        /* Scrollable lists like menu-items-list (exclude tiers-list: points-section scrolls as a whole) */
        #orders-list,
        #customers-list,
        #notification-history-list {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            /* padding: 0 1.5rem; */
            scrollbar-width: thin;
            scrollbar-color: #cbd5e0 #f7fafc;
        }

        /* Webkit scrollbar for the lists (exclude tiers-list) */
        #orders-list::-webkit-scrollbar,
        #customers-list::-webkit-scrollbar,
        #notification-history-list::-webkit-scrollbar {
            width: 8px;
        }
        #orders-list::-webkit-scrollbar-track,
        #customers-list::-webkit-scrollbar-track,
        #notification-history-list::-webkit-scrollbar-track {
            background: #f7fafc;
            border-radius: 4px;
        }
        #orders-list::-webkit-scrollbar-thumb,
        #customers-list::-webkit-scrollbar-thumb,
        #notification-history-list::-webkit-scrollbar-thumb {
            background: #cbd5e0;
            border-radius: 4px;
        }
        #orders-list::-webkit-scrollbar-thumb:hover,
        #customers-list::-webkit-scrollbar-thumb:hover,
        #notification-history-list::-webkit-scrollbar-thumb:hover {
            background: #a0aec0;
        }

        /* Ensure notification history tab layout allows its list to flex/scroll */
        #notification-history-tab {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
        }

        /* Points section should scroll as a whole (not the tiers-list individually) */
        #points-section > .p-4 {
            overflow-y: auto;
        }
        /* Undo flex scrolling on the first block so the whole section scrolls */
        #points-section > .p-4 > .mb-6:first-of-type {
            display: block;
            flex: initial;
            min-height: auto;
        }

        /* Ensure loading/empty/pagination blocks don't consume flexible space */
        #orders-loading,
        #orders-empty,
        #orders-pagination,
        #customers-loading,
        #customers-empty,
        #customers-pagination,
        #tiers-loading,
        #tiers-empty,
        #rewards-loading,
        #rewards-empty,
        #notification-history-pagination,
        #history-loading,
        #history-empty {
            flex-shrink: 0;
        }
        
        /* Webkit scrollbar */
        #menu-items-list::-webkit-scrollbar {
            width: 8px;
        }
        
        #menu-items-list::-webkit-scrollbar-track {
            background: #f7fafc;
            border-radius: 4px;
        }
        
        #menu-items-list::-webkit-scrollbar-thumb {
            background: #cbd5e0;
            border-radius: 4px;
        }
        
        #menu-items-list::-webkit-scrollbar-thumb:hover {
            background: #a0aec0;
        }
        
        /* Menu item cards */
        .menu-item-card {
            padding: 1rem 1.5rem;
            margin-bottom: 0.75rem;
            border-radius: 0.75rem;
            border: 1px solid #e5e7eb;
            transition: all 0.2s ease;
            cursor: pointer;
            user-select: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
        }
        
        .menu-item-card:hover {
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            transform: translateY(-1px);
        }
        
        .menu-item-card:active {
            transform: translateY(0);
            box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
        }
        
        /* Long press visual feedback */
        .menu-item-card.long-press {
            background-color: #fef2f2 !important;
            border-color: #ef4444 !important;
            transform: scale(0.98);
            box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
        }
        
        /* Prevent text selection on long press */
        .menu-item-card * {
            user-select: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
        }
        
        /* Menu item content */
        .menu-item-card .flex.items-center.justify-between {
            gap: 1rem;
        }
        
        .menu-item-card .flex.items-center.flex-1 {
            gap: 1rem;
        }
        
        .menu-item-card .flex.gap-1 {
            gap: 0.5rem;
        }
        
        /* Loading and empty states */
        #menu-items-loading,
        #menu-items-empty {
            padding: 2rem 1.5rem;
            text-align: center;
        }
        /* ==================== MOBILE OPTIMIZATION ==================== */
        
        @media (max-width: 640px) {
            #menu-section {
                height: calc(100vh - 180px);
            }
            
            #menu-section > div:first-child {
                padding: 1rem;
            }
            
            /* Compact stats layout */
            #menu-section .flex.gap-4 {
                gap: 0.5rem;
                padding: 0.5rem 0.75rem;
                font-size: 0.75rem;
            }
            
            #menu-section .flex.gap-4 > span {
                font-size: 0.75rem;
            }
            
            /* Mobile filter layout */
            #menu-section .flex.items-center.gap-3 {
                gap: 0.5rem;
                padding: 0.25rem 0;
            }
            
            /* Mobile menu items padding */
            #menu-items-list {
                padding: 0 1rem;
            }
            
            .menu-item-card {
                padding: 0.75rem 1rem;
                margin-bottom: 0.5rem;
            }
            
            /* Mobile touch optimization */
            .menu-item-card {
                -webkit-tap-highlight-color: transparent;
                touch-action: manipulation;
            }
            
            /* Mobile long press feedback */
            .menu-item-card.long-press {
                background-color: #fef2f2 !important;
                border-color: #ef4444 !important;
                transform: scale(0.98) !important;
                box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3) !important;
            }
            
            /* Mobile loading states */
            #menu-items-loading,
            #menu-items-empty {
                padding: 1.5rem 1rem;
            }
        }
        
        /* ==================== BULK ACTIONS ==================== */
        
        /* Force bulk-actions to appear above everything */
        #bulk-actions {
            z-index: 1200 !important;
            position: fixed !important;
        }
        

        




        /* Toggle Switch Styles */
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 44px;
            height: 24px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            transition: .4s;
            border-radius: 24px;
        }

        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }

        input:checked + .toggle-slider {
            background-color: var(--primary-color);
        }

        input:checked + .toggle-slider:before {
            transform: translateX(20px);
        }
        .modal.active {
            display: flex !important;
            /* Force modal to be visible */
            visibility: visible !important;
            opacity: 1 !important;
            background-color: rgba(0, 0, 0, 0.5) !important;
            z-index: 9999 !important;
        }
        
        /* Search overlay styling */
        #menu-search-overlay {
            position: fixed !important;
            top: 0 !important;
            left: 0 !important;
            right: 0 !important;
            z-index: 1000 !important;
            max-width: 448px !important;
            margin: 0 auto !important;
        }




        
        /* Date filter collapse animations */
        .filter-arrow {
            transition: transform 0.2s ease;
        }
        
        .date-filter-content {
            transition: all 0.3s ease;
        }
        .modal .bg-white {
            height: 100% !important;
            max-width: 448px !important; /* Same as app-container max-w-md */
        }
        
        /* Override cho menu-management-modal */
        #menu-management-modal .bg-white {
            height: auto !important;
            max-width: 42rem !important; /* max-w-2xl = 42rem */
        }
        
        /* Customization modal specific styles */
        #customization-modal .bg-white {
            height: auto !important;
            max-height: 90vh !important;
            overflow-y: auto !important;
        }

        /* Settings Content Styles */
        .settings-content {
            display: none;
        }

        .settings-content.active {
            display: block;
        }

        .settings-tab {
            transition: all 0.2s ease;
        }

        .settings-tab.active {
            border-bottom-color: var(--primary-color);
            color: var(--primary-color);
        }





        .modal .bg-white {
            max-height: 100% !important;
            min-height: 100% !important;
            /* Ensure modal content is visible */
            background-color: white !important;
            border: none !important;
            box-shadow: none !important;
            border-radius: 0 !important;
            /* Force modal content to be visible */
            position: relative !important;
            z-index: 10000 !important;
            /* Center modal horizontally */
            margin: 0 auto !important;
            /* Ensure modal content is properly positioned */
            overflow: hidden !important;
        }
        .modal input, .modal select, .modal textarea {
            font-size: 16px; /* Prevent zoom on iOS */
        }
        
        /* Ensure modal content can scroll properly */
        .modal .flex-1 {
            overflow-y: auto !important;
            overflow-x: hidden !important;
        }
        
        /* Ensure modal forms are properly spaced */
        .modal form {
            padding: 1rem !important;
        }
        /* Force modal to be above everything - FULL SCREEN */
        #overview-modal,
        #tier-modal,
        #reward-modal,
        #order-detail-modal,
        #customer-detail-modal,
        #edit-notification-modal,
        #order-edit-modal,
        #system-settings-modal {
            z-index: 9999 !important;
        }

        #promotion-modal {
            z-index: 1100 !important;
        }
        /* Force modal to be above everything - FULL SCREEN */
        #overview-modal,
        #tier-modal,
        #reward-modal,
        #order-detail-modal,
        #customer-detail-modal,
        #edit-notification-modal,
        #order-edit-modal,
        #system-settings-modal,
        #add-admin-psid-modal {
            position: fixed !important;
            /* Ensure modal is visible */
            display: none;
            /* Force modal to be above everything */
            top: 0 !important;
            left: 0 !important;
            right: 0 !important;
            bottom: 0 !important;
            /* Ensure modal is not hidden by other elements */
            pointer-events: auto !important;
            overflow: visible !important;
            /* Center modal horizontally */
            justify-content: center !important;
            align-items: center !important;
        }
        #overview-modal.active,
        #tier-modal.active,
        #reward-modal.active,
        #order-detail-modal.active,
        #customer-detail-modal.active,
        #edit-notification-modal.active,
        #order-edit-modal.active,
        #system-settings-modal.active,
        #add-admin-psid-modal.active {
            display: flex !important;
            z-index: 9999 !important;
        }



        #promotion-modal.active {
            display: flex !important;
            z-index: 1100 !important;
        }





        /* Add Admin PSID Modal và System Settings Modal - Giống overview-modal */
        #add-admin-psid-modal.active,
        #system-settings-modal.active {
            z-index: 1000000 !important;
        }

        /* Ensure stacking order: POS input > order-edit-modal > order-detail-modal */
        #order-detail-modal,
        #order-detail-modal.active {
            z-index: 1000001 !important;
        }
        #order-edit-modal,
        #order-edit-modal.active {
            z-index: 1000003 !important;
        }
        
        /* Menu item selection modal - must be above order modals */
        #menu-item-selection-modal,
        #menu-item-selection-modal.active {
            z-index: 1000004 !important;
        }
        
        #menu-item-options-modal,
        #menu-item-options-modal.active {
            z-index: 1000005 !important;
        }

        #add-admin-psid-modal.active .bg-white {
            width: 100% !important;
            height: 100% !important;
            max-width: none !important;
            border-radius: 0 !important;
        }
        

        #add-admin-psid-modal .bg-primary,
        #system-settings-modal .bg-primary {
            background-color: var(--primary-color) !important;
        }

.settings-content {
            display: none;
        }
.settings-content.active {
            display: block;
        }
.settings-content {
            display: none;
        }
.settings-content.active {
            display: block;
        }

.settings-tab {
            transition: all 0.2s ease;
        }
.settings-tab.active {
            border-bottom-color: var(--primary-color);
            color: var(--primary-color);
        }
.settings-tab {
            transition: all 0.2s ease;
        }
.settings-tab.active {
            border-bottom-color: var(--primary-color);
            color: var(--primary-color);
        }

