

        /* Invoice Styling - Mobile First */
        :root {
            --primary-color: #58a8d9;
            --secondary-color: #6d6d6d;
            --success-color: #2ecc71;
            --warning-color: #f39c12;
            --danger-color: #e74c3c;
            --light-bg: #f8f9fa;
            --border-color: #e9ecef;
        }
        
        .invoice-wrapper {
            max-width: 100%;
            margin: 20px auto;
            padding: 20px;
            background: white;
            box-shadow: 0 2px 15px rgba(0,0,0,0.08);
            border-radius: 10px;
            position: relative;
            overflow: hidden;
        }
        
        .invoice-header {
            border-bottom: 2px solid var(--primary-color);
            padding-bottom: 20px;
            margin-bottom: 25px;
            position: relative;
            flex-direction: column;
            display: flex;
        }
        
        .invoice-header .company-info {
            order: -1;
            text-align: left;
            margin-bottom: 20px;
        }
        
        .invoice-title {
            color: var(--primary-color);
            font-weight: 700;
            font-size: 1.8rem;
            margin-bottom: 5px;
            line-height: 1.2;
        }
        
        .invoice-label {
            font-size: 1.4rem;
            color: var(--secondary-color);
            font-weight: 300;
        }
        
        .invoice-number {
            color: var(--secondary-color);
            font-weight: 600;
            font-size: 1.2rem;
        }
        
        .invoice-details-grid {
            display: flex;
            flex-direction: column;
            gap: 20px;
            margin-bottom: 30px;
            padding: 20px;
            background: var(--light-bg);
            border-radius: 8px;
        }
        
        .detail-box {
            width: 100%;
        }
        
        .detail-box h5 {
            color: #2c3e50;
            margin-bottom: 12px;
            font-weight: 600;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 8px;
            font-size: 1rem;
        }
        
        .detail-box p {
            margin-bottom: 6px;
            color: #555;
            font-size: 0.9rem;
            line-height: 1.4;
        }
        
        .status-badge {
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 600;
            letter-spacing: 0.3px;
            display: inline-block;
        }
        
        .paid { background: #d4edda; color: #155724; }
        .pending { background: #fff3cd; color: #856404; }
        .processing { background: #cce5ff; color: #004085; }
        .completed { background: #d1ecf1; color: #0c5460; }
        .cancelled { background: #f8d7da; color: #721c24; }
        
        /* Table Styling - Mobile Responsive */
        .invoice-table-container {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            margin: 20px 0;
            border: 1px solid var(--border-color);
            border-radius: 8px;
        }
        
        .invoice-table {
            width: 100%;
            min-width: 600px;
            border-collapse: collapse;
            margin: 0;
        }
        
        .invoice-table thead {
            background: var(--primary-color);
            color: white;
        }
        
        .invoice-table th {
            padding: 12px 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.3px;
            font-size: 0.8rem;
            white-space: nowrap;
        }
        
        .invoice-table td {
            padding: 12px 10px;
            border-bottom: 1px solid var(--border-color);
            vertical-align: top;
            font-size: 0.9rem;
        }
        
        .invoice-table tbody tr:last-child td {
            border-bottom: none;
        }
        
        .invoice-table tbody tr:nth-child(even) {
            background-color: rgba(0,0,0,0.02);
        }
        
        .product-title {
            font-weight: 600;
            color: #2c3e50;
            display: block;
            font-size: 0.9rem;
            line-height: 1.3;
        }
        
        .product-variant {
            font-size: 0.8rem;
            color: #6c757d;
            margin-top: 3px;
        }
        
        .product-sku {
            font-size: 0.75rem;
            color: #95a5a6;
            font-family: monospace;
            word-break: break-all;
        }
        
        .product-image {
            width: 50px;
            height: 50px;
            object-fit: cover;
            border-radius: 5px;
            border: 1px solid var(--border-color);
        }
        
        /* Totals Section */
        .totals-section {
            background: linear-gradient(to right, #f8f9fa, #ffffff);
            padding: 20px;
            border-radius: 8px;
            margin-top: 20px;
        }
        
        .totals-grid {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        
        .total-row {
            display: flex;
            justify-content: space-between;
            padding: 10px 0;
            border-bottom: 1px dashed var(--border-color);
            font-size: 0.95rem;
        }
        
        .total-row.grand-total {
            border-bottom: 2px solid #2c3e50;
            font-size: 1.1rem;
            font-weight: 700;
            color: #2c3e50;
        }
        
        /* Action Buttons - Mobile Optimized */
        .invoice-actions {
            display: flex;
            flex-direction: column;
            gap: 15px;
            margin-top: 30px;
            padding-top: 25px;
            border-top: 1px solid var(--border-color);
        }
        
        .btn-invoice {
            padding: 14px 20px;
            border-radius: 30px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            transition: all 0.3s ease;
            border: none;
            text-decoration: none;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            font-size: 0.9rem;
            width: 100%;
        }
        
        .btn-print {
            background: var(--primary-color);
            color: white;
        }
        
        .btn-print:hover, .btn-print:active {
            background: #2980b9;
            transform: translateY(-1px);
            box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
        }
        
        .btn-download {
            background: var(--success-color);
            color: white;
        }
        
        .btn-download:hover, .btn-download:active {
            background: #27ae60;
            transform: translateY(-1px);
            box-shadow: 0 3px 10px rgba(46, 204, 113, 0.3);
        }
        
        /* Mobile-specific touch improvements */
        @media (hover: none) and (pointer: coarse) {
            .btn-invoice {
                padding: 16px 20px;
                min-height: 54px;
            }
            
            .invoice-table th,
            .invoice-table td {
                padding: 15px 10px;
            }
            
            select, input, button, .btn-invoice {
                font-size: 16px !important; /* Prevents iOS zoom on focus */
            }
        }
        
        /* Tablet and Desktop */
        @media (min-width: 768px) {
            .invoice-wrapper {
                padding: 30px;
                margin: 30px auto;
                max-width: 900px;
            }
            
            .invoice-header {
                flex-direction: row;
                justify-content: space-between;
                align-items: flex-start;
            }
            
            .invoice-header .company-info {
                order: 0;
                text-align: right;
                margin-bottom: 0;
            }
            
            .invoice-title {
                font-size: 2.2rem;
            }
            
            .invoice-label {
                font-size: 1.6rem;
            }
            
            .invoice-details-grid {
                flex-direction: row;
                grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
                display: grid;
            }
            
            .detail-box {
                width: auto;
            }
            
            .invoice-actions {
                flex-direction: row;
                gap: 20px;
            }
            
            .btn-invoice {
                width: auto;
                padding: 12px 30px;
            }
            
            .totals-grid {
                flex-direction: row;
                justify-content: space-between;
            }
            
            .totals-grid > div {
                width: 48%;
            }
        }
        
        /* Large Desktop */
        @media (min-width: 1200px) {
            .invoice-wrapper {
                padding: 40px;
                margin: 40px auto;
            }
        }
        
        /* Print Styles */
        @media print {
            body {
                background: white !important;
                font-size: 12px !important;
                margin: 0;
                padding: 0;
            }
            
            .invoice-wrapper {
                box-shadow: none;
                margin: 0;
                padding: 10px;
                max-width: 100%;
                width: 100%;
            }
            
            .invoice-actions,
            .no-print,
            .btn-invoice,
            .watermark {
                display: none !important;
            }
            
            .invoice-table thead {
                background: #333 !important;
                color: white !important;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }
            
            .product-image {
                width: 40px;
                height: 40px;
            }
            
            .invoice-details-grid {
                background: none !important;
                padding: 10px 0 !important;
            }
            
            /* Ensure proper page breaks */
            .invoice-table-container {
                page-break-inside: avoid;
            }
            
            .totals-section {
                page-break-inside: avoid;
            }
        }
        
        /* Watermark */
        .watermark {
            position: absolute;
            opacity: 0.03;
            font-size: 120px;
            font-weight: bold;
            color: #000;
            z-index: 0;
            transform: rotate(-45deg);
            top: 30%;
            left: -30px;
            white-space: nowrap;
            pointer-events: none;
            display: none;
        }
        
        @media (min-width: 768px) {
            .watermark {
                display: block;
                font-size: 150px;
                top: 25%;
                left: -40px;
            }
        }
        
        /* Loading overlay for PDF generation */
        .pdf-loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.7);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            color: white;
            display: none;
        }
        
        .pdf-loading-overlay.active {
            display: flex;
        }
        
        .spinner {
            width: 50px;
            height: 50px;
            border: 5px solid rgba(255,255,255,0.3);
            border-radius: 50%;
            border-top-color: var(--primary-color);
            animation: spin 1s ease-in-out infinite;
            margin-bottom: 20px;
        }
        
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        
        /* Improve readability on mobile */
        body {
            -webkit-text-size-adjust: 100%;
            -moz-text-size-adjust: 100%;
            text-size-adjust: 100%;
        }
        
        /* Better touch targets */
        a, button {
            min-height: 44px;
            min-width: 44px;
        }
        
        /* Prevent horizontal scroll on mobile */
        html, body {
            overflow-x: hidden;
            max-width: 100%;
        }
