{% extends "base.html" %}
{% block title %}Nouvelle pièce — GMAO{% endblock %}

{% block content %}
<div class="container-fluid">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h1><i class="bi bi-plus-circle"></i> Nouvelle pièce</h1>
        <a href="{{ url_for('parts.index') }}" class="btn btn-secondary">
            <i class="bi bi-arrow-left"></i> Retour
        </a>
    </div>

    <div class="card">
        <div class="card-body">
            <form method="POST">
                <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
                
                <div class="row mb-3">
                    <div class="col-md-6">
                        <label class="form-label">Nom *</label>
                        <input type="text" name="name" class="form-control" required>
                    </div>
                    <div class="col-md-6">
                        <label class="form-label">Référence</label>
                        <input type="text" name="reference" class="form-control">
                    </div>
                </div>
                
                <div class="row mb-3">
                    <div class="col-md-6">
                        <label class="form-label">Quantité</label>
                        <input type="number" name="quantity" class="form-control" value="0">
                    </div>
                    <div class="col-md-6">
                        <label class="form-label">Unité</label>
                        <input type="text" name="unit" class="form-control" placeholder="ex: pcs, m, kg">
                    </div>
                </div>

                <div class="text-end">
                    <button type="submit" class="btn btn-primary">
                        <i class="bi bi-check-lg"></i> Créer
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
{% endblock %}