/* main.css — រចនា (CSS) សម្រាប់ទំព័រអតិថិជន ឃ្លាំងលឿង */
        html { background-color: #e9eaec; }
        body { font-family: 'Segoe UI', Arial, sans-serif; background-color: #e9eaec; margin: 0; padding: 0; }
        
        #login-section { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh; background-color: #FFD700; padding: 20px; text-align: center; }
        .login-box { position: relative; background: white; padding: 30px 20px; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); width: 100%; max-width: 400px; box-sizing: border-box; }
        .login-box h2 { margin-top: 0; color: #333; font-size: 24px; }
        .input-group { margin-bottom: 20px; text-align: left; }
        .input-group input { width: 100%; padding: 15px; border: 1px solid rgba(0,0,0,0.1); border-radius: 10px; font-size: 18px; box-sizing: border-box; outline: none; transition: 0.3s; }
        .input-group input:focus { border-color: #FFD700; }
        .btn-primary { width: 100%; background: #FFD700; border: none; padding: 16px; font-size: 18px; font-weight: bold; border-radius: 10px; cursor: pointer; color: #000; margin-top: 5px; }
        .btn-outline { width: 100%; background: white; border: 2px solid #FFD700; padding: 14px; font-size: 18px; font-weight: bold; border-radius: 10px; cursor: pointer; color: #333; margin-top: 15px; }
        
        #main-app { display: none; padding-bottom: 80px; min-height: 100vh; background-color: transparent; }

        .top-ui-wrapper { position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; background-color: rgba(255, 255, 255, 0.18); backdrop-filter: blur(14px) saturate(180%); -webkit-backdrop-filter: blur(14px) saturate(180%); transition: transform 0.3s ease-in-out, background-color 0.3s ease, backdrop-filter 0.3s ease; box-shadow: none; padding-top: env(safe-area-inset-top); }
        .top-ui-wrapper.glassy { background-color: rgba(255, 255, 255, 0.28); backdrop-filter: blur(14px) saturate(180%); -webkit-backdrop-filter: blur(14px) saturate(180%); box-shadow: 0 2px 10px rgba(0,0,0,0.05); border-bottom: 1px solid rgba(255,255,255,0.35); }
        .top-ui-wrapper.kl-hide {
            transform: translateY(calc(-100% + env(safe-area-inset-top)));
            background: transparent !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
            border-bottom-color: transparent !important;
            box-shadow: none !important;
        }

        .header-inner { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; box-sizing: border-box; }
        .header-title { font-size: 24px; font-weight: bold; color: #000; }
        
        .header-actions { display: flex; align-items: center; gap: 15px; }
        
        .settings-menu { display: none; position: fixed; top: calc(65px + env(safe-area-inset-top)); right: 20px; background: white; border-radius: 12px; box-shadow: 0 5px 25px rgba(0,0,0,0.25); overflow: hidden; z-index: 1001; min-width: 250px; border: 1px solid #eee; }
        .settings-menu button { display: block; width: 100%; text-align: left; padding: 16px; background: none; border: none; font-size: 15px; font-weight: bold; cursor: pointer; border-bottom: 1px solid #f0f2f5; color: #333; transition: 0.2s; }
        .settings-menu button:hover { background: #f8f9fa; }
        
        #searchPanel { padding: 0 20px 15px 20px; box-sizing: border-box; }
        .search-input-wrapper { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
        .search-input-wrapper input { width: 100%; padding: 12px 15px; border: 1px solid rgba(0,0,0,0.1); border-radius: 12px; font-size: 16px; box-sizing: border-box; outline: none; background: #fff; color: #000; box-shadow: 0 2px 5px rgba(0,0,0,0.05); flex-grow:1; }
        
        #products { padding-top: calc(56px + env(safe-area-inset-top)); transition: padding-top 0.3s; }
        .feed-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; padding: 20px; box-sizing: border-box; max-width: 1400px; margin: 0 auto; }
        .feed-item { background: white; border-radius: 15px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.1); display: flex; flex-direction: column; transition: transform 0.2s; }
        .feed-header { padding: 15px; display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid #f0f0f0; }
        .product-code { font-size: 16px; color: #555; font-weight: bold; }
        .feed-content { padding: 15px; display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }
        .product-name { font-size: 20px; font-weight: bold; color: #111; line-height: 1.4; margin: 0; }
        .feed-price { font-size: 24px; font-weight: bold; color: #d63638; margin: 5px 0 15px 0; }
        
        .btn-add { background: #e7f3ff; border: 2px solid #b3d4ff; width: 100%; padding: 14px; border-radius: 12px; font-size: 17px; font-weight: bold; cursor: pointer; color: #1877f2; display: flex; justify-content: center; align-items: center; gap: 10px; }
        .bottom-cart { background: white; margin-top: 20px; padding: 20px 0; border-top: 2px solid #FFD700; box-shadow: 0 -4px 15px rgba(0,0,0,0.05); margin-bottom: 75px; position: relative; z-index: 999; }
        .cart-inner { display: flex; justify-content: space-between; align-items: center; padding: 0 20px; box-sizing: border-box; max-width: 1400px; margin: 0 auto; }
        .btn-checkout { background: #FFD700; border: none; padding: 12px 20px; font-size: 18px; font-weight: bold; border-radius: 12px; cursor: pointer; color: #000; box-shadow: 0 4px 10px rgba(255, 215, 0, 0.3); }
        .loading-text { text-align: center; padding: 50px 20px; color: #666; font-size: 20px; font-weight: bold; grid-column: 1 / -1; }
        
        .hover-copy { position: relative; cursor: pointer; display: inline-block; transition: 0.2s; border-bottom: 1px dashed transparent; }
        .hover-copy:hover { border-bottom: 1px dashed #0066cc; color: #0066cc; }
        
        #goTopBtn { display: none; position: fixed; bottom: 100px; right: 20px; z-index: 999; background: transparent; border: none; filter: drop-shadow(2px 5px 6px rgba(0,0,0,0.4)); cursor: pointer; opacity: 0; padding: 0; }
    
/* ========================================== */
        /* រចនាបថប្រវត្តិទិញ ឱ្យដូចវិក្កយបត្រ (Invoice UI) */
        /* ========================================== */
        .invoice-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin-bottom: 20px; border: 1px solid #eaeaea; }
        .invoice-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #FFD700; padding-bottom: 12px; margin-bottom: 15px; }
        .invoice-title { font-size: 18px; font-weight: bold; color: #0066cc; }
        .invoice-date { font-size: 13px; color: #888; }
        
        .invoice-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
        .invoice-table th { background: #f8f9fa; padding: 12px 10px; color: #555; border-bottom: 2px solid #ddd; font-weight: bold; }
        .invoice-table td { padding: 12px 10px; border-bottom: 1px dashed #eee; color: #333; vertical-align: top; }
        .invoice-table tr:last-child td { border-bottom: none; }
        
        .inv-num { width: 30px; text-align: center; font-weight: bold; color: #888; }
        .inv-item { flex-grow: 1; }
        .inv-qty, .inv-price, .inv-total { text-align: right; white-space: nowrap; }
        
        .inv-discount-badge { background: #fffbe6; color: #b38000; font-size: 11px; padding: 2px 6px; border-radius: 4px; border: 1px solid #FFD700; display: inline-block; margin-top: 4px; font-weight: bold; }
        
        .invoice-footer { display: flex; justify-content: flex-end; align-items: center; padding-top: 15px; margin-top: 10px; border-top: 2px dashed #ddd; }
        .invoice-grand-total { font-size: 20px; font-weight: 900; color: #d63638; margin-left: 15px; }
        
        .inv-status { padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: bold; }
        .inv-pending { background: #fff3cd; color: #856404; }
        .inv-accepted { background: #d4edda; color: #155724; }
        .inv-rejected { background: #f8d7da; color: #721c24; }
        
        /* សម្រាប់ទូរស័ព្ទតូចៗ */
        @media (max-width: 600px) {
            .invoice-table thead { display: none; }
            .invoice-table, .invoice-table tbody, .invoice-table tr, .invoice-table td { display: block; width: 100%; }
            .invoice-table tr { margin-bottom: 15px; border-bottom: 2px solid #eee; padding-bottom: 10px; }
            .invoice-table td { text-align: right; padding-left: 50%; position: relative; border-bottom: none; padding-top: 8px; padding-bottom: 8px; }
            .invoice-table td::before { content: attr(data-label); position: absolute; left: 10px; width: 45%; padding-right: 10px; white-space: nowrap; text-align: left; font-weight: bold; color: #666; }
            .inv-num { display: none; }
        }
