<?php $site = $site ?? []; ?>
<div class="enterprise-settings-fields">
    <div class="enterprise-field">
        <label class="enterprise-field-label">Name <span class="text-danger">*</span></label>
        <input type="text" name="name" class="form-control" placeholder="e.g. City Center Mall"
               value="<?= esc(old('name', $site['name'] ?? '')) ?>" required>
    </div>
    <div class="enterprise-field">
        <label class="enterprise-field-label">Code <span class="text-danger">*</span></label>
        <input type="text" name="code" class="form-control text-uppercase" maxlength="30"
               value="<?= esc(old('code', $site['code'] ?? '')) ?>" required>
    </div>
    <div class="enterprise-field">
        <label class="enterprise-field-label">Type</label>
        <input type="text" name="site_type" class="form-control" placeholder="Mall, Complex, Campus…"
               value="<?= esc(old('site_type', $site['site_type'] ?? '')) ?>">
    </div>
    <div class="enterprise-field">
        <label class="enterprise-field-label">Status</label>
        <select name="status" class="form-select">
            <?php foreach (['active', 'inactive'] as $s): ?>
                <option value="<?= $s ?>" <?= old('status', $site['status'] ?? 'active') === $s ? 'selected' : '' ?>><?= ucfirst($s) ?></option>
            <?php endforeach; ?>
        </select>
    </div>
    <div class="enterprise-field">
        <label class="enterprise-field-label">Address</label>
        <input type="text" name="address" class="form-control" value="<?= esc(old('address', $site['address'] ?? '')) ?>">
    </div>
    <div class="enterprise-field">
        <label class="enterprise-field-label">City</label>
        <input type="text" name="city" class="form-control" value="<?= esc(old('city', $site['city'] ?? '')) ?>">
    </div>
    <div class="enterprise-field">
        <label class="enterprise-field-label">Country</label>
        <input type="text" name="country" class="form-control" value="<?= esc(old('country', $site['country'] ?? '')) ?>">
    </div>
    <div class="enterprise-field" style="grid-column: 1 / -1;">
        <label class="enterprise-field-label">Description</label>
        <textarea name="description" class="form-control" rows="2"><?= esc(old('description', $site['description'] ?? '')) ?></textarea>
    </div>
    <div class="enterprise-field" style="grid-column: 1 / -1;">
        <label class="enterprise-field-label">Notes</label>
        <textarea name="notes" class="form-control" rows="2"><?= esc(old('notes', $site['notes'] ?? '')) ?></textarea>
    </div>
</div>
