{% extends "base.html" %}
{% block title %}Proyek Baru{% endblock %}
{% block breadcrumb %}<a href="{{ url_for('projects.index') }}" style="color:var(--text-muted)">Proyek</a> / Buat Baru{% endblock %}
{% block page_title %}Buat Proyek Baru{% endblock %}

{% block content %}
<div class="card">
    <form method="POST">
        <div style="margin-bottom:24px">
            <div style="font-size:13px;color:var(--accent);font-weight:600;margin-bottom:4px">Informasi Kontrak</div>
            <div class="form-grid">
                <div class="form-group">
                    <label>Nama Proyek *</label>
                    <input type="text" name="project_name" required placeholder="cth. Pengadaan Peralatan Kantor Dinas X">
                </div>
                <div class="form-group">
                    <label>Instansi Pemerintah / Klien *</label>
                    <input type="text" name="client_name" required placeholder="cth. Dinas Pekerjaan Umum Kab. XYZ">
                </div>
                <div class="form-group">
                    <label>Nomor Kontrak/SPK</label>
                    <input type="text" name="contract_number" placeholder="cth. 027/SPK/DPU/2025/001">
                </div>
                <div class="form-group">
                    <label>Tanggal Kontrak</label>
                    <input type="date" name="contract_date">
                </div>
                <div class="form-group">
                    <label>Nilai Kontrak (Rp) *</label>
                    <input type="number" name="contract_value" required placeholder="0" min="0" step="1">
                </div>
                <div class="form-group">
                    <label>Metode Pengakuan Pendapatan (PSAK 72)</label>
                    <select name="satisfaction_method">
                        <option value="overtime">Overtime — Persentase Penyelesaian</option>
                        <option value="point_in_time">Point in Time — Saat Serah Terima</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>Tanggal Mulai *</label>
                    <input type="date" name="start_date" required>
                </div>
                <div class="form-group">
                    <label>Tanggal Selesai *</label>
                    <input type="date" name="end_date" required>
                </div>
                <div class="form-group full">
                    <label>Deskripsi Proyek</label>
                    <textarea name="description" placeholder="Deskripsi singkat lingkup pekerjaan..."></textarea>
                </div>
                <div class="form-group full">
                    <label>Kewajiban Pelaksanaan (PSAK 72 — Performance Obligation)</label>
                    <textarea name="performance_obligation" placeholder="Tuliskan kewajiban pelaksanaan yang harus dipenuhi sesuai kontrak..."></textarea>
                </div>
            </div>
        </div>

        <div style="display:flex;gap:12px;justify-content:flex-end">
            <a href="{{ url_for('projects.index') }}" class="btn btn-secondary">Batal</a>
            <button type="submit" class="btn btn-primary">Simpan Proyek →</button>
        </div>
    </form>
</div>
{% endblock %}
