        :root { --primary-color: #0284c7; --dark-bg: #111b1e; --primary-rgb: 2, 132, 199; }
        html, body { overflow-x: hidden; }
        .glass { background: rgba(255,255,255,0.8); backdrop-filter: blur(20px); }
        .dark .glass { background: rgba(17,27,30,0.9); }
        .elevation-1 { box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); }
        .elevation-2 { box-shadow: 0 3px 6px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.12); }
        .elevation-3 { box-shadow: 0 10px 20px rgba(0,0,0,0.15), 0 3px 6px rgba(0,0,0,0.10); }
        .card-hover { transition: all 0.3s ease; }
        .card-hover:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
        .btn-primary-gradient { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%); }
        .btn-success-gradient { background: linear-gradient(135deg, #059669 0%, #047857 100%); }
        .btn-warning-gradient { background: linear-gradient(135deg, #d97706 0%, #b45309 100%); }
        .nav-item-active { background: linear-gradient(135deg, rgba(14,165,233,0.1) 0%, rgba(2,132,199,0.05) 100%); border-left: 3px solid #0ea5e9; color: #0284c7; }
        .sidebar-section { margin-bottom: 0.7rem; }
        .sidebar-section-toggle {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            padding: 0.85rem 0.9rem;
            border-radius: 1rem;
            border: 1px solid rgba(148, 163, 184, 0.16);
            background: linear-gradient(135deg, rgba(248,250,252,0.98) 0%, rgba(241,245,249,0.9) 100%);
            text-align: left;
            transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
        }
        .dark .sidebar-section-toggle {
            background: linear-gradient(135deg, rgba(26,38,43,0.96) 0%, rgba(20,31,36,0.94) 100%);
            border-color: rgba(42, 58, 64, 0.92);
        }
        .sidebar-section-toggle:hover {
            transform: translateY(-1px);
            border-color: rgba(14,165,233,0.28);
            box-shadow: 0 10px 24px rgba(2, 132, 199, 0.10);
        }
        .sidebar-section-toggle.is-active {
            border-color: rgba(14,165,233,0.34);
            background: linear-gradient(135deg, rgba(14,165,233,0.14) 0%, rgba(2,132,199,0.06) 100%);
            box-shadow: 0 14px 30px rgba(2, 132, 199, 0.10);
        }
        .dark .sidebar-section-toggle.is-active {
            background: linear-gradient(135deg, rgba(14,165,233,0.18) 0%, rgba(2,132,199,0.08) 100%);
        }
        .sidebar-section-icon {
            width: 2.2rem;
            height: 2.2rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 0.8rem;
            background: rgba(14,165,233,0.12);
            color: #0284c7;
            flex-shrink: 0;
        }
        .dark .sidebar-section-icon { background: rgba(14,165,233,0.18); color: #67e8f9; }
        .sidebar-section-copy { display: flex; flex-direction: column; min-width: 0; }
        .sidebar-section-copy strong { font-size: 0.92rem; color: #0f172a; }
        .dark .sidebar-section-copy strong { color: #f8fafc; }
        .sidebar-section-copy small { margin-top: 0.15rem; font-size: 0.72rem; color: #64748b; }
        .dark .sidebar-section-copy small { color: #94a3b8; }
        .sidebar-section-chevron {
            color: #64748b;
            transition: transform 0.26s ease, color 0.2s ease;
        }
        .sidebar-section.is-open .sidebar-section-chevron {
            transform: rotate(180deg);
            color: #0284c7;
        }
        .sidebar-section-panel {
            display: grid;
            grid-template-rows: 0fr;
            opacity: 0;
            transition: grid-template-rows 0.32s ease, opacity 0.22s ease, margin-top 0.22s ease;
            margin-top: 0;
        }
        .sidebar-section.is-open .sidebar-section-panel {
            grid-template-rows: 1fr;
            opacity: 1;
            margin-top: 0.45rem;
        }
        .sidebar-section-panel-inner {
            overflow: hidden;
            padding: 0 0.2rem;
        }
        .sidebar-section .nav-item {
            border-radius: 0.85rem;
            padding-top: 0.7rem;
            padding-bottom: 0.7rem;
        }
        .gradient-text { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
        .pos-terminal { font-family: 'JetBrains Mono', monospace; background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%); }
        .status-online { background: #10b981; box-shadow: 0 0 8px #10b981; }
        .status-offline { background: #ef4444; }
        .loading-spinner { border: 3px solid rgba(14,165,233,0.1); border-top-color: #0ea5e9; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; }
        @keyframes spin { to { transform: rotate(360deg); } }
        .splash-logo-wrap { display: flex; align-items: center; justify-content: center; margin-bottom: 2rem; animation: splashLogoIn 0.8s ease-out both; }
        .splash-logo-img { width: min(78vw, 960px); max-height: 50vh; height: auto; object-fit: contain; filter: drop-shadow(0 0 56px rgba(255,255,255,0.45)); animation: splashLogoPulse 2s ease-in-out infinite; }
        .splash-loading-dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
        .splash-loading-dots span { width: 8px; height: 8px; border-radius: 9999px; background: rgba(255,255,255,0.9); animation: splashDotBounce 1.2s infinite ease-in-out; }
        .splash-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
        .splash-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
        @keyframes splashLogoIn { from { opacity: 0; transform: scale(0.75); } to { opacity: 1; transform: scale(1); } }
        @keyframes splashLogoPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
        @keyframes splashDotBounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.35; } 40% { transform: translateY(-7px); opacity: 1; } }
        @media (max-width: 767px) {
            .splash-logo-img { width: min(95vw, 680px); max-height: 40vh; }
        }
        .notification-badge { position: absolute; top: -5px; right: -5px; background: linear-gradient(135deg, #0ea5e9, #0284c7); color: white; font-size: 10px; font-weight: bold; padding: 2px 6px; border-radius: 10px; min-width: 18px; text-align: center; }
        .pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
        @media (max-width: 767px) {
            .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
            .pos-product-card { min-height: 180px; padding: 12px; border-radius: 14px; }
            .pos-filter-bar { scrollbar-width: thin; }
        }
        @media (min-width: 768px) { .pos-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
        .animate-enter { animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
        @keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        .payment-split-input { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: white; }
        .payment-split-input:focus { border-color: #0ea5e9; outline: none; }
        .timeline-item::before { content: ''; position: absolute; left: 15px; top: 35px; bottom: -15px; width: 2px; background: #e5e7eb; }
        .timeline-item:last-child::before { display: none; }
        .dark .timeline-item::before { background: #374151; }
        .sort-asc::after { content: ' ↑'; }
        .sort-desc::after { content: ' ↓'; }
        
        /* Custom Color Palette Overrides */
        .dark body { background-color: #111b1e !important; }
        .dark .bg-gray-800 { background-color: #1a262b !important; }
        .dark .bg-gray-900 { background-color: #111b1e !important; }
        .dark .border-gray-700 { border-color: #2a3a40 !important; }
        .dark .bg-gray-700 { background-color: #243038 !important; }
        .dark .bg-gray-600 { background-color: #2d3f47 !important; }
        .text-primary-600 { color: #0284c7 !important; }
        .bg-primary-600 { background-color: #0284c7 !important; }
        .bg-primary-700 { background-color: #0369a1 !important; }
        .bg-primary-800 { background-color: #075985 !important; }
        .bg-primary-900 { background-color: #0c4a6e !important; }
        .text-primary-700 { color: #0369a1 !important; }
        .hover\:text-primary-600:hover { color: #0284c7 !important; }
        .hover\:text-primary-700:hover { color: #0369a1 !important; }
        .focus\:ring-primary-600:focus { --tw-ring-color: #0284c7 !important; }
        .from-primary-700 { --tw-gradient-from: #0369a1 !important; }
        .via-primary-800 { --tw-gradient-stops: #075985, #0c4a6e !important; }
        .to-primary-900 { --tw-gradient-to: #0c4a6e !important; }
        .from-primary-50 { --tw-gradient-from: #f0f9ff !important; }
        .to-primary-100 { --tw-gradient-to: #e0f2fe !important; }
        .from-primary-600 { --tw-gradient-from: #0284c7 !important; }
        .to-primary-700 { --tw-gradient-to: #0369a1 !important; }
        #mainContent > div { width: 100%; max-width: 100%; }
        .rw-table-scroll { width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
        .rw-table-scroll table { min-width: 720px; }
        .rw-table-scroll::-webkit-scrollbar { height: 8px; }
        .rw-table-scroll::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.5); border-radius: 9999px; }
        .rw-table-scroll table th, .rw-table-scroll table td { white-space: nowrap; }
        .rw-table-scroll table td:first-child, .rw-table-scroll table th:first-child { white-space: normal; }
        .rw-page-header-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; width: 100%; }
        .rw-page-header-actions > * { flex: 1 1 180px; }
        .rw-filter-row { display: flex; flex-wrap: wrap; gap: 1rem; }
        .rw-filter-row > * { min-width: 0; }
        .rw-modal-body .rw-table-scroll table { min-width: 560px; }
        
        /* Sidebar scroll improvements */
        #sidebar > div:first-child {
            scrollbar-width: thin;
            scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
        }
        #sidebar > div:first-child::-webkit-scrollbar {
            width: 5px;
        }
        #sidebar > div:first-child::-webkit-scrollbar-track {
            background: transparent;
        }
        #sidebar > div:first-child::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.4);
            border-radius: 9999px;
        }
        #sidebar > div:first-child::-webkit-scrollbar-thumb:hover {
            background: rgba(148, 163, 184, 0.6);
        }
        
        /* Post-Login Loading Screen with Tips */
        .app-loading-screen {
            position: fixed;
            inset: 0;
            z-index: 9998;
            background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #dbeafe 100%);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 2rem;
        }
        .dark .app-loading-screen {
            background: linear-gradient(135deg, #0c4a6e 0%, #075985 50%, #0369a1 100%);
        }
        .app-loading-card {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            border-radius: 2rem;
            padding: 2.5rem;
            max-width: 500px;
            width: 100%;
            text-align: center;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
            animation: appLoadingCardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .dark .app-loading-card {
            background: rgba(17, 27, 30, 0.95);
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
        }
        @keyframes appLoadingCardIn {
            from { opacity: 0; transform: translateY(30px) scale(0.95); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }
        .app-loading-logo {
            width: 100px;
            height: 100px;
            margin: 0 auto 1rem;
            animation: appLoadingLogoPulse 2s ease-in-out infinite;
        }
        @keyframes appLoadingLogoPulse {
            0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(2, 132, 199, 0.3)); }
            50% { transform: scale(1.05); filter: drop-shadow(0 0 40px rgba(2, 132, 199, 0.5)); }
        }
        .app-loading-spinner {
            width: 50px;
            height: 50px;
            border: 4px solid rgba(14, 165, 233, 0.15);
            border-top-color: #0ea5e9;
            border-radius: 50%;
            animation: appLoadingSpin 1s linear infinite;
            margin: 0 auto 1.5rem;
        }
        @keyframes appLoadingSpin {
            to { transform: rotate(360deg); }
        }
        .app-loading-title {
            font-size: 1.5rem;
            font-weight: 700;
            color: #0c4a6e;
            margin-bottom: 0.5rem;
        }
        .dark .app-loading-title {
            color: #e0f2fe;
        }
        .app-loading-subtitle {
            font-size: 0.875rem;
            color: #64748b;
            margin-bottom: 1.5rem;
        }
        .dark .app-loading-subtitle {
            color: #94a3b8;
        }
        .app-tip-container {
            background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
            border-radius: 1.5rem;
            padding: 1.5rem;
            margin-top: 1rem;
            min-height: 280px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
        }
        .dark .app-tip-container {
            background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(2, 132, 199, 0.1) 100%);
        }
        .app-tip-image {
            width: 100px;
            height: 100px;
            margin-bottom: 1rem;
            border-radius: 1rem;
            object-fit: cover;
            animation: appTipImageIn 0.5s ease-out;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }
        @keyframes appTipImageIn {
            0% { opacity: 0; transform: scale(0.8) rotate(-10deg); }
            100% { opacity: 1; transform: scale(1) rotate(0deg); }
        }
        .app-tip-content {
            animation: appTipContentIn 0.5s ease-out 0.1s both;
        }
        @keyframes appTipContentIn {
            from { opacity: 0; transform: translateY(15px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .app-tip-label {
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: #0284c7;
            margin-bottom: 0.5rem;
        }
        .dark .app-tip-label {
            color: #38bdf8;
        }
        .app-tip-text {
            font-size: 1rem;
            font-weight: 600;
            color: #0f172a;
            line-height: 1.5;
            max-width: 100%;
        }
        .dark .app-tip-text {
            color: #f1f5f9;
        }
        .app-tip-progress-container {
            margin-top: 1rem;
            width: 100%;
        }
        .app-tip-progress-bar {
            width: 100%;
            height: 6px;
            background: rgba(14, 165, 233, 0.15);
            border-radius: 3px;
            overflow: hidden;
            position: relative;
        }
        .app-tip-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #0ea5e9, #0284c7);
            border-radius: 3px;
            transition: width 0.5s ease;
            box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
        }
        .app-tip-progress-text {
            margin-top: 0.5rem;
            font-size: 0.75rem;
            color: #0ea5e9;
            font-weight: 600;
            text-align: center;
        }
        .app-loading-progress {
            width: 100%;
            height: 4px;
            background: rgba(14, 165, 233, 0.1);
            border-radius: 2px;
            margin-top: 1.5rem;
            overflow: hidden;
        }
        .app-loading-progress-bar {
            height: 100%;
            background: linear-gradient(90deg, #0ea5e9, #0284c7);
            border-radius: 2px;
            animation: appLoadingProgress 3s ease-in-out infinite;
        }
        @keyframes appLoadingProgress {
            0% { width: 0%; transform: translateX(-100%); }
            50% { width: 100%; transform: translateX(0); }
            100% { width: 100%; transform: translateX(100%); }
        }
        /* =====================================================
           RESPONSIVE DESIGN - ALL DEVICES SUPPORT
           ===================================================== */
        
        /* ===== SMALL MOBILES (Galaxy S8+: 360px) ===== */
        @media (max-width: 360px) {
            /* Splash screen */
            .splash-logo-img { width: 80vw; max-height: 35vh; }
            #splashScreen h1 { font-size: 2rem; }
            #splashScreen p { font-size: 0.875rem; }
            
            /* Login screen */
            #loginScreen .w-full.max-w-sm { padding: 0 0.75rem; }
            #loginScreen h1 { font-size: 1.5rem; }
            #loginScreen img.h-32 { height: 6rem; }
            
            /* App header */
            header .w-14 { width: 2.5rem; height: 2.5rem; }
            header h1 { font-size: 0.875rem; }
            #userInitials { font-size: 0.75rem; }
            
            /* Main content */
            #mainContent { padding: 8px !important; }
            
            /* POS grid */
            .pos-grid { grid-template-columns: repeat(1, 1fr); gap: 8px; }
            .pos-product-card { min-height: 140px; padding: 8px; }
            
            /* Tables */
            .rw-table-scroll table { min-width: 560px; }
            
            /* Modals */
            #activeModal > div:last-child { margin: 0.5rem; padding: 1rem; }
            
            /* Forms */
            .rw-filter-row { gap: 0.5rem; }
            .rw-filter-row > * { width: 100% !important; flex: none !important; }
            
            /* Cards */
            .card-hover { padding: 0.75rem; }
            
            /* Toast */
            #toastContainer { left: 8px; right: 8px; top: 70px; }
            
            /* Sidebar */
            #sidebar { width: 100%; max-width: 280px; }
            
            /* App loading */
            .app-loading-card { padding: 1.5rem; margin: 0.5rem; }
            .app-loading-logo { width: 70px; height: 70px; }
            .app-tip-container { min-height: 200px; padding: 1rem; }
            .app-tip-image { width: 70px; height: 70px; }
        }
        
        /* ===== MOBILE SMALL (iPhone SE: 375px) ===== */
        @media (min-width: 361px) and (max-width: 375px) {
            .splash-logo-img { width: 85vw; max-height: 38vh; }
            #splashScreen h1 { font-size: 2.25rem; }
            
            .pos-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
            .pos-product-card { min-height: 160px; }
            
            #mainContent { padding: 10px !important; }
            
            .rw-table-scroll table { min-width: 600px; }
            
            header .w-14 { width: 2.75rem; height: 2.75rem; }
            
            .app-loading-card { padding: 1.75rem; }
            .app-tip-container { min-height: 220px; }
        }
        
        /* ===== MOBILE MEDIUM (iPhone 12 Pro: 390px, Pixel 7: 412px, Galaxy A51/71: 412px, S20 Ultra: 412px) ===== */
        @media (min-width: 376px) and (max-width: 413px) {
            .splash-logo-img { width: 88vw; max-height: 40vh; }
            
            .pos-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
            .pos-product-card { min-height: 170px; padding: 10px; }
            
            #mainContent { padding: 12px !important; }
            
            .rw-table-scroll table { min-width: 640px; }
            
            header .w-14 { width: 3rem; height: 3rem; }
            
            .app-loading-card { padding: 2rem; }
            .app-tip-container { min-height: 240px; }
        }
        
        /* ===== MOBILE LARGE (iPhone XR: 414px) ===== */
        @media (min-width: 414px) and (max-width: 429px) {
            .splash-logo-img { width: 90vw; max-height: 42vh; }
            
            .pos-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
            .pos-product-card { min-height: 180px; padding: 12px; }
            
            #mainContent { padding: 14px !important; }
            
            .rw-table-scroll table { min-width: 680px; }
            
            .app-loading-card { padding: 2.25rem; }
        }
        
        /* ===== MOBILE XL (iPhone 14 Pro Max: 430px) ===== */
        @media (min-width: 430px) and (max-width: 539px) {
            .splash-logo-img { width: min(92vw, 400px); max-height: 42vh; }
            
            .pos-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
            .pos-product-card { min-height: 190px; }
            
            #mainContent { padding: 14px !important; }
            
            .rw-table-scroll table { min-width: 720px; }
            
            header .w-14 { width: 3.25rem; height: 3.25rem; }
        }
        
        /* ===== DUAL SCREEN / FOLDABLES (Surface Duo: 540px) ===== */
        @media (min-width: 540px) and (max-width: 599px) {
            .splash-logo-img { width: min(80vw, 450px); max-height: 45vh; }
            
            .pos-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
            .pos-product-card { min-height: 170px; }
            
            #mainContent { padding: 16px !important; }
            
            .rw-table-scroll table { min-width: 680px; }
            
            /* Login side-by-side layout */
            #loginScreen .hidden.lg\:flex { display: none !important; }
        }
        
        /* ===== TABLET SMALL / FOLDABLES UNFOLDED (Galaxy Z Fold 5: 744px) ===== */
        @media (min-width: 600px) and (max-width: 767px) {
            .splash-logo-img { width: min(75vw, 500px); max-height: 48vh; }
            
            .pos-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
            .pos-product-card { min-height: 180px; }
            
            #mainContent { padding: 18px !important; }
            
            .rw-table-scroll table { min-width: 600px; }
            
            /* Header adjustments */
            header .hidden.md\:flex { display: flex !important; }
            #globalSearchContainer { max-width: 280px; }
            
            /* Sidebar improvements */
            #sidebar { width: 280px; }
        }
        
        /* ===== TABLET MINI (iPad Mini: 768px) ===== */
        @media (min-width: 768px) and (max-width: 819px) {
            .splash-logo-img { width: min(70vw, 550px); max-height: 50vh; }
            
            .pos-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
            
            #mainContent { padding: 20px !important; }
            
            /* Sidebar visible by default on tablets */
            #sidebar { 
                position: static; 
                transform: none !important; 
                width: 260px;
            }
            #sidebarToggle { display: none !important; }
            #sidebarOverlay { display: none !important; }
            
            /* Header adjustments */
            header .hidden.md\:flex { display: flex !important; }
            header .hidden.sm\:block { display: block !important; }
            
            /* Tables */
            .rw-table-scroll table { min-width: 680px; }
            
            /* License widget */
            #sidebar .p-4 { padding: 1rem; }
        }
        
        /* ===== TABLET AIR (iPad Air: 820px, Surface Pro 7: 912px) ===== */
        @media (min-width: 820px) and (max-width: 911px) {
            .splash-logo-img { width: min(65vw, 600px); max-height: 50vh; }
            
            .pos-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
            
            #mainContent { padding: 22px !important; }
            
            #sidebar { 
                position: static; 
                transform: none !important; 
                width: 270px;
            }
            #sidebarToggle { display: none !important; }
            #sidebarOverlay { display: none !important; }
            
            header .hidden.lg\:px-6 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
            
            .rw-table-scroll table { min-width: 720px; }
        }
        
        /* ===== LAPTOP / TABLET PRO (Surface Pro 7: 912px - 1023px) ===== */
        @media (min-width: 912px) and (max-width: 1023px) {
            .splash-logo-img { width: min(60vw, 650px); max-height: 50vh; }
            
            .pos-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
            
            #mainContent { padding: 24px !important; }
            
            #sidebar { 
                position: static; 
                transform: none !important; 
                width: 280px;
            }
            #sidebarToggle { display: none !important; }
            #sidebarOverlay { display: none !important; }
            
            /* Login: show left panel on larger screens */
            #loginScreen .hidden.lg\:flex { display: flex !important; }
            #loginScreen .w-1\/2 { width: 50%; }
            
            .rw-table-scroll table { min-width: 760px; }
        }
        
        /* ===== TABLET PRO / SMALL LAPTOP (iPad Pro: 1024px, Nest Hub: 1024px) ===== */
        @media (min-width: 1024px) and (max-width: 1099px) {
            .splash-logo-img { width: min(55vw, 700px); max-height: 50vh; }
            
            .pos-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
            
            #mainContent { padding: 24px !important; }
            
            #sidebar { 
                position: static; 
                transform: none !important; 
                width: 280px;
            }
            #sidebarToggle { display: none !important; }
            #sidebarOverlay { display: none !important; }
            
            /* Nest Hub landscape optimization */
            @media (max-height: 650px) {
                header { height: 56px; }
                header h1 { font-size: 1rem; }
                #sidebar { width: 240px; }
                .pos-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
            }
            
            .rw-table-scroll table { min-width: 800px; }
        }
        
        /* ===== NEST HUB MAX / MEDIUM SCREENS (Nest Hub Max: 1280px) ===== */
        @media (min-width: 1100px) and (max-width: 1365px) {
            .splash-logo-img { width: min(50vw, 750px); max-height: 50vh; }
            
            .pos-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
            
            #mainContent { padding: 26px !important; }
            
            #sidebar { 
                position: static; 
                transform: none !important; 
                width: 288px;
            }
            #sidebarToggle { display: none !important; }
            #sidebarOverlay { display: none !important; }
            
            /* Landscape optimization for Nest Hub Max */
            @media (max-height: 850px) {
                .pos-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
            }
            
            .rw-table-scroll table { min-width: auto; }
        }
        
        /* ===== LAPTOP / DESKTOP (iPad Pro Large, standard screens: 1366px+) ===== */
        @media (min-width: 1366px) {
            .splash-logo-img { width: min(45vw, 960px); max-height: 55vh; }
            
            .pos-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
            
            #mainContent { padding: 28px !important; }
            
            #sidebar { 
                position: static; 
                transform: none !important; 
                width: 288px;
            }
            #sidebarToggle { display: none !important; }
            #sidebarOverlay { display: none !important; }
            
            .rw-table-scroll table { min-width: auto; }
        }
        
        /* ===== FOLDABLES SPECIAL CASES ===== */
        /* Galaxy Z Fold 5 - Unfolded inner screen */
        @media (min-width: 700px) and (max-width: 750px) and (min-height: 1500px) {
            #sidebar { 
                position: static; 
                transform: none !important; 
                width: 300px;
            }
            #sidebarToggle { display: none !important; }
            .pos-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
        }
        
        /* Asus Zenbook Fold - Large foldable */
        @media (min-width: 1800px) and (max-height: 1300px) {
            .pos-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
            #mainContent { padding: 32px !important; }
        }
        
        /* ===== LANDSCAPE MOBILE OPTIMIZATIONS ===== */
        @media (max-height: 500px) and (orientation: landscape) and (max-width: 896px) {
            header { height: 50px; }
            header .w-14 { width: 2rem; height: 2rem; }
            header h1 { display: none; }
            #tenantName { display: none; }
            
            #splashScreen h1 { font-size: 1.75rem; }
            .splash-logo-img { max-height: 50vh; width: auto; }
            
            .app-loading-card { padding: 1rem; }
            .app-tip-container { min-height: 150px; }
            .app-tip-image { width: 60px; height: 60px; }
        }
        
        /* ===== GENERAL RESPONSIVE UTILITIES ===== */
        
        /* Hide scrollbar but keep functionality */
        .no-scrollbar::-webkit-scrollbar { display: none; }
        .no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
        
        /* Touch-friendly tap targets */
        @media (pointer: coarse) {
            button, a, input, select, [role="button"] { min-height: 44px; min-width: 44px; }
            .pos-product-card { min-height: 160px; }
            nav a { padding-top: 0.75rem; padding-bottom: 0.75rem; }
        }
        
        /* Safe area insets for notched devices */
        @supports (padding: max(0px)) {
            header { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
            #mainContent { padding-bottom: max(1rem, env(safe-area-inset-bottom)) !important; }
            #toastContainer { top: max(76px, env(safe-area-inset-top) + 60px); }
        }
        
        /* Print styles */
        @media print {
            #sidebar, header, #toastContainer, #appLoadingScreen, #splashScreen { display: none !important; }
            #mainContent { margin: 0; padding: 0; overflow: visible; }
            body { background: white; }
            .pos-terminal { background: white !important; color: black !important; }
        }
        
        /* Dark mode specific adjustments */
        @media (prefers-color-scheme: dark) {
            @media (max-width: 767px) {
                #sidebar { background: rgba(17, 27, 30, 0.98); }
            }
        }
        
        /* Reduced motion preferences */
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }
            .splash-logo-img { animation: none; }
            .loading-spinner { animation: none; }
        }
        
        /* High contrast mode support */
        @media (prefers-contrast: high) {
            .nav-item-active { border-left-width: 4px; }
            button, input, select { border-width: 2px; }
        }
        
        /* =====================================================
           LOGIN UNDERWATER EFFECT & LOGO SHINE
           ===================================================== */
        .login-underwater-bg {
            background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 30%, #0369a1 60%, #075985 85%, #0c4a6e 100%);
        }
        
        /* Ondas del mar animadas */
        .ocean-waves {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            z-index: 1;
            pointer-events: none;
        }
        
        .wave {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 200%;
            height: 200px;
            background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' fill='%23ffffff' fill-opacity='0.05'/%3E%3C/svg%3E") repeat-x;
            animation: wave-move 8s linear infinite;
        }
        
        .wave-1 {
            bottom: -20px;
            animation-duration: 12s;
            opacity: 0.3;
        }
        
        .wave-2 {
            bottom: -40px;
            animation-duration: 8s;
            animation-delay: -2s;
            opacity: 0.2;
        }
        
        .wave-3 {
            bottom: -60px;
            animation-duration: 6s;
            animation-delay: -4s;
            opacity: 0.1;
        }
        
        @keyframes wave-move {
            0% { transform: translateX(0); }
            100% { transform: translateX(-50%); }
        }
        
        /* Burbujas flotantes */
        .bubbles {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            z-index: 2;
            pointer-events: none;
            overflow: hidden;
        }
        
        .bubble {
            position: absolute;
            bottom: -50px;
            background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.2));
            border-radius: 50%;
            animation: bubble-rise linear infinite;
        }
        
        .bubble-1 { width: 20px; height: 20px; left: 10%; animation-duration: 8s; animation-delay: 0s; }
        .bubble-2 { width: 12px; height: 12px; left: 20%; animation-duration: 10s; animation-delay: 1s; }
        .bubble-3 { width: 25px; height: 25px; left: 35%; animation-duration: 7s; animation-delay: 2s; }
        .bubble-4 { width: 15px; height: 15px; left: 50%; animation-duration: 9s; animation-delay: 0.5s; }
        .bubble-5 { width: 18px; height: 18px; left: 65%; animation-duration: 11s; animation-delay: 3s; }
        .bubble-6 { width: 10px; height: 10px; left: 75%; animation-duration: 8s; animation-delay: 1.5s; }
        .bubble-7 { width: 22px; height: 22px; left: 85%; animation-duration: 12s; animation-delay: 2.5s; }
        .bubble-8 { width: 14px; height: 14px; left: 95%; animation-duration: 9s; animation-delay: 4s; }
        
        @keyframes bubble-rise {
            0% {
                transform: translateY(0) scale(1);
                opacity: 0;
            }
            10% {
                opacity: 0.6;
            }
            90% {
                opacity: 0.6;
            }
            100% {
                transform: translateY(-100vh) scale(0.5);
                opacity: 0;
            }
        }
        
        /* Ondas y burbujas para el loading screen */
        .app-loading-waves {
            z-index: 0;
        }
        .app-loading-waves .wave {
            background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' fill='%230ea5e9' fill-opacity='0.15'/%3E%3C/svg%3E") repeat-x;
        }
        .app-loading-waves .wave-1 {
            opacity: 0.4;
        }
        .app-loading-waves .wave-2 {
            opacity: 0.3;
        }
        .app-loading-waves .wave-3 {
            opacity: 0.2;
        }
        .dark .app-loading-waves .wave {
            background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' fill='%23ffffff' fill-opacity='0.08'/%3E%3C/svg%3E") repeat-x;
        }
        .app-loading-bubbles {
            z-index: 1;
        }
        .app-loading-bubbles .bubble {
            background: radial-gradient(circle at 30% 30%, rgba(14, 165, 233, 0.6), rgba(14, 165, 233, 0.15));
        }
        .dark .app-loading-bubbles .bubble {
            background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.1));
        }
        .app-loading-card {
            position: relative;
            z-index: 10;
        }
        
        /* Logo con efecto de brillo */
        .logo-shine {
            filter: drop-shadow(0 0 20px rgba(14, 165, 233, 0.5));
            animation: logo-shine 3s ease-in-out infinite, logo-float 4s ease-in-out infinite;
        }
        
        @keyframes logo-shine {
            0%, 100% {
                filter: drop-shadow(0 0 20px rgba(14, 165, 233, 0.4)) drop-shadow(0 0 40px rgba(14, 165, 233, 0.2));
            }
            50% {
                filter: drop-shadow(0 0 30px rgba(14, 165, 233, 0.8)) drop-shadow(0 0 60px rgba(14, 165, 233, 0.4)) drop-shadow(0 0 100px rgba(255, 255, 255, 0.3));
            }
        }
        
        @keyframes logo-float {
            0%, 100% {
                transform: translateY(0);
            }
            50% {
                transform: translateY(-10px);
            }
        }
        
        /* Efecto de luz que barre el logo */
        .logo-shine::after {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 50%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
            animation: shine-sweep 4s ease-in-out infinite;
        }
        
        @keyframes shine-sweep {
            0%, 100% {
                left: -100%;
            }
            50% {
                left: 150%;
            }
        }
        .nav-item-wrapper { position: relative; }
        .nav-item-wrapper .nav-item { padding-right: 2.25rem; }
        .vital-sign-alert-high { color: #dc2626; font-weight: 700; }
        .vital-sign-alert-low { color: #ea580c; font-weight: 700; }
        .medication-five-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
        .medication-five-checks label { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem; border-radius: 0.75rem; background: #f8fafc; border: 2px solid transparent; cursor: pointer; transition: all 0.2s; }
        .medication-five-checks label.checked { border-color: #059669; background: #ecfdf5; }
        .dark .medication-five-checks label { background: #1f2937; }
        .dark .medication-five-checks label.checked { background: #064e3b; }
        .icd10-autocomplete-dropdown { position: absolute; left: 0; right: 0; top: 100%; margin-top: 0.25rem; background: white; border: 1px solid #e5e7eb; border-radius: 0.75rem; max-height: 16rem; overflow-y: auto; z-index: 50; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
        .dark .icd10-autocomplete-dropdown { background: #1f2937; border-color: #374151; }
        .icd10-option { padding: 0.5rem 1rem; cursor: pointer; font-size: 0.875rem; }
        .icd10-option:hover, .icd10-option.active { background: #f3f4f6; }
        .dark .icd10-option:hover, .dark .icd10-option.active { background: #374151; }
