<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self'; base-uri 'none'; form-action 'self'">
  <title>Manage HODs | SLPS</title>
  <script src="../../authentication/js/auth.js" defer></script>
  <script src="../../shared/js/panel-sidebar.js?v=19" defer></script>
  <script src="../js/manage_hods.js?v=4" defer></script>

<script src="../../shared/vendor/bootstrap/bootstrap.bundle.min.js" defer></script>
<script src="../../shared/js/bootstrap-ui.js?v=9" defer></script>
<script src="../../shared/js/form-modals.js?v=5" defer></script>
<link rel="stylesheet" href="../../shared/css/application.css?v=5">
</head>
<body class="portal-page" data-sidebar-active="manage-hods">
<a class="skip-link" href="#main">Skip to content</a>
<header class="topbar">
  <a class="brand" href="dashboard.html"><img class="brand-logo" width="46" src="../../shared/images/logo.png" alt="Rockview University"><span class="brand-copy"><strong>ROCKVIEW <span>UNIVERSITY</span></strong><small>STUDENT LEARNING PRACTICAL SYSTEM · MANAGEMENT</small></span></a>
  <div class="top-actions"><span class="admin-label">Management workspace</span><button id="themeToggle" class="icon-button" type="button" aria-label="Switch to dark theme"><svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 4h18v13H3zM8 21h8m-4-4v4M7 8h10m-10 4h6"/></svg></button><span class="avatar" id="avatar">SL</span><span class="account-copy"><strong id="accountName">Loading account…</strong><small id="accountRole">Top Management</small></span><a class="button secondary" href="dashboard.html">Dashboard</a><button id="logoutButton" class="icon-button" type="button" aria-label="Sign out"><svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 5H4v14h5m6-14 7 7-7 7m7-7H9"/></svg></button><button id="menuToggle" class="icon-button mobile-menu" type="button" aria-expanded="false" aria-controls="sidebar" aria-label="Open navigation">☰</button></div>
</header>
<div class="body-layout">
  <button id="sidebarOverlay" class="sidebar-overlay" type="button" aria-label="Close navigation" hidden></button>
  <aside class="sidebar" id="sidebar"><div class="workspace-label"><span class="workspace-icon">SL</span><div><strong>Top Management</strong><small>SLPS workspace</small></div></div><nav id="panelNavigation" aria-label="Management navigation"><a class="nav-item" href="dashboard.html"><span>Dashboard overview</span></a><a class="nav-item" href="manage_campuses.html"><span>Campus Management</span></a><div class="nav-item active"><span>Manage All HODs</span></div></nav><div class="sidebar-bottom"><span class="small-dot"></span> Rockview University<small>Student Learning Practical System</small></div></aside>
  <div class="workspace">
    <main id="main">
      <div class="page-heading"><div><div class="breadcrumb">Management <span>/</span> People and access</div><h1>Heads of Department</h1><p>Assign and review HOD accounts by department and campus.</p></div><div class="heading-actions"><span class="hod-page-tag">STAFF DIRECTORY</span></div></div>
      <div id="message" class="notice" role="status" aria-live="polite" hidden></div>
      <section class="hod-summary" aria-label="HOD account summary"><div class="hod-summary-mark">HOD</div><div><strong id="hodCount">Loading HOD accounts…</strong><p>Each HOD is linked to one department and one campus.</p></div><span class="hod-summary-icon" aria-hidden="true">✦</span></section>
      <section class="panel">
        <div class="section-heading"><div><span class="section-kicker">NEW ACCOUNT</span><h2>Create an HOD account</h2><p>Complete the account details and set the department-campus assignment.</p></div><span class="form-step">01 <span>/</span> CREATE</span></div>
        <form id="hodForm" class="module-form" enctype="multipart/form-data">
          <div class="module-form-grid">
            <label>Full name<input name="full_name" autocomplete="name" required maxlength="150" placeholder="Enter HOD full name"></label>
            <label>Email address<input name="email" type="email" autocomplete="email" required maxlength="150" placeholder="name@example.com"></label>
            <label>NRC number<input name="nrc" required pattern="[0-9]{6}/[0-9]{2}/[0-9]" placeholder="157486/79/1"></label>
            <label>Department<select name="department_id" id="department" required><option value="">Loading departments…</option></select></label>
            <label>Campus<select name="campus_id" id="campus" required><option value="">Loading campuses…</option></select></label>
            <label>Profile picture<input name="profile_picture" type="file" accept="image/jpeg,image/png,image/webp" required><small class="field-help">JPG, PNG or WebP · Maximum 5 MB</small></label>
          </div>
          <div class="form-actions"><span class="form-note">The system generates the initial password and emails it to the HOD.</span><button class="button primary" id="submit" type="submit">Create HOD account <span aria-hidden="true">→</span></button></div>
        </form>
      </section>
      <section class="panel directory-panel">
        <div class="section-heading"><div><span class="section-kicker">CURRENT ASSIGNMENTS</span><h2>HOD directory</h2><p>Search the assigned HOD accounts and their campus coverage.</p></div><label class="search-field"><span class="sr-only">Search HODs</span><input id="hodSearch" type="search" placeholder="Search name, email or campus…"></label></div>
        <div id="directoryMessage" class="directory-message" role="status" hidden></div>
        <div class="table-wrap"><table id="hodRecords"><thead><tr><th>HOD</th><th>NRC</th><th>Department</th><th>Campus</th><th>Account</th></tr></thead><tbody id="hodRows"><tr><td colspan="5" class="table-loading">Loading HOD directory…</td></tr></tbody></table></div>
        <div id="hodEmpty" class="hod-empty" hidden><span class="hod-empty-icon">＋</span><strong>No HOD accounts found</strong><p>Create an account above or change your search.</p></div>
      </section>
      <footer class="site-footer"><span>Rockview University · SLPS</span><span>Management workspace</span></footer>
    </main>
  </div>
</div>
</body>
</html>
