{% extends "base.html" %}
{% block title %}Data Settings — ComplyForm Dashboard{% endblock %}
{% block content %}
<div class="max-w-3xl mx-auto px-4 py-6">
  <h1 class="text-xl font-semibold mb-6" style="color: var(--text-primary);">Data Management</h1>

  <section class="mb-8 p-4 rounded-lg" style="background: var(--bg-surface); border: 1px solid var(--border-default);">
    <h2 class="text-lg font-semibold mb-3" style="color: var(--text-primary);">Export Data</h2>
    <p class="text-sm mb-4" style="color: var(--text-secondary);">Download a copy of all your data (GDPR Art. 20). Export includes projects, scans, audit logs, and member information. You will receive an email with a download link.</p>
    <form method="POST" action="/dashboard/settings/data/export">
      <input type="hidden" name="_csrf" value="{{ csrf_token }}">
      <button type="submit" class="px-4 py-2 rounded text-sm font-medium text-white" style="background: var(--accent);">Request Data Export</button>
    </form>
    <p class="text-xs mt-2" style="color: var(--text-secondary);">Limited to one export per 24 hours.</p>
  </section>

  <section class="p-4 rounded-lg" style="background: #fef2f2; border: 1px solid #fecaca;">
    <h2 class="text-lg font-semibold mb-3" style="color: #dc2626;">Delete All Data</h2>
    <p class="text-sm mb-4" style="color: #991b1b;">Permanently delete all your data (GDPR Art. 17). This action is irreversible and will remove all projects, scans, members, and audit logs. Billing records are retained for legal/accounting purposes.</p>
    <form method="POST" action="/dashboard/settings/data/delete">
      <input type="hidden" name="_csrf" value="{{ csrf_token }}">
      <button type="submit" class="px-4 py-2 rounded text-sm font-medium text-white" style="background: #dc2626;" onclick="return confirm('Are you sure? This action cannot be undone.');">Delete All Data</button>
    </form>
  </section>
</div>
{% endblock %}
