{% extends "base.html" %}

{% block title %}Edit User - Finance Tracker{% endblock %}

{% block content %}
<div class="form-container">
    <div class="glass-card form-card">
        <h1>✏️ Edit User: {{ user.username }}</h1>
        
        <form method="POST" class="form">
            <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
            
            <div class="form-group">
                <label for="username">Username *</label>
                <input type="text" id="username" name="username" value="{{ user.username }}" required>
            </div>
            
            <div class="form-group">
                <label for="email">Email *</label>
                <input type="email" id="email" name="email" value="{{ user.email }}" required>
            </div>
            
            <div class="form-group">
                <label for="new_password">New Password (leave blank to keep current)</label>
                <input type="password" id="new_password" name="new_password" minlength="6">
            </div>
            
            <div class="form-group">
                <label>
                    <input type="checkbox" name="is_admin" {% if user.is_admin %}checked{% endif %}> Admin User
                </label>
            </div>
            
            <div class="form-actions">
                <a href="{{ url_for('settings.index') }}" class="btn btn-secondary">Cancel</a>
                <button type="submit" class="btn btn-primary">💾 Save Changes</button>
            </div>
        </form>
    </div>
</div>
{% endblock %}
