<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Invoice #{{id}}</title>
    <style>
        body { 
            font-family: DejaVu Sans, sans-serif; 
            font-size: 12px; 
            color: #333; 
            margin: 0; 
            padding: 20px;
        }
        .container { max-width: 750px; margin: 0 auto; }
        .header-table { width: 100%; margin-bottom: 20px; border-collapse: collapse; }
        .header-bg { background: #10847e; padding: 25px; }
        .logo { height: 60px; }
        .company-title { color: #fff; font-size: 28px; font-weight: bold; margin: 10px 0 0 0; }
        .invoice-badge { background: rgba(255,255,255,0.2); color: #fff; padding: 8px 15px; border-radius: 15px; font-size: 11px; }
        .section-title { color: #10847e; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; font-weight: bold; margin-bottom: 8px; border-bottom: 2px solid #10847e; padding-bottom: 5px; }
        .info-table { width: 100%; border-collapse: collapse; margin-bottom: 25px; }
        .info-table td { vertical-align: top; padding: 10px; }
        .info-block { background: #fafafa; padding: 15px; border-radius: 8px; }
        .info-block p { margin: 0; line-height: 1.6; color: #555; }
        .info-block strong { color: #333; font-size: 14px; }
        .provider-box { background: #f0f9f8; border-left: 4px solid #10847e; padding: 15px; margin-bottom: 25px; }
        .provider-box .section-title { border-bottom: none; margin-bottom: 5px; }
        .items-table { width: 100%; border-collapse: collapse; margin-bottom: 25px; }
        .items-table th { background: #10847e; color: #fff; padding: 12px 15px; text-align: left; font-size: 11px; text-transform: uppercase; }
        .items-table th:last-child { text-align: right; }
        .items-table td { padding: 15px; border-bottom: 1px solid #eee; }
        .items-table td:last-child { text-align: right; font-weight: bold; }
        .totals-wrapper { width: 100%; }
        .totals-table { width: 280px; margin-left: auto; border-collapse: collapse; }
        .totals-table td { padding: 10px 15px; border-bottom: 1px solid #eee; }
        .totals-table td:last-child { text-align: right; }
        .total-row { background: #10847e; color: #fff; font-weight: bold; font-size: 14px; }
        .total-row td { border-bottom: none; padding: 15px; }
        .notes-box { background: #f8f9fa; padding: 20px; border-radius: 8px; margin: 25px 0; }
        .notes-box .section-title { border-bottom: none; }
        .notes-box p { color: #666; margin: 0; line-height: 1.6; }
        .footer { text-align: center; padding: 15px; background: #333; color: #fff; font-size: 11px; margin-top: 30px; }
        .footer .brand { color: #10847e; font-weight: bold; }
    </style>
</head>
<body>
    <div class="container">
        <table class="header-table">
            <tr>
                <td class="header-bg" colspan="2">
                    <table width="100%">
                        <tr>
                            <td width="70%">
                                <img src="{{logo}}" class="logo" alt="Logo"><br>
                                <div class="company-title">{{company_name}}</div>
                            </td>
                            <td width="30%" style="text-align: right; vertical-align: top;">
                                <span class="invoice-badge">Invoice #{{id}}</span>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        
        <table class="info-table">
            <tr>
                <td width="33%">
                    <div class="info-block">
                        <div class="section-title">From</div>
                        <p><strong>{{company_name}}</strong><br>{{company_address}}<br>{{company_email}}<br>{{company_phone}}</p>
                    </div>
                </td>
                <td width="33%">
                    <div class="info-block">
                        <div class="section-title">Bill To</div>
                        <p><strong>{{user_name}}</strong><br>{{user_address}}<br>{{user_email}}<br>{{user_phone}}</p>
                    </div>
                </td>
                <td width="33%">
                    <div class="info-block">
                        <div class="section-title">Invoice Details</div>
                        <p><strong>Date:</strong> {{date}}<br><strong>Invoice #:</strong> {{id}}<br><strong>Type:</strong> {{description}}</p>
                    </div>
                </td>
            </tr>
        </table>
        
        <div class="provider-box">
            <div class="section-title">Service Provider</div>
            <p><strong>{{provider_name}}</strong><br>{{provider_email}} | {{provider_phone}}</p>
        </div>
        
        <table class="items-table">
            <thead>
                <tr>
                    <th width="50%">Service</th>
                    <th width="25%">Rate</th>
                    <th width="25%">Amount</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>{{category}}</td>
                    <td>{{ratehour}}</td>
                    <td>{{currency}}{{service_amount}}</td>
                </tr>
            </tbody>
        </table>
        
        <div class="totals-wrapper">
            <table class="totals-table">
                <tr>
                    <td>Subtotal</td>
                    <td>{{currency}}{{service_amount}}</td>
                </tr>
                <tr>
                    <td>Tax</td>
                    <td>{{currency}}{{amount_tax}}</td>
                </tr>
                <tr class="total-row">
                    <td>Total</td>
                    <td>{{currency}}{{quote}}</td>
                </tr>
            </table>
        </div>
        
        <div class="notes-box">
            <div class="section-title">Note</div>
            <p>Thank you for your business.</p>
        </div>
        
        <div class="footer">
            <span class="brand">{{company_name}}</span>
        </div>
    </div>
</body>
</html>