@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

        body {
            font-family: 'Inter', sans-serif;
            overflow-x: hidden;
            user-select: none;
        }

        /* Custom scrollbar for sidebar */
        .custom-scrollbar::-webkit-scrollbar {
            width: 8px;
        }

        .custom-scrollbar::-webkit-scrollbar-track {
            background-color: transparent;
        }

        .custom-scrollbar::-webkit-scrollbar-thumb {
            background-color: #cbd5e1;
            border-radius: 9999px;
        }

        .dark .custom-scrollbar::-webkit-scrollbar-thumb {
            background-color: #4b5563;
        }

        /* Explicit CSS for focus effect to ensure it overrides everything else */
        input:focus,
        textarea:focus {
            outline: none;
            border-color: #facc15 !important;
            /* Yellow-500 */
            box-shadow: 0 0 0 3px rgba(255, 208, 21, 0.69) !important;
        }

        /* Loading indicator */
        .loading {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid #f3f3f3;
            border-top: 3px solid #facc15;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        .pagination-btn {
            min-width: 34px;
            height: 34px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 500;
            transition: all 0.2s ease-in-out;
        }

        .pagination-btn:hover:not(:disabled) {
            transform: translateY(-1px);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .pagination-btn:disabled {
            cursor: not-allowed;
            opacity: 0.5;
        }

        .spin {
            display: inline-block;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        /* สไตล์สำหรับโหมดสว่างแบบโทนเขียว */
        .light-mode-green {
            background-color: #f0fdf4 !important; /* สีพื้นหลังหลัก */
            color: #166534 !important; /* สีข้อความหลัก */
        }

        .light-mode-green .bg-white {
            background-color: #ecfdf5 !important; /* สีการ์ด/กล่อง */
        }

        .light-mode-green .bg-gray-100 {
            background-color: #f0fdf4 !important; /* สีพื้นหลัง */
        }

        .light-mode-green .text-gray-900 {
            color: #166534 !important; /* สีข้อความหลัก */
        }

        .light-mode-green .text-gray-700 {
            color: #15803d !important; /* สีข้อความรอง */
        }

        .light-mode-green .text-gray-500 {
            color: #16a34a !important; /* สีข้อความจาง */
        }

        .light-mode-green .border-gray-300 {
            border-color: #bbf7d0 !important; /* สีเส้นขอบ */
        }

        .light-mode-green .bg-gray-50 {
            background-color: #dcfce7 !important; /* สีพื้นหลังอ่อน */
        }

        .light-mode-green .divide-gray-200 > * + * {
            border-color: #bbf7d0 !important; /* สีเส้นแบ่ง */
        }

        .light-mode-green .shadow-md {
            box-shadow: 0 4px 6px -1px rgba(34, 197, 94, 0.1), 0 2px 4px -1px rgba(34, 197, 94, 0.06) !important;
        }

        .light-mode-green .bg-blue-500 {
            background-color: #22c55e !important; /* สีปุ่ม */
        }

        .light-mode-green .bg-blue-500:hover {
            background-color: #16a34a !important;
        }

        .light-mode-green .bg-gray-200 {
            background-color: #dcfce7 !important;
        }

        .light-mode-green .bg-gray-200:hover {
            background-color: #bbf7d0 !important;
        }

        .light-mode-green .text-gray-600 {
            color: #15803d !important;
        }

        /* สไตล์สำหรับเมนูไซด์บาร์ในโหมดสว่างแบบโทนเขียว */
        .light-mode-green #sidebar {
            background-color: #dcfce7 !important; /* สีพื้นหลังเมนู */
            color: #166534 !important; /* สีข้อความหลัก */
        }

        .light-mode-green #sidebar .bg-gray-700 {
            background-color: #bbf7d0 !important; /* สีพื้นหลังเมนูที่เลือก */
            color: #166534 !important;
        }

        .light-mode-green #sidebar .bg-gray-700:hover {
            background-color: #86efac !important; /* สีเมื่อ hover */
        }

        .light-mode-green #sidebar .hover\:bg-gray-600:hover {
            background-color: #86efac !important; /* สีเมื่อ hover */
        }

        .light-mode-green #sidebar .hover\:bg-gray-700:hover {
            background-color: #86efac !important; /* สีเมื่อ hover */
        }

        .light-mode-green #sidebar .text-gray-400 {
            color: #15803d !important; /* สีไอคอน */
        }

        .light-mode-green #sidebar .text-white {
            color: #166534 !important; /* สีข้อความ */
        }

        .light-mode-green #sidebar .text-yellow-400 {
            color: #ca8a04 !important; /* สีข้อความเน้น */
        }

        .light-mode-green #sidebar .hover\:text-white:hover {
            color: #166534 !important; /* สีข้อความเมื่อ hover */
        }

        .light-mode-green #sidebar .border-gray-700 {
            border-color: #bbf7d0 !important; /* สีเส้นขอบ */
        }

        .light-mode-green #sidebar .bg-gray-800 {
            background-color: #dcfce7 !important; /* สีพื้นหลัง */
        }

        .light-mode-green #sidebar .bg-gray-600 {
            background-color: #bbf7d0 !important; /* สีพื้นหลังเมนูที่เลือก */
        }

        .light-mode-green #sidebar .text-gray-300 {
            color: #15803d !important; /* สีข้อความรอง */
        }

        .light-mode-green #sidebar .divide-gray-700 > * + * {
            border-color: #bbf7d0 !important; /* สีเส้นแบ่ง */
        }
        /* สไตล์สำหรับ badge สถานะ */
        .status-badge {
            display: inline-flex;
            align-items: center;
            padding: 0.375rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.875rem;
            font-weight: 500;
            border-width: 1px;
        }

        .status-waiting {
            background-color: #fef3c7;
            color: #92400e;
            border-color: #f59e0b;
        }

        .status-paid {
            background-color: #dbeafe;
            color: #1e40af;
            border-color: #3b82f6;
        }

        .status-cancelled {
            background-color: #fee2e2;
            color: #991b1b;
            border-color: #ef4444;
        }

        .status-overdue {
            background-color: #ffedd5;
            color: #c2410c;
            border-color: #ea580c;
        }

        /* Transition Classes (Applied to main content and header for padding-left) */
        .content-transition {
            transition: padding-left 0.3s ease-in-out;
        }

        .menu-text.hidden-transition {
            transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
        }

        /* Dropdown transition (simple fade/height) */
        .dropdown-content {
            transition: all 0.3s ease-out;
            max-height: 0;
            overflow: hidden;
            opacity: 0;
            visibility: hidden;
        }
        .dropdown-content.active {
            max-height: 500px; /* Large enough to contain all sub-items */
            opacity: 1;
            visibility: visible;
        }
        
        /* Mobile Overlay */
        #mobile-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 45;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
        }
        #mobile-overlay.active {
            opacity: 1;
            visibility: visible;
        }
        
        /* Mobile-specific sidebar styles */
        @media (max-width: 1023px) {
            #sidebar {
                transform: translateX(-100%);
                width: 280px !important; /* Fixed width on mobile */
                height: 100vh;
                overflow-y: auto;
            }
            #sidebar.mobile-open {
                transform: translateX(0);
            }
            #main-content {
                padding-left: 0 !important;
                margin-left: 0 !important;
            }
            #resizer-handle {
                display: none; /* Hide resizer on mobile */
            }
            
            /* ปรับปรุงการแสดงผลเมนูบนมือถือ */
            #sidebar.mobile-open {
                z-index: 50;
            }
            
            /* ปรับปรุง dropdown บนมือถือ */
            .dropdown-content.active {
                max-height: none;
            }

            /* ปรับปรุงโครงสร้าง sidebar สำหรับมือถือ */
            #sidebar {
                display: flex;
                flex-direction: column;
            }

            .sidebar-nav {
                flex: 1;
                overflow-y: auto;
                padding-bottom: 1rem;
            }

            .sidebar-footer {
                flex-shrink: 0;
                margin-top: auto;
                position: sticky;
                bottom: 40px; /* เพิ่มระยะห่างจากด้านล่าง 70px */
                background-color: inherit;
                border-top: 1px solid #374151;
                padding-top: 1rem;
                padding-bottom: 1rem;
                margin-bottom: 40px; /* เพิ่ม margin-bottom เพื่อให้มีพื้นที่ว่างด้านล่าง */
            }

            /* ปรับปรุงสำหรับโหมดสว่างบนมือถือ */
            .light-mode-green .sidebar-footer {
                border-top-color: #bbf7d0 !important;
                background-color: #dcfce7 !important;
            }
        }

        /* Resizer Handle */
        #resizer-handle {
            position: absolute;
            top: 0;
            right: 0;
            width: 8px;
            cursor: col-resize;
            height: 100%;
            z-index: 10;
            background-color: transparent; 
            border-right: 1px solid rgba(59, 130, 246, 0.3); 
        }

        /* ปรับปรุงสไตล์สำหรับการจัดวางใหม่ */
        #sidebar {
            top: 0;
            height: 100vh;
            display: flex;
            flex-direction: column;
        }

        #main-content {
            min-height: 100vh;
            width: 100%;
        }

        header {
            position: sticky;
            top: 0;
            z-index: 40;
        }

        /* ปรับปรุงการแสดงผลบนหน้าจอคอมพิวเตอร์ */
        @media (min-width: 1024px) {
            #sidebar {
                position: fixed;
                transform: translateX(0) !important;
            }
            
            #main-content {
                margin-left: 0;
                width: calc(100% - var(--sidebar-width, 280px));
            }

            .sidebar-footer {
                margin-top: auto;
            }
        }

        /* สไตล์สำหรับโลโก้และไอคอน */
        .logo-container {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .terminal-icon {
            width: 24px;
            height: 24px;
            /* สีจะถูกกำหนดผ่าน CSS classes ด้านล่าง */
        }

        /* สีไอคอนในโหมดสว่าง (สีดำ) */
        .light-mode-green .terminal-icon {
            color: #000000 !important;
        }

        /* สีไอคอนในโหมดมืด (สีเหลือง) */
        .dark .terminal-icon {
            color: #facc15 !important;
        }

        /* สีข้อความโลโก้ในโหมดสว่าง (สีดำ) */
        .light-mode-green .logo-text {
            color: #000000 !important;
        }

        /* สีข้อความโลโก้ในโหมดมืด (สีเหลือง) */
        .dark .logo-text {
            color: #facc15 !important;
        }

        /* ปรับตำแหน่งโลโก้ให้อยู่กึ่งกลางเมื่อย่อเมนู */
        .sidebar-item.justify-center .logo-container {
            justify-content: center;
            width: 100%;
        }