<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <style>
        body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
        }
        .header {
            background-color: #3b82f6;
            color: white;
            padding: 20px;
            text-align: center;
            border-radius: 5px;
        }
        .content {
            background-color: #f9fafb;
            padding: 20px;
            margin-top: 20px;
            border-radius: 5px;
        }
        .invoice-details {
            background-color: white;
            padding: 15px;
            margin: 15px 0;
            border-left: 4px solid #3b82f6;
        }
        .invoice-details table {
            width: 100%;
            border-collapse: collapse;
        }
        .invoice-details td {
            padding: 8px 0;
        }
        .invoice-details td:first-child {
            font-weight: bold;
            width: 40%;
        }
        .custom-message {
            background-color: #fef3c7;
            padding: 15px;
            margin: 15px 0;
            border-left: 4px solid #f59e0b;
            border-radius: 5px;
        }
        .footer {
            text-align: center;
            color: #6b7280;
            font-size: 12px;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #e5e7eb;
        }
    </style>
</head>
<body>
    <div class="header">
        <h1>{{ _('Invoice') }} {{ invoice.invoice_number }}</h1>
    </div>
    
    <div class="content">
        <p>Hello,</p>
        
        <p>Please find attached invoice <strong>{{ invoice.invoice_number }}</strong> for your records.</p>
        
        <div class="invoice-details">
            <table>
                <tr>
                    <td>Invoice Number:</td>
                    <td>{{ invoice.invoice_number }}</td>
                </tr>
                <tr>
                    <td>Issue Date:</td>
                    <td>{{ invoice.issue_date|format_date if invoice.issue_date else 'N/A' }}</td>
                </tr>
                <tr>
                    <td>Due Date:</td>
                    <td>{{ invoice.due_date|format_date if invoice.due_date else 'N/A' }}</td>
                </tr>
                <tr>
                    <td>Amount:</td>
                    <td><strong>{{ invoice.currency_code }} {{ invoice.total_amount }}</strong></td>
                </tr>
            </table>
        </div>
        
        {% if custom_message %}
        <div class="custom-message">
            <p><strong>Message:</strong></p>
            <p>{{ custom_message }}</p>
        </div>
        {% endif %}
        
        <p>Please remit payment by the due date.</p>
        
        <p>Thank you for your business!</p>
    </div>
    
    <div class="footer">
        <p><strong>{{ company_name }}</strong></p>
        <p>TimeTracker - Time Tracking & Project Management</p>
        <p>This invoice was sent automatically. Please contact us if you have any questions.</p>
    </div>
</body>
</html>

