* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: Arial, sans-serif;
            background: #f0f0f0;
            padding: 20px;
            padding-top: 55px; /* Space for fixed menu bar */
        }

        .container {
            max-width: 900px;
            margin: 0 auto;
            background: white;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }

        /* Menu Bar Styles */
        #menu-bar {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
            padding: 0;
            display: none; /* Hidden by default, shown after login */
            align-items: center;
            border-bottom: 2px solid #404040;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
            height: 35px;
            z-index: 10001;
        }
        
        #menu-bar .logo {
            color: #00ff88;
            font-weight: bold;
            font-size: 16px;
            padding: 0 16px;
            margin-right: 16px;
            border-right: 1px solid #404040;
        }
        
        .menu-item {
            position: relative;
            display: inline-block;
        }
        
        .menu-btn {
            background: none;
            border: none;
            color: #fff;
            padding: 8px 15px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            height: 35px;
        }
        
        .menu-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #00ff88;
        }
        
        .menu-dropdown {
            display: none;
            position: absolute;
            background: #2d2d2d;
            min-width: 220px;
            box-shadow: 0 8px 16px rgba(0,0,0,0.4);
            border: 1px solid #404040;
            border-radius: 6px;
            margin-top: 2px;
            z-index: 10002;
        }
        
        .menu-item:hover .menu-dropdown {
            display: block;
        }
        
        .menu-dropdown button {
            width: 100%;
            background: none;
            border: none;
            color: #fff;
            padding: 12px 16px;
            text-align: left;
            cursor: pointer;
            font-size: 13px;
            transition: all 0.2s;
            display: block;
        }
        
        .menu-dropdown button:hover {
            background: rgba(0, 255, 136, 0.1);
            color: #00ff88;
        }
        
        .menu-work-orders {
            display: flex;
            align-items: center;
            gap: 8px;
            padding-left: 16px;
            position: relative;
        }
        
        .searchable-dropdown-container {
            position: relative;
            min-width: 450px;
        }
        
        .searchable-dropdown-input {
            padding: 6px 10px;
            border: 1px solid #404040;
            border-radius: 4px;
            background: #2d2d2d;
            color: #fff;
            font-size: 12px;
            width: 100%;
            text-transform: uppercase;
        }
        
        .searchable-dropdown-input::placeholder {
            color: #888;
        }
        
        .searchable-dropdown-input:focus {
            outline: none;
            border-color: #00bfff;
            box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2);
        }
        
        .searchable-dropdown-list {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            max-height: 400px;
            overflow-y: auto;
            background: #2d2d2d;
            border: 1px solid #404040;
            border-top: none;
            border-radius: 0 0 4px 4px;
            z-index: 10003;
            margin-top: -4px;
        }
        
        .searchable-dropdown-list.show {
            display: block;
        }
        
        .searchable-dropdown-item {
            padding: 10px;
            cursor: pointer;
            border-bottom: 1px solid #404040;
            white-space: pre-line;
            text-transform: uppercase;
            font-size: 12px;
            color: #fff;
        }
        
        .searchable-dropdown-item:hover {
            background: #404040;
        }
        
        .searchable-dropdown-item:last-child {
            border-bottom: none;
        }
        
        .searchable-dropdown-list::-webkit-scrollbar {
            width: 8px;
        }
        
        .searchable-dropdown-list::-webkit-scrollbar-track {
            background: #1e1e1e;
        }
        
        .searchable-dropdown-list::-webkit-scrollbar-thumb {
            background: #555;
            border-radius: 4px;
        }
        
        .searchable-dropdown-list::-webkit-scrollbar-thumb:hover {
            background: #666;
        }
        
        #menu-status {
            margin-left: auto;
            padding: 0 16px;
            font-size: 12px;
            color: #00ff88;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        #menu-status.locked-readonly {
            color: #ff4757;
        }
        
        #menu-force-unlock-btn {
            display: none;
            background: linear-gradient(135deg, #ff9800 0%, #ff6f00 100%);
            color: white;
            border: none;
            padding: 4px 10px;
            border-radius: 4px;
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            margin-right: 16px;
        }
        
        #menu-force-unlock-btn:hover {
            background: linear-gradient(135deg, #ff6f00 0%, #ff9800 100%);
        }
        
        #menu-force-unlock-btn.visible {
            display: inline-block;
        }

        #firebase-status {
            position: fixed;
            top: 35px;
            left: 0;
            width: 100%;
            padding: 4px;
            background-color: #ffc107; /* Yellow for connecting */
            color: black;
            text-align: center;
            font-size: 11px;
            z-index: 999;
            font-weight: bold;
        }
        #firebase-status.connected {
            background-color: #28a745; /* Green for connected */
            color: white;
        }
        #firebase-status.disconnected {
            background-color: #dc3545; /* Red for disconnected */
            color: white;
        }
        
        /* Lock status indicator */
        #save-status.locked-readonly {
            background: linear-gradient(135deg, #ff4757 0%, #ff6b7a 100%);
            color: white !important;
            padding: 4px 12px;
            border-radius: 6px;
            font-weight: 600;
            box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
        }
        
        /* Force unlock button */
        #force-unlock-btn {
            display: none;
            background: linear-gradient(135deg, #ff9800 0%, #ff6f00 100%);
            color: white;
            border: none;
            padding: 6px 16px;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            margin-left: 8px;
            box-shadow: 0 2px 8px rgba(255, 152, 0, 0.4);
            transition: all 0.3s;
        }
        #force-unlock-btn:hover {
            background: linear-gradient(135deg, #ff6f00 0%, #ff9800 100%);
            box-shadow: 0 4px 12px rgba(255, 152, 0, 0.6);
        }
        
        /* Ensure text selection works properly (Firefox/Edge fix) */
        input, textarea, [contenteditable] {
            -webkit-user-select: text;
            -moz-user-select: text;
            -ms-user-select: text;
            user-select: text;
        }
        
        /* Prevent blur events from clearing selection */
        input::selection, textarea::selection, [contenteditable]::selection {
            background: #0078d4;
            color: white;
        }
        input::-moz-selection, textarea::-moz-selection, [contenteditable]::-moz-selection {
            background: #0078d4;
            color: white;
        }
        #force-unlock-btn.visible {
            display: inline-block;
        }
        
        /* VIN Hover Overlay Styles */
        .vin-overlay {
            position: absolute;
            background: #fff;
            border: 2px solid #333;
            padding: 10px 15px;
            border-radius: 5px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.2);
            z-index: 10000;
            font-size: 18px;
            font-family: 'Courier New', monospace;
            letter-spacing: 1px;
            white-space: nowrap;
            pointer-events: none;
            display: none;
        }
        
        .vin-overlay.show {
            display: block;
        }
        
        .vin-first-part {
            font-weight: normal;
            color: #666;
        }
        
        .vin-last-eight {
            font-weight: bold;
            color: #000;
            font-size: 20px;
        }

        #bottom-bar {
            position: fixed;
            left: 0;
            bottom: 0;
            width: 100%;
            background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
            border-top: 1px solid #404040;
            box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
            z-index: 101;
            padding: 4px 0 4px 0;
            text-align: center;
            backdrop-filter: blur(10px);
        }
        
        /* VIN Scanner Camera Styles */
        .scan-vin-btn {
            position: absolute;
            right: -28px;
            top: 50%;
            transform: translateY(-50%);
            width: 24px !important;
            height: 24px !important;
            background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 13px !important;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(0, 255, 136, 0.3);
            transition: all 0.2s;
            z-index: 10;
        }
        .scan-vin-btn:hover {
            background: linear-gradient(135deg, #00cc6a 0%, #00ff88 100%);
            transform: translateY(-50%) scale(1.1);
            box-shadow: 0 4px 12px rgba(0, 255, 136, 0.5);
        }
        .scan-vin-btn:active {
            transform: translateY(-50%) scale(0.95);
        }
        
        #scanner-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: #000;
            z-index: 9999;
            flex-direction: column;
        }
        #scanner-overlay.active {
            display: flex;
        }
        
        .scanner-header {
            width: 100%;
            padding: 15px 20px;
            background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 2px solid #00ff88;
            flex-shrink: 0;
        }
        
        .scanner-title {
            color: #00ff88;
            font-size: 20px;
            font-weight: bold;
        }
        
        .scanner-close-btn {
            background: #dc3545;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 20px;
            font-weight: bold;
            box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
        }
        .scanner-close-btn:active {
            background: #c82333;
        }
        
        #scanner-container {
            position: relative;
            flex: 1;
            width: 100%;
            min-height: 0;
            background: #000;
            overflow: hidden;
        }
        
        #scanner-video {
            position: relative;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #000;
            overflow: hidden;
        }
        
        #scanner-video video {
            max-width: 100%;
            max-height: 100%;
            width: 100%;
            height: 100%;
            object-fit: contain;
        }
        
        #scanner-video canvas {
            position: absolute !important;
            top: 0 !important;
            left: 0 !important;
            width: 100% !important;
            height: 100% !important;
            object-fit: contain !important;
        }
        
        #scanner-video canvas.drawingBuffer {
            position: absolute !important;
            top: 50% !important;
            left: 50% !important;
            transform: translate(-50%, -50%) !important;
            max-width: 100% !important;
            max-height: 100% !important;
            width: auto !important;
            height: auto !important;
        }
        
        .scanner-instructions {
            width: 100%;
            padding: 20px;
            background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
            color: #fff;
            text-align: center;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
            border-top: 2px solid #00ff88;
            flex-shrink: 0;
        }
        
        @media (max-width: 900px) {
            .scanner-title {
                font-size: 18px;
            }
            .scanner-header {
                padding: 12px 15px;
            }
            .scanner-instructions {
                padding: 15px;
            }
        }
        #entries-list {
            width: 100%;
            max-width: 850px;
            margin: 0 auto 10px auto;
            padding: 4px;
            background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
            border: 1px solid #404040;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.3);
            position: static;
            z-index: 99;
            margin-bottom: 4px;
        }
        
        /* Professional Button Styling - Dark Mode */
        .btn-professional {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            font-weight: 600;
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.3px;
            padding: 6px 12px;
            border: 1px solid;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
            position: relative;
            overflow: hidden;
            margin-left: 4px;
            min-width: 80px;
            backdrop-filter: blur(10px);
        }
        
        .btn-professional:first-child {
            margin-left: 0;
        }
        
        .btn-professional:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
        }
        
        .btn-professional:active {
            transform: translateY(-1px);
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
        }
        
        /* Button Color Schemes - Dark Mode */
        #save-btn {
            background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
            color: #00ff88;
            border: 1px solid #00ff88;
        }
        
        #save-btn:hover {
            background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%);
            box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
            color: #00ffaa;
        }
        
        #new-work-order-btn {
            background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
            color: #8a2be2;
            border: 1px solid #8a2be2;
        }
        
        #new-work-order-btn:hover {
            background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%);
            box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
            color: #9932cc;
        }
        
        #new-order-btn {
            background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
            color: #00bfff;
            border: 1px solid #00bfff;
        }
        
        #new-order-btn:hover {
            background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%);
            box-shadow: 0 4px 12px rgba(0, 191, 255, 0.3);
            color: #1e90ff;
        }
        
        #print-btn {
            background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
            color: #ff6b35;
            border: 1px solid #ff6b35;
        }
        
        #print-btn:hover {
            background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%);
            box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
            color: #ff7f50;
        }
        
        #delete-entry-btn {
            background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
            color: #ff4757;
            border: 1px solid #ff4757;
        }
        
        #delete-entry-btn:hover {
            background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%);
            box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
            color: #ff6b7a;
        }
        
        /* Button shimmer effect - Dark Mode */
        .btn-professional::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
            transition: left 0.6s;
        }
        
        .btn-professional:hover::before {
            left: 100%;
        }
        
        /* Additional dark mode glow effect */
        .btn-professional::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: 8px;
            background: inherit;
            z-index: -1;
            filter: blur(4px);
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .btn-professional:hover::after {
            opacity: 0.3;
        }
        
        /* Mobile bottom bar adjustments */
        @media (max-width: 900px) {
            #bottom-bar {
                padding: 4px 4px;
                position: fixed;
                background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
                border-top: 1px solid #404040;
            }
            #bottom-bar > div {
                padding: 0 4px;
            }
            #entry-search, #entries-dropdown {
                width: 85% !important;
                margin-bottom: 3px;
                font-size: 14px !important;
                padding: 6px 5px !important;
                border-radius: 4px;
                text-transform: uppercase;
                background: #2d2d2d !important;
                color: #ffffff !important;
                border: 1px solid #404040 !important;
            }
            #entry-search::placeholder {
                color: #888 !important;
            }
            #entries-dropdown option {
                padding: 3px 3px;
                line-height: 1.1;
                text-transform: uppercase;
                background: #2d2d2d !important;
                color: #ffffff !important;
            }
            .btn-professional {
                padding: 8px 12px !important;
                font-size: 13px !important;
                touch-action: manipulation;
                min-height: 36px;
                margin: 2px 1px !important;
                min-width: 100px;
            }
            body {
                padding-bottom: 140px; /* Minimal space for scaled container */
            }
            #save-status {
                display: block;
                margin-left: 0 !important;
                margin-top: 4px;
                text-align: center;
                color: #00ff88 !important;
                font-size: 12px;
            }
            #force-unlock-btn {
                display: block;
                width: 100%;
                margin-top: 8px;
            }
        }
        
        /* Android-Specific Performance Optimizations (Desktop unaffected) */
        @media (hover: none) and (pointer: coarse) {
            /* Touch device optimizations */
            * {
                -webkit-tap-highlight-color: rgba(0, 150, 255, 0.2);
                -webkit-touch-callout: none;
                -webkit-user-select: none;
                user-select: none;
            }
            
            input, textarea, [contenteditable] {
                -webkit-user-select: text;
                user-select: text;
            }
            
            /* Improve input responsiveness on Android */
            input, textarea, [contenteditable], select {
                touch-action: manipulation;
            }
            
            /* Better button tap areas */
            button, .btn-professional {
                min-height: 44px;
                min-width: 44px;
                touch-action: manipulation;
            }
            
            /* Smoother scrolling on Android */
            body, .container {
                -webkit-overflow-scrolling: touch;
            }
            
            /* Hardware acceleration for form fields */
            .form-field {
                -webkit-transform: translate3d(0, 0, 0);
                transform: translate3d(0, 0, 0);
                will-change: transform;
            }
            
            /* Optimize scanner for mobile */
            #scanner-overlay {
                -webkit-transform: translate3d(0, 0, 0);
                transform: translate3d(0, 0, 0);
            }
            
            #scanner-video video {
                -webkit-transform: translate3d(0, 0, 0);
                transform: translate3d(0, 0, 0);
            }
        }
        
        /* Android Chrome specific optimizations */
        @supports (-webkit-touch-callout: none) {
            /* Safari/Chrome on iOS/Android */
            input[type="text"],
            input[type="number"],
            textarea,
            [contenteditable] {
                -webkit-appearance: none;
                appearance: none;
            }
        }
        
        /* Uppercase all text inputs and textareas */
        input[type="text"],
        textarea {
            text-transform: uppercase;
        }
        
        /* Prevent text selection issues on Android */
        @media (max-width: 900px) {
            .scan-vin-btn {
                -webkit-tap-highlight-color: rgba(0, 255, 136, 0.3);
            }
            
            /* Ensure dropdowns work well on mobile */
            select {
                padding: 10px !important;
            }
            
            /* Better touch targets for small screens */
            #entries-dropdown {
                min-height: 44px;
            }
        }
        
        /* Enhanced Visual Design for Android/Mobile Devices */
        @media (max-width: 900px) {
            /* Modern gradient background for mobile */
            body {
                background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
            }
            
            /* Refined container with subtle elevation */
            .container {
                box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
                border-radius: 12px;
                overflow: hidden;
            }
            
            /* Polished form fields */
            .form-field input,
            .form-field textarea,
            .form-field [contenteditable] {
                border-radius: 6px;
                transition: all 0.2s ease;
            }
            
            .form-field input:focus,
            .form-field textarea:focus,
            .form-field [contenteditable]:focus {
                box-shadow: 0 0 0 3px rgba(0, 150, 255, 0.2);
                transform: scale(1.01);
            }
            
            /* Modern button styling */
            .btn-professional {
                background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
                border: none;
                box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
                transition: all 0.3s ease;
                font-weight: 600;
                letter-spacing: 0.5px;
            }
            
            .btn-professional:active {
                transform: translateY(2px);
                box-shadow: 0 2px 8px rgba(33, 150, 243, 0.4);
            }
            
            /* Enhanced VIN scanner button */
            .scan-vin-btn {
                background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
                box-shadow: 0 4px 16px rgba(0, 255, 136, 0.4);
                transition: all 0.3s ease;
                animation: pulse-glow 2s infinite;
                width: 24px !important;
                height: 24px !important;
                font-size: 13px !important;
                right: -28px !important;
            }
            
            @keyframes pulse-glow {
                0%, 100% {
                    box-shadow: 0 4px 16px rgba(0, 255, 136, 0.4);
                }
                50% {
                    box-shadow: 0 4px 24px rgba(0, 255, 136, 0.6);
                }
            }
            
            .scan-vin-btn:active {
                transform: translateY(-50%) scale(0.95);
            }
            
            /* Refined scanner overlay */
            #scanner-overlay {
                background: rgba(0, 0, 0, 0.95);
                backdrop-filter: blur(10px);
            }
            
            #scanner-header {
                background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
                box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
            }
            
            #scanner-header h2 {
                font-weight: 600;
                letter-spacing: 0.5px;
                text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            }
            
            /* Modern scanner buttons */
            .scanner-close-btn {
                background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
                box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
                transition: all 0.2s ease;
            }
            
            .scanner-close-btn:active {
                transform: scale(0.95);
            }
            
            #text-scan-mode-btn {
                background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
                box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
                transition: all 0.2s ease;
            }
            
            #barcode-scan-mode-btn {
                background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
                box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
                transition: all 0.2s ease;
            }
            
            #manual-vin-btn {
                background: linear-gradient(135deg, #607d8b 0%, #455a64 100%);
                box-shadow: 0 2px 8px rgba(96, 125, 139, 0.3);
                transition: all 0.2s ease;
            }
            
            #text-scan-mode-btn:active,
            #barcode-scan-mode-btn:active,
            #manual-vin-btn:active {
                transform: scale(0.95);
            }
            
            /* Enhanced scan status */
            #scan-status {
                border-radius: 8px;
                padding: 12px 20px;
                font-size: 15px;
                font-weight: 600;
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
                backdrop-filter: blur(10px);
                border: 1px solid rgba(255, 255, 255, 0.1);
            }
            
            /* Refined dropdown */
            #entries-dropdown {
                border-radius: 10px;
                box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
                border: 1px solid #404040;
            }
            
            #entry-search {
                border-radius: 8px;
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
                border: 1px solid #404040;
                transition: all 0.2s ease;
            }
            
            #entry-search:focus {
                border-color: #2196f3;
                box-shadow: 0 2px 12px rgba(33, 150, 243, 0.3);
            }
            
            /* Modern bottom bar */
            #bottom-bar {
                background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%);
                border-top: 2px solid #404040;
                box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.8);
                backdrop-filter: blur(15px);
            }
            
            /* Enhanced status indicator */
            #firebase-status {
                backdrop-filter: blur(10px);
                font-weight: 600;
                letter-spacing: 0.5px;
                text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
            }
            
            /* Smooth animations for all interactive elements */
            button, input, select, textarea, [contenteditable] {
                transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            }
            
            /* Refined scrollbar for mobile webkit browsers */
            ::-webkit-scrollbar {
                width: 8px;
                height: 8px;
            }
            
            ::-webkit-scrollbar-track {
                background: rgba(255, 255, 255, 0.05);
                border-radius: 4px;
            }
            
            ::-webkit-scrollbar-thumb {
                background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
                border-radius: 4px;
            }
            
            ::-webkit-scrollbar-thumb:hover {
                background: linear-gradient(135deg, #42a5f5 0%, #2196f3 100%);
            }
        }

        /* ===== CLEAN FORM STYLES ===== */
        
        .work-order {
            width: 850px;
            min-height: 900px;
            background: white;
            border: 2px solid #000;
            margin: 0 auto;
            font-size: 11px;
        }

        /* Company Header */
        .company-header {
            text-align: center;
            padding: 4px;
            border-bottom: 2px solid #000;
            position: relative;
        }

        .company-header h1 {
            font-size: 20px;
            margin: 0 0 3px 0;
            font-weight: bold;
        }

        .company-header p {
            font-size: 10px;
            margin: 1px 0;
        }
        
        /* Editable company info hover effect */
        .company-header h1:hover,
        .company-header p:hover {
            background-color: #fffacd;
            outline: 1px dashed #999;
        }
        
        .company-header h1:focus,
        .company-header p:focus {
            background-color: #fff8dc;
            outline: 2px solid #4CAF50;
        }

        /* Header */
        .header {
            border-bottom: 2px solid #000;
        }

        .header-row {
            display: grid;
            grid-template-columns: 140px 120px 120px 100px 1fr;
            border-bottom: 1px solid #000;
        }

        .header-row:last-child {
            border-bottom: none;
        }

        .header-field {
            border-right: 1px solid #000;
            padding: 1px;
            display: flex;
            align-items: baseline;
            gap: 5px;
        }

        .header-field:last-child {
            border-right: none;
        }

        .header-field label {
            font-weight: bold;
            font-size: 9px;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .header-field input {
            flex: 1;
            min-width: 0;
            max-width: 100%;
            border: none;
            border-bottom: 1px solid #000;
            font-size: 11px;
            padding: 2px;
            color: #000;
            font-weight: 500;
            text-transform: uppercase;
        }

        /* Customer Section */
        .customer-section {
            border-bottom: 2px solid #000;
            padding: 3px;
        }

        .customer-row {
            display: grid;
            grid-template-columns: 2fr 1fr 1fr 1fr;
            gap: 8px;
            margin-bottom: 3px;
        }

        .customer-field {
            display: flex;
            align-items: baseline;
            gap: 5px;
        }

        .customer-field label {
            font-weight: bold;
            font-size: 9px;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .customer-field input {
            flex: 1;
            min-width: 0;
            max-width: 100%;
            border: none;
            border-bottom: 1px solid #000;
            font-size: 11px;
            padding: 2px;
            color: #000;
            font-weight: 500;
            text-transform: uppercase;
        }

        /* Main Content */
        .main-content {
            display: grid;
            grid-template-columns: 350px 1fr;
            border-bottom: 2px solid #000;
        }

        /* Parts Table */
        .parts-header {
            display: grid;
            grid-template-columns: 50px 1fr 80px 80px;
            background: #f0f0f0;
            border-bottom: 1px solid #000;
            font-weight: bold;
            font-size: 10px;
        }

        .parts-header div {
            padding: 1px;
            border-right: 1px solid #000;
        }

        .parts-header div:last-child {
            border-right: none;
        }

        .part-row {
            display: grid;
            grid-template-columns: 50px 1fr 80px 80px;
            border-bottom: 1px solid #000;
            min-height: 18px;
        }

        .part-row div {
            border-right: 1px solid #000;
            padding: 1px;
        }

        .part-row div:last-child {
            border-right: none;
        }

        .part-row input {
            width: 100%;
            border: none;
            font-size: 11px;
            height: 100%;
            color: #000;
            font-weight: 500;
            text-transform: uppercase;
        }

        /* Description Section */
        .description-section {
            padding: 6px;
            border-left: 2px solid #000;
        }

        .description-section label {
            font-weight: bold;
            font-size: 10px;
            display: block;
            margin-bottom: 5px;
        }

        .description-section textarea {
            width: 100%;
            border: none;
            font-size: 11px;
            font-family: Arial, sans-serif;
            resize: none;
            height: 280px;
            text-align: center;
            color: #000;
            font-weight: 500;
            text-transform: uppercase;
        }

        /* Footer */
        .footer {
            padding: 4px;
        }

        .footer-grid {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr 1fr;
            gap: 4px;
        }

        .footer-section h4 {
            font-size: 10px;
            margin-bottom: 3px;
            text-decoration: underline;
        }

        .footer-field {
            margin-bottom: 2px;
            font-size: 9px;
        }

        .footer-field label {
            display: inline-block;
            width: 20px;
            font-weight: bold;
        }

        .footer-field input[type="text"] {
            width: 40px;
            border: none;
            border-bottom: 1px solid #000;
            font-size: 9px;
            margin-left: 0px;
            color: #000;
            font-weight: 500;
            text-transform: uppercase;
        }

        .footer-field input[type="checkbox"] {
            margin-right: 5px;
        }

        /* Oil Change and State Inspection wider labels */
        .footer-section.oil-change .footer-field label,
        .footer-section.state-inspection .footer-field label,
        .footer-section.state-inspection div .footer-field label,
        .footer-section.tire-pressure .footer-field label {
            width: 50px;
        }

        .footer-section.oil-change .footer-field input[type="text"],
        .footer-section.state-inspection .footer-field input[type="text"],
        .footer-section.state-inspection div .footer-field input[type="text"] {
            width: 80px;
        }

        /* Controls */
        .controls {
            margin-bottom: 20px;
            text-align: center;
        }

        .btn {
            padding: 10px 20px;
            margin: 5px;
            background: #667eea;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
        }

        .btn:hover {
            background: #5568d3;
        }

        .btn-secondary {
            background: #6c757d;
        }

        .btn-secondary:hover {
            background: #5a6268;
        }

        /* ===== WORK ORDER PRINT TEMPLATE STYLES ===== */
        #work-order-print.work-order {
            width: 850px;
            min-height: 1100px;
            background: white;
            border: 2px solid #000;
            margin: 0 auto;
            font-size: 11px;
            display: none; /* Hidden on screen, visible when printing */
        }

        /* Company Header */
        .company-header {
            text-align: center;
            padding: 4px;
            border-bottom: 2px solid #000;
        }

        .company-header h1 {
            font-size: 20px;
            margin: 0 0 3px 0;
            font-weight: bold;
        }

        .company-header p {
            font-size: 10px;
            margin: 1px 0;
        }

        /* Header */
        .work-order .header {
            border-bottom: 2px solid #000;
        }

        .header-row {
            display: grid;
            grid-template-columns: 140px 120px 120px 100px 1fr;
            border-bottom: 1px solid #000;
        }

        .header-row:last-child {
            border-bottom: none;
        }

        .header-field {
            border-right: 1px solid #000;
            padding: 1px;
            display: flex;
            align-items: baseline;
            gap: 5px;
        }

        .header-field:last-child {
            border-right: none;
        }

        .header-field label {
            font-weight: bold;
            font-size: 12px;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .header-field input {
            flex: 1;
            min-width: 0;
            max-width: 100%;
            border: none;
            border-bottom: 1px solid #000;
            font-size: 13px;
            padding: 2px;
            color: #000;
            font-weight: 500;
            text-transform: uppercase;
        }

        /* Customer Section */
        .customer-section {
            border-bottom: 2px solid #000;
            padding: 3px;
        }

        .customer-row {
            display: grid;
            grid-template-columns: 2fr 1fr 1fr 1fr;
            gap: 8px;
            margin-bottom: 3px;
        }

        .customer-row:last-child {
            margin-bottom: 0;
        }

        .customer-field {
            display: flex;
            align-items: baseline;
            gap: 5px;
        }

        .customer-field label {
            font-weight: bold;
            font-size: 12px;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .customer-field input {
            flex: 1;
            min-width: 0;
            max-width: 100%;
            border: none;
            border-bottom: 1px solid #000;
            font-size: 13px;
            padding: 2px;
            color: #000;
            font-weight: 500;
            text-transform: uppercase;
        }

        /* Main Content */
        .main-content {
            display: grid;
            grid-template-columns: 350px 1fr;
            border-bottom: 2px solid #000;
        }

        /* Parts Section */
        .parts-section {
            padding: 0;
            margin: 0;
        }

        /* Parts Table */
        .parts-header {
            display: grid;
            grid-template-columns: 50px 1fr 80px 80px;
            background: #f0f0f0;
            border-bottom: 1px solid #000;
            font-weight: bold;
            font-size: 10px;
        }

        .parts-header div {
            padding: 1px;
            border-right: 1px solid #000;
        }

        .parts-header div:last-child {
            border-right: none;
        }

        .part-row {
            display: grid;
            grid-template-columns: 50px 1fr 80px 80px;
            border-bottom: 1px solid #000;
            min-height: 18px;
        }

        .part-row div {
            border-right: 1px solid #000;
            padding: 1px;
        }

        .part-row div:last-child {
            border-right: none;
        }

        .part-row input {
            width: 90%;
            border: none;
            font-size: 13px;
            height: 90%;
            color: #000;
            font-weight: 500;
            text-transform: uppercase;
        }

        .part-row div:nth-child(2) input {
            width: 98%;
        }

        /* Description Section */
        .description-section {
            padding: 6px;
            border-left: 2px solid #000;
        }

        .description-section label {
            font-weight: bold;
            font-size: 10px;
            display: block;
            margin-bottom: 5px;
        }

        .description-section textarea {
            width: 100%;
            border: none;
            font-size: 13px;
            font-family: Arial, sans-serif;
            resize: none;
            height: 280px;
            text-align: center;
            color: #000;
            font-weight: 500;
            text-transform: uppercase;
        }

        /* Footer */
        .work-order .footer {
            padding: 10px;
        }

        .footer-grid {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr 1fr;
            gap: 4px;
        }

        .footer-section h4 {
            font-size: 10px;
            margin-bottom: 3px;
            text-decoration: underline;
        }

        .footer-field {
            margin-bottom: 2px;
            font-size: 9px;
        }

        .footer-field label {
            display: inline-block;
            width: 20px;
            font-weight: bold;
        }

        .footer-field input[type="text"] {
            width: 40px;
            border: none;
            border-bottom: 1px solid #000;
            font-size: 9px;
            margin-left: 0px;
            color: #000;
            font-weight: 500;
            text-transform: uppercase;
        }

        .footer-field input[type="checkbox"] {
            margin-right: 5px;
        }

        /* Oil Change and State Inspection wider labels */
        .footer-section.oil-change .footer-field label,
        .footer-section.state-inspection .footer-field label,
        .footer-section.state-inspection div .footer-field label,
        .footer-section.tire-pressure .footer-field label {
            width: 50px;
        }

        .footer-section.oil-change .footer-field input[type="text"],
        .footer-section.state-inspection .footer-field input[type="text"],
        .footer-section.state-inspection div .footer-field input[type="text"] {
            width: 80px;
        }

        /* Hide print template from screen view */
        #work-order-print {
            display: none;
        }

        /* Print Styles */
        @media print {
            @page {
                size: letter;
                margin: 0.5in;
            }

            html, body {
                height: 100%;
                margin: 0 !important;
                padding: 0 !important;
            }

            /* Hide everything by default */
            body * {
                visibility: hidden !important;
            }

            /* Show only the work order print template */
            #work-order-print,
            #work-order-print * {
                visibility: visible !important;
            }

            #work-order-print {
                display: block !important;
                position: absolute !important;
                left: 0 !important;
                top: 0 !important;
                margin: 0 !important;
                padding: 0 !important;
                width: 850px !important;
                page-break-after: avoid !important;
            }

            .container {
                max-width: 100%;
                padding: 0;
                box-shadow: none;
            }
        }

        .no-print {
            display: block;
        }

        @media print {
            .no-print,
            #labor-timer-widget {
                display: none !important;
            }
        }
        
        /* Labor Timer Widget */
        #labor-timer-widget {
            position: fixed;
            top: 80px;
            left: 20px;
            width: 280px;
            background: #1e1e1e;
            border: 2px solid #00bfff;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 191, 255, 0.3);
            z-index: 9999;
            font-family: 'Segoe UI', Tahoma, sans-serif;
            cursor: move;
        }
        
        /* Quick Jobs Widget */
        #quick-jobs-widget {
            display: none !important;
            position: fixed;
            top: 160px;
            left: 20px;
            width: 280px;
            background: #1e1e1e;
            border: 2px solid #ffc107;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
            z-index: 9998;
            font-family: 'Segoe UI', Tahoma, sans-serif;
            cursor: move;
        }
        
        #quick-jobs-widget .widget-header {
            background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
        }
        
        #quick-jobs-widget.minimized {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            overflow: hidden;
        }
        
        #quick-jobs-widget.minimized .widget-content {
            display: none;
        }
        
        #quick-jobs-widget.minimized .widget-header {
            height: 60px;
            justify-content: center;
            border-radius: 50%;
            cursor: pointer;
        }
        
        #quick-jobs-widget.minimized .widget-header h3 {
            display: none;
        }
        
        #quick-jobs-widget.minimized .minimize-btn {
            font-size: 24px;
            margin: 0;
        }
        
        #labor-timer-widget.minimized {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            overflow: hidden;
        }
        
        #labor-timer-widget.minimized .widget-content {
            display: none;
        }
        
        #labor-timer-widget.minimized .widget-header {
            height: 60px;
            justify-content: center;
            border-radius: 50%;
            cursor: pointer;
        }
        
        #labor-timer-widget.minimized .widget-header h3 {
            display: none;
        }
        
        #labor-timer-widget.minimized .minimize-btn {
            font-size: 24px;
            margin: 0;
        }
        
        .widget-header {
            background: linear-gradient(135deg, #00bfff 0%, #0088cc 100%);
            padding: 10px 15px;
            border-radius: 6px 6px 0 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            user-select: none;
        }
        
        .widget-header h3 {
            margin: 0;
            color: white;
            font-size: 14px;
            font-weight: 600;
        }
        
        .minimize-btn {
            background: none;
            border: none;
            color: white;
            font-size: 18px;
            cursor: pointer;
            padding: 0;
            width: 24px;
            height: 24px;
            line-height: 24px;
            text-align: center;
            border-radius: 4px;
            transition: background 0.2s;
        }
        
        .minimize-btn:hover {
            background: rgba(255, 255, 255, 0.2);
        }
        
        .widget-content {
            padding: 15px;
        }
        
        .labor-hours-display {
            background: #2d2d2d;
            border: 1px solid #444;
            border-radius: 6px;
            padding: 12px;
            margin-bottom: 15px;
        }
        
        .labor-hours-display label {
            display: block;
            color: #00bfff;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            margin-bottom: 6px;
            letter-spacing: 0.5px;
        }
        
        .labor-hours-value {
            color: #00ff88;
            font-size: 20px;
            font-weight: 700;
            font-family: 'Courier New', monospace;
        }
        
        .labor-hours-subtitle {
            color: #888;
            font-size: 10px;
            margin-top: 4px;
        }
        
        .tech-notes-section label {
            display: block;
            color: #00bfff;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            margin-bottom: 6px;
            letter-spacing: 0.5px;
        }
        
        #tech_notes_widget {
            width: 100%;
            height: 120px;
            background: #2d2d2d;
            border: 1px solid #444;
            border-radius: 6px;
            padding: 10px;
            color: #fff;
            font-size: 13px;
            font-family: 'Segoe UI', Tahoma, sans-serif;
            resize: vertical;
            outline: none;
        }
        
        #tech_notes_widget:focus {
            border-color: #00bfff;
            box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2);
        }
        
        .widget-save-status {
            color: #00ff88;
            font-size: 10px;
            margin-top: 6px;
            text-align: right;
            min-height: 14px;
        }

        /* Login Screen Styles */
        #login-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 10000;
        }

        .login-container {
            background: white;
            padding: 40px;
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.3);
            max-width: 400px;
            width: 90%;
        }

        .login-container h2 {
            margin: 0 0 10px 0;
            color: #333;
            text-align: center;
        }

        .login-container p {
            margin: 0 0 30px 0;
            color: #666;
            text-align: center;
            font-size: 14px;
        }

        .login-form input {
            width: 100%;
            padding: 12px;
            margin-bottom: 15px;
            border: 2px solid #ddd;
            border-radius: 6px;
            font-size: 14px;
            box-sizing: border-box;
        }

        .login-form input:focus {
            outline: none;
            border-color: #667eea;
        }

        .login-form button {
            width: 100%;
            padding: 12px;
            background: #667eea;
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: background 0.3s;
        }

        .login-form button:hover {
            background: #5568d3;
        }

        .login-error {
            color: #dc3545;
            font-size: 13px;
            margin-bottom: 10px;
            text-align: center;
            display: none;
        }

        /* Device Name Modal */
        #device-name-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.7);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 10001;
        }

        .device-modal-content {
            background: white;
            padding: 30px;
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.3);
            max-width: 400px;
            width: 90%;
        }

        .device-modal-content h3 {
            margin: 0 0 10px 0;
            color: #333;
        }

        .device-modal-content p {
            margin: 0 0 20px 0;
            color: #666;
            font-size: 14px;
        }

        .device-modal-content input {
            width: 100%;
            padding: 12px;
            margin-bottom: 15px;
            border: 2px solid #ddd;
            border-radius: 6px;
            font-size: 14px;
            box-sizing: border-box;
        }

        .device-modal-content input:focus {
            outline: none;
            border-color: #667eea;
        }

        .device-modal-content button {
            width: 100%;
            padding: 12px;
            background: #28a745;
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: background 0.3s;
        }

        .device-modal-content button:hover {
            background: #218838;
        }

        .device-examples {
            font-size: 12px;
            color: #999;
            margin-top: 5px;
        }

        /* Real-time Notification Animations */
        @keyframes slideIn {
            from {
                transform: translateX(400px);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes slideOut {
            from {
                transform: translateX(0);
                opacity: 1;
            }
            to {
                transform: translateX(400px);
                opacity: 0;
            }
        }
