<div class="modal fade project-modal history-modal" id="projectHistoryModal" tabindex="-1" aria-hidden="true"><div class="modal-dialog modal-xl modal-dialog-centered modal-dialog-scrollable"><div class="modal-content">
<div class="modal-header px-4 py-3"><div><div class="history-kicker"><i class="bi bi-clock-history"></i> Recovery &amp; source control</div><h5 class="modal-title mb-0"><span id="historyProjectName"></span> history</h5></div><button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close history and version control"></button></div>
<div class="history-tabs"><button class="active" type="button" data-history-tab="checkpoints"><i class="bi bi-layers"></i> Checkpoints</button><button type="button" data-history-tab="git"><i class="bi bi-git"></i> Git</button></div>
<div class="modal-body p-0">
 <section class="history-pane active" data-history-pane="checkpoints"><div class="history-layout"><aside class="checkpoint-create"><span class="history-eyebrow">New recovery point</span><h6>Capture current project</h6><p>Stores editable configuration and Custom Files without database credentials or data.</p><form id="checkpointForm"><label class="form-label">Label</label><input class="form-control" name="label" maxlength="120" placeholder="Before navigation redesign" required><label class="form-label mt-2">Notes</label><textarea class="form-control" name="notes" rows="3" maxlength="2000" placeholder="What changed and why?"></textarea><button class="btn btn-primary w-100 mt-3" id="checkpointSubmit"><i class="bi bi-camera me-1"></i>Create checkpoint</button></form><div class="history-safety"><i class="bi bi-shield-check"></i>Restore creates another safety checkpoint automatically.</div></aside><div class="checkpoint-list-wrap"><div class="history-section-head"><div><span class="history-eyebrow">Timeline</span><h6>Saved checkpoints</h6></div><button class="btn btn-sm btn-light border" type="button" id="historyRefresh"><i class="bi bi-arrow-clockwise"></i></button></div><div id="checkpointList" class="checkpoint-list"></div><div id="checkpointEmpty" class="history-empty"><i class="bi bi-clock-history"></i><strong>No checkpoints yet</strong><span>Create one before a major change.</span></div></div></div><div class="comparison-panel d-none" id="checkpointComparison"></div></section>
 <section class="history-pane" data-history-pane="git"><div class="git-grid"><div class="git-status-card"><div class="git-status-icon"><i class="bi bi-git"></i></div><div><span class="history-eyebrow">Local repository</span><h6 id="gitStatusTitle">Checking Git…</h6><p id="gitStatusCopy"></p></div><span class="git-branch" id="gitBranch"></span></div><form class="git-settings" id="gitSettingsForm"><div class="history-section-head"><div><span class="history-eyebrow">Repository settings</span><h6>Identity and optional remote</h6></div><button type="submit" class="btn btn-sm btn-outline-primary" id="gitSettingsSave">Save settings</button></div><div class="row g-3"><div class="col-md-6"><label class="form-label">Author name</label><input class="form-control" name="author_name" maxlength="120"></div><div class="col-md-6"><label class="form-label">Author email</label><input class="form-control" name="author_email" type="email"></div><div class="col-md-8"><label class="form-label">Remote URL</label><input class="form-control" name="remote_url" placeholder="https://github.com/organization/project.git"><div class="form-text">Credentials in URLs are rejected. Push and pull remain explicit external operations.</div></div><div class="col-md-4"><label class="form-label">Default branch</label><input class="form-control" name="default_branch" value="main" pattern="[A-Za-z0-9][A-Za-z0-9._/-]*"></div></div><label class="form-check mt-3"><input class="form-check-input" name="auto_checkpoint" type="checkbox" value="1" checked><span class="form-check-label">Create safety checkpoints before destructive operations</span></label></form><div class="git-actions"><button class="btn btn-primary" id="gitInitialize" type="button"><i class="bi bi-git me-1"></i>Initialize Git</button><form id="gitCommitForm"><div class="input-group"><input class="form-control" name="message" maxlength="200" placeholder="Describe this project change" required><button class="btn btn-dark" id="gitCommit" type="submit"><i class="bi bi-check2-circle me-1"></i>Commit</button></div></form></div><div class="git-last" id="gitLastCommit"></div><div class="git-changes" id="gitChanges"></div></div></section>
</div></div></div></div>
