<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Reminder: 7 Days Left to Resolve Quota Overage</title>
</head>
<body style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; line-height: 1.6; color: #374151; max-width: 600px; margin: 0 auto; padding: 20px;">
    <div style="background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); padding: 30px; border-radius: 12px 12px 0 0; text-align: center;">
        <h1 style="color: white; margin: 0; font-size: 24px;">7 Days Remaining</h1>
        <p style="color: rgba(255,255,255,0.9); margin: 10px 0 0 0;">Your quota overage grace period is ending soon</p>
    </div>

    <div style="background: #ffffff; padding: 30px; border: 1px solid #e5e7eb; border-top: none; border-radius: 0 0 12px 12px;">
        <p>Hi {{ owner.first_name|default:owner.username }},</p>

        <p>This is a reminder that your <strong>{{ tenant.name }}</strong> account is still over the limit for <strong>{{ display_name }}</strong>.</p>

        <div style="background: #fef3c7; border: 1px solid #f59e0b; border-radius: 8px; padding: 20px; margin: 20px 0;">
            <div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
                <span style="color: #92400e;">Current Usage:</span>
                <strong style="color: #92400e;">{{ current_usage }}</strong>
            </div>
            <div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
                <span style="color: #92400e;">Your Plan Allows:</span>
                <strong style="color: #92400e;">{{ allowed_limit }}</strong>
            </div>
            <div style="display: flex; justify-content: space-between; border-top: 1px solid #f59e0b; padding-top: 10px;">
                <span style="color: #92400e;">Over Limit By:</span>
                <strong style="color: #dc2626;">{{ overage_amount }}</strong>
            </div>
        </div>

        <div style="background: #fee2e2; border: 1px solid #ef4444; border-radius: 8px; padding: 20px; margin: 20px 0; text-align: center;">
            <p style="margin: 0 0 10px 0; color: #991b1b; font-size: 18px;">
                <strong>⏰ {{ days_remaining }} days left</strong>
            </p>
            <p style="margin: 0; color: #991b1b;">
                Grace period ends on <strong>{{ grace_period_ends|date:"F j, Y" }}</strong>
            </p>
        </div>

        <h2 style="color: #1f2937; font-size: 18px; margin-top: 30px;">Take action now</h2>

        <p>To avoid automatic archiving of your {{ display_name }}, please:</p>

        <ol style="padding-left: 20px;">
            <li style="margin-bottom: 10px;"><strong>Choose which {{ display_name }} to keep</strong> - Select which ones to archive</li>
            <li style="margin-bottom: 10px;"><strong>Upgrade your plan</strong> - Increase your limits</li>
            <li style="margin-bottom: 10px;"><strong>Export your data</strong> - Download a copy for your records</li>
        </ol>

        <div style="text-align: center; margin: 30px 0;">
            <a href="{{ manage_url }}" style="display: inline-block; background: #f59e0b; color: white; padding: 12px 30px; border-radius: 8px; text-decoration: none; font-weight: 600; margin-right: 10px;">Manage Now</a>
            <a href="{{ upgrade_url }}" style="display: inline-block; background: #10b981; color: white; padding: 12px 30px; border-radius: 8px; text-decoration: none; font-weight: 600;">Upgrade Plan</a>
        </div>

        <p style="margin-top: 30px; color: #6b7280; font-size: 14px;">
            <strong>What happens if I don't take action?</strong><br>
            After the grace period, the oldest {{ display_name }} will be automatically archived. Archived items become read-only, and data may become unrecoverable.
        </p>

        <hr style="border: none; border-top: 1px solid #e5e7eb; margin: 30px 0;">

        <p style="color: #6b7280; font-size: 14px;">
            Questions? Contact our support team - we're happy to help you find the best solution.
        </p>
    </div>
</body>
</html>
