@model IEnumerable<foundation_system.Models.Proveedor>

@{
    ViewData["Title"] = "Proveedores";
}

<div class="container-fluid">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h1 class="h3 mb-0 text-gray-800">@ViewData["Title"]</h1>
        <a asp-action="Create" class="btn btn-primary">
            <i class="bi bi-plus-circle me-1"></i> Nuevo Proveedor
        </a>
    </div>

    <div class="card shadow mb-4">
        <div class="card-body">
            <div class="table-responsive">
                <table class="table table-hover align-middle">
                    <thead class="table-light">
                        <tr>
                            <th>Nombre</th>
                            <th>NIT / DUI</th>
                            <th>Estado</th>
                            <th>Acciones</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model)
                        {
                            <tr>
                                <td>@item.Nombre</td>
                                <td>@item.NitDui</td>
                                <td>
                                    @if (item.Activo)
                                    {
                                        <span class="badge bg-success">Activo</span>
                                    }
                                    else
                                    {
                                        <span class="badge bg-secondary">Inactivo</span>
                                    }
                                </td>
                                <td>
                                    <a asp-action="Edit" asp-route-id="@item.Id" class="btn btn-sm btn-outline-primary">
                                        <i class="bi bi-pencil"></i>
                                    </a>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
