<!doctype html>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>Mastermind — Project</title>
  <style>
    body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;margin:0;background:#0b0f14;color:#e8eef7}
    header{background:#111824;border-bottom:1px solid #233043;padding:14px 16px;position:sticky;top:0}
    main{max-width:1100px;margin:0 auto;padding:16px}
    .card{background:#111824;border:1px solid #233043;border-radius:12px;padding:14px;margin:12px 0}
    a{color:#7cc4ff;text-decoration:none}
    .muted{color:#a9b7c6}
    .grid{display:grid;grid-template-columns:repeat(12,1fr);gap:12px}
    .col6{grid-column:span 12}
    @media(min-width:900px){.col6{grid-column:span 6}}
    input,select{padding:12px;border-radius:10px;border:1px solid #233043;background:#0e1520;color:#e8eef7;width:100%}
    button{padding:12px 14px;border-radius:10px;border:1px solid #233043;background:#1c2a3d;color:#e8eef7}
    .pill{display:inline-block;padding:2px 8px;border:1px solid #233043;border-radius:999px;font-size:12px;color:#a9b7c6}
  </style>
</head>
<body>
<header>
  <div style="display:flex;justify-content:space-between;align-items:center;gap:10px">
    <div>
      <div style="font-weight:700"><%= project.name %></div>
      <div class="muted" style="font-size:13px">Job: <%= project.job_number || '—' %> · Mode: <span class="pill"><%= project.role_mode %></span></div>
    </div>
    <div style="display:flex;gap:10px">
      <a href="/projects/<%= project.id %>/inbox">Inbox</a>
      <a href="/projects">Projects</a>
      <a href="/">Dashboard</a>
    </div>
  </div>
</header>

<main>
  <div class="card">
    <h2 style="margin:0 0 8px">Project profile</h2>
    <form method="post" action="/projects/<%= project.id %>/update" class="grid">
      <div class="col6">
        <label class="muted">Name</label>
        <input name="name" value="<%= project.name %>" required />
      </div>
      <div class="col6">
        <label class="muted">Job #</label>
        <input name="jobNumber" value="<%= project.job_number || '' %>" />
      </div>
      <div class="col6">
        <label class="muted">Mode</label>
        <select name="roleMode">
          <option value="ec" <%= project.role_mode==='ec'?'selected':'' %>>Electrical contractor</option>
          <option value="gc" <%= project.role_mode==='gc'?'selected':'' %>>General contractor</option>
        </select>
      </div>
      <div class="col6">
        <label class="muted">GC name</label>
        <input name="gcName" value="<%= project.gc_name || '' %>" />
      </div>
      <div style="grid-column:span 12">
        <label class="muted">Keywords (used for email sorting)</label>
        <input name="keywords" value="<%= project.keywords || '' %>" />
      </div>
      <div style="grid-column:span 12">
        <button type="submit">Save</button>
      </div>
    </form>
  </div>

  <div class="card">
    <h2 style="margin:0 0 8px">Next modules</h2>
    <ul class="muted">
      <li>Inbox for this project (auto-sorted from the single mailbox)</li>
      <li>Logs: RFI / Submittals / PCO / Procurement</li>
      <li>Draft tools: create RFI or PCO from an email</li>
    </ul>
  </div>
</main>
</body>
</html>
