<!-- Available Units for Assignment -->
{% if units %}
<div class="space-y-1">
    {% for unit in units %}
    <label class="flex items-center gap-3 p-2 hover:bg-gray-50 dark:hover:bg-gray-700 rounded cursor-pointer">
        <input type="checkbox" name="unit_ids" value="{{ unit.id }}"
               class="w-4 h-4 text-blue-600 focus:ring-blue-500 rounded border-gray-300 dark:border-gray-600">
        <span class="font-medium text-gray-900 dark:text-white">{{ unit.id }}</span>
        <span class="text-sm text-gray-500 dark:text-gray-400 flex-1">
            {% if unit.last_calibrated %}
            Cal: {{ unit.last_calibrated }}
            {% else %}
            No cal date
            {% endif %}
        </span>
        {% if unit.calibration_status == 'expiring_soon' %}
        <span class="text-xs px-2 py-0.5 bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-400 rounded-full">
            Expiring soon
        </span>
        {% endif %}
        {% if unit.deployed %}
        <span class="text-xs px-2 py-0.5 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 rounded-full">
            Deployed
        </span>
        {% else %}
        <span class="text-xs px-2 py-0.5 bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400 rounded-full">
            Benched
        </span>
        {% endif %}
    </label>
    {% endfor %}
</div>
{% else %}
<p class="text-gray-500 dark:text-gray-400 text-sm py-4 text-center">
    No units available for this date range.
    {% if start_date and end_date %}
    <br><span class="text-xs">All units are either reserved, have expired calibrations, or are retired.</span>
    {% endif %}
</p>
{% endif %}
