<?php require_once __DIR__ . '/../layout.php'; ?>

<div style="margin-bottom: 2rem;">
    <a href="/superadmin/uoms" style="color: var(--superadmin-color); text-decoration: none; display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 500; font-size: 0.9rem; margin-bottom: 1rem;">
        <i class="ph ph-arrow-left" style="font-weight: bold;"></i> Back to Units Directory
    </a>
    <h3 style="margin: 0; color: white;"><?php echo htmlspecialchars($title); ?></h3>
</div>

<div class="card" style="max-width: 600px;">
    <form action="<?php echo $actionUrl; ?>" method="POST">
        <div class="input-group">
            <label for="name">Unit Name</label>
            <input type="text" id="name" name="name" value="<?php echo htmlspecialchars($record['name'] ?? ''); ?>" placeholder="e.g. Capsule, Strip, Bottle" required style="width: 100%; padding: 0.75rem 1rem; border-radius: 8px; border: 1px solid var(--glass-border); background: rgba(15,23,42,0.6); color: white; outline: none;">
        </div>

        <div style="margin-top: 2rem; display: flex; gap: 1rem;">
            <button type="submit" class="btn-gold">Save Unit</button>
            <a href="/superadmin/uoms" class="btn-outline-gold" style="display: inline-flex; align-items: center; justify-content: center;">Cancel</a>
        </div>
    </form>
</div>

</div> <!-- main-content -->
</div> <!-- dashboard-layout -->
</body>
</html>
