<div class="form-row">
    <div class="form-group col-md-6">
        <label><i class="fas fa-tags"></i> Type</label>
        <input type="text" name="type" class="form-control" placeholder="Type (e.g. yarn, trim)" value="{{ old('type', $item->type ?? '') }}" required>
    </div>

    <div class="form-group col-md-6">
        <label><i class="fas fa-list-alt"></i> Category</label>
        <input type="text" name="category" class="form-control" placeholder="Category (e.g. fabric, accessories)" value="{{ old('category', $item->category ?? '') }}">
    </div>
</div>

<div class="form-row">
    <div class="form-group col-md-6">
        <label><i class="fas fa-box"></i> Item Name</label>
        <input type="text" name="name" class="form-control" placeholder="item name (e.g. Cotton 30s)" value="{{ old('name', $item->name ?? '') }}" required>
    </div>

    <div class="form-group col-md-6">
        <label><i class="fas fa-weight"></i> GSM (Only for Fabric)</label>
        <input type="text" name="gsm" class="form-control" placeholder="GSM (Only for Fabric)" value="{{ old('gsm', $item->gsm ?? '') }}">
    </div>
</div>

<div class="form-row">
    <div class="form-group col-md-6">
        <label><i class="fas fa-percent"></i> Wastage % (Only for Fabric)</label>
        <input type="number" step="0.01" name="wastage_percent" class="form-control" placeholder=" for fabric calculation
" value="{{ old('wastage_percent', $item->wastage_percent ?? '') }}">
    </div>

    <div class="form-group col-md-6">
        <label><i class="fas fa-balance-scale"></i> Unit</label>
        <input type="text" name="unit" class="form-control" placeholder="Unit (e.g. kg, pcs, %)" value="{{ old('unit', $item->unit ?? '') }}">
    </div>
</div>

<div class="form-row">
    <div class="form-group col-md-6">
        <label><i class="fas fa-dollar-sign"></i> Rate</label>
        <input type="number" step="0.01" name="rate" class="form-control" placeholder="rate per unit
" value="{{ old('rate', $item->rate ?? '') }}">
    </div>

    <div class="form-group col-md-6">
        <label><i class="fas fa-calendar-alt"></i> Effective From</label>
        <input type="date" name="effective_from" class="form-control" value="{{ old('effective_from', $item->effective_from ?? '') }}">
    </div>
</div>

<div class="form-row">
    <div class="form-group col-md-12">
        <label><i class="fas fa-align-left"></i> Description</label>
        <textarea name="description" class="form-control" rows="3" placeholder="optional notes
">{{ old('description', $item->description ?? '') }}</textarea>
    </div>
</div>

<div class="form-row">
    <div class="form-group col-md-6">
        <label><i class="fas fa-toggle-on"></i> Status</label>
        <select name="status" class="form-control" required>
            <option value="">-- Select Status --</option>
            <option value="active" {{ (old('status', $item->status ?? '') == 'active') ? 'selected' : '' }}>Active</option>
            <option value="inactive" {{ (old('status', $item->status ?? '') == 'inactive') ? 'selected' : '' }}>Inactive</option>
        </select>
    </div>
</div>
